HL7 RSP_Z82 Dispense History Response

HL7 message structure RSP_Z82 groups and segments from HL7 v2.5.1 Hide structure

These are the generated groups and segments for the version selected at the top of the page. The article explains the workflow, and this panel follows the chosen HL7 version.

Message Structure

SegmentNameRequiredRepeatable
Message Header Yes No
Software Segment No Yes
Message Acknowledgment Yes No
Error No No
Query Acknowledgment Yes No
Query Parameter Definition Yes No
Response Control Parameter Yes No
RSP_Z82.QUERY_RESPONSE
Query Response group Yes Yes
RSP_Z82.PATIENT
Patient group No No
Patient Identification Yes No
Patient Additional Demographic No No
Notes and Comments No Yes
RSP_Z82.VISIT
Visit group No No
Patient Allergy Information Yes Yes
Patient Visit Yes No
Patient Visit - Additional Information No No
RSP_Z82.COMMON_ORDER
Common Order group Yes Yes
Common Order Yes No
RSP_Z82.TIMING
Timing group No Yes
Timing/Quantity Yes No
Timing/Quantity Relationship No Yes
RSP_Z82.ORDER_DETAIL
Order Detail group No No
Pharmacy/Treatment Order Yes No
Notes and Comments No Yes
Pharmacy/Treatment Route Yes Yes
RSP_Z82.TREATMENT
Treatment group No No
Pharmacy/Treatment Component Order Yes Yes
Notes and Comments No Yes
RSP_Z82.ENCODED_ORDER
Encoded Order group No No
Pharmacy/Treatment Encoded Order Yes No
RSP_Z82.TIMING_ENCODED
Timing Encoded group No Yes
Timing/Quantity Yes No
Timing/Quantity Relationship No Yes
Pharmacy/Treatment Route Yes Yes
Pharmacy/Treatment Component Order No Yes
Pharmacy/Treatment Dispense Yes No
Pharmacy/Treatment Route Yes Yes
Pharmacy/Treatment Component Order No Yes
RSP_Z82.OBSERVATION
Observation group Yes Yes
Observation/Result No No
Notes and Comments No Yes
Continuation Pointer No No

RSP_Z82 returns patient pharmacy dispense history. A requesting system asks for prior dispenses, usually with a QBP query profile, and the pharmacy or medication-history server sends back matching patient, order, dispense, route, and observation details.

This is a query response, not a new dispense event. If the receiver wants to file the result safely, it has to read MSA, QAK, QPD, and the returned pharmacy groups together.

A small RSP Z82 example

MSH|^~\&|PHARM|CITYHOSP|MEDREC|CITYHOSP|20260718103000||RSP^Z82^RSP_Z82|RSPZ820001|P|2.5.1 MSA|AA|QBPZ810001 QAK|QDISP001|OK|Z81^Dispense History^HL7nnn|1|1|0 QPD|Z81^Dispense History^HL7nnn|QDISP001|123456^^^CITYHOSP^MR|20260701000000|20260717235959 RCP|I|10^RD PID|1||123456^^^CITYHOSP^MR||Smith^Jane^Anne^^Ms^^L||19800314|F ORC|RE|MED448811^EHR|RX998877^PHARM RXD|1|AMOX500^Amoxicillin 500 mg capsule^L|20260715124000|30|CAP^capsule^UCUM|RX998877^PHARM|30|CAP^capsule^UCUM|20260715124000|PHARM1^Main pharmacy^L RXR|PO^Oral^HL70162 OBX|1|CE|DISPSTATUS^Dispense status^L||COMP^Completed^L||||||F

What systems do with it

The sender is usually a pharmacy system, medication-history server, or integration service that can search dispense records. The receiver may populate medication reconciliation, answer a pharmacy-history screen, support charge review, or enrich a clinical repository.

The returned rows are pharmacy-shaped rather than table-shaped. PID identifies the patient when present, ORC ties the result to an order, RXD carries the dispense, RXR gives the route, and OBX can carry status or supporting observations.

How to read the structure

The required query-response group can repeat. Each group may include patient context and then one or more common-order groups. The common-order group is broad because a dispense-history answer may need the original order, encoded order, actual dispense, route, components, and observations.

RCP is part of the response structure here, so the response can echo or constrain the quantity and modality of the returned history. Optional DSC handles continuation when the result set is larger than one response.

Implementation traps

Do not treat historical dispense as current medication truth. A dispense can be returned, wasted, replaced, or never administered. It is evidence, not a complete medication list by itself.

Also preserve identifiers. The placer order, filler order, prescription number, and dispense sub-ID are the breadcrumbs that let pharmacy, billing, and clinical systems agree which dispense is being discussed.

Reference notes

HL7 identifies event Z82 as Dispense History (Response), and the refactored message page shows RSP_Z82 with query status, patient context, common-order pharmacy groups, observations, and optional continuation. See HL7 Europe event Z82 and RSP_Z82.