Developer documentation‎ > ‎HL7 API‎ > ‎Roadmap‎ > ‎

QRY A19 - Registration Status

QRY^A19: Query for patient registration status

Status

In development. API spec subject to change.

Overview


This message can be used to retrieve a list of patients including registration status 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.

Definition

Segment Field Component Description Example Data Model
MSH Message header. This conforms to PKB's standard definition.  
QRD

Query definition
 

[ QRD-1 ]
Timestamp. We do not process this field. However, we will echo the value back to you in our response.
 
  [ QRD-4 ]   Query ID. We do not process this field. However, we will echo the value back to you in our response.    
  [ QRD-8 ]   Who subject filter    


QRD-8.1 ID number (e.g. NHS number, or an MRN) 5637453543 If National ID:
[[Patient->National ID.Value]]

If Organisation Level ID:
[[Patient->Organisation Level ID.Value]]

If Team Level ID:
[[Patient->Team Level ID.Value]]
    QRD-8.2 Patient family name. We do not process this field. However, we will echo the value back to you in our response.    
    QRD-8.3 Patient given name. We do not process this field. However, we will echo the value back to you in our response.    


QRD-8.13 ID number type code. Use "MR" for a local number search. Otherwise, a National ID search is performed, regardless of what this value is. The National ID Type used for the search will be the one associated with the country of the connecting organisation or team.

If this value is supplied then QRD.11.1 and the QRF segment are ignored.
NH  

[ QRD-9 ]
"STA" to request results for all patients including registration status custom segment.
 


QRD-9.1 What subject filter STA  
   [QRD-11]    Registration status filter.    
     QRD-11.1   

The registration status to filter results by when QRD.9.1 = STA.


Options:

NOT_INVITED_NOT_REGISTERED,

INVITED_NOT_REGISTERED,

REGISTERED


Mandatory if start timestamp (QRF.2.1) or end timestamp (QRF.3.1) is supplied.


If start timestamp (QRF.2.1) is specified then the query behaviour is to find patients where current registration status = specified value and where that status was set on or after the timestamp specified in QRF.2.1.


If end timestamp (QRF.3.1) is additionally specified then the query behaviour is to find patients where current registration status = specified value and where that status was set within the time period specified in the QRF segment.


If there is no date restriction specified within the QRF segment then this is an open status query and results will be returned where current registration status = the value specified.

 REGISTERED  
[ QRF ]

Query filter
 

[ QRF-2 ]
Start timestamp. This will restrict the returned results to those patients with a registration status set on or after this date
 


QRF-2.1 Start timestamp (inclusive).  Mandatory if QRF-3.1 specified. 201807012352  

[ QRF-3 ]
End timestamp. This will restrict the returned results to those patients with a registration status set on or before this timestamp.
 


QRF-3.1 End timestamp (exclusive) 201807022351  

Examples

PKB supports a few variations on the registration status (STA) query:

1. 
An open registration status query (return all patients for this institute including registration status)
MSH|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId|||||STA

2. 
A specific registration status query (return all patients with a registration state set to QRD.11 for this institute) 
MSH|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId|||||STA|REGISTERED

3. 
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 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

