Schedule a demo
Segment

Specimen

Provides detailed specimen information including specimen type, collection method, source site, collection date and time, specimen condition, and specimen identifier. Introduced in v2.5 to replace the deprecated OBR-15 specimen source field, SPM is the standard way to communicate specimen details in lab order (OML) and result (ORU) messages between EHRs, LIS, and reference labs. It supports multi-specimen and aliquoting scenarios in laboratory automation workflows.

35fields
1required
v2.9HL7 version
spm.py
from zato.hl7v2.v2_9 import SPM
from zato.hl7v2.v2_9 import CWE

spm = SPM()
spm.set_id_spm = '1'
spm.specimen_type = CWE(identifier='SER')

Build SPM segments in Python

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

1

Wellness serum specimen

Preventive screening draw with collection window and receipt time

from zato.hl7v2.v2_9 import SPM
from zato.hl7v2.v2_9 import CX, CWE, DR, EIP

spm = SPM()
spm.set_id_spm = '1'
spm.specimen_identifier = EIP(
    eip_1='ACC24-100',
    eip_2='WELL',
)
spm.specimen_type = CWE(
    identifier='SER',
    text='Serum',
    name_of_coding_system='LN',
)
spm.specimen_collection_date_time = DR(
    dr_1='20240415100000',
    dr_2='20240415103000',
)
spm.specimen_received_date_time = '20240415104500'
spm.accession_id = [
    CX(
        id_number='WELL-2024-001',
        assigning_authority='LAB',
        identifier_type_code='ACCN',
    ),
]
2

Fitness lab whole blood

Exercise physiology panel with volume and container type

from zato.hl7v2.v2_9 import SPM
from zato.hl7v2.v2_9 import CQ, CWE

spm = SPM()
spm.set_id_spm = '1'
spm.specimen_type = CWE(
    identifier='BLD',
    text='Whole blood',
    name_of_coding_system='LN',
)
spm.specimen_collection_method = CWE(
    identifier='VEN',
    text='Venipuncture',
)
spm.specimen_collection_amount = CQ(
    quantity='5',
    units=CWE(
        identifier='mL',
        name_of_coding_system='UCUM',
    ),
)
spm.container_type = CWE(
    identifier='TUBE',
    text='SST',
)
3

Nutrition screening urine

Hydration and micronutrient wellness kit with availability flag

from zato.hl7v2.v2_9 import SPM
from zato.hl7v2.v2_9 import CWE

spm = SPM()
spm.set_id_spm = '1'
spm.specimen_type = CWE(
    identifier='URN',
    text='Urine',
    name_of_coding_system='LN',
)
spm.specimen_availability = 'Y'

Learn by building

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

Frequently asked questions

SPM usually sits before OBR and OBX rows that describe preventive panels. It identifies the specimen type and collection context so downstream systems can interpret nutrition, fitness, or general wellness markers consistently.

After parsing, access attributes by name on the SPM segment:

from zato.hl7v2.v2_9 import SPM, CWE

spm = SPM()
spm.specimen_type = CWE(
    identifier='SER',
    text='Serum',
)
spm.specimen_received_date_time = '20260401100000'

Field 4 is a CWE with optional coding system and text:

from zato.hl7v2.v2_9 import SPM, CWE

spm = SPM()
spm.specimen_type = CWE(
    identifier='SER',
    text='Serum',
    name_of_coding_system='LN',
)

Field 17 uses the DR datatype: the first component is the interval start and the second is the end. This is helpful when a draw window is recorded for fasting or timed wellness protocols.

from zato.hl7v2.v2_9 import SPM, DR

spm = SPM()
spm.specimen_collection_date_time = DR(
    dr_1='20240415100000',
    dr_2='20240415103000',
)

Use SPM for what was collected from the participant and SAC for physical container measurements, additives, and storage-oriented attributes. Together they describe both the biological material and the tube or vessel that carried it.

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.

SPM field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_spmSIOptionalNo-
2specimen_identifierEIPOptionalNo-
3specimen_parent_i_dsEIPOptionalYes-
4specimen_typeCWERequiredNoHL70487
5specimen_type_modifierCWEOptionalYesHL70541
6specimen_additivesCWEOptionalYesHL70371
7specimen_collection_methodCWEOptionalNoHL70488
8specimen_source_siteCWEOptionalNoHL70784
9specimen_source_site_modifierCWEOptionalYesHL70542
10specimen_collection_siteCWEOptionalNoHL70543
11specimen_roleCWEOptionalYesHL70369
12specimen_collection_amountCQOptionalNo-
13grouped_specimen_countNMOptionalNo-
14specimen_descriptionSTOptionalYes-
15specimen_handling_codeCWEOptionalYesHL70376
16specimen_risk_codeCWEOptionalYesHL70489
17specimen_collection_date_timeDROptionalNo-
18specimen_received_date_timeDTMOptionalNo-
19specimen_expiration_date_timeDTMOptionalNo-
20specimen_availabilityIDOptionalNoHL70136
21specimen_reject_reasonCWEOptionalYesHL70490
22specimen_qualityCWEOptionalNoHL70491
23specimen_appropriatenessCWEOptionalNoHL70492
24specimen_conditionCWEOptionalYesHL70493
25specimen_current_quantityCQOptionalNo-
26number_of_specimen_containersNMOptionalNo-
27container_typeCWEOptionalNoHL70785
28container_conditionCWEOptionalNoHL70544
29specimen_child_roleCWEOptionalNoHL70494
30accession_idCXOptionalYes-
31other_specimen_idCXOptionalYes-
32shipment_idEIOptionalNo-
33culture_start_date_timeDTMOptionalNo-
34culture_final_date_timeDTMOptionalNo-
35action_codeIDOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python