I want to see all referral orders for a patient including those are complete
ORD_*** do not show complete orders
Also, is there any way to limit this to last 6 months
Use ORDERS_ALL("delimited", "R") then loop through to only select the ones that are recent. The centricity help file has details on all the fields. I haven't looked at how to do the date comparison but the order start date is in the 4th field
fn RecentReferrals(){
local strResult = ""
local arrOrders = getfield(ORDERS_ALL("delimited", "R"), "|","")
local arrOrdersSize = size(arrOrders)
local i
for i = 1, i <= arrOrdersSize, i = i + 1 do
arrOrders[i] = getfield(arrOrders[i],"^","")
if /*compare arrOrders[i][4] to today's date*/ then
strResult = strResult + arrOrders[i][1] + "\r\n"
endif
endfor
return strResult
}