Beginner VFE user here, so apologies if this is a dumb question. Anyways.
I have a custom form with a checkbox that our clinicians check after they've performed a Problems, Meds, or Allergies review with the patient. I have text translations which at that point pull the lists into the chart note.
For my allergies review checkbox, the text translation checks first for a value of "T" in obs term NKA and returns "no known allergies" or prints the patient's allergies list followed by a statement of "Allergies were reviewed during this visit." This code was working fine until staff asked that it include the "reaction details" for each allergy. So I had to insert a function to produce that information from a GETFIELD(ALL_AFTER("DELIMITED"))
Here is my working text translation, using (ALL_AFTER("list"))
{If OBSNOW("NKA") == "T" then CFMT("No Known Allergies
","","ALLERGIES:
", "B,1", "
") else CFMT(ALL_AFTER("LIST"),"","ALLERGIES:
", "B,1", "
Allergies were reviewed during this visit.
")endif}
and my function to create the allergy list
{fn ALLLISTER(){
ALLLIST = GETFIELD(ALL_AFTER("DELIMITED"),"|","")
ALLSIZE = SIZE(ALLLIST)
COUNT
GETALL
RETURNALL = ""
FOR COUNT = 1, COUNT <= ALLSIZE, COUNT = COUNT + 1 DO
GETALL = GETFIELD(ALLLIST[COUNT],"^","")
RETURNALL = RETURNALL + GETALL[1] + " (" + GETALL[7] + "Reaction: " + if GETALL[5] == "" then "No reaction details noted" else GETALL[5] endif + ")" + HRET
ENDFOR
RETURNALL}}
How can I call the function in the text translation in place of the CFMT(ALL_AFTER("LIST")?
replace ALL_AFTER("LIST") with ALLLISTER()
Thanks! I had a problem in my syntax when i tried that earlier and started wondering if CFMT would support a function. 😀