I'm trying to get a list similar to ORDER_LIST_CHANGES but with more data. ORDERS_NEW doesn't include orders that were completed upon signing so I know I have to use ORDERS_ALL, but how do I single out just those orders from this update?
The end result should look something like this:
AFP Non-Maternal - CPT- 82105
Diagnosis: ACUTE MAXILLARY SINUSITIS (ICD-461.0)
Authorized by: Rachael Carpenter
ePrescribing-G8553 - CPT-G8553
Diagnosis: ACUTE MAXILLARY SINUSITIS (ICD-461.0)
Authorized by: Rachael Carpenter
I thought about filtering on start date, but that won't work if a provider enters a future order or if there is more than one update today.
I wrote a match comparing the code with ORDER_LIST_CHANGES, but if that code has been used on this chart before (E&M codes for example) then it lists all historical instances of the code.
Anyone have a workaround for this? Here's what I have with the match() that's not quite working for me:
{fn fnListOrders(strOrders){
local strList = getfield(strOrders, "|", "")
local strBuf
local strFormattedList = ""
for i = 1, i <= size(strList), i = i + 1 do
strList[i] = getfield(strList[i], "^", "")
if (match(ORDER_LIST_CHANGES(),strList[i][3])>0) then
strBuf = strList[i][1] + " - " + strList[i][3] + HRET + " Diagnosis: " + strList[i][6] + " (" + strList[i][7] + ")" + HRET + " Authorized by: " + strList[i][21]
strFormattedList = CFMT(strFormattedList,"","","",HRET) + strBuf
else strFormattedList = strFormattedList endif
endfor
return strFormattedList}}
you could write a durationdays() statement to capture orders from today and and in the future, but you will probably still have the issue with orders from another update. I bet the only really clean way to do this is using meldefs
I thought about this a while ago but haven't tried yet. Instead of using the date, my idea was to watch ORDERS_NEW to store the order number prefix when an order is added and then later use that to filter ORDERS_ALL (such as '1234-' from '1234-987'). That might work if the orders always have the same prefix and adding an order always triggers ORDERS_NEW even if its signed right away (I would imagine so but I never checked).