A solution using two separate tables, AllDiagList and PtDiag:
;Then in table PtDiag, enter in the first cells
=LET(pt_diags, TRIM(TEXTSPLIT([@[PATIENT''S DIAGNOSIS(ES)]], ";")),
IF(SUM(ISNUMBER(XMATCH(AllDiagList[Diag], pt_diags)) * (AllDiagList[CARDIO] = "Y")), "Y", "N"))
=LET(pt_diags, TRIM(TEXTSPLIT([@[PATIENT''S DIAGNOSIS(ES)]], ";")),
IF(SUM(ISNUMBER(XMATCH(AllDiagList[Diag], pt_diags)) * (AllDiagList[RESP] = "Y")), "Y", "N"))
Please let me know if you need further explanation of the steps.