Schedule a demo
Segment

Equipment command

Sends a remote-control instruction to a laboratory instrument or automated device, carrying a sequential command number, the coded command to execute, and whether a response is required. It is used in equipment-management and automation messages to start, stop, calibrate, or clear instruments from a central laboratory information system.

4fields
2required
v2.9HL7 version
ecd.py
from zato.hl7v2 import ECD

ecd = ECD()
ecd.reference_command_number = '1'
ecd.remote_control_command = 'CL'

Build ECD segments in Python

How to construct and work with real-world ECD segments.

1

Clear instrument

Sending a clear command to an analyzer requiring acknowledgment

from zato.hl7v2.v2_9 import ECD
from zato.hl7v2.v2_9 import CWE

ecd = ECD()
ecd.reference_command_number = '1'
ecd.remote_control_command = CWE(
    identifier='CL',
    text='Clear',
    name_of_coding_system=
        'HL70368'
)
ecd.response_required = 'Y'
2

Initialize device

Issuing an initialize command to prepare equipment for a run

from zato.hl7v2.v2_9 import ECD
from zato.hl7v2.v2_9 import CWE

ecd = ECD()
ecd.reference_command_number = '2'
ecd.remote_control_command = CWE(
    identifier='IN',
    text='Initialize',
    name_of_coding_system=
        'HL70368'
)
ecd.response_required = 'Y'
3

Emergency stop

Sending an emergency stop without requiring a response

from zato.hl7v2.v2_9 import ECD
from zato.hl7v2.v2_9 import CWE

ecd = ECD()
ecd.reference_command_number = '3'
ecd.remote_control_command = CWE(
    identifier='ES',
    text='Emergency stop',
    name_of_coding_system=
        'HL70368'
)
ecd.response_required = 'N'

Learn by building

Step-by-step guides for working with HL7 v2 in Zato.

Frequently asked questions

ECD sends remote-control commands to laboratory instruments and automated devices. Each command has a sequence number, a coded instruction (clear, initialize, stop, etc.), and an optional flag indicating whether the device must respond.

The remote_control_command uses CWE with HL7 table 0368:

from zato.hl7v2.v2_9 import ECD, CWE

ecd = ECD()
ecd.reference_command_number = '1'
ecd.remote_control_command = CWE(
    identifier='CL',
    text='Clear',
    name_of_coding_system=
        'HL70368'
)

HL7 table 0368 defines equipment commands. Common values include:

from zato.hl7v2.v2_9 import ECD, CWE

ecd = ECD()
ecd.reference_command_number = '1'

# CL = Clear
ecd.remote_control_command = CWE(identifier='CL')

# IN = Initialize
ecd.remote_control_command = CWE(identifier='IN')

# ES = Emergency stop
ecd.remote_control_command = CWE(identifier='ES')

Set response_required to Y or N using HL7 table 0136:

from zato.hl7v2.v2_9 import ECD

ecd = ECD()
ecd.reference_command_number = '1'
ecd.remote_control_command = 'CL'
ecd.response_required = 'Y'

Access the fields directly after creating the segment:

from zato.hl7v2.v2_9 import ECD

ecd = ECD()
ecd.reference_command_number = '1'
ecd.remote_control_command = 'CL'

cmd_num = ecd.reference_command_number
command = ecd.remote_control_command

Zato 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.

ECD field reference

Complete list of fields in the ECD segment, HL7 v2.9.

#Python nameDatatypeUsageRepeatableTable
1reference_command_numberNMRequiredNo-
2remote_control_commandCWERequiredNoHL70368
3response_requiredIDOptionalNoHL70136
5parametersTXOptionalYes-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python