Schedule a demo
Segment

Next of kin / associated parties

Identifies the patient's next of kin, emergency contacts, and other associated parties such as guardians or power of attorney, including their names, relationship, addresses, and phone numbers. It repeats to carry multiple contacts and is included in ADT messages, referrals, and BAR transactions. Registration and EHR systems send NK1 data for use by emergency departments, social services, and billing systems.

38fields
1required
v2.9HL7 version
nk1.py
from zato.hl7v2 import NK1

nk1 = NK1()
nk1.set_id_nk1 = '1'
nk1.name = 'SMITH^JANE'
nk1.relationship = 'SPO'
nk1.phone_number = '5551234567'

Build NK1 segments in Python

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

1

Emergency contact — spouse with address

Records a spouse as the primary emergency contact with their name, relationship, and home address for coordination purposes

from zato.hl7v2.v2_9 import NK1
from zato.hl7v2.v2_9 import CWE, XAD, XPN

nk1 = NK1()
nk1.set_id_nk1 = '1'
nk1.name = XPN(
    family_name='SMITH',
    given_name='JANE'
)
nk1.relationship = CWE(
    identifier='SPO',
    text='Spouse',
    name_of_coding_system='HL70063'
)
nk1.address = XAD(
    street_address='742 Evergreen Terrace',
    city='Springfield',
    state_or_province='IL',
    zip_or_postal_code='62704'
)
2

Parent as next of kin with contact role and organization

Records a parent contact with an emergency contact role and an associated organization for benefits coordination

from zato.hl7v2.v2_9 import NK1
from zato.hl7v2.v2_9 import CWE, XAD, XON, XPN

nk1 = NK1()
nk1.set_id_nk1 = '2'
nk1.name = XPN(
    family_name='JOHNSON',
    given_name='ROBERT'
)
nk1.relationship = CWE(
    identifier='PAR',
    text='Parent',
    name_of_coding_system='HL70063'
)
nk1.address = XAD(
    street_address='100 Oak Avenue',
    city='Portland',
    state_or_province='OR',
    zip_or_postal_code='97201'
)
nk1.contact_role = CWE(
    identifier='EC',
    text='Emergency Contact',
    name_of_coding_system='HL70131'
)
nk1.organization_name_nk1 = XON(organization_name='Greenvalley Wellness')
3

Sibling contact with job title and start date

Records a sibling as next of kin with a contact role, job title, and the date the contact relationship became effective

from zato.hl7v2.v2_9 import NK1
from zato.hl7v2.v2_9 import CWE, XPN

nk1 = NK1()
nk1.set_id_nk1 = '3'
nk1.name = XPN(
    family_name='WILLIAMS',
    given_name='SARAH'
)
nk1.relationship = CWE(
    identifier='SIB',
    text='Sibling',
    name_of_coding_system='HL70063'
)
nk1.contact_role = CWE(
    identifier='NK',
    text='Next of Kin',
    name_of_coding_system='HL70131'
)
nk1.start_date = '20240301'
nk1.next_of_kin_associated_parties_job_title = 'Wellness Coordinator'

Learn by building

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

Frequently asked questions

NK1 carries information about a patient's next of kin, emergency contacts, guardians, and other associated parties. It includes their names, addresses, phone numbers, relationships, contact roles, and demographic details. It appears in ADT, registration, and scheduling messages.

Create an NK1 segment and read its fields directly:

from zato.hl7v2.v2_9 import NK1, XPN, CWE, XTN

nk1 = NK1()
nk1.name = XPN(family_name='SMITH',
    given_name='JANE')
nk1.relationship = CWE(identifier='SPO')
nk1.phone_number = XTN(
    telecommunication_use_code='PRN',
    local_number='5551234'
)

kin_name = nk1.name
relation = nk1.relationship
phone = nk1.phone_number

The relationship field uses the CWE datatype with HL7 table 0063 codes:

from zato.hl7v2.v2_9 import NK1, CWE

nk1 = NK1()
nk1.relationship = CWE(identifier='SPO')

# Common codes:
# SPO = Spouse
# PAR = Parent
# CHD = Child
# FRD = Friend
# GRD = Guardian

Create separate NK1 instances, each with its own set_id_nk1:

from zato.hl7v2.v2_9 import NK1, XPN, CWE

nk1_spouse = NK1()
nk1_spouse.set_id_nk1 = '1'
nk1_spouse.name = XPN(
    family_name='SMITH', given_name='JANE')
nk1_spouse.relationship = CWE(
    identifier='SPO')

nk1_friend = NK1()
nk1_friend.set_id_nk1 = '2'
nk1_friend.name = XPN(
    family_name='JONES', given_name='BOB')
nk1_friend.relationship = CWE(
    identifier='FRD')

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

from zato.hl7v2.v2_9 import NK1, XON

nk1 = NK1()
nk1.organization_name_nk1 = XON(
    organization_name='Greenvalley Wellness',
    id_number='ORG-100'
)

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.

NK1 field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_nk1SIRequiredNo-
2nameXPNOptionalYesHL70200
3relationshipCWEOptionalNoHL70063
4addressXADOptionalYes-
7contact_roleCWEOptionalNoHL70131
8start_dateDTOptionalNo-
9end_dateDTOptionalNo-
10next_of_kin_associated_parties_job_titleSTOptionalNo-
11next_of_kin_associated_parties_job_code_classJCCOptionalNo-
12next_of_kin_associated_parties_employee_numberCXOptionalNo-
13organization_name_nk1XONOptionalYes-
14marital_statusCWEOptionalNoHL70002
15administrative_sexCWEOptionalNoHL70001
16date_time_of_birthDTMOptionalNo-
17living_dependencyCWEOptionalYesHL70223
18ambulatory_statusCWEOptionalYesHL70009
19citizenshipCWEOptionalYesHL70171
20primary_languageCWEOptionalNoHL70296
21living_arrangementCWEOptionalNoHL70220
22publicity_codeCWEOptionalNoHL70215
23protection_indicatorIDOptionalNoHL70136
24student_indicatorCWEOptionalNoHL70231
25religionCWEOptionalNoHL70006
26mothers_maiden_nameXPNOptionalYes-
27nationalityCWEOptionalNoHL70212
28ethnic_groupCWEOptionalYesHL70189
29contact_reasonCWEOptionalYesHL70222
30contact_persons_nameXPNOptionalYes-
32contact_persons_addressXADOptionalYes-
33next_of_kin_associated_partys_identifiersCXOptionalYes-
34job_statusCWEOptionalNoHL70311
35raceCWEOptionalYesHL70005
36handicapCWEOptionalNoHL70295
37contact_person_social_security_numberSTOptionalNo-
38next_of_kin_birth_placeSTOptionalNo-
39vip_indicatorCWEOptionalNoHL70099
40next_of_kin_telecommunication_informationXTNOptionalNo-
41contact_persons_telecommunication_informationXTNOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python