HELP!!!,
I have been working on an if then statement over the past many months without any resolve.
I am trying to put in a text component that draws in a form if two conditions are met.
First condition is that the patient is between 13 and 63 years old
and second if the patient has NOT been offered an HIV test in the past (OB Term HIVTESTOFFER).
I have tried so many different age symbols, If Then statements, formatting, and all to no avail. I would appreciate any help as I am a MEL novice and have made a number of If Then statements, just not one quite this complex.
This is the most current attempt (by using two different statements, one for over 12 and one for under 64):
{IF PATIENT.FORMATTEDAGE> 12 THEN {if (LAST_SIGNED_OBS_VALUE(“HIVTESTOFFER”) <> "") then "" else add_form_comp("Enterprise\Alliance\Specialty Care","HIV Testing","3") ""} else endif ""}
Thank you so much for your help in this
Dan
I am pretty sure PATIENT.FORMATTEDAGE returns a string including " years old", PATIENT_AGE() I think returns a number so i would use that so you are comparing appples to apples. You also can't have '{' inside of a statement, so take those out. And use the forward slash in the add_form function, the backslash is used for special characters in Centricty (like 't' and 'n') it can throw off MEL. And you were missing an endif, each if needs an endif. Not sure about the end quotes, I dont think you should need them
Try -
{IF PATIENT_AGE() > 12 THEN
if (LAST_SIGNED_OBS_VALUE(“HIVTESTOFFER”) <> "") then "" else
add_form_comp("Enterprise/Alliance/Specialty Care","HIV Testing","3")
endif
endif}
Michael,
Worked like a charm. Thank you so much. Now I can stop leaving forehead sized dents in my walls.
Dan