Returns the result of a previously issued equipment command, carrying a coded response status and the date/time the command completed. It is sent by laboratory instruments and automated devices back to the controlling system to confirm execution, report errors, or indicate that a command was rejected.
from zato.hl7v2 import ECR
ecr = ECR()
ecr.command_response = 'OK'
ecr.date_time_completed = '20260515'How to construct and work with real-world ECR segments.
Equipment confirms a command completed successfully with timestamp
from zato.hl7v2.v2_9 import ECR
from zato.hl7v2.v2_9 import CWE
ecr = ECR()
ecr.command_response = CWE(
identifier='OK',
text='Command completed',
name_of_coding_system=
'HL70387'
)
ecr.date_time_completed = '20240515103000'Equipment reports an error while executing a command
from zato.hl7v2.v2_9 import ECR
from zato.hl7v2.v2_9 import CWE
ecr = ECR()
ecr.command_response = CWE(
identifier='ER',
text=
'Command cannot be '
'completed',
name_of_coding_system=
'HL70387'
)
ecr.date_time_completed = '20240515110000'Equipment reports that a command timed out before finishing
from zato.hl7v2.v2_9 import ECR
from zato.hl7v2.v2_9 import CWE
ecr = ECR()
ecr.command_response = CWE(
identifier='TI',
text='Command timed out',
name_of_coding_system=
'HL70387'
)
ecr.date_time_completed = '20240515120000'Step-by-step guides for working with HL7 v2 in Zato.
ECR carries the response from a laboratory instrument or automated device after executing a remote command. It reports whether the command succeeded, failed, or timed out, along with the completion timestamp.
The command_response field uses CWE with HL7 table 0387:
from zato.hl7v2.v2_9 import ECR, CWE
ecr = ECR()
ecr.command_response = CWE(
identifier='OK',
text='Command completed',
name_of_coding_system=
'HL70387'
)HL7 table 0387 defines command response codes:
from zato.hl7v2.v2_9 import ECR, CWE
ecr = ECR()
# OK = Completed
ecr.command_response = CWE(identifier='OK')
# ER = Error
ecr.command_response = CWE(identifier='ER')
# TI = Timed out
ecr.command_response = CWE(identifier='TI')The date_time_completed field uses DTM format:
from zato.hl7v2.v2_9 import ECR
ecr = ECR()
ecr.command_response = 'OK'
ecr.date_time_completed = '20240515103000'Access the fields directly after creating the segment:
from zato.hl7v2.v2_9 import ECR
ecr = ECR()
ecr.command_response = 'OK'
ecr.date_time_completed = '20240515103000'
response = ecr.command_response
completed = ecr.date_time_completedZato connects to any system that speaks HL7v2 over MLLP or FHIR over REST. This includes Epic, Cerner, Meditech, Allscripts, and other EHR platforms.
Yes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically.
Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. Standard segments and datatypes are available as typed Python classes.
Yes. Zato handles both HL7v2 and FHIR natively, so you can parse v2 messages and build FHIR resources with IG-specific extensions in the same service. Typed Python classes are available for both protocols, including extensions from US Core, UK Core, Da Vinci, and other Implementation Guides.
Complete list of fields in the ECR segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | command_response | CWE | Required | No | HL70387 |
| 2 | date_time_completed | DTM | Required | No | - |
| 3 | command_response_parameters | TX | Optional | Yes | - |
Get started with Zato and connect your systems in minutes.