So I got the following code:
{!fn fnPopUpDisplayDocsToRecon() {
local hold = getfield(GET_RECONCILE_DOC_LIST('PATIENT.PATIENTID'), "|", "")
local temp
local rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt "") then
rslt = rslt
endif
rslt = rslt + temp[2] + " - Reason: " + temp[3] + " - Date: " + temp[4] + "
"
endfor
return rslt
}}
{if fnPopUpDisplayDocsToRecon(),"") "" then
userok("The following stuff needs to be taking care of please -" + hret + hret + (fnPopUpDisplayDocsToRecon(),"")) + hret + hret + "If this is a medication you are trying to fill, please remove it from the patient list and add a coded medication.")
""
else
""
endif}
I get an error:
{if fnPopUpDisplayDocsToRecon(),"") <-COMPILER ERROR NEARBY: RIGHT PAREN was unexpected after STRING
Basically I'm trying to have a pop up fire as soon as an OV is started to alert providers that they need to do reconciliations for that particular chart. A user here provided me this pop up for uncoded meds:
{
fn UncodedMedsPres(meds,allergies) {
local temp = getfield(meds,"|","")
local hold
local rslt =""
for i=1, i<=size(temp),i=i+1 do
hold = getfield(temp[i],"^","")
if hold[5] =="" then
if rslt "" then
rslt = rslt + hret
endif
rslt = rslt + hold[1] + " (" + hold[7] + ")"
endif
endfor
return rslt
}}
{if UncodedMedsPres(MEDS_AFTER("Delimited"),"") "" then
userok("The following medication(s) are not coded for prescribing -" + hret + hret + (UncodedMedsPres(MEDS_AFTER("Delimited"),"")) + hret + hret + "If this is a medication you are trying to fill, please remove it from the patient list and add a coded medication.")
""
else
""
endif}
Wish I could recall who, but thank you very much!
So obviously I'm basing my new pop up off this uncoded med one.
Any way hope CHUG nation can help me out, thanks in advance!
Got it! Working code is:
{!fn fnPopUpDisplayDocsToRecon() {
local hold = getfield(GET_RECONCILE_DOC_LIST('PATIENT.PATIENTID'), "|", "")
local temp
local rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt "") then
rslt = rslt
endif
rslt = rslt + temp[2] + " - Reason: " + temp[3] + " - Date: " + temp[4] + "
"
endfor
return rslt
}}
{if fnPopUpDisplayDocsToRecon('PATIENT.PATIENTID') "" then
userok("The following stuff needs to be taking care of please -" + hret + hret + (fnPopUpDisplayDocsToRecon('PATIENT.PATIENTID')) + hret + hret + "stuff testing stuff what should we do here.")
""
else
""
endif}
Only problem is I get those /par inbetween multiple reconcilations. I'll try to provide a screen shot.
Fixed the par thing. Text components must not like ... + " " +... so i used hret in the rslt
Would you mind sharing the entire snippet correcting the \par issue?
Here is the full text component:
{!fn fnPopUpDisplayDocsToRecon() {
local hold = getfield(GET_RECONCILE_DOC_LIST('PATIENT.PATIENTID'), "|", "")
local temp
local rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt <> "") then
rslt = rslt
endif
rslt = rslt + temp[2] + " - Reason: " + temp[3] + " - Date: " + temp[4] + hret + hret
endfor
return rslt
}}
{if fnPopUpDisplayDocsToRecon('PATIENT.PATIENTID') <> "" then
userok("The following reconciliation(s) has been recieved from another practice for this patient -" + hret + hret + (fnPopUpDisplayDocsToRecon('PATIENT.PATIENTID')) + hret + hret + "Please reconcile problems, medications, and allergies before continuing.")
""
else
""
endif}
Of course what I have is nice and spaced out properly haha, not sure why the forum scrunches things up.
It always does. WYSINWYG.
SLHV - Was that able to work for you?
I haven't used it yet. I put it in our kb for later experimentation & testing. It looks like something we would use, but testing time is hard to come by lately. 🙂
Thanks for the code!