Reference·QPD Segment·QPD-1
HL7 v2 Reference

HL7 v2 QPD-1 (Message Query Name): Format, Values, and Testing Notes

Jul 28, 2026 · 4 min read
QPD-2 →

QPD-1 is a single coded value, but it decides how every field after it in the segment gets interpreted — get the code wrong and the rest of the query is being parsed against the wrong rulebook.

Quick answer

QPD-1 is the Message Query Name field. It identifies, by a coded value plus a locally or externally defined table, exactly which predefined query the sending system wants run — for example, a patient demographic lookup versus some other kind of search. Because each defined query specifies its own list of expected parameters, QPD-1 effectively sets the schema for the rest of the QPD segment.

What this field contains

Component 1
Query code — a short identifier for the specific query being invoked, drawn from a table shared by the requester and responder
Component 2
Query name (text) — a human-readable label for the same query, useful when eyeballing logs or test fixtures
Component 3
Coding system — identifies which table the query code in component 1 was pulled from, since both parties need to agree on the same reference table for the code to mean anything

Example

Synthetic example Generated by Synthibase
QPD|Q22^Find Candidates^HL70471|SYNTHIBQ00019|9284471^^^SYNTHIBMRN^MR

QPD-1 (Q22^Find Candidates^HL70471) names the query being run in this synthetic segment; the tag and search value that follow are fabricated.

Where this trips people up

Test generators frequently hardcode one query code and never touch it again, which means the receiving system's query-dispatch logic — the code that reads QPD-1 and decides how to parse QPD-3 onward — only ever gets exercised for a single query type. When a second query type reaches production, mapping code that quietly assumed the first query's parameter layout can misread fields it was never actually tested against, producing wrong search results instead of an obvious failure.

HL7 v2 QPD Segment Guide: Fields, Format, and Testing Gotchas
HL7 ADT Messages: A01 through A08 Explained
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Test more than one query type
Synthibase can generate QBP/QPD messages spanning multiple defined query codes, so your query-dispatch logic gets validated against real variety instead of a single hardcoded path.
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.