HL7 v2 QPD-1 (Message Query Name): Format, Values, and Testing Notes
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.
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
Example
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.