Hello,
Is there a way to display all of the orders in a patients chart, with the date that the order was signed, the status of the order and if possible the provider who signed it? The more information the better.
Any help is much appreciated 🙂
Thank you in advance!
{ORDERS_AFTER("delimited")} will give you all information of current active orders. You would then have to use it in a function to parse through the data and format the data to what you want to display. It will not give you information or data on already completed orders however.
Thank you Dan! Tried this and it works great! Do you have any examples of functions that format this data? I am getting a lot of MEL vomit working with this part.
Hi Courtney,
Here is a function we use that will return a comma-delimited list of Referrals and populate a document variable named DOCUMENT.REFERRAL_LIST. It's pretty basic, but you should be able to customize it to whatever you need.
{
!DOCUMENT.REFERRAL_LIST = getReferralOrders(ORDERS_AFTER("delimited", "R"))
}
!fn getReferralOrders(o)
{
local retStr = ""
local oArr
local oArrPlus
cond
case o == "": /*Do Nothing*/
case match(o, 1, "|") == 0:
oArr = getfield(o, "^", "")
retStr = oArr[25] + ": " + replacestr(oArr[1], ",", "")
if oArr[13] <> "" then
retStr = retStr + ". " + replacestr(oArr[13], ",", "")
endif
else:
oArrPlus = getfield(o, "|", "")
for x = 1, x <= size(oArrPlus), x = x + 1 do
oArr = getfield(oArrPlus[x], "^", "")
if retStr <> "" then retStr = retStr + "," endif
retStr = retStr + oArr[25] + ": " + replacestr(oArr[1], ",", "")
if oArr[13] <> "" then retStr = retStr + ". " + replacestr(oArr[13], ",", "") endif
endfor
endcond
return retStr
}
Thank you!! That is pretty much exactly what I need to work off of!
Hi, is there anyway to code for only seeing the orders that were placed in the last 6 months and of those, only the orders that are In Process? Each time I try to code this it doesn't come out exactly right. Much appreciated!