Schedule a demo
Segment

Patient additional demographic

Carries supplemental demographic data not included in PID, such as the patient's primary care provider, immunization registry status, living will and advance directive indicators, and organ donor status. It is used in ADT messages sent by registration and EHR systems to downstream systems that need this extended demographic context.

22fields
0required
v2.9HL7 version
pd1.py
from zato.hl7v2 import PD1

pd1 = PD1()
pd1.living_arrangement = 'A'
pd1.student_indicator = 'F'
pd1.immunization_registry_status = 'A'

Build PD1 segments in Python

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

1

Student registration

Full-time student with immunization registry status and primary facility

from zato.hl7v2.v2_9 import PD1
from zato.hl7v2.v2_9 import CWE, XON

pd1 = PD1()
pd1.living_arrangement = CWE(identifier='A')
pd1.patient_primary_facility = XON(
    organization_name='GREENVALLEY WELLNESS',
    id_number='12345'
)
pd1.student_indicator = CWE(identifier='F')
pd1.immunization_registry_status = CWE(
    identifier='A'
)
2

Advance directive

Patient with an advance directive and a living will on file

from zato.hl7v2.v2_9 import PD1
from zato.hl7v2.v2_9 import CWE

pd1 = PD1()
pd1.living_arrangement = CWE(identifier='F')
pd1.advance_directive_code = CWE(
    identifier='DNR'
)
pd1.advance_directive_last_verified_date = '20240601'
3

Military service

Active duty service member with branch and rank details

from zato.hl7v2.v2_9 import PD1
from zato.hl7v2.v2_9 import CWE

pd1 = PD1()
pd1.living_arrangement = CWE(identifier='S')
pd1.military_branch = CWE(
    identifier='USA'
)
pd1.military_rank_grade = CWE(
    identifier='CPT'
)
pd1.military_status = CWE(
    identifier='ACT'
)

Learn by building

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

Frequently asked questions

PD1 carries additional patient demographics not found in PID - living arrangement, student status, immunization registry status, military service details, advance directive codes, and primary care facility. It appears in ADT and registration messages.

Create a PD1 segment and read its fields directly:

from zato.hl7v2.v2_9 import PD1, CWE

pd1 = PD1()
pd1.living_arrangement = CWE(identifier='A')
pd1.student_indicator = CWE(identifier='F')
pd1.immunization_registry_status = CWE(
    identifier='A'
)

arrangement = pd1.living_arrangement
student = pd1.student_indicator
registry = pd1.immunization_registry_status

Position 4 (Patient Primary Care Provider Name & ID No.) was withdrawn in HL7 v2.9. The field is retained as a gap to preserve the positional numbering of all subsequent fields. This is standard HL7v2 practice for deprecated fields.

The patient_primary_facility field uses the XON (extended composite organization name) datatype:

from zato.hl7v2.v2_9 import PD1, XON

pd1 = PD1()
pd1.patient_primary_facility = XON(
    organization_name='Greenvalley Wellness',
    id_number='12345'
)

Military branch, rank, and status each use the CWE datatype:

from zato.hl7v2.v2_9 import PD1, CWE

pd1 = PD1()
pd1.military_branch = CWE(identifier='USA')
pd1.military_rank_grade = CWE(
    identifier='CPT'
)
pd1.military_status = CWE(identifier='ACT')

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.

PD1 field reference

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

#Python nameDatatypeUsageRepeatableTable
1living_dependencyCWEOptionalYesHL70223
2living_arrangementCWEOptionalNoHL70220
3patient_primary_facilityXONOptionalYesHL70204
5student_indicatorCWEOptionalNoHL70231
6handicapCWEOptionalNoHL70295
7living_will_codeCWEOptionalNoHL70315
8organ_donor_codeCWEOptionalNoHL70316
9separate_billIDOptionalNoHL70136
10duplicate_patientCXOptionalYes-
11publicity_codeCWEOptionalNoHL70215
12protection_indicatorIDOptionalNoHL70136
13protection_indicator_effective_dateDTOptionalNo-
14place_of_worshipXONOptionalYes-
15advance_directive_codeCWEOptionalYesHL70435
16immunization_registry_statusCWEOptionalNoHL70441
17immunization_registry_status_effective_dateDTOptionalNo-
18publicity_code_effective_dateDTOptionalNo-
19military_branchCWEOptionalNoHL70140
20military_rank_gradeCWEOptionalNoHL70141
21military_statusCWEOptionalNoHL70142
22advance_directive_last_verified_dateDTOptionalNo-
23retirement_dateDTOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python