IntegrationsHL7 (Old Flow)Inbound

Inbound HL7 Overview

Operation map for inbound HL7/SFTP order workflows handled by `hl7/2_3/createOrder/`.

👤 Development Team📅 Updated: May 5, 2026📁 Integrations🏷️ HL7🏷️ SFTP🏷️ Inbound🏷️ Orders

Inbound HL7 Overview

hl7/2_3/createOrder/ is the inbound HL7/SFTP router for order-related workflows. It validates the integration token, parses the raw HL7 payload, checks the external order number, and then routes the request to the correct operation.

Entry Point

ItemValue
Functionhl7/2_3/createOrder/
Source filelivehealthapp/labs/views.py
Parser, standard ordersorm_hl7_parsing_api_corrohealth
Parser, tox/micro ordersorm_hl7_parsing_function_tox
Downstream bill creation endpoint/create_order_in_crelio/
Required integration categoryactionCategoryListId = 51

Request Contract

FieldLocationRequiredDescription
authKeyQuery stringYesValidates requestToken and resolves lab, lab user, and lab timezone.
integrationQuery stringNoVendor identifier passed to the parser for vendor-specific mapping.
patient_strict_checkQuery stringNoEnables stricter downstream patient matching by demographic fields.
HL7 messageRequest bodyYesRaw HL7 payload parsed into the inbound order payload.

Routing Summary

OperationRouting conditionDocumentation
Create new orderNo active bill exists for the inbound order number, or no order number is parsed.Create Order
Update order / accessionExisting bill or report is found downstream and the request carries accession/sample identifiers.Update Order
Add tests to billExisting active bill, addTestToBill = 1, and uniqueOrderNo = 0.Add Test to Bill
Cancel billExisting active bill, uniqueOrderNo = 1, cancelBill = 1, and ORC-1 = CA.Bill Cancel

Request Routing Flow

Common Integration Configuration

These keys are read from the integration configuration.

KeyDefaultUsed byDescription
uniqueOrderNo1Create, cancel, duplicate handlingEnforces one active bill per external order number.
cancelBill0Bill cancelAllows full bill cancellation when the inbound order status is CA.
addTestToBill0Add test to billAllows appending inbound tests to an existing bill when duplicate order numbers are permitted.
add_duplicate_test0Add test to billAllows adding a test even if the bill already has that test.
toxMicroIntegration0Create orderSwitches to the tox/micro parser and post-bill drug setup.
orgPriceList0Create, add testUses organization price-list amounts where applicable.
replace_insurance_details0Create orderReplaces active patient insurance records before saving inbound insurance.
auto_add_insurance0Create orderCreates insurance master data from inbound IN1 if the code is not found.
prescription_reflex_at_order0Tox/micro create orderControls prescription reflex setup after tox bill creation.
is_aoe_storeunsetCreate, add testStores OBX question/value data as AOE values.

Parsed Fields Used For Routing

Parsed fieldHL7 sourceDescription
orm_statusORC-1Order control/status. CA is used for cancellation.
orderNumberOBR placer/filler fields, with vendor-specific overridesExternal order number used for duplicate, update, add-test, and cancel lookup.
testListOBR-4Inbound tests to create or append.
lab_report_idOBR-3Report identifier used by accession/update flows.
manual_sample_idZCT-12Manual sample/accession identifier used by update flows.

Duplicate Order Lookup

When the inbound orderNumber is available, the router searches active bills in the same lab where:

  • isCancel = 0
  • isRefund = 0
  • isWriteOff = 0
  • orderNumber matches the inbound order number, or the inbound order number is numeric and matches labBillId

That lookup decides whether the request becomes add-test, bill cancel, duplicate acknowledgement, or create order.

Response Timing

Create-order requests are forwarded to Fusion and return a jobId immediately. Add-test and bill-cancel requests are handled synchronously in the router. Update/accession behavior happens inside /create_order_in_crelio/ when the downstream function detects an existing order or report.

On this page