wow, this code is so neat, thank you!!
Laryssa Lewis said:
wow, this code is so neat, thank you!!
I spoke too soon, I added the code to a text file and added the text file to the rx encounter template, the pop up appeared when I started the update, but then the body of the note shows this after the pop up is closed. Do you know how to fix this? I don't want to see this in the note, thank you!!
?
{!if UncodedMedsPres(MEDS_AFTER(
"Delimited"),"") <> "" and document.popblock == "" 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.")
document.popblock =
"Done"
else
"" endif <-COULDN'T FIND THE SYMBOL
I got the same message, any thoughts?
Here is a version with all the formatting strangeness that the copy to the forums introduced "corrected". I haven't tried it but see if it helps.
DavidShower said:
Here is a version with all the formatting strangeness that the copy to the forums introduced "corrected". I haven't tried it but see if it helps.
Thanks David
I'll give it a try.
Laurie
DavidShower said:
Here is a version with all the formatting strangeness that the copy to the forums introduced "corrected". I haven't tried it but see if it helps.
I created a text file and this is what it produced:
{!if UncodedMedsPres(MEDS_AFTER("Delimited"),"") <> "" and document.popblock == "" 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.")
document.popblock ="Done"
else
""
endif <-COULDN'T FIND THE SYMBOL
_TEXT:1716217645056250]
DavidShower said:
Here is a version with all the formatting strangeness that the copy to the forums introduced "corrected". I haven't tried it but see if it helps.
bummer, I'm still getting this with the new code. The pop up works great, I'm just not sure how to avoid seeing this in the note.
{!if UncodedMedsPres(MEDS_AFTER("Delimited"),"") <> "" and document.popblock == "" 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.")
document.popblock ="Done"
else
""
endif <-COULDN'T FIND THE SYMBOL
Hmm, well I have never used text components for anything, so I am not sure what the issue is. The way I understand them though they only run once when you insert them. So I think the document.popblock symbol may be redundant and may be causing the issues (have you tried to run a trace?) maybe remove those references if trying in a text component.
{!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}
I also like Davids idea of exporting the Prescription form and manually modifying the XLW file to include this, I have successfully modified the XLT in the past so I know thats possible.
gibsonmi said:
Hmm, well I have never used text components for anything, so I am not sure what the issue is. The way I understand them though they only run once when you insert them. So I think the document.popblock symbol may be redundant and may be causing the issues (have you tried to run a trace?) maybe remove those references if trying in a text component.
{!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}
I also like Davids idea of exporting the Prescription form and manually modifying the XLW file to include this, I have successfully modified the XLT in the past so I know thats possible.
Thanks Michael
I tried at as above and recieved this:
{!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 <-FUNCTION DEFINITION IS NOT EXECUTABLE
So I will try Davids idea, as clearly the text file is not working with this.
Thanks
Laurie
I did get this to work in a text component:
{ 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} Now I have to figure out how to get the FALSE out of the note. I know I've done that before - just have to remember how...
Ok, to get rid of the false add a empty double quote, "" , between the last parthesis and the else in the statement calling the userok. Adds a blank line but better than printing FALSE.
{ 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}
The empty line is probably from the line break between brackets, try switching
}}
{if Uncoded...
to
}
}{if Uncoded...
This Is great, we have a large amount of uncoded errors one questions has anyone tried making a button to insert the text component so it runs that way. I can see our docs now complaining about a pop up as soon as they go into an update.
gibsonmi said:
The empty line is probably from the line break between brackets, try switching
}}
{if Uncoded...
to
}
}{if Uncoded...
So I tried this, but I am still getting this text in the note:
TEXT:1716122522056110]
I did a MEL trace but did not find this or any errors in the trace. Any ideas what might be causing this?
Thanks
Laurie
Do you get that when you manually insert the text component into an empty update?