Hello All,
I have a form that uses lists boxes and a button to add orders with diagnosis attached. I need to make sure the provider does not add the same order more than once if they click the button repeatedly. It would make sense to compare the order I am trying to add with my function against the list items ordered during the current visit. There are two issues I'm running into:
1) ORDERS_NEW() only returns orders that do not have a status of complete. Given the workflows of the office I am developing this for this means that part way through the visit this function may become inaccurate.
2)ORDER_LIST_CHANGES() does not return in a delimited or comma separated format. This is example output:
Added new Test order of CBC with Differential (CPT-85025) – signed
Added new Referral order of EEG Evaluation (CPT-95950) – signed
Added new Service order of Ofc Vst, Est Level II (CPT-99212)
My best effort at making ORDER_LIST_CHANGES() something I could work with was this:
olArray = getfield(ORDER_LIST_CHANGES(), "\r\n","")
This works when there is 1 entry only. If there are two entries the size of the array returns as 3, if there are three entries the array size is 5. If you look at the mel trace with two sample entries this is what ORDER_LIST CHANGES returns:
"Added new Service order of EKG, tracing with report (CPT-93000) \r\nAdded new Service order of Aspirin 81mg (Aspirin81) "
Since "\r\n" is the delimiter for getfield, I would expect the array would have two items.
If anyone has any thoughts on my example above or getting a good list of orders just in this visit regardless of status I would appreciate them.
Thanks,
Brad
the getfield() function is using "\r" OR "\n" as a delimiter, since they are both there you will find a blank array item between your hard return characters. To get around it do this instead-
olArray = getfield(ORDER_LIST_CHANGES(), "\n","\r")
Thanks! This worked great for me.