Hello chuggers!
I have a VFE from that I'm using to parse ORDERS_NEW and compare to a
ORDER_CUST_LIST. The end-goal is to be able to separate out orders of different types for documentation and instruction purposes (our docs want to separate out labs from other types of tests etc.). The challenge I am facing is that once the orders have been created and translated out to the form text, they do not update like ORDERS_NEW usually do (say a provider adds or removes orders before signing). I've attempted to use watcher functions to overcome this, but to no avail. Here is the main function i am using for comparison:
{!fn fnSHOW_CURRENTLY_ORDERED(in_string,arg){
// variable that builds our string that we will later output:
// 4-17-2013 how about setting up an array, instead? that way we could do something with each element…
local build_string = ""
// variable to store the Order Description (field #1):
local current_new_order
// variable to store the Order Code (field #3):
local current_new_order_code
// variable to store the Order Comments (field #8):
local current_new_order_comments = ""
// variable to store current ORDERS_NEW for comparrison:
local new_orders
//variable for building our array
local ary
new_orders = getfield(ORDERS_NEW('delimited'), "|","")
for ii = 1, ii <= size(new_orders), ii = ii + 1 do
new_orders[ii] = getfield(new_orders[ii], '^', '')
current_new_order = new_orders[ii][1]
current_new_order_code = new_orders[ii][3]
// check to see if instructions are to be included or not
if arg=="instructions" then
current_new_order_comments = FMT("instructions:", "I,U,-1") + " " + FMT(new_orders[ii][8], "-1") + HRET + HRET
else
current_new_order_comments = ""
endif
// Check "current_new_order" variable and compare to our custom order list which is temp variable (in_string)
// If equal, set to "build_string" variable, otherwise do nothing and move on to next order
ary = getfield(ORDER_CUST_LIST(in_string), '|','')
for b = 1, b <= size(ary), b = b + 1 do
ary[b] = getfield(ary[b], '^','')
if ary[b][2] == current_new_order then
// Build a string that adds each "ary" to the next with a new line after each
build_string = build_string + FMT(current_new_order, "B") + " [" + current_new_order_code + "] " + HRET + current_new_order_comments
endif
endfor
endfor
if in_string == 'Labs Specialty' and build_string <> "" then
build_string = insert(build_string,1,specialty_pre) + specialty_post
endif
if (build_string <> "") then
return build_string
else
return ""
endif
}}
In the VFE form translation "Chart Note" area, calling the function works as expected upon order placement. The problem is if any orders are added or removed as the chart note does not update.
Can anyone lend some advice?
Thanks so much in advance!
Posted : April 17, 2013 10:57 am