Demographics


HL7 Integration Assurance Test Script


Demographics

Overview

This document defines a series of tests that a new HL7 integration will need to perform before passing QA. This test script should be run with support from PKB, and will provide assurance that the new interface is behaving as expected.


This test script focusses on demographics. Specifically:


  • Creating a new medical record

  • Updating the demographics of an existing medical record

  • Patient identification (hard and soft matching) when adding data to a medical record

  • Performing the above in a multi-source environment


In addition to providing some useful test cases, this document is anticipated to be instructional since it highlights the expected outcome for a number of different scenarios.

Scope

This document is intended to be a mid-level test script. Whilst it adds detail to the high level test plan by providing specific test cases, it does not detail the exact messages to be sent by the integrating party. There may well be specific nuances relevant to the integrating party, and these will either need addressing separately, or else used to form the basis of a tailored version of this test script. Furthermore, this test script is not intended to provide comprehensive test coverage such as that required by PKB’s internal functional testing.


Also, note that this test script does not relate specifically to any particular environment. It is anticipated that these tests are performed on sandbox.patientsknowbest.com but details of the test environment do not fall within the scope of this document.

.

Test Script

Terminology


For the purpose of this test script, the following terms will be used as described.


HL7 Registration Message. Either an A28 or A31 message.

HL7 Data Message. An HL7 message supported by PKB which is neither an HL7 Registration Message nor a query message.

Valid NHS Number. An identifier which meets the NHS numbering criteria, and has been provided in the HL7 message with a status code equal to 01, and with an Assigning Authority and Identifier Type Code which match those defined by PKB.

Valid Organisation Level ID. An identifier which has been provided in the HL7 message with an Assigning Authority and Identifier Type Code which match one of the Organisation Level ID Types agreed with PKB before testing begins.

Invalid Organisation Level ID. An identifier which has been provided in the HL7 message with an Assigning Authority and Identifier Type Code which do not match one of the Organisation Level ID Types agreed with PKB before testing begins.

Test Script Preconditions


Before this test script is run, the following preconditions must be true:


  • The integrating party has been assigned HL7 credentials to the test environment.

  • PKB has configured the corresponding interface as follows:

    • Soft-match enabled for lastName, firstNameInitial, dateOfBirth

    • Checking of NHS number status enabled

    • All Organisation Level ID Types and Team Level ID Types have been configured, including the agreed Assigning Authority and Identifier Type Code values for any local identifiers

  • The integrating party is configured to be part of an Organisation Network which includes the PKB test organisation.

  • The web interface for the integrating party has been configured to display Organisation Level IDs and/or Team Level IDs as appropriate.

  • The PKB test organisation has created a medical record (referred to as PKB Test Patient A), has associated that medical record with an NHS number, and passed the NHS number to the integrating party.

Creating a medical record (explicit creation)


Single Source Testing


The following tests should be performed using an HL7 Registration Message (A28 or A31). PKB handles both messages identically, so the choice of message is left to the integrating party.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.1.01

No identifiers provided in the HL7 message.

Without any valid identifiers, the medical record cannot be created. The message will be rejected.

AR

No medical record created.

Dem.1.02

One valid Organisation Level ID provided.


AA

The medical record is created, and is returned when searching by Organisation Level ID.

Dem.1.03

Two valid Organisation Level IDs provided.


AA

The medical record is created, and is returned when searching by either Organisation Level ID.

Dem.1.04

One NHS number provided, no status value.

The single NHS number will be ignored if no status value was provided. As such, there will be no valid identifiers in this message, so it will be rejected.

AR

No medical record created.

Dem.1.05

One NHS number provided, status value present but not equal to “01”.

As above, the message will be rejected.

AR

No medical record created.

Dem.1.06

One valid NHS number provided.

With a status of 01 provided, the NHS number is now considered valid, so the message can be accepted.

AA

The medical record is created, and is returned when searching by NHS number.

Dem.1.07

