I'm new to MEL and attempting to add a listbox to a form that will allow the user insert the order description and CPT code for orders in a patient's chart to the chart note.
I have written some looping functions to pull the pieces of data from the delimited lists but I'm having formatting problems and I'm not very familiar with reading through all the logic in a MEL trace to troubleshoot.
Has anyone done this before and have a working function they could share?
Thanks,
Tim
Well, I ended up using this:
{!fn OrdListGen(){
local ord_arg = getfield(ORDERS_ALL("delimited"),"|","")
local max = SIZE(ord_arg)
local ord_str = ''
FOR COUNT = 1, COUNT <= max, COUNT = COUNT + 1
do
local getord = getfield(ord_arg[COUNT],"^","")
local tempstr = ReplaceStr(getord[1],","," ")
ord_str = ord_str + tempstr + " " + getord[3] + " " + getord[4] + ","
endfor
return ord_str}}
It gave me a fight until I used ReplaceStr to get the commas out of the first field of ORDERS_ALL "delimited"
I also ended up adding the 4th field to show the order date to make selecting the orders easier for staff.