Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAH-3052 | Refactored query to contain all extraIdentifier values #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions masterdata/configuration/globalproperties/gp_registration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<property>emrapi.sqlSearch.activePatients</property>
<value>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
Expand All @@ -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;</value>
where v.date_stopped is null AND v.voided = 0 group by identifier;</value>
</globalProperty>
<globalProperty>
<property>order.durationUnitsConceptUuid</property>
Expand Down
2 changes: 1 addition & 1 deletion openmrs/apps/clinical/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
],
"config": {
"preferExtraIdInSearchResults": true,
"preferredExtraIdInPatientList": "ABHA Number",
"allowAdhocTeleConsultation": true,
"defaultVisitType":"OPD",
"teleConsultationDomain": "meet.jit.si",
Expand Down