I am trying to add the following into a data display to pull in the last Coumadin dose. The following code is giving me an error when I oull the form into GE> Please tell me if I am doing this right.
{(OBSPREV("Sunday Dose"),OBSPREV("Monday Dose"),OBSPREV("Tuesday Dose"),OBSPREV("Weds. Dose"),OBSPREV("Thurs. Dose"),OBSPREV("Friday Dose"),OBSPREV("Sat. Dose"))}
How exactly do you want the data to display? If you are looking for some thing like this:
Monday Dose: <value> Tuesday Dose: <value>
Then try this:
{"Sunday Dose: " + OBSPREV(“Sunday Dose”) + " Monday Dose: " + OBSPREV(“Monday Dose”) + " Tuesday Dose: " + OBSPREV(“Tuesday Dose”) + " Wednesday Dose: " + OBSPREV(“Weds. Dose”) + " Thursday Dose: " + OBSPREV(“Thurs. Dose”) + " Friday Dose: " + OBSPREV(“Friday Dose”) + " Saturday Dose: " + OBSPREV(“Sat. Dose”)}
It worked. I was able to get the previous Coumadin dose into the form/note. For some reason it broke 3 other things though. My currently weekly regimen, % Coumadin change, and prior weekly total dose all say N/A. I found the MEL code its looking at. Any ideas??
if size(v)>0 then
obsnow("coum tot wk","N/A")
obsnow("Coum dose","N/A")
DOCUMENT.TEMP_CPOE_ANTICOAG_SHOW_ERR = str(v)
return ""
endif
t = val(str(eval(str(i,"+"))))
obsnow("coum tot wk",if t=0 then "" else str(round(t,1)) + " mg" endif)
obsnow("Coum dose",if t=0 then "" else str(i,"^") endif)
}
}
{
!fn ccc_cpoe_anticoag_perc_change(aa,bb)
{
if aa="N/A" or bb="N/A" then obsnow("Coumadin Chg","N/A") return "N/A" endif
local a,b,c
a = aa
b = bb
while match(a," mg")>0 do a = remove(a,match(a," mg"),3) endwhile
while match(b," mg")>0 do b = remove(b,match(b," mg"),3) endwhile
if val(str(a))=0 or val(str(b))=0 then return "N/A" endif
c = round((val(str(b))-val(str(a)))/val(str(a))*100,0)
obsnow("Coumadin Chg",str(c))
if c < 0 then c = "- " + remove(str(c),1,1) else "" endif
if c > 0 then "+ " + c + " %" else c + " %" endif
}
}
Two questions:
1) Is this code also in the data display?
2) The fn ccc_cpoe_anticoag_perc_change() function, where/what value is populating aa and bb?
I would try and back track it from aa and bb and see why they are being populated with "N/A".