we have been struggling with the issue of uncoded meds. Sometimes these may be the doctor manually typing in the medicine, but other times the medicine may simply 'change' and be no longer valid.
If I read the tables correctly, an uncoded medicine will not have a valid entry for MEDICATE.NDCLABPROD
Assuming that to be correct (let me know if I am wrong), then I next want to look at the MEL function MEDS_AFTER and when delimited the "NDC CODE" that is returned.
Finally, if all these assumptions are correct, then if I put the MEDS_AFTER into an array, I should be able to cycle thru the entries to see if any current meds return null/zero for that field. Correct?
Or, is there a simpler way of doing this?
Thanks in advance....
We have the same issue, I wrote this to check NDC, I think your assumptions are correct.
{fn UncodedMedsPres(meds,allergies){
local temp = getfield(meds,"|","")
local hold
local rslt = ""
for i=1, i<=size(temp),i=i+1do
hold = getfield(temp[i],"^","")
if hold[5] == "" then
if rslt <> "" then
rslt = rslt + hret
endif
rslt = hold[1] + " (" + hold[7] + ")"
endif
endfor
return rslt
}}
Michael, when are you using this? I'm curious as to where in the workflow your providers are checking this.
Thanks,
In the Rx Refill document, when they open the Rx Refill document it runs and if not blank a popup warns the user which meds are uncoded. In our workflow if a provider wants to refill a med they select the med from a listbox on the assessment and plan and click a button to send a flag to a proxy user with the request, a staff member then fills the request.
Michael
Are you using a custom Rx refill form?
Laurie
No, I added another form to the Rx Refill document type. You could also use this in a text component though and add that to the encounter (I think). Then the staff would not see anything different
Thank you!
gibsonmi said:
No, I added another form to the Rx Refill document type. You could also use this in a text component though and add that to the encounter (I think). Then the staff would not see anything different
I created a Text Component and added it to our phone note encounter, but did not get any results. Thanks.
This is exactly what I have in the form component for it to work -
{!document.popblock}
{!fn UncodedMedsPres(meds,allergies){
local temp = getfield(meds,
"|","")
local hold
local rslt =
""
for i=1, i<=size(temp),i=i+1do
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"),"") <> "" 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}
I'm curious as to why there's an allergy parameter when it doesn't appear to be used in the function. Assuming you were planning on always looking at MEDS_AFTER, could you eliminate the parameters entirely and set temp = getfield(MEDS_AFTER...)?
It was there from an older version of the function, what you describe could work just the same for the way I called it. If you leave the meds as a parameter though you could also have it run any time you change medications instead of just once, it leaves your options open at least...
Wow, thanks! Worked perfectly. I wish we could access the Rx Refill form though, I would like to see the pop up only when I checked an uncoded medication for refill...
You could always try exporting the clinical kit for the form, pasting the code into the XLW file and then reimporting it and see if that would work....
DavidShower said:
You could always try exporting the clinical kit for the form, pasting the code into the XLW file and then reimporting it and see if that would work....
I can't find the clinical kit for the Rx Refill form.
ljburnham said:
DavidShower said:
You could always try exporting the clinical kit for the form, pasting the code into the XLW file and then reimporting it and see if that would work....
I can't find the clinical kit for the Rx Refill form.
And if it wasn't such a long day, then I would know it was under Prescriptions, not RX! Tried it, and it actually did the same thing. The pop up came when I clicked the Rx Refill quick button. Thanks.