Schedule a demo
Segment

Access restriction

Conveys access restriction directives for patient or visit data. It specifies the action to be taken (such as restrict or unrestrict), the type of restriction, date range of applicability, security classification tags, and instance identifiers. This segment appears in ADT and other messages to enforce privacy and confidentiality rules in compliance with organizational policies and regulatory requirements.

10fields
3required
v2.9HL7 version
arv.py
from zato.hl7v2 import ARV

arv = ARV()
arv.set_id = '1'
arv.access_restriction_action_code = 'RS'
arv.access_restriction_value = 'DEM'

Build ARV segments in Python

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

1

Demographic restriction

Restricts access to demographic data with a security classification tag and date range

from zato.hl7v2.v2_9 import ARV
from zato.hl7v2.v2_9 import CNE, CWE, DR

arv = ARV()
arv.set_id = '1'
arv.access_restriction_action_code = CNE(
    identifier='RS',
    text='Restrict',
    name_of_coding_system='HL70206'
)
arv.access_restriction_value = CWE(
    identifier='DEM',
    text='Demographics',
    name_of_coding_system='HL70717'
)
arv.access_restriction_date_range = DR(
    range_start_date_time='20240101',
    range_end_date_time='20241231'
)
arv.security_classification_tag = CWE(
    identifier='V',
    text='Very restricted',
    name_of_coding_system='HL70952'
)
2

Clinical data restriction

Restricts clinical record access with an instance identifier for tracking

from zato.hl7v2.v2_9 import ARV
from zato.hl7v2.v2_9 import CNE, CWE, EI

arv = ARV()
arv.set_id = '2'
arv.access_restriction_action_code = CNE(
    identifier='RS',
    text='Restrict',
    name_of_coding_system='HL70206'
)
arv.access_restriction_value = CWE(
    identifier='ALL',
    text='All',
    name_of_coding_system='HL70717'
)
arv.security_classification_tag = CWE(
    identifier='R',
    text='Restricted',
    name_of_coding_system='HL70952'
)
arv.access_restriction_instance_identifier = EI(
    entity_identifier='ARV-2024-001',
    namespace_id='MAIN'
)
3

Unrestrict action

Removes a previously applied restriction on demographic data

from zato.hl7v2.v2_9 import ARV
from zato.hl7v2.v2_9 import CNE, CWE, EI

arv = ARV()
arv.set_id = '3'
arv.access_restriction_action_code = CNE(
    identifier='UN',
    text='Unrestrict',
    name_of_coding_system='HL70206'
)
arv.access_restriction_value = CWE(
    identifier='DEM',
    text='Demographics',
    name_of_coding_system='HL70717'
)
arv.security_classification_tag = CWE(
    identifier='U',
    text='Unrestricted',
    name_of_coding_system='HL70952'
)
arv.access_restriction_instance_identifier = EI(
    entity_identifier='ARV-2024-002',
    namespace_id='MAIN'
)

Learn by building

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

Frequently asked questions

ARV conveys access restriction directives on patient data. It specifies what action to take (restrict or unrestrict), which data categories are affected, the applicable date range, security classification tags, and a tracking identifier. It appears in ADT and other messages to enforce privacy policies.

Set the action code to restrict and the value to the data category:

from zato.hl7v2.v2_9 import ARV, CNE, CWE

arv = ARV()
arv.access_restriction_action_code = CNE(
    identifier='RS',
    text='Restrict',
    name_of_coding_system='HL70206'
)
arv.access_restriction_value = CWE(
    identifier='DEM',
    text='Demographics',
    name_of_coding_system='HL70717'
)

The access_restriction_date_range field uses the DR datatype:

from zato.hl7v2.v2_9 import ARV, DR

arv = ARV()
arv.access_restriction_date_range = DR(
    range_start_date_time='20240101',
    range_end_date_time='20241231'
)

The security_classification_tag field uses CWE with HL7 table 0952:

from zato.hl7v2.v2_9 import ARV, CWE

arv = ARV()
arv.security_classification_tag = CWE(
    identifier='V',
    text='Very restricted',
    name_of_coding_system='HL70952'
)

Use the access_restriction_instance_identifier field with the EI datatype:

from zato.hl7v2.v2_9 import ARV, EI

arv = ARV()
arv.access_restriction_instance_identifier = EI(
    entity_identifier='ARV-2024-001',
    namespace_id='MAIN'
)

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.

ARV field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_idSIOptionalNo-
2access_restriction_action_codeCNERequiredNoHL70206
3access_restriction_valueCWERequiredNoHL70717
4access_restriction_reasonCWEOptionalYesHL70719
5special_access_restriction_instructionsSTOptionalYes-
6access_restriction_date_rangeDROptionalNo-
7security_classification_tagCWERequiredNoHL70952
8security_handling_instructionsCWEOptionalYesHL70953
9access_restriction_message_locationERLOptionalYes-
10access_restriction_instance_identifierEIOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python