I recieved this code from a form distributed on chug.
{
fn allergyList(strList)
{
local lCounter
local lAllArray
local lStart
local lBuffer
local lFormattedList = ""
lAllArray = getfield(strList, "|", "")
for lCounter = 1, lCounter <= size(lAllArray), lCounter = lCounter + 1 do
lAllArray[lCounter] = getfield(lAllArray[lCounter], "^", "")
lBuffer = ReplaceStr(lAllArray[lCounter][1], ",", ";")
lFormattedList = lFormattedList + lBuffer + " " + if lAllArray[lCounter][3] == "C" then "" else "" endif +"" + HRET + if lAllArray[lCounter][5] == "" then "" else " Reaction: " + lAllArray[lCounter][5] + HRET endif
endfor
if (lCounter > 1) then
lFormattedList = remove(lFormattedList, size(lFormattedList))
endif
return (lFormattedList)
}
}
{allergyList(ALL_AFTER("Delimited"))}
It works fine in a form but can i use it in a handout??? I have used functions in a handout before and I am not sure why this one is not working.
Thanks
Gail Ruhlin
just tried it in EMR 9.5…works fine. try doing a trace when you preview the handout.
where are you putting the function?
I copied exactly what you have posted and pasted it into a new handout and then previewed it from a patient's chart.
{
fn allergyList(strList)
<-COMPILER ERROR NEARBY: Expect LEFT CURLY BRACKET. Instead had IDENTIFIER after RIGHT PAREN
?
{allergyList(ALL_AFTER("Delimited")) <-FUNCTION DEFINITION IS NOT EXECUTABLE
This is what I am getting for my translation 🙁
And this is what is happening when I run MEL trace
--------------------------------------------------------------
-- Starting MELTrace on 10/16/2012 4:34 PM for WSID 6110
--------------------------------------------------------------
>{allergyList(ALL_AFTER("Delimited"))}
execute>call ALL_AFTER("Delimited")
results>""
execute>call ALLERGYLIST("")
ERROR: 32847 FUNCTION DEFINITION IS NOT EXECUTABLE
where did you copy it from? always paste anything you copy into Notepad and copy it from Notepad to paste into Centricity to remove any funky characters.
yep, well I'm a idiot. It works, sorry
Thanks for your help!!!!