Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Segment

Field

Opt

RP/#

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

O

Who subject filter. This will be ignored if APN is provided in QRD-9.

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.

NH

QRD-9

O

Type of query to perform. Use "DEM" for demographics, or "APN" to request all active patients (including those without an ID). The default is "DEM".

QRD-9.1

What subject filter

DEM

[ QRF ]

Query filter. This will be ignored if APN is provided in QRD-9.

QRF-2

O

Start timestamp. This will restrict the returned results to those patients activated or modified since the timestamp.

QRF-2.1

Start timestamp (inclusive)

201507012352

QRF-3

O

End timestamp. This will restrict the returned results to those patients activated or modified before the timestamp.

QRF-3.1

End timestamp (exclusive)

201507022351

...

Segment

Field

Opt

RP/#

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

O

Who subject filter. This will be ignored if APN is provided in QRD-9.

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.

NH

QRD-9

O

Type of query to perform. Use "DEM" for demographics, or "APN" to request all active patients (including those without an ID). The default is "DEM".

QRD-9.1

What subject filter

DEM

[ QRF ]

Query filter. This will be ignored if APN is provided in QRD-9.

QRF-2

O

Start timestamp. This will restrict the returned results to those patients activated or modified since the timestamp.

QRF-2.1

Start timestamp (inclusive)

201507012352

QRF-3

O

End timestamp. This will restrict the returned results to those patients activated or modified before the timestamp.

QRF-3.1

End timestamp (exclusive)

201507022351

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

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

R

Name

PID-5.1

Family name

Smith

[[Patient.Family Name]]

PID-5.2

Given name

John

[[Patient.Given Name]]

PID-7

O

Date of birth

PID-7.1

Date of birth

19800101

[[Patient.Date of Birth]]

PID-11

O

Address

PID-11.5

Postal code

SW1A 1AA

[[Patient.Postal Code]]

...

Segment

Field

Opt

RP/#

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

O

Quantity Limited Request

QRD-7.1

The result size to return before a DSC segment is introduced.

10000

QRD-7.2

Must be 'RD'

RD

QRD-9

O

"STA" to request results for all patients including registration status custom segment.

QRD-9.1

What subject filter

STA

QRD-11

O

Registration status filter.

QRD-11.1

An optional registration status to filter results by when QRD-9.1 = STA.

Options:

REGISTERED
NOT_REGISTERED

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

O

Start timestamp. This will restrict the returned results to those patients whose record has been updated on or after this point in time.

QRF-2.1

Start timestamp (inclusive)

201507012352

QRF-5

O

Last seen patient identifier. This should be used in conjunction with QRF-2.1 when a previous search response has been truncated and a DSC segment provided.

Providing the last seen patient identifier from the previous response allows the registration status query to be reinvoked from that last known point (QRF-2.1 + QRF-5.1).

The last known patient identifier will not be returned in the response i.e. the search criteria is non inclusive.

QRF-5.1

Public ID (UUID) for the corresponding patient

1fd2a0f6-890b-4f68-9fa1-65342f649771

...

Segment

Field

Opt

RP/#

Component

Description

Example

Data Model

MSH

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

MSA

Message acknowledgement

MSA-1

R

Acknowledgement code

MSA-1.1

Acknowledgement code. AA = accepted, AR = rejected, AE = error

AA

MSA-2

R

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

O

Y

The patient identifiers. A repeating list of national id and any additional local id's connected to the calling organisation

PID-3.1

Patient ID

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]]

PID-3.4

Patient ID assigning authority (e.g 'NHS')

NHS

If National ID:
[[Patient.National ID.National ID Type.HL7 Assigning Authority]]

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-3.5

Patient ID type code. (e.g 'NH' for national id.)

NH

If National ID:
[[Patient.National ID.National ID Type.HL7 Type Code]]

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

R

Name

PID-5.1

Family name

Smith

[[Patient.Family Name]]

PID-5.2

Given name

John

[[Patient.Given Name]]

PID-7

O

Date of birth

PID-7.1

Date of birth

19800101

[[Patient.Date of Birth]]

PID-11

O

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

R

ZID-1.1

Public ID (UUID) for the corresponding PID segment.

1fd2a0f6-890b-4f68-9fa1-65342f649771

[[User.Public ID]]

ZID-2

R

ZID-2.1

Registration status

REGISTERED

[[Patient.Registered]]

ZID-3

R

ZID-3.1

Last modified timestamp

20190101101112.123+0000

[ DSC ]

Continuation pointer segment. This will be returned if the number of results has exceeded the value specified by the caller in QRD-7.1 or has exceeded the server side max results setting.

The calling organisation will need to recognise this segment and programmatically re-query with an amended start timestamp (QRF-2.1) based on the last seen timestamp (ZID-3) and the inclusion of a last seen patient (QRF-5.1) based on the last seen patient UUID (ZID-1.1).

DSC-1

R

DSC-1.1

A UUID. Not to be used on subsequent calls.

...