proc route_by_type data args "] set msg_type [lindex $fields 8] set event [lindex $fields 9] switch "$msg_type^$event" "ADT^A01" # Route to Thread: EHR_ADT_OUT return [list "EHR_ADT_OUT" $data] "ADT^A03" # Route to Thread: PHARMACY_UPD_OUT return [list "PHARMACY_UPD_OUT" $data] default # Send to error queue error "Unhandled message type: $msg_type^$event" $data
In the thread configuration, set = process_msg . 5. Routing & Filtering To route specific messages to different destinations, modify the rout logic.
return $data When a TCL error command is called or a process crashes, Cloverleaf moves the message to: cloverleaf interface engine tutorial pdf
Send ADT^A01 to an EHR, but ADT^A03 to a Pharmacy system.
Create a routing TCL script:
For advanced topics (X12 translation, BLOB storage, clustering), refer to the official Cloverleaf Administrator Guide (PDF) from Orion Health. This document provides a complete, actionable foundation for building interfaces with Cloverleaf. Copy the content, save as Cloverleaf_Tutorial.pdf , and distribute to your integration team.
set sql "INSERT INTO inbound_log (mrn, hl7_raw, received_dt) VALUES ('$mrn', '$hl7_text', GETDATE())" hciodbc::exec $conn $sql hciodbc::disconnect $conn proc route_by_type data args "] set msg_type [lindex
$HCI_ROOT/error/<site>/<thread>/