I am trying to create a CAM for CMS68
I created the follow ...
{CFMT(OBSNOW("Meds review"), "", "Medication List Reviewed During this Update: ", "B", "
")}
{IF OBSNOW("MEDS REVIEW")== "Done" then MEL_ADD_ORDER("S","PQRI","SNOMED-CT:428191000124101 Current Medications Documented","","", "","","1","N","","")"" else""endif}
What I am trying to accomplish is when the check box for "Medication List Reviewed During this Update" is checked it creates a value of "Done" --- and send the SNOMED code to the orders--- this parts works
My problem is each time the encounter is open it places the SNOMED order again. So if the encounter is open five times there are five SNOMED orders entered on the orders list.
How can I prevent this from happening???
Any and all suggestions apprecated
Rosemary Lust, RN
[email protected]
This will work. Add this to your functions window and it will watch obsterm Meds Review
Cecil
/* Function finds if a particular service order was ordered and orders if not based on obs meds reviewed */
{
!if OBSNOW("MEDS REVIEW")== "Done" Then fnGetarray2()
endif
}
{!fn fnGetarray2() {
local rcode
local OrdValue
local sList = ""
local sAry =""
local imax
local OrdDescrip = "SNOMED-CT: 428191000124101 Current Medications Documented"
OrdValue = "Start"
sList = ORDERS_NEW('DELIMITED','S')
sAry = getfield(sList,"|","")
imax = size(sAry)
local i
local aRow
rcode =""
OrdValue = "False"
for i=1, i<=imax, i=i+1 do
aRow = getfield(sAry[i],"^","")
if (str(aRow[1])= OrdDescrip) then OrdValue = "True"
else ""
endif
endfor
if (OrdValue = "True") then ""
else
MEL_ADD_ORDER("S","PQRI","SNOMED-CT: 428191000124101 Current Medications Documented","","","","","","","","")
endif
}
}
You are using MEL_ADD_ORDER instead of CCC_ADD_ORDER !
From the CAM file:
/*
//// To prevent duplicate orders from being entered use the CCC_ADD_ORDER function.
//// It requires the same arguments as the MEL_ADD_ORDER data symbol.
//// The function is defined in the CCC-fndef-supplement-1.ccc file
*/
Rosemary,
You can also use the following:
{IF OBSNOW("MEDS REVIEW")== "Done" then if Match(ORDERS_NEW("delim","S"),"SCT - 428191000124101")=="" then MEL_ADD_ORDER("S","PQRI","SNOMED-CT:428191000124101 Current Medications Documented","","", "","","1","N","","") else "" endif endif}