Two valid NHS numbers provided.

It is not valid to supply 2 instances of any National ID Type.

AR

No medical record created.

Dem.1.08

One valid Organisation Level ID and one NHS number provided, but with status not equal to “01”.


AA

The medical record is created, but the NHS number has been ignored. The new medical record is only available when searching by the Organisation Level ID.

Dem.1.09

One valid NHS number and one valid Organisation Level ID are provided.


AA

The medical record is created, and is returned when searching by either the NHS number or the Organisation Level ID.

Dem.1.10

One valid NHS number, one valid Organisation Level ID, and one invalid Organisation Level ID are provided.

An invalid Organisation Level ID will be silently ignored.

AA

The medical record is created, and is returned when searching by either the valid NHS number or the valid Organisation Level ID. It is not returned when searching by the invalid Organisation Level ID, since this ID has not been added to the medical record.

Dem.1.11

One valid NHS number provided, but PID contains demographics (first name, last name, and date of birth) that match an existing medical record.

A new medical record will be created. Checks against existing demographics are not performed when creating a medical record with previously unknown identifiers.

AA

A new medical record is created. There will be two medical records with the same name and DOB information. This is by design, since the identifier values differ.


Multiple Source Testing


Multiple source testing is not meaningful when creating a new medical record. Any given patient only has one medical record, and as such it can only be created once. Multiple source issues only appear when updating an existing medical record.



.

Creating a medical record (automatic creation)


Single Source Testing


An HL7 Data Message for an unknown patient should trigger the automatic creation of a new medical record, providing auto-create has been enabled on the interface. If auto-create has not been enabled then such a message will be rejected.


PKB performs this logic for any HL7 Data Message, e.g. new appointment, new lab result, new encounter. As such, the choice of data message is left to the integrating party.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.2.01

Any valid combination of identifiers provided, but which do not relate to any existing patient.

Behaviour is dependent on whether auto-create is enabled.

AA / AR

If auto-create is enabled, the message will cause a new medical record to be created, and the relevant data points added to that medical record.


If auto-create is not enabled then the message will be rejected.


Multiple Source Testing


Multiple source testing is not meaningful when creating a new medical record. Any given patient only has one medical record, and as such it can only be created once. Multiple source issues only appear when updating an existing medical record..

Updating demographics (medical record not associated with NHS number)

Single Source Testing


The following tests should be performed using an HL7 Registration Message (A28 or A31). PKB handles both messages identically, so the choice of message is left to the integrating party.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.3.01

New demographics sent in a message containing the correct Organisation Level ID associated with the medical record.


AA

The demographics of the medical record are updated, as can be seen by having a Team Coordinator search for the relevant patient.

Dem.3.02

New demographics sent in a message containing an NHS number without a status code, and the correct Organisation Level ID.


Post-test actions

Remove NHS number from medical record.

Since the NHS number did not contain a status code, the message will be accepted but queued for manual review.

AA

The medical record demographics are not updated. The message is added to the queue for the Organisation Administrator, visible in their “HL7 Review” tab. If the Organisation Administrator approves the message, then the new demographics can be seen by having a Team Coordinator search for the relevant patient. In addition, the NHS number is added to the medical record.

Dem.3.03

New demographics sent in a message containing an NHS number with a status code not equal to “01”, and the correct Organisation Level ID.


Post-test actions

Remove NHS number from medical record.

As above, the message is accepted but queued for manual review.

AA

As above.

Dem.3.04

New demographics sent in a message containing a valid NHS number, and the correct Organisation Level ID.


Post-test actions

Remove NHS number from medical record.

Since the new NHS number is valid, the update is applied right away.

AA

The demographics of the medical record are updated. In addition, the NHS number is added to the medical record.


Multiple Source Testing


The NHS number is the common identifier used across British PKB environment. As such, it is not possible to have multiple senders add data via HL7 to a medical record that does not have an NHS number associated with it.


However, there is an error condition that should be tested. A sender cannot add an NHS number to a medical record if that NHS number is already associated with a different medical record. The situations where this can arise, and the implications, are covered in the Numbering Strategy. The test below covers this scenario.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.3.05

As for Dem.3.04, except where the NHS number is that of PKB Test Patient A.

A sender cannot add an NHS number to a second medical record.

AR

The NHS number has not been added, since the message was rejected.



.

Updating demographics (medical record associated with NHS number)


Single Source Testing


The following tests should be performed using an HL7 Registration Message (A28 or A31). PKB handles both messages identically, so the choice of message is left to the integrating party.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.4.01

New demographics sent in a message containing the correct NHS number but without a status code.

Since the NHS number did not contain a status code, the message will be accepted but queued for manual review.

AA

The medical record demographics are not immediately updated. The message is added to the queue for the Organisation Administrator, visible in their “HL7 Review” tab. If the Organisation Administrator approves the message, then the new demographics can be seen by having a Team Coordinator search for the relevant patient.

Dem.4.02

New demographics sent in a message containing the correct NHS number but with a status code not equal to “01”.

As above, the message is accepted but queued for manual review.

AA

As above.

Dem.4.03

New demographics sent in a message containing just an Organisation Level ID associated with the medical record.

The message should have contained the NHS number (since at some point in the past it must have been known to be associated with the Organisation Level ID). The message will be accepted, but queued for manual review.

AA

As above.

Dem.4.04

New demographics sent in a message containing the valid and correct NHS number.

With a present and correct status code, the demographic update will be accepted immediately.

AA

The demographics of the medical record are updated, as can be seen by having a Team Coordinator search for the relevant patient.

Dem.4.05

Message containing the valid and correct NHS number sent along with a previously unknown Organisation Level ID for that patient.

Additional IDs can be added to a medical record using A28 or A31 messages.

AA

The new Organisation Level ID has been added to the relevant medical record.


Multiple Source Testing


Tests 4.06 through 4.10 are repetitions of the tests above, except that PKB Test Patient A is being targeted. 4.11 tests the behaviour when a queued message is leapfrogged by another message.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.4.06

As Dem.4.01, but targeting PKB Test Patient A.




Dem.4.07

As Dem.4.02, but targeting PKB Test Patient A.




Dem.4.08

As Dem.4.03, but targeting PKB Test Patient A.




Dem.4.09

As Dem.4.04, but targeting PKB Test Patient A.




Dem.4.10

As Dem.4.05, but targeting PKB Test Patient A.




Dem.4.11

Demographic update sent to PKB Test Patient A, but with incorrect NHS number status.


Then PKB to modify PKB Test Patient A demographics.


Then Organisation Administrator of integrating party to release original message from queue (found in HL7 Review tab).

Old messages from the queue are applied when they are released, even if a newer demographic update has been applied in the meantime.

AA

The first message does not update the demographics.


The message from PKB does update the demographics.


When the first message is released, it also updates the demographics, despite being an older update then the second message.



.

Soft matching when sending data

Single Source Testing


An HL7 Data Message for a known patient will have their last name, first name initial, and date of birth compared to that in PKB. PKB performs this logic for any message that contains data points to be added to a patient’s medical record, e.g. new appointment, new lab result. As such, choice of data message is left to the integrating party.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.5.01

Data sent in a message which has the correct and valid NHS number, but which contains a mistake in one or more of last name, first name initial, or date of birth (a mistake includes omitting the field altogether).

The message is accepted, but queued for manual review.

AA

The medical record is not immediately updated. The message is added to the queue for the Organisation Administrator, visible in their “HL7 Review” tab. If the Organisation Administrator approves the message, then the new data points will become visible in the patient’s medical record.


Multiple Source Testing


These tests should be repeated against the PKB Test Patient A.


ID

Test Details

Notes

HL7 Response

GUI Outcome

Dem.5.02

As Dem.5.01, but targeting PKB Test Patient A.





Comments