Details
-
Bug
-
Status: Closed
-
Must
-
Resolution: Duplicate
-
Platform 1.12.0, Platform 1.11.8
-
None
-
None
-
Undetermined
-
Description
When you do a patient search using the getPatient method and an exact identifier match, the result Patient object returned only contains the patient identifier searched for, not all the identifiers for that patient.
This bug first appeared in 1.11.x and appears to happen at the Hibernate level... I tracked it down to these PatientSearchCriteria method:
I confirmed that when doing a exact identifier search the following criteria is generated:
CriteriaImpl(org.openmrs.Patient:this[Subcriteria(identifiers:ids)][(ids.voided=false and ids.identifier=Y2AX43), voided=false])
After the criteria.list() the resulting Patient object contains only a single identifier (in this case "Y2AX43") no matter how many identifiers the patient has.
The main patient REST object uses this search, so, concretely, if you make a call like:
/openmrs/ws/rest/v1/patient?identifier=CDI000003&v=default
The resulting object returns will contain an "identifiers" section with only that identifier, not all the patient's identifiers. This seems incorrect.