This message can be used to retrieve a list of patients who have medical records in PKB and who are associated with your Organisation or Team.
Note: Self-registered patients that have not been activated will not be returned from an A19 query.
PKB supports a few variations on this query:
1. An "open" query (return all active patients for this institute) -- just leave the search value in the QRD empty to get all active patients with national or hospital IDs:
MSH|^~\&|App|SendingInst|HL7API|PKB|20130219140316||QRY^A19|ABC0000000001|P|2.4||||||||
QRD|20130219140316|R|I|_3B30U4GM1|||||DEM||||
Alternatively, for debugging purposes you may want to see the full list of patients (including those that are still missing national and hospital IDs) -- to get this list, use “APN” instead of “DEM” in the QRD-9.1 field (note: queries filtering on patient name are not currently supported).
2. A timestamp-limited query (return all active patients with a national or hospital ID set or modified in a timestamp range -- use the QRF filter to specify timestamp range)
MSH|^~\&|App|SendingInst|HL7API|PKB|20130219140316||QRY^A19|ABC0000000001|P|2.4||||||||
QRD|20130219140316|R|I|_3B30U4GM1|||||DEM||||
QRF||201302191100|||||||||
3. A single patient query, with NHS number in the QRD
MSH|^~\&|App|SendingInst|HL7API|PKB|20130219140316||QRY^A19|ABC0000000001|P|2.4||||||||
QRD|20130219140316|R|I|_3B30U4GM1||||4444444444^^^^^^^^^^^^NH|DEM||||
4. A single patient query, with hospital ID number in the QRD
MSH|^~\&|App|SendingInst|HL7API|PKB|20130219140316||QRY^A19|ABC0000000001|P|2.4||||||||
QRD|20130219140316|R|I|_3B30U4GM1||||ABC12345^^^^^^^^^^^^MR|DEM||||
Note on ID-based queries: the type of ID search depends on the connecting institution and the QRD-8.13 field. If the QRD-8.13 value is “MR” the hospital ID for the connecting institution is searched. If the QRD-8.13 is any other value, the national ID for the country of the connecting institution is searched.
PKB will respond with an ADR A19 message. This message returns the patient information requested by a QRY A19 message where QRD-9.1 = "DEM" or "APN".
PKB responds to the QRY A19 with a list of matching patients. Minimal info for each patient is listed -- enough to match records (NHS num, name, DoB).
MSH|^~\&|HL7API|PKB|App|ReceivingInst|201302201100||ADR^A19|ABC0000000002|P|2.4|
MSA|AA|ABC0000000001
QRD|201204201100|R|I|_3B30U4GM1|||||DEM||||
PID||4444444444^^^NHS^NH||1234567^^^ABCHospital^MR|SMITH^MARJORIE||19700101||||^^^^CB1 1BC
PID||5555555555^^^NHS^NH||2345678^^^ABCHospital^MR|DOE^JAMES||195001202||||^^^^CB1 8BL
This query can be used to retrieve a list of patients including registration status who are associated with your Organisation. A patient will be returned if there is a consent record (whether active or inactive) for any Team in your Organisation.
A patient record will be repeated in the query response when a patient is in more than one Team within your Organisation. I.e. if a patient is in two teams then the response will include two pairs of PID/ZID segments for the one patient record. If the caller wishes to filter out the repeating results then they should inspect ZID-1.1 which is a unique UUID for a patient record (independent of Team association) and remove duplicates before processing the records locally.
Note: Self-registered patients that have not been activated will not be returned from an A19 query.
PKB supports a few variations on the registration status (STA) query:
1. An open registration status query (return all patients including registration status) for your organisation
MSH|^~\&|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId|||||STA
2. An open registration status query (return all patients including registration status) for your organisation. Limit results to 1000 records per query.
MSH|^~\&|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId|||1000^RD||STA
3. A specific registration status query (return all patients with a registration state set to QRD-11) for your organisation.
MSH|^~\&|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId|||||STA|REGISTERED
4. A timestamp start and registration status specific query (return all patient records with a registration state set to and remaining at value specified in QRD-11 and where the record was updated since defined timestamp -- use the QRF filter to specify timestamp range).
MSH|^~\&|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId|||||STA||REGISTERED
QRF||201811090000
5. A registration status query submitted following a previous truncated response. QRF-2.1 and QRF-5.1 are included as the last known values to search from.
MSH|^~\&|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId|||||STA
QRF||20181001235212.345+0000|||962cb105-8e95-41f1-9ebe-7761b8c5fd93
PKB will respond with an ADR A19 message. This message returns the patient registration status information requested by a QRY A19 message where QRD-9.1 = "STA". The response includes a custom ZID segment and potentially a DSC continuation pointer segment. The returned patients will be sorted first by timestamp of change, and second by patient ID.
PKB responds to the QRY A19 with a list of matching patients and their registration status. Minimal info for each patient is listed -- enough to match records (NHS num, name, DoB).
1. Response to query for all patient registration statuses
MSH|^~\&|HL7API|PKB|App|ReceivingInst|201901101100||ADR^A19|E|P|2.4
MSA|AA|ABC0000000001
QRD||||query1|||||STA
PID|||9444444444^^^NHS^NH||SMITH^MARJORIE||19700101||||^^^^CB1 1BC|
ZID|1fd2a0f6-890b-4f68-9fa1-65342f649771|REGISTERED|20180601235212.345+0000
PID|||9555555555^^^NHS^NH||DOE^JAMES||195001202||||^^^^CB1 8BL|
ZID|6e4ba6f5-8c6e-43b9-8de0-601ec833ee83|NOT_REGISTERED|20180601235212.345+0000
PID|||9666666666^^^NHS^NH||BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|9d90e773-dfe4-4c95-9690-d9b07c62f004|REGISTERED|20180701235212.345+0000
PID|||977777777^^^NHS^NH||JONES^BOB||195001202||||^^^^CB1 8BL|
ZID|962cb105-8e95-41f1-9ebe-7761b8c5fd93|NOT_REGISTERED|20181001235212.345+0000
2. Response to query for all patient registration statuses - result limit exceeded
MSH|^~\&|HL7API|PKB|App|ReceivingInst|201901101100||ADR^A19|E|P|2.4
MSA|AA|ABC0000000001
QRD||||query1|||1000^RD||STA
PID|||1000112C^^^MRN^HOSP~9444444444^^^NHS^NH||SMITH^MARJORIE||19700101||||^^^^CB1 1BC|
ZID|1fd2a0f6-890b-4f68-9fa1-65342f649771|REGISTERED|20180601235212.345+0000
PID|||9555555555^^^NHS^NH||DOE^JAMES||195001202||||^^^^CB1 8BL|
ZID|6e4ba6f5-8c6e-43b9-8de0-601ec833ee83|NOT_REGISTERED|20180601235212.345+0000
PID|||9666666666^^^NHS^NH||BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|9d90e773-dfe4-4c95-9690-d9b07c62f004|REGISTERED|20180701235212.345+0000
PID|||977777777^^^NHS^NH||JONES^BOB||195001202||||^^^^CB1 8BL|
ZID|962cb105-8e95-41f1-9ebe-7761b8c5fd93|NOT_REGISTERED|20181001235212.345+0000
DSC|c4e61363-45c4-4a3d-a96e-777fe0f1e3e7
3. Response to query for all patients with a current registration status of REGISTERED
MSH|^~\&|HL7API|PKB|App|ReceivingInst|201901101100||ADR^A19|E|P|2.4
MSA|AA|ABC0000000001
QRD||||query1|||||STA||REGISTERED
PID|||1000112C^^^MRN^HOSP~9444444444^^^NHS^NH||SMITH^MARJORIE||19700101||||^^^^CB1 1BC|
ZID|1fd2a0f6-890b-4f68-9fa1-65342f649771|REGISTERED|20180601235212.345+0000
PID|||9666666666^^^NHS^NH||BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|9d90e773-dfe4-4c95-9690-d9b07c62f004|REGISTERED|20180701235212.345+0000
4. Response to query for patients with a current registration status set to REGISTERED and where the record was updated on or after a defined start date
MSH|^~\&|HL7API|PKB|App|ReceivingInst|201901101100||ADR^A19|E|P|2.4
MSA|AA|ABC0000000001
QRD|||||||||STA||REGISTERED
QRF||201806290000
PID|||9666666666^^^NHS^NH||BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|9d90e773-dfe4-4c95-9690-d9b07c62f004|REGISTERED|20180701235212.345+0000