ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

QRY^A19 — Patient Query

The HL7 v2 ancestor of FHIR's GET /Patient/123: a synchronous request to retrieve a patient's full demographics — still in service across the vast majority of HIS deployments.

Purpose

QRY^A19 asks the HIS: "Give me everything you know about patient MRN567890". The response is an ADR^A19 (Acknowledgment Response, A19 structure) that carries one or more PID + PV1. This is the classic HL7 v2 channel for:

  • verifying patient identity before submitting results;
  • retrieving full demographics to pre-fill an EHR form;
  • reconciling identifiers between systems during merge or migration.

Note: since v2.5, HL7 recommends QBP^Q22/RSP^K22 (Find Candidates) for this logic, which is more rigorous. QRY^A19 remains widely used for backward compatibility.

Segment structure

QRY_A19
  MSH                    Message Header (mandatory)
  QRD                    Query Definition (mandatory) — carries parameters
  [ QRF ]                Query Filter — time bounds, source

MSH — Message Header

  • MSH-9: QRY^A19^QRY_A19.
  • MSH-11: P in production.

QRD — Query Definition

Central segment:

  • QRD-1: query date/time.
  • QRD-2: requested response format (table 0106: R=Record-oriented, D=Display, T=Tabular).
  • QRD-3: priority (I=Immediate, D=Deferred).
  • QRD-4: query identifier (key for correlation).
  • QRD-7: expected number/type of units.
  • QRD-8: target patient identifiers (CX, repeatable: MRN, SSN, national ID).
  • QRD-9: information nature (table 0048: DEM=Demographics, OTH=Other).

QRF — Query Filter

Optional but common to scope:

  • QRF-1: where to look (system, application).
  • QRF-3: start date.
  • QRF-4: end date.

ADR^A19 / RSP^K11 response

The HIS responds with an ADR^A19 message:

  • MSH (with MSH-9 = ADR^A19^ADR_A19);
  • MSA (query acknowledgment — AA if found, AE on error, AR on refusal);
  • QRD + QRF repeated (request parameters, for correlation);
  • EVN (A19 event typing);
  • 0..n blocks (PID + PD1 + NK1 + PV1 + PV2 + DB1 + OBX + AL1 + DG1 + …) — one per matching patient.

If several patients match the criteria, the HIS may return multiple PID (typical on homonyms).

Real-world example

Demographic query for MRN567890 between January and May 2026:

plaintext qry-a19-example.hl7
MSH|^~\&|EHR|CLINIC02|HIS|HOSP01|20260515094500||QRY^A19^QRY_A19|MSG00005001|P|2.5.1|||AL|NE
QRD|20260515094500|R|I|Q001|||1^RD&Records&HL70394|MRN567890^^^HOSP^MR|DEM^Demographics^HL70048
QRF|HIS||20260101|20260515

HIS ADR^A19 response:

plaintext adr-a19-example.hl7
MSH|^~\&|HIS|HOSP01|EHR|CLINIC02|20260515094501||ADR^A19^ADR_A19|MSG00005002|P|2.5.1|||AL|NE
MSA|AA|MSG00005001
QRD|20260515094500|R|I|Q001|||1^RD&Records&HL70394|MRN567890^^^HOSP^MR|DEM^Demographics^HL70048
QRF|HIS||20260101|20260515
EVN|A19|20260515094501
PID|1||MRN567890^^^HOSP^MR||DOE^JOHN^A^^MR.||19720515|M|||100 MAIN ST^^ANYTOWN^CA^90210^USA||(555)555-1234|||S||ACCT123456
PV1|1|I|ICU^101^A^HOSP01|EM|||DRSMITH^Smith^James^A^^DR.|||CAR|||1|||DRSMITH^Smith^James^A^^DR.|ADM|VIP

Common errors

  • QRD-8 without identifier type: MRN567890 alone is ambiguous. Always type as CX: MRN567890^^^HOSP^MR.
  • QRD-4 reused: each query must have a unique identifier to correlate the response with the query.
  • No client-side timeout: a synchronous QRY that gets no response in 30s blocks indefinitely.
  • Unplanned FHIR migration: QRY^A19 is very much in service; plan coexistence with FHIR REST before disabling.
  • Multiple responses unhandled: on homonyms, the client must display a list, not crash on the first PID.

FHIR equivalent

In FHIR R5, the QRY^A19 equivalent is:

GET [base]/Patient?identifier=urn:oid:1.2.34|MRN567890&_include=Patient:general-practitioner

with a Bundle type=searchset response. Benefits: native pagination, standardized filters, JSON parsers everywhere. See FHIR Patient.