diff --git a/masterdata/configuration/globalproperties/gp_registration.xml b/masterdata/configuration/globalproperties/gp_registration.xml
index f19d8dcc..eed2c178 100644
--- a/masterdata/configuration/globalproperties/gp_registration.xml
+++ b/masterdata/configuration/globalproperties/gp_registration.xml
@@ -12,7 +12,8 @@
emrapi.sqlSearch.activePatients
select distinct concat(pn.given_name," ", ifnull(pn.family_name,"")) as name,
primaryIdentifier.identifier as identifier,
- IF(extraIdentifier.identifier IS NULL OR extraIdentifier.identifier = '', primaryIdentifier.identifier, extraIdentifier.identifier) as "extraIdentifierVal",
+ group_concat(extraIdentifier.identifier) as extraIdentifierVal,
+ group_concat(extraIdentifier.name) as extraIdentifiers,
concat("",p.uuid) as uuid,
concat("",v.uuid) as activeVisitUuid,
IF(va.value_reference = "Admitted", "true", "false") as hasBeenAdmitted
@@ -24,15 +25,15 @@ from visit v
join patient_identifier_type pit on pri.identifier_type = pit.patient_identifier_type_id
join global_property gp on gp.property="bahmni.primaryIdentifierType" and gp.property_value=pit.uuid) primaryIdentifier
ON v.patient_id = primaryIdentifier.patient_id
- left outer JOIN (SELECT ei.patient_id, ei.identifier
+ left outer JOIN (SELECT ei.patient_id, ei.identifier, pit.name
FROM patient_identifier ei
join patient_identifier_type pit on ei.identifier_type = pit.patient_identifier_type_id
- join global_property gp on gp.property="bahmni.extraPatientIdentifierTypes" and pit.uuid=left(gp.property_value, 36)) extraIdentifier
- ON v.patient_id = extraIdentifier.patient_id
+ join global_property gp on gp.property="bahmni.extraPatientIdentifierTypes" and locate(pit.uuid,gp.property_value) != 0) extraIdentifier
+ ON v.patient_id = extraIdentifier.patient_id
join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id
left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (
select visit_attribute_type_id from visit_attribute_type where name="Admission Status") and va.voided = 0
-where v.date_stopped is null AND v.voided = 0;
+where v.date_stopped is null AND v.voided = 0 group by identifier;
order.durationUnitsConceptUuid
diff --git a/openmrs/apps/clinical/app.json b/openmrs/apps/clinical/app.json
index 66cea264..b3e825c7 100644
--- a/openmrs/apps/clinical/app.json
+++ b/openmrs/apps/clinical/app.json
@@ -7,7 +7,7 @@
}
],
"config": {
- "preferExtraIdInSearchResults": true,
+ "preferredExtraIdInPatientList": "ABHA Number",
"allowAdhocTeleConsultation": true,
"defaultVisitType":"OPD",
"teleConsultationDomain": "meet.jit.si",