I have 3 patient instruction boxes for 3 different items. I created document variables called INSTR1, INSTR2, and INSTR3.
I want to combine those three variables into the INSTRUCTIONS Observation term so it prints on the patient instructions handout.
Is this possible?
Yes Katie.
{OBSNOW("INSTRUCTIONS",DOCUMENT.INSTR1+ HRET + DOCUMENT.INSTR2 + HRET + DOCUMENT.INSTR3)}
When you want to set the value of an obs term, you use OBSNOW, then the two parameters are the obs term and what you want the value to be. This second parameter concatenates each of your 3 document variables and puts a carrage return (HRET) between each one. Now, the problem you will have is that is that if you are using the Patient Instructions form and this is on another form - it will overwrite what gets chosen on the Patient Instructions form and put in INSTRUCTIONS if it is accessed after that one or vice versa. You will have to play around with scenarios and you might need to get a little fancier - doing tests to determine if anything is already in INSTRUCTIONS and appending your document variables to what is already in the obs term.
Good luck!
I use this a lot -
{fn fnCommaCombine(){
local rslt = ""
for i = 1, i <= getnargs(), i = i + 1 do
rslt = fncombineutility(rslt,getarg(i))
endfor
return rslt
}}
{fn fnCombineutility(one,two){
if (one <> "") and (two <> "") then
return (one + ", " + two)
else
return (one + two)
endif
}}
{OBSNOW("INSTRUCTIONS",fncommacombine(DOCUMENT.INSTR1,DOCUMENT.INSTR2,DOCUMENT.INSTR3))}
You can pass as many arguments to it as you want and it formats them into a list
I added the {OBSNOW("INSTRUCTIONS",DOCUMENT.INSTR1+ HRET + DOCUMENT.INSTR2 + HRET + DOCUMENT.INSTR3)}
It pulls the patient instructions I have created into the note but it will not show up when printed.
Please Help!!!!!!!!!!!!!!!!!!!!