IntegrationsHL7 (Old Flow)Inbound

Update Order

Inbound HL7/SFTP documentation for order update, accession update, and sample-status update behavior.

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

Update Order

The inbound create-order endpoint also supports update-like behavior. This does not call the normal UI bill-update API. Instead, /create_order_in_crelio/ detects existing bills or reports and updates accession/sample state before attempting new bill creation.

When This Flow Runs

This flow runs inside create_order_in_crelio when the parsed payload points to an existing active bill or report.

Supported identifiers:

Parsed fieldTypical HL7 sourceLookup behavior
orderNumberOBR/ORC-derived order numberFinds active bill by order number.
lab_report_idOBR-3Finds the active lab report relation.
manual_sample_idZCT-12Finds active report by manual sample ID.
bill_idVendor-specific, mainly CernerFinds report/bill for Cerner accession update.

Implementation Path

StepFunctionDescription
Existing order detectioncreate_order_in_crelioChecks order number, report ID, and manual sample ID before patient/bill creation.
Accession parsingsample_accession_hl7_payloadRe-parses the original HL7 payload for accession fields.
Accession updatecommon_function_to_update_sample_idUpdates report and collected sample accession data.
Test/sample dismissaldismissTestAPIUsed when inbound sample status indicates cancellation.

Accession Parser Fields

sample_accession_hl7_payload reads a smaller payload from the same raw HL7 message.

Parsed fieldHL7 sourceDescription
lab_report_idOBR-3Report identifier.
manual_sample_idZCT-12New manual sample/accession number.
test_codeOBR-4Test code used as a fallback report lookup.
orc_statusORC-1Order control/status.
sample_statusORC-5Sample state such as in-lab, completed, collected, or cancel-like values.
lrr_listAll OBR-3 valuesMulti-report update list, used especially for Cerner.
sample_location_mappingCerner ZCT/location fieldsSample rack/location mapping.

Update Behavior

When a matching report/sample is found, the update flow can:

  • Update the report manual sample ID.
  • Update the collected sample accession number.
  • Mark accession as done on the collected sample.
  • Update report/sample timestamps.
  • Update sample collected or received flags when sample_status is in-lab, completed, or collected.
  • Update Elasticsearch report/sample fields.
  • Write an activity log for the accession update.

Sample-Level Cancellation

If sample_status contains cancel, the flow dismisses the matching report/test instead of updating accession fields.

The dismissal comment is:

Test dismissed through Integration by user <lab_user>

This is test/sample-level cancellation. Full bill cancellation is documented in Bill Cancel.

Cerner-Specific Behavior

When integration = cerner, the update flow supports additional behavior:

  • It can update an existing bill's orderNumber.
  • It can update sample received state for all tests listed in OBR segment.
  • It can match tests by lab report ID, test code, or test name.
  • It can update rack/location information from Cerner-specific ZCT data.

Responses

ResponseMeaning
Manual sampleId updatedExisting bill/report was found and accession update succeeded.
Manual sampleId failed to updateExisting bill/report was found but update failed.
Accession Number was updated successfullyCerner accession update succeeded.
Sample Received successfully!Cerner sample received update succeeded.
Accession number should not be blankNon-Cerner update did not include a manual sample/accession ID.
No records foundNo bill/report identifier could be resolved for update.
Can not find the Lab Report...Report lookup failed for the bill/test combination.

On this page