4. 
A timestamp range (start and end provided) and registration status specific query (return all patient records with a current registration state of QRD.11 which was set within the period specified -- 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||201901010000|201901100000

5. 
A single patient query - NHS or local id. QRF and QRD.11.1 ignored if supplied.
MSH|^~\&|App|SendingInst|HL7API|PKB|20190110140316||QRY^A19|ABC0000000001|P|2.4
QRD||||_queryId||||4444444444^^^^^^^^^^^^NH|STA

Response

PKB will respond with an ADR^A19 message including a custom ZID segment.

ADR^A19: Query response to a Registration Status 'STA' query

Overview

This message returns the patient information requested by a QRY^A19 message when QRD-9.1 is 'STA'.

Definition

Segment Field Component Description Example Data Model
MSH

Message header. This conforms to PKB's standard definition.
 
MSA

Message acknowledgement
 

MSA-1
Acknowledgement code
 


MSA-1.1 Acknowledgement code. AA = accepted, AR = rejected, AE = error AA  

MSA-2
Message control ID. This is the MSH-10 value that was sent to PKB.
 


MSA-2.1 Message control ID ABC0000000001  
QRD

Query definition. A copy of the submitted QRD segment is returned.
 
[ QRF ]

Query filter. If a QRF segment was supplied, it will be returned.
 
{ [ PID ] }

Patient identification. One PID segment is returned for each matching patient.
 

{ [ PID-2 ] }
National IDs. The National ID Type used for the search will be the one associated with the country of the connecting organisation or team.
 


PID-2.1 National ID 5637453543 [[Patient->National ID.Value]]


PID-2.4 National ID assigning authority (e.g. "NHS" for the UK) NHS [[Patient->National ID->National ID Type.HL7 Assigning Authority]]


PID-2.5 National ID type code NH [[Patient->National ID->National ID Type.HL7 Type Code]]

{ [ PID-3 ] }
PID-3 contains a copy of the contents of PID-2
 

{ [ PID-4 ] }
PID-4 contains local identifiers
 


PID-4.1 Patient ID XYZ00001 If Organisation Level ID:
[[Patient->Organisation Level ID.Value]]

If Team Level ID:
[[Patient->Team Level ID.Value]]


PID-4.4 Patient ID assigning authority (e.g "NHS" for the UK) ABCHospital If Organisation Level ID:
[[Patient->Organisation Level ID->Organisation Level ID Type.HL7 Assigning Authority]]

If Team Level ID:
[[Patient->Team Level ID->Team Level ID Type.HL7 Assigning Authority]]


PID-4.5 Patient ID type code MR If Organisation Level ID:
[[Patient->Organisation Level ID->Organisation Level ID Type.HL7 Type Code]]

If Team Level ID:
[[Patient->Team Level ID->Team Level ID Type.HL7 Type Code]]

PID-5
Name
 


[ PID-5.1 ] Family name Smith [[Patient.Family Name]]


[ PID-5.2 ] Given name John [[Patient.Given Name]]

[ PID-7 ]
Date of birth
 


PID-7.1 Date of birth 19800101 [[Patient.Date of Birth]]

PID-11
Address
 


[ PID-11.5 ] Postal code SW1A 1AA
[[Patient.Postal Code]]
 { [ ZID ] }     Custom segment to return registration specific information. One ZID segment per corresponding PID segment.    
   ZID-1        
     ZID-1.1  Public ID (UUID) for the corresponding PID segment. 12345678 [[User->Public ID.Value]]
   ZID-2

 
      ZID-2.1  Registration status   REGISTERED  [[Patient->Status.Value]]
   ZID-3        
     ZID-3.1      Registration status last updated. Timestamp reflecting when ZID-2.1 was set. 201807012352  Derived from multiple sources.

Examples

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||4444444444^^^NHS^NH||1234567^^^ABCHospital^MR|SMITH^MARJORIE||19700101||||^^^^CB1 1BC|
ZID|12345|REGISTERED|201806012352
PID||5555555555^^^NHS^NH||2345678^^^ABCHospital^MR|DOE^JAMES||195001202||||^^^^CB1 8BL|
ZID|67891|NOT_INVITED_NOT_REGISTERED|201806012352
PID||6666666666^^^NHS^NH||2345678^^^ABCHospital^MR|BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|11111|REGISTERED|201807012352
PID||777777777^^^NHS^NH||2345678^^^ABCHospital^MR|JONES^BOB||195001202||||^^^^CB1 8BL|
ZID|22222|INVITED_NOT_REGISTERED|201810012352

2. 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||4444444444^^^NHS^NH||1234567^^^ABCHospital^MR|SMITH^MARJORIE||19700101||||^^^^CB1 1BC|
ZID|12345|REGISTERED|201806012352
PID||6666666666^^^NHS^NH||2345678^^^ABCHospital^MR|BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|11111|REGISTERED|201807012352

3. Response to query for patients with a current registration status set to REGISTERED and that status was set 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||6666666666^^^NHS^NH||2345678^^^ABCHospital^MR|BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|11111|REGISTERED|201807012352

4. Response to query for patients with a current registration status of REGISTERED and that status was set between start date and end date

MSH|^~\&|HL7API|PKB|App|ReceivingInst|201901101100||ADR^A19|E|P|2.4
MSA|AA|ABC0000000001
QRD|||||||||STA||REGISTERED
QRF||201806290000|201807290000
PID||6666666666^^^NHS^NH||2345678^^^ABCHospital^MR|BLOGGS^DAVID||195001202||||^^^^CB1 8BL|
ZID|11111|REGISTERED|201807012352

5. Response to query for the registration status of a single patient by NHS number.

MSH|^~\&|HL7API|PKB|App|ReceivingInst|201901101100||ADR^A19|E|P|2.4
MSA|AA|ABC0000000001
QRD||||_queryId||||4444444444^^^^^^^^^^^^NH|STA
PID||4444444444^^^NHS^NH||1234567^^^ABCHospital^MR|SMITH^MARJORIE||19700101||||^^^^CB1 1BC|
ZID|12345|REGISTERED|201806012352

6. Response to query for patients who have a current status of INVITED_NOT_REGISTERED since a specific date.

MSH|^~\&|HL7API|PKB|App|ReceivingInst|201901101100||ADR^A19|E|P|2.4
MSA|AA|ABC0000000001
QRD||||_query1|||||STA|INVITED_NOT_REGISTERED|
QRF||201809290000
PID||777777777^^^NHS^NH||2345678^^^ABCHospital^MR|JONES^BOB||195001202||||^^^^CB1 8BL|
ZID|22222|INVITED_NOT_REGISTERED|201810012352
Comments