Schedule a demo
Segment

Consent

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.

25fields
4required
v2.9HL7 version
con.py
from zato.hl7v2 import CON

con = CON()
con.set_id_con = '1'
con.consent_status = 'A'
con.consent_mode = 'V'

Build CON segments in Python

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

1

Basic consent record

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'
2

Written consent with dates

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'
3

Consent with bypass

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'

Learn by building

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

Frequently asked questions

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.

CON field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_conSIRequiredNo-
2consent_typeCWEOptionalNoHL70496
3consent_form_id_and_versionSTOptionalNo-
4consent_form_numberEIOptionalNo-
5consent_textFTOptionalYes-
6subject_specific_consent_textFTOptionalYes-
7consent_background_informationFTOptionalYes-
8subject_specific_consent_background_textFTOptionalYes-
9consenter_imposed_limitationsFTOptionalYes-
10consent_modeCNEOptionalNoHL70497
11consent_statusCNERequiredNoHL70498
12consent_discussion_date_timeDTMOptionalNo-
13consent_decision_date_timeDTMOptionalNo-
14consent_effective_date_timeDTMOptionalNo-
15consent_end_date_timeDTMOptionalNo-
16subject_competence_indicatorIDOptionalNoHL70136
17translator_assistance_indicatorIDOptionalNoHL70136
18language_translated_toCWEOptionalNoHL70296
19informational_material_supplied_indicatorIDOptionalNoHL70136
20consent_bypass_reasonCWEOptionalNoHL70499
21consent_disclosure_levelIDOptionalNoHL70500
22consent_non_disclosure_reasonCWEOptionalNoHL70501
23non_subject_consenter_reasonCWEOptionalNoHL70502
24consenter_idXPNRequiredYes-
25relationship_to_subjectCWERequiredYesHL70548

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python