Skip to content

Commit

Permalink
Merge pull request #1356 from Angie-540/POC-613
Browse files Browse the repository at this point in the history
POC-613:restricted reschedule reminder within biweekly period
  • Loading branch information
Alfred-Mutai authored Jan 19, 2024
2 parents f8bbbb5 + cb3c6aa commit b7869c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/reporting-framework/json-reports/clinical-reminder-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@
"joinCondition": "mwl.person_id = pre_s.person_id "
}
},
{
"table": "(SELECT ps.* FROM etl.pre_appointment_summary ps JOIN ( SELECT MAX(encounter_datetime) AS max_encounter_datetime, person_id FROM etl.pre_appointment_summary GROUP BY person_id ) latest_dates ON ps.encounter_datetime = latest_dates.max_encounter_datetime AND ps.person_id = latest_dates.person_id)",
"alias": "pre_u",
"join": {
"type": "LEFT",
"joinCondition": "pre_s.person_id = pre_u.person_id"
}
},
{
"table": "amrs.relationship",
"alias": "t6",
Expand Down Expand Up @@ -346,12 +354,12 @@
{
"type": "simple_column",
"alias": "reschedule_appointment",
"column": "pre_s.reschedule_appointment"
"column": "pre_u.reschedule_appointment"
},
{
"type": "simple_column",
"alias": "rescheduled_date",
"column": "pre_s.rescheduled_date"
"column": "pre_u.rescheduled_date"
},
{
"type": "simple_column",
Expand Down
1 change: 1 addition & 0 deletions service/patient-reminder.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ function generateAppointmentNoShowUpRiskReminder(data) {

function generateAppointmentRescheduledReminder(data) {
let reminders = [];

if (data.reschedule_appointment && data.reschedule_appointment === 'YES') {
if (data.last_encounter_date < data.prediction_generated_date) {
reminders.push({
Expand Down

0 comments on commit b7869c3

Please sign in to comment.