TEST: OHIE-CR-08-FHIR
Patient Merges
This test ensures that the client registry properly handles merge requests sent by patient identity sources using the PMIR merge mechanism described in IHE Patient Mater Identity Registry.
References
Discussion
The PMIR profile makes the assumption that the client is controlling the process of merge by instructing the server to link/de-activate a victim. Since merging is an event which triggers several business rules in the Master Data Management layer, the SanteDB PMIR handler detects this condition (a client attempting to control linking of patients, which is an internal matter) and mimics the equivalent behaviors of ADT^A40
from HL7v2.
Furthermore, the SanteDB implementation of merging behaves as described in Chapter 3 - Patient Administration
in HL7 Version 2 (see: 3.6.2.1.2
). For example, if two patients from HOSPITAL_A
are registered as illustrated below (patient 1 with two identifiers and patient 2 with one):
Then a merge requests where Patient 1 is replaced by Patient 2 would result in a merge such that:
Subsequent requests to query for a patient using GREEN_TRIANGLE
would result in Patient 2
being resolved. This behavior differs from the prescribed behavior of PMIR whereby the victim (in this case Patient 2) is not returned, or continues to be resolved with an inactive flag.
Pre-Conditions
Prior to running this test ensure that the pre-conditions from TEST: OHIE-CR-04 and TEST: OHIE-CR-06 have been run.
Authenticate as TEST_HARNESS
The test harness authenticates against the SanteMPI IdP using a client_credentials grant for the test-harness-a account.
Register First Patient Identity in TEST
The test harness sends an authenticated request to create a new patient with a new identifier in TEST domain. Patient details:
Identifier
FHR-080
inhttp://ohie.org/test/test
Identifier
NID080
inhttp://ohie.org/test/nid
Name: MERGY SMITH
Gender: Male
DOB: 1986-05-25
Expected Behaviour
Execute PIXm Query To Validate The First Patient in TEST
The test harness sends an IHE PIXm query for a patient with identifier FHR-080 to the receiver.
Expected Behaviour
Register Second Patient Identity in TEST
The test harness sends an authenticated request to create a new patient with a new identifier in TEST domain. Patient details:
Identifier
FHR-081
inhttp://ohie.org/test/test
Name: MERGY SMYTHE
Gender: Male
DOB: 1986-05-25
Expected Behaviour
Execute PIXm Query To Validate The Second Patient in TEST
The test harness sends an IHE PIXm query for a patient with identifier FHIR-081 to the receiver.
Expected Behaviour
Merge FHR-081 (Patient 2) into FHR-080 (Patient 1)
In this step the test harness sends a PIMR request to instruct the Client Registry that FHR-081
has been replaced by FHR-080
.
You will notice that the link
element in the above message uses the business identifier reference rather than an absolute reference by URL. This is considered best practice when merging on SanteDB server as it abstracts the logical identifier (which changes as the resource moves between servers). See: http://hl7.org/fhir/resource.html#identifiers
Alternate Merge Request
Alternately, the test harness may fetch/obtain the logical ID of the resource and may indicate the merge using the logical identifier of the resource. For example, if the SanteDB MPI registered a patient with logical identifier 5d0e583f-1fda-4a25-8fbe-f4fb3e876f3c
, the sender may issue a link request such as:
Expected Behavior
Query for Merged Record
This test ensures that the client registry returns the new record (with identifier FHR-080) when the old record (FHR-081) is queried. This resolution ensures that the merge occurred successfully and any attempts to reference an old record results in the new being returned.
This test uses the business identifiers to ensure the cross referencing is updated, and is the recommended manner for handling record merges. Alternates (such as returning the old record with active of false would place a burden on the client to intelligently handle merges by following, potentially, dozens of "replaced-by" links)
Expected Behavior
Fetch Merged Record
This test ensures compliance with the IHE PMIR profile by explicitly querying for a resource by logical identifier (rather than business identifier). IHE PMIR provides several options for handling a READ
or SEARCH
operation for merged records. All of these options are expressed as alternates in the expected behaviors table.
This test requires that the logical resource identifier assigned by the iCDR / MPI instance is known by the SUT.
Expected Behavior
Search Merged Record
This test ensures compliance with the IHE PMIR profile by explicitly searching for a resource by logical identifier (rather than business identifier). IHE PMIR provides several options for handling a SEARCH
operation for merged records. All of these options are expressed as alternates in the expected behaviors table.
This test requires that the logical resource identifier assigned by the iCDR / MPI instance is known by the SUT.
Expected Behavior
Execute PIXm Query To Validate Merged Record
This test ensures that the updates applied via the PMIR merge are reflected in the PIXm cross-referencing query request. The test harness issues a cross-referencing request to obtain the national health identifier for FHRA-081 (a patient, when registered, did not have a NID however by virtue FHRA-081 was merged into FHR-080 which carries a NID, FHRA-081 should carry a NID).
Expected Behavior
Last updated