I HAVE A DYNAMIC LISTBOX SHOWING THE CURRENT PROBLEM LIST, BUT IT DISPLAYS ONLY THE DESCRIPTION AND THE ICD9 CODE. HOW CAN I MAKE THIS DISPLAY THE DESCRIPTION PLUS THE ICD10 CODE OR BOTH THE ICD9 & 10?
HERE IS THE MEL EXPRESSION ON THE LISTBOX:
{fnProbList(PROB_AFTER("delimited"))}
HERE IS THE CURRENT FUNCTION:
!fn fnProbList(strList)
{
local lCounter
local strProblemList
local nStart
local strBuf
local strFormattedList = ""
strProblemList = getfield(strList, "|", "")
for lCounter = 1, lCounter <= size(strProblemList), lCounter = lCounter + 1 do
strProblemList[lCounter] = getfield(strProblemList[lCounter], "^", "")
strFormattedList = strFormattedList + str(lCounter) + ". " + fnConvertProblemTypeToString(strProblemList[lCounter][1], FALSE) /* Number and prefix */
/* Need to remove commas from problem name */
strBuf = strProblemList[lCounter][2]
strBuf = ReplaceStr(strBuf, ",", "\,")
strFormattedList = strFormattedList + strBuf + ","
endfor
if (lCounter > 1) then
strFormattedList = remove(strFormattedList, size(strFormattedList))
endif
return strFormattedList
}
I WOULD APPRECIATE ANY HELP ANYONE CAN GIVE ME. THANKS IN ADVANCE!
The ICD-10 code is located in the 8th field of the array. This will give you the name, ICD-9, and ICD-10:
!fn fnproblemcheck_AP(strlist)
{ local strproblemlist
local nstart
local strbuf
local strformattedlist = ""
strproblemlist = getfield(strlist, "|","")
for i = 1, i <= size(strproblemlist), i=i+1 do strproblemlist[i]=getfield(strproblemlist[i],"^","")
strBuf = fnConvertProblemTypeToString_AP(strProblemList[i][1], FALSE) + strProblemList[i][2]
strBuf = ReplaceStr(strBuf, ",", "")
strFormattedList = strFormattedList + strBuf + " ("
strBuf = strProblemList[i][3]
strBuf = ReplaceStr(strBuf, ",", "")
strFormattedList = strFormattedList + strBuf + ")("
strBuf = strProblemList[i][8]
strBuf = ReplaceStr(strBuf, ",", "")
strFormattedList = strFormattedList + strBuf + "),"
endfor
return (strFormattedList)
}
Thanks! I replaced my function with yours. To link this function to the listbox, I now have:
{fnproblemcheck_AP(PROB_AFTER("delimited"))}
but nothing is appearing on the form in EMR.
Suggestions? I have little to no experience with functions or arrays.
Well, it's very strange but I've got Dynamic Choice List checked and I've tried putting in the MEL exactly as you have it both where the function is written and where it calls it with a MEL expression. That section on the form is still blank when I load it into EMR. Thanks for your help though. I'll keep playing around with it.
I'm sorry. I din't notice that the function was invoking another function. Please insert this function:
!fn fnConvertProblemTypeToString_AP(strType, bIncludeDx)
{
strType = tolower(strType)
cond
case (strType == "dx of")
if (bIncludeDx) then
return ("Diagnosis of ")
else
return ("")
endif
case (strType == "mdxof")
return ("Minor diagnosis of ")
case (strType == "h/f")
return ("Hospitalized for ")
case (strType == "hx of")
return ("History of ")
case (strType == "s/p")
return ("Status post ")
case (strType == "r/o")
return ("Rule out ")
case (strType == "? of")
return ("Question of ")
case (strType == "sx of")
return ("Symptom of ")
case (strType == "rs of")
return ("Risk of ")
case (strType == "note:")
return ("Take note of ")
case (strType == "fh of")
return ("Family history of ")
endcond
return ("")
}
It worked! Thank you so much!
You're welcome. Sorry that I didn't notice that before.
Good morning,
I am trying to accomplish the same thing with the ICD10 codes but I am still getting a blank box in CPS. Could you look at my code and see if you see my error:
!fn fnproblemcheck_AP(strlist)
{ local strproblemlist
local nstart
local strbuf
local strformattedlist = ""
strproblemlist = getfield(strlist, "|","")
for i = 1, i <= size(strproblemlist), i=i+1 do strproblemlist[i]=getfield(strproblemlist[i],"^","")
strBuf = fnConvertProblemTypeToString_AP(strProblemList[i][1], FALSE) + strProblemList[i][2]
strBuf = ReplaceStr(strBuf, ",", "")
strFormattedList = strFormattedList + strBuf + " ("
strBuf = strProblemList[i][3]
strBuf = ReplaceStr(strBuf, ",", "")
strFormattedList = strFormattedList + strBuf + ")("
strBuf = strProblemList[i][8]
strBuf = ReplaceStr(strBuf, ",", "")
strFormattedList = strFormattedList + strBuf + "),"
endfor
return (strFormattedList)
}
!fn fnConvertProblemTypeToString_AP(strType, bIncludeDx)
{
strType = tolower(strType)
cond
case (strType == "dx of")
if (bIncludeDx) then
return ("Diagnosis of ")
else
return ("")
endif
case (strType == "mdxof")
return ("Minor diagnosis of ")
case (strType == "h/f")
return ("Hospitalized for ")
case (strType == "hx of")
return ("History of ")
case (strType == "s/p")
return ("Status post ")
case (strType == "r/o")
return ("Rule out ")
case (strType == "? of")
return ("Question of ")
case (strType == "sx of")
return ("Symptom of ")
case (strType == "rs of")
return ("Risk of ")
case (strType == "note:")
return ("Take note of ")
case (strType == "fh of")
return ("Family history of ")
endcond