I have a Text component that pulls in the patients Allergy List with reactions. I also need this text component to auto update if changes are made to the Allergy List during the encounter. I would prefer that the Allergy List be numbered as well.
I have one text component that auto updates and numbers the list but does not pull in reactions.
Current Allergies:
{'{if ALL_AFTER() == "" then "No known allergies" else ccc_add_num_with_carriage_ret(ALL_AFTER()) endif}'}
The other text component pulls in reactions but does not number the list or auto update.
Allergies:
{'{local titleA
titleA = ""
titleA = ""
local retListALL
retListALL = ""
local retA
retA = ""
retA = ALL_AFTER("delimited")
if retA = "" then retListALL = ""
else
retA = getfield(ALL_AFTER("delimited"),"|","")
for x = 1, x <= size(retA),x = x + 1
do
retA[x] = getfield(retA[x],"^","")
retListALL = retListALL + (if retListALL == "" then "" else HRET endif) +
retA[x][1] + " (" + retA[x][7] + ": " + if retA[x][5] == "" then "no reaction noted" else retA[x][5] endif + ")"
endfor
endif
retListALL = titleA + HRET + retListALL
retListALL}'}
I am having trouble combing the two to get exactly what I want. Can anyone offer some guidance?
This is the code that is pulling the reaction:
+ if retA[x][5] == "" then "no reaction noted" else retA[x][5] endif
On the second function, you might try changing the last line to:
ccc_add_num_with_carriage_ret(retListALL)}'}
That worked!!! Thank you!!