Reference·PID Segment·PID-18
HL7 v2 Reference

HL7 v2 PID-18 (Patient Account Number): Format, Values, and Testing Notes

Jul 27, 2026 · 4 min read
← PID-16 PID-19 →

It is common for a billing system and a clinical system to disagree on which field is "the" patient identifier — PID-18 is the account number, PID-3 is usually the MRN, and integrations that conflate the two end up reconciling charges against the wrong key.

Quick answer

PID-18 is the eighteenth field of the HL7 v2 PID segment — it carries the patient account number, typically the visit- or encounter-linked identifier used by billing systems, distinct from the medical record number in PID-3.

What this field contains

Component 1
ID Number (the account number value)
Component 4
Assigning Authority
Component 5
Identifier Type Code (typically AN)

Example

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

55219847 in PID-18 is the billing account number, separate from the 847213609 medical record number carried in PID-3. Synthetic patient — not a real person.

Where this trips people up

Because PID-3 and PID-18 often look similar and are both numeric identifiers, some integrations built by teams unfamiliar with the distinction wire billing reconciliation logic to the wrong field. Charges then fail to match against the correct account the moment a patient has more than one encounter, since MRN is patient-level while account number is often encounter-level.

HL7 v2 PID Segment Guide: Fields, Format, and Testing Gotchas
How to Evaluate a Healthcare EDI Clearinghouse Vendor: RFP Checklist
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Test MRN vs. account number handling explicitly
Synthibase generates synthetic patients with distinct, realistic MRN and account number values, so billing reconciliation logic gets tested against the identifiers it will actually see.
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.