Hi is there any way to find that the order has been created or not created. This validation will help us to avoid placing a duplicate order.
Check the orders section of the patient's chart. Make sure under the organize button you have Complete checked to see all orders in case you run in house labs (services show as complete status).
Via MEL, look at looping through the ORDERS_AFTER (delimited) data symbol. You will need to limit the date range to avoid looping through the entire history. You will also want to add filters to exclude cancelled orders and if desired, specify the type of order (service vs test vs referral).
Is there a way to remove an order (unsigned) via MEL? If not, what other method is suggested?
Currently, no. The only method is to open the orders module itself and manually remove it via the native workflow. You can use a button to open the module from a form making it easier to execute the manual process.
{if match(str(ORDERS_ALL("delim")), 1, "^CPT-00000^") > 0 then
userok("This order has already been placed.")
else
MEL_ADD_ORDER("S", "Path","Description","","","", "", "", "", "", "")
endif}
Please let me know if this helps, we are here if you need any other MEL/VFE help.
Just as an FYI: I would avoid matching on the CPT code for orders since many orders share the same CPT code but use different order descriptions (names). Also be aware that orders all lists all orders ever placed in the patient's chart, regardless of status, making it a poor choice for recurring order scenarios. In addition, because the list returned can be rather huge on long term patient charts, it could have an adverse impact on performance when matching on the unfiltered list.