Records patient consent information including the type of consent obtained, its current status, and the dates of discussion, decision, and effective periods. It supports tracking of consent mode (verbal, written, telephonic), competence indicators, translator assistance, and bypass reasons. The segment appears in consent-related messages and is used by clinical and administrative systems to document regulatory compliance and patient authorization.
from zato.hl7v2 import CON
con = CON()
con.set_id_con = '1'
con.consent_status = 'A'
con.consent_mode = 'V'How to construct and work with real-world CON segments.
Simple consent with set ID, type, status, and effective date for a surgical procedure
from zato.hl7v2.v2_9 import CON
from zato.hl7v2.v2_9 import CNE, CWE
con = CON()
con.set_id_con = '1'
con.consent_type = CWE(
identifier='S',
text='Surgical',
name_of_coding_system='HL70496'
)
con.consent_mode = CNE(
identifier='V',
text='Verbal',
name_of_coding_system='HL70497'
)
con.consent_status = CNE(
identifier='A',
text='Active',
name_of_coding_system='HL70498'
)
con.consent_decision_date_time = '20240601'Written consent for treatment with discussion, decision, effective, and end dates
from zato.hl7v2.v2_9 import CON
from zato.hl7v2.v2_9 import CNE, CWE, EI
con = CON()
con.set_id_con = '2'
con.consent_type = CWE(
identifier='T',
text='Treatment',
name_of_coding_system='HL70496'
)
con.consent_form_id_and_version = (
'FORM-v3.1'
)
con.consent_form_number = EI(
entity_identifier='CF-20240501',
universal_id_type='HOSP'
)
con.consent_mode = CNE(
identifier='W',
text='Written',
name_of_coding_system='HL70497'
)
con.consent_status = CNE(
identifier='A',
text='Active',
name_of_coding_system='HL70498'
)
con.consent_discussion_date_time = (
'20240501120000'
)
con.consent_decision_date_time = (
'20240501130000'
)
con.consent_effective_date_time = (
'20240501'
)
con.consent_end_date_time = '20250501'Emergency bypass consent with disclosure level, non-disclosure reason, and translator flag
from zato.hl7v2.v2_9 import CON
from zato.hl7v2.v2_9 import CNE, CWE
con = CON()
con.set_id_con = '3'
con.consent_type = CWE(
identifier='E',
text='Emergency',
name_of_coding_system='HL70496'
)
con.consent_mode = CNE(
identifier='T',
text='Telephonic',
name_of_coding_system='HL70497'
)
con.consent_status = CNE(
identifier='B',
text='Bypassed',
name_of_coding_system='HL70498'
)
con.subject_competence_indicator = (
'N'
)
con.translator_assistance_indicator = (
'Y'
)
con.language_translated_to = CWE(
identifier='SPA',
text='Spanish',
name_of_coding_system='HL70296'
)
con.consent_bypass_reason = CWE(
identifier='EM',
text='Emergency',
name_of_coding_system='HL70499'
)
con.consent_disclosure_level = 'F'Step-by-step guides for working with HL7 v2 in Zato.
CON documents patient consent records including the type of consent, its mode (verbal, written, telephonic), current status, and the associated dates. It is used in clinical and administrative workflows to track regulatory compliance and patient authorization for procedures and treatment.
Set the required set ID and consent status, then add optional fields as needed:
from zato.hl7v2.v2_9 import CON, CNE
con = CON()
con.set_id_con = '1'
con.consent_status = CNE(
identifier='A',
text='Active',
name_of_coding_system='HL70498'
)The consent_mode field uses the CNE datatype with HL7 table 0497. Common values are V (Verbal), W (Written), and T (Telephonic):
from zato.hl7v2.v2_9 import CON, CNE
con = CON()
con.set_id_con = '1'
con.consent_mode = CNE(
identifier='W',
text='Written',
name_of_coding_system='HL70497'
)CON supports four date fields: discussion, decision, effective, and end dates, each using the DTM datatype:
from zato.hl7v2.v2_9 import CON
con = CON()
con.set_id_con = '1'
con.consent_discussion_date_time = (
'20240501120000'
)
con.consent_decision_date_time = (
'20240501130000'
)
con.consent_effective_date_time = (
'20240501'
)
con.consent_end_date_time = '20250501'Set translator_assistance_indicator to Y and specify the language using the language_translated_to field:
from zato.hl7v2.v2_9 import CON, CWE
con = CON()
con.set_id_con = '1'
con.translator_assistance_indicator = (
'Y'
)
con.language_translated_to = CWE(
identifier='SPA',
text='Spanish',
name_of_coding_system='HL70296'
)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.
Complete list of fields in the CON segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_con | SI | Required | No | - |
| 2 | consent_type | CWE | Optional | No | HL70496 |
| 3 | consent_form_id_and_version | ST | Optional | No | - |
| 4 | consent_form_number | EI | Optional | No | - |
| 5 | consent_text | FT | Optional | Yes | - |
| 6 | subject_specific_consent_text | FT | Optional | Yes | - |
| 7 | consent_background_information | FT | Optional | Yes | - |
| 8 | subject_specific_consent_background_text | FT | Optional | Yes | - |
| 9 | consenter_imposed_limitations | FT | Optional | Yes | - |
| 10 | consent_mode | CNE | Optional | No | HL70497 |
| 11 | consent_status | CNE | Required | No | HL70498 |
| 12 | consent_discussion_date_time | DTM | Optional | No | - |
| 13 | consent_decision_date_time | DTM | Optional | No | - |
| 14 | consent_effective_date_time | DTM | Optional | No | - |
| 15 | consent_end_date_time | DTM | Optional | No | - |
| 16 | subject_competence_indicator | ID | Optional | No | HL70136 |
| 17 | translator_assistance_indicator | ID | Optional | No | HL70136 |
| 18 | language_translated_to | CWE | Optional | No | HL70296 |
| 19 | informational_material_supplied_indicator | ID | Optional | No | HL70136 |
| 20 | consent_bypass_reason | CWE | Optional | No | HL70499 |
| 21 | consent_disclosure_level | ID | Optional | No | HL70500 |
| 22 | consent_non_disclosure_reason | CWE | Optional | No | HL70501 |
| 23 | non_subject_consenter_reason | CWE | Optional | No | HL70502 |
| 24 | consenter_id | XPN | Required | Yes | - |
| 25 | relationship_to_subject | CWE | Required | Yes | HL70548 |
Get started with Zato and connect your systems in minutes.