Reference·PV1 Segment·PV1-2
HL7 v2 Reference

HL7 v2 PV1-2 Field Guide: Patient Class Codes and Common Mistakes

Jul 27, 2026 · 4 min read
← PV1-1 PV1-3 →

PV1-2 is one of the first fields most routing rules check, which means any code value a rule engine has never seen — a recurring outpatient, a preadmit, an observation stay — tends to fall through to a default branch nobody actually reviewed.

Quick answer

PV1-2 is the second field of the PV1 segment — a required, site-defined code that classifies the type of patient visit, such as inpatient, outpatient, or emergency.

Valid code values

I
Inpatient
O
Outpatient
E
Emergency
P
Preadmit
R
Recurring patient
B
Obstetrics
N
Not applicable
U
Unknown

Example

Synthetic example Generated by Synthibase
PV1|1|I|3W^301^B^HOSP|U|||445566^PATEL^RAJ^S^^MD|667788^JONES^MARY^E^^MD|889900^LEE^DAVID^R^^MD|CAR||||7|||998877^CHEN^LISA^K^^MD|I|8827364501|MCR||||||||||||||||01||||||||202607261430

The 2nd field (I) marks this as an inpatient visit. Synthetic patient — not a real person.

Where this trips people up

This field is technically site-defined, so the exact list of valid codes varies by facility — some hospitals actively use R for recurring patients or B for obstetrics, others never send them. Interfaces built and tested against only I and O will mis-route or reject those less common values the first time a source system that uses them goes live, usually during an acquisition or new-facility onboarding.

Testing HL7 v2 PV1: The Fields Your System Actually Needs to Handle
HL7 ADT Messages: A01 through A08 Explained
Regression Testing for EHR Upgrades: A Complete Guide
Generate every Patient Class code automatically
Synthibase generates synthetic PV1 segments covering every patient class value — including the ones most test suites never exercise.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.