I am using the following functions to return a list of problems.
{fn fnCommaCombine(){
local rslt = ""
for i = 1, i <= getnargs(), i = i + 1 do
rslt = fncombineutility(rslt,getarg(i))
endfor
return rslt
}}
{fn fnCombineutility(one,two){
if (one <> "") and (two <> "") then
return (one + "," + two)
else
return (one + two)
endif
}}
{document.assesslist=fncommacombine(DOCUMENT.cervical1,DOCUMENT.cervical2,DOCUMENT.thoracic1,document.thoracic2,
document.lumbar1,document.lumbar2,document.head1,document.head2,
document.postop1,document.misc1)}
In my translation, I am using the following to remove commas and add a return.
{CFMT(ReplaceStr(DOCUMENT.assesslist, ",",HRET), "I", "
", "", "
")}
This is working okay for us, but we would like to number the results on separate lines depending on how many problems are selected.
Any help would be appreciated.
I am assuming that you only need the numbering to appear in the chart note.
Here is a function that you can call in your text translation to list the problems as numbered, one per line:
Define in MEL code area:
{fn fnNumberList(sPlist) {
// Insert "1.) 2.) 3.) ... etc" in front of each problem in sPlist
// Also, might as well insert HRET instead of commas
// Use this function when printing to chart note
local sAry = getfield( sPlist, ",","")
local i=0, imax=size(sAry)
local sNumList = ""
for i=1, i<=imax, i=i+1 do
sNumList = sNumList + (if sNumList<>"",HRET,"") + i + ".) " + sAry[i]
endfor
return sNumList
}}
DOCUMENT.assesslist TRANSLATION
{CFMT( fnNumberList(DOCUMENT.assesslist), "I", "
", "", "
")}
Does this do what you wanted ?
- Beverly
Works perfectly. Thanks Beverly!