simple-server icon indicating copy to clipboard operation
simple-server copied to clipboard

Use device_created_at to pick latest overdue appointment

Open prabhanshuguptagit opened this issue 3 years ago • 1 comments

Story card: sc-9056

Because

We use the latest scheduled_date to find a patient's latest overdue appointment. If a user creates many appointments for a patient, we should use the latest created appointment and not the one that's farthest into the future (latest scheduled appointment) to evaluate overdueness.

This addresses

Updates the "latest appointment" calculation in PatientSummary and MaterializedPatientSummary to:

  • Find the latest appointment for a patient by device_created_at
  • Patient is overdue if the status of this appointment is scheduled or cancelled and the scheduled_date has passed

prabhanshuguptagit avatar Sep 02 '22 11:09 prabhanshuguptagit