Reference·PID Segment·PID-5
HL7 v2 Reference

What Is HL7 v2 PID-5? Patient Name, Explained for Testers

Jul 27, 2026 · 4 min read
← PID-3 PID-6 →

Patient name matching is one of the most common causes of duplicate medical records, and PID-5 is the field where those mismatches start — a missing middle initial or a suffix in the wrong component can be enough for a matching algorithm to miss a duplicate.

Quick answer

PID-5 is the fifth field of the HL7 v2 PID segment — it carries the patient’s legal name broken into components such as family name, given name, and middle name, separated by carets.

What this field contains

Component 1
Family Name
Component 2
Given Name
Component 3
Middle Name or Initial
Component 4
Suffix (e.g. Jr, III)
Component 5
Prefix (e.g. Dr, Rev)

Example

Synthetic example Generated by Synthibase
PID|1||847213609^^^HOSP^MR||GARCIA^ELENA^MARIE^^^^L||19870314|F|||482 OAK ST^^DENVER^CO^80202||3035550142|

PID-5 breaks the patient name into GARCIA (family), ELENA (given), and MARIE (middle), with an "L" legal-name-type code trailing after the empty suffix and prefix components. Synthetic patient — not a real person.

Where this trips people up

Teams often test name matching only against clean, fully-populated names. In production, feeds arrive with the middle name crammed into the given-name component, missing components entirely, or hyphenated surnames split across two components — any of which can cause an exact-match algorithm to treat the same patient as a new one.

HL7 v2 PID Segment Guide: Fields, Format, and Testing Gotchas
How to Build a Synthetic Patient Registry for Healthcare Testing
Synthetic Patient Data: Complete Guide for Software Testing
Generate realistic name variation automatically
Synthibase generates synthetic patient names with the messy real-world variation — hyphens, missing components, suffixes — that name-matching logic needs to be tested against.
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.