Description
Problem Statement
When a client creates a resource via PUT
request, they can assign a client-assigned ID. The DB will also assign its own PID, and the PID can be mapped to the client-assigned ID.
When the results for $mdm-link-history
are ordered, they are ordered by PID instead of client-assigned ID (see MdmLinkDaoJpaImpl:390
), but PIDs are generally not what the client sees, meaning from a user perspective, the results still appear not to be in the correct order.
Steps to Reproduce
- Start and configure Smile with MDM
PUT Patient/456a
with id456a
in the body --> is assigned to PIDPatient/1
; new GR is created with PIDPatient/2
PUT Patient/123a
with the same body (but change id to123a
) --> is assigned to PIDPatient/3
; matches with GR with PIDPatient/2
- Do a
$mdm-query-links
to find the ID of the golden resource the Patients match to - Perform a
$mdm-link-history?goldenResourceId=<golden resource id>
Observed Results
The$mdm-link-history
response will return with the order Patient/456a (PID Patient/1), Patient/123a (PID Patient/3)
. This is in ascending order by PID, which is Patient/1, Patient/3
, but appears in descending order to the user who sees the client assigned IDs in the response Patient/456a, Patient/123a
Expected Results
The order of results should be ascending by client-assigned IDs instead of by PIDs (ie. should be Patient/123a, Patient/456a
)
Environment (please complete the following information):
HAPI FHIR Version: v6.6.2