Skip to content

Commit

Permalink
Merge pull request Bahmni#50 from Bahmni-Covid19/master
Browse files Browse the repository at this point in the history
BAH-1125 - Swati/Praveena - Hide 'Join teleconsultation' button on non-teleconsultation Appointments
  • Loading branch information
buvaneswari-arun authored Feb 8, 2021
2 parents 09ecca2 + f63eeda commit de60806
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
12 changes: 10 additions & 2 deletions api/src/main/resources/liquibase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,23 @@
<sqlFile path="patientPastAppointments.sql"/>
</changeSet>

<changeSet id="global-property-upcoming-appointments-sql-04022021" author="Maharjun, Shireesha">
<changeSet id="global-property-past-appointments-sql-update" author="Himabindu">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="1">select count(*) from global_property where property='bahmni.sqlGet.pastAppointments'</sqlCheck>
</preConditions>
<comment>Updating query to fetch past appointments for patient</comment>
<sqlFile path="patientPastAppointments_v2.sql"/>
</changeSet>

<changeSet id="global-property-upcoming-appointments-sql" author="Maharjun, Shireesha">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">select count(*) from global_property where property='bahmni.sqlGet.upComingAppointments'</sqlCheck>
</preConditions>
<comment>Adding query to fetch upcoming appointments for patient</comment>
<sqlFile path="patientUpcomingAppointments.sql"/>
</changeSet>

<changeSet id="global-property-upcoming-appointments-sql-update-04022021" author="Shankar, Mahesh">
<changeSet id="global-property-upcoming-appointments-sql-update" author="Shankar, Mahesh">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="1">select count(*) from global_property where property='bahmni.sqlGet.upComingAppointments'</sqlCheck>
</preConditions>
Expand Down
1 change: 0 additions & 1 deletion api/src/main/resources/patientPastAppointments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ 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 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
Expand Down
22 changes: 22 additions & 0 deletions api/src/main/resources/patientPastAppoitments_v2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
UPDATE global_property ('bahmni.sqlGet.pastAppointments',
SET property_value= "SELECT
app_service.name AS `DASHBOARD_APPOINTMENTS_SERVICE_KEY`,
app_service_type.name AS `DASHBOARD_APPOINTMENTS_SERVICE_TYPE_KEY`,
DATE_FORMAT(start_date_time, \"%d/%m/%Y\") AS `DASHBOARD_APPOINTMENTS_DATE_KEY`,
CONCAT(DATE_FORMAT(start_date_time, \"%l:%i %p\"), \" - \", DATE_FORMAT(end_date_time, \"%l:%i %p\")) AS `DASHBOARD_APPOINTMENTS_SLOT_KEY`,
CONCAT(pn.given_name, ' ', pn.family_name) AS `DASHBOARD_APPOINTMENTS_PROVIDER_KEY`,
pa.status AS `DASHBOARD_APPOINTMENTS_STATUS_KEY`
FROM
patient_appointment pa
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 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
WHERE p.uuid = ${patientUuid} AND start_date_time < CURDATE() AND (app_service_type.voided IS FALSE OR app_service_type.voided IS NULL)
ORDER BY start_date_time DESC
LIMIT 5;"
WHERE property='bahmni.sqlGet.pastAppointments'
1 change: 0 additions & 1 deletion api/src/main/resources/patientUpcomingAppointments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ 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 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
Expand Down
5 changes: 4 additions & 1 deletion api/src/main/resources/patientUpcomingAppointments_v2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ SET property_value= "SELECT
DATE_FORMAT(start_date_time, \"%d/%m/%Y\") AS `DASHBOARD_APPOINTMENTS_DATE_KEY`,
CONCAT(DATE_FORMAT(start_date_time, \"%l:%i %p\"), \" - \", DATE_FORMAT(end_date_time, \"%l:%i %p\")) AS `DASHBOARD_APPOINTMENTS_SLOT_KEY`,
CONCAT(pn.given_name, ' ', pn.family_name) AS `DASHBOARD_APPOINTMENTS_PROVIDER_KEY`,
pa.status AS `DASHBOARD_APPOINTMENTS_STATUS_KEY`
pa.status AS `DASHBOARD_APPOINTMENTS_STATUS_KEY`,
pa.teleconsultation AS `DASHBOARD_APPOINTMENTS_TELECONSULTATION`
FROM
patient_appointment pa
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 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 = pa.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
Expand Down

0 comments on commit de60806

Please sign in to comment.