Hello,
Our providers requested we add a data display to displays when the last time a code was billed ( such as a preventive code) to help them not bill it if a patient is not due for it to avoid billing the patient. Any one know how I can do this? I'm really not sure how to pull in billing or CPT code information to data displays. Any help would be greatly appreciated.
Thanks!
To start with, the command ORDERS_PRIOR will display prior orders. Suggest you explore that command. Probably will require the 'delimited' option, and storing the output to an array. Finally, loop through the array to see if any of the orders match what you are looking for --> 99201-99215 for prior preventive care services, etc..
Here is an example of the coding to loop through immunization data and display certain data elements. Including so you get an idea of how to capture the output and loop through it.
{!fn fnTextTransImmunHx() {
local hold = getfield(IMMUN_GETLIST("", "all"), "|", "")
local temp
global rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt <> "") then
rslt = rslt + rtntype
endif
rslt = rslt + temp[3] + if temp[4] <> "" then " - " else "" endif + temp[4] + " on " + temp[30] + HRET
endfor
return rslt
}}
This should get you started. Define strSel to be your desired CPT Code, in code below strSel="CPT-99204". Set up a data display with following MEL: {RetrieveOrder()}
{ fn RetrieveOrder()
{
local arrayOrder
local i=0
local strSel="CPT-99204"
local strOrder=""
local strRet=""
strOrder=Orders_All("delimited")
if strOrder<>"" then
arrayOrder=GetField(strOrder,"|","")
for i=1,i<=size(arrayOrder),i=i+1 do
arrayOrder[i]=GetField(arrayOrder[i],"^","")
if arrayOrder[i][3]==strSel then
strRet=strRet+(if strRet=="","",",")+arrayOrder[i][3]+" "+arrayOrder[i][4]
endif
endfor
endif
return strRet
}
}
Thank you I got it to work with the first function posted by jftzmd but it brings ALL the previous dates of the order code. Is there a way to just get the last one?