Skip to content

Commit

Permalink
Merge pull request Bahmni#52 from Bahmni/BAH-1136
Browse files Browse the repository at this point in the history
Bindu | BAH-1136 | Change query to get provider from patient appointment provider table
  • Loading branch information
buvaneswari-arun authored Jan 28, 2021
2 parents c5c09c2 + 0db5762 commit 1bdd81c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/src/main/resources/patientPastAppointments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ FROM
JOIN person p ON p.person_id = pa.patient_id AND pa.voided IS FALSE
JOIN appointment_service app_service
ON app_service.appointment_service_id = pa.appointment_service_id AND app_service.voided IS FALSE
LEFT JOIN provider prov ON prov.provider_id = pa.provider_id AND prov.retired IS FALSE
LEFT JOIN patient_appointment_provider pap on pa.patient_appointment_id = pap.patient_appointment_id AND (pap.voided=0 OR pap.voided IS NULL)
LEFT JOIN provider prov ON prov.provider_id = pap.provider_id AND prov.retired IS FALSE
LEFT JOIN person_name pn ON pn.person_id = prov.person_id AND pn.voided IS FALSE
LEFT JOIN appointment_service_type app_service_type
ON app_service_type.appointment_service_type_id = pa.appointment_service_type_id
Expand Down
3 changes: 2 additions & 1 deletion api/src/main/resources/patientUpcomingAppointments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ FROM
JOIN person p ON p.person_id = pa.patient_id AND pa.voided IS FALSE
JOIN appointment_service app_service
ON app_service.appointment_service_id = pa.appointment_service_id AND app_service.voided IS FALSE
LEFT JOIN provider prov ON prov.provider_id = pa.provider_id AND prov.retired IS FALSE
LEFT JOIN patient_appointment_provider pap on pa.patient_appointment_id = pap.patient_appointment_id AND (pap.voided=0 OR pap.voided IS NULL)
LEFT JOIN provider prov ON prov.provider_id = pap.provider_id AND prov.retired IS FALSE
LEFT JOIN person_name pn ON pn.person_id = prov.person_id AND pn.voided IS FALSE
LEFT JOIN appointment_service_type app_service_type
ON app_service_type.appointment_service_type_id = pa.appointment_service_type_id
Expand Down

0 comments on commit 1bdd81c

Please sign in to comment.