Notifications
Clear all
Topic starter
I'm looking for code for a text component and/or handouts that would list MEDS_AFTER with only the medication name (component 1 in delimited format) and instructions (component 7 in delimited format.
I hope that makes sense.
Thanks!
Posted : March 14, 2017 11:04 am
//Put this code at the top of your handout/text component
{fn ListMeds(){
medsArray = getfield(MEDS_AFTER("delimited"),"|","")
resultStr = ""
for c =1, c<= size(medsArray),c = c+1 do
medsArray[c] = getfield(medsArray[c],"^","")
resultStr = ResultStr+ medsArray[c][1] + " " + medsArray[c][7] + HRET
endfor
return resultStr
}}
//in the spot you want to list the meds, you should type this:
{List Meds()}
If you have any questions or concerns, let me know.
Posted : March 15, 2017 3:34 am
Topic starter
Worked perfectly, thank you very much!
Posted : March 15, 2017 5:43 am