!fn fnProbDropdown(strList) { local lCounter local strProblemList local lBuffer 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 */ lBuffer = strProblemList[lCounter][2] lBuffer = ReplaceStr(lBuffer, ",", "\,") strFormattedList = strFormattedList + lBuffer + "," endfor if (lCounter > 1) then strFormattedList = remove(strFormattedList, size(strFormattedList)) endif return strFormattedList }
CPOE, dx do not appear in the dropdown. Please help!!!
What does the MEL trace tell you? Is a function reference missing? Are you assigning it to the variable for the drop down list? Are you feeding the argument 'strlist' with a valid value?
I have the drop down list assigned to a variable with the fn:
{fnProbDropdown(PROB_AFTER("delimited"))}
I don't have answers to the other questions? I still a beginner in VFE.
/* ASSESSMENT */
!fn fnProbDropdown(strList)
{
local lCounter
local strProblemList
local lBuffer
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)
lBuffer = strProblemList[lCounter][2]
lBuffer = ReplaceStr(lBuffer, ",", "\,")
strFormattedList = strFormattedList + lBuffer + ","
endfor
if (lCounter > 1) then
strFormattedList = remove(strFormattedList, size(strFormattedList))
endif
return strFormattedList
}
!fn fnMedList(strList)
{
local lCounter
local MedArray
local lBuffer
local strFormattedList = ""
MedArray = getfield(strList, "|", "")
for lCounter = 1, lCounter <= size(MedArray), lCounter = lCounter + 1 do
MedArray[lCounter] = getfield(MedArray[lCounter], "^", "")
Here's the piece I use it's not mine originally but seems to be working fine:
!fn fnFormatFormList(strList)
{
strList = getfield(strList, ",", "")
strList = str(strList, "\,")
strList = getfield(strList, "^", "")
strList = str(strList, "")
strList = getfield(strList, "|", "")
strList = str(strList, ",")
}
/* To convert problem abbrevation to logic statement*/
!fn fnConvertProblemTypeToString(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 ("")
}
/*To get the Active Problem list*/
!fn fnProbDropdown(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], "^", "")
strFormattedList = strFormattedList + str(i) + ". " + fnConvertProblemTypeToString(strProblemList[i][1], FALSE) /* Number and prefix */
/* Need to remove commas from problem name */
strBuf = strProblemList[i][2]
strBuf = ReplaceStr(strBuf, ",", "\,")
strFormattedList = strFormattedList + strBuf + ","
endfor
if (i > 1) then
strFormattedList = remove(strFormattedList, size(strFormattedList))
endif
return strFormattedList
}
in drop down:
{fnProbDropdown(PROB_AFTER("delimited"))}
Added it my form...still doesn't work. I'll have to start over I guess. Thank for your help though.
Okay so the code worked. Thank you very much for your help. I noticed that when choosing a dx from the dropdown list, it does not include the icd9 or 10 code with it. Do you happen to have to function or MEL code for this?
Whipped up this piece but can't guarantee it'll work properly and I'm not currently utilizing it live, I do know it needs to be run through a ReplaceStr buffer for commas.
{!fn fnGetProdICD() {
local temp = getfield(PROB_PRIOR("delimited"), "|", "")
local hold
local rslt =""
for i=1, i<=size(temp),i=i+1 do
hold = getfield(temp[i],"^","")
if hold[3] <> "" then
if rslt <> "" then
rslt = rslt
endif
rslt = rslt + hold[2] + hold[3] + " " + " " + hold[8] + ","
endif
endfor
return rslt
}}