HELP!!! need to change these so I can commit my orders with ICD10 code. I know how to get it to display but I can't get it to commit. With my MEL_ADD_ORDER.
fn fnGetProblemCodes()
{
local lCounter
local lSize
local lResult = str("")
local lProblemList = getfield(DOCUMENT.PROBLEMS, ",", "") /* Get selected problems and separate into array by commas */
lSize = size(lProblemList) /* Determine size of array */
for lCounter = 1, lCounter <= lSize, lCounter = lCounter + 1 do /* Loop through all rows of the array */
lProblemList[lCounter] = getfield(lProblemList[lCounter], "^", "") /* Separate problem description and code */
lResult = lResult + lProblemList[lCounter][2] + "|"/* Join codes into a string separated by pipes */
endfor
if (lResult <> "") then
lResult = remove(lResult, size(lResult)) /* Remove trailing pipe (|) */
endif
}
fn fnGetProblemDescriptions()
{
local lCounter
local lSize
local lResult = str("")
local lProblemList = getfield(DOCUMENT.PROBLEMS, ",", "") /* Get selected problems and separate into array by commas */
lSize = size(lProblemList) /* Determine size of array */
for lCounter = 1, lCounter <= lSize, lCounter = lCounter + 1 do /* Loop through all rows of the array */
lProblemList[lCounter] = getfield(lProblemList[lCounter], "^", "") /* Separate problem description and code */
lResult = lResult + lProblemList[lCounter][1] + "|"/* Join descriptions into a string separated by pipes */
endfor
if (lResult <> "") then
lResult = remove(lResult, size(lResult)) /* Remove trailing pipe (|) */
endif
}
!fn fnProblemList2(strList)
{
local lCounter
local lProbArray
local lStart
local lBuffer
local lFormattedList = ""
/* Create array of medications */
lProbArray = getfield(strList, "|", "")
for lCounter = 1, lCounter <= size(lProbArray), lCounter = lCounter + 1 do
/* Create array for each medication */
lProbArray[lCounter] = getfield(lProbArray[lCounter], "^", "")
/* Need to remove commas from problem name */
lBuffer = ReplaceStr(lProbArray[lCounter][2], ",", ";")
/* Append problem and ICD-9 code to formatted list */
lFormattedList = lFormattedList + lBuffer + " (" + lProbArray[lCounter][3] + "; " + lProbArray[lCounter][8] + "), " endfor
/* Remove trailing comma */
if (lCounter > 1) then
lFormattedList = remove(lFormattedList, size(lFormattedList))
endif
/* Return comma separated list */
return (lFormattedList)
}