Read about OpenEMR's Response to the COVID-19 Pandemic at

New appointment in calendar tab prefills wrong patient

In 5.0.2 (2), I search a patient, start looking at their records, etc. Now, I search a new patient. The tabs that were already open such as Dashboard and Past Encounters appear to update correctly with this new patient’s data. However, if I go to the Calendar tab and click + for new appointment, the Patient field is prefilled with the first patient that I had looked up, not my current patient. If I click the Calendar link at top left of the screen, it refreshes the calendar tab and corrects this issue.

Not sure if this is by design or some sort of refresh issue when looking up a new patient, but we scheduled some appointments on the wrong patients before we recognized it. We are training ourselves to click the main Calendar link each time just to be sure.

hi @whittech, thanks for the bug report, was able to confirm on a 5.0.2(2)openemr demo

looks like when you use the pt search in the calendar add/edit event popup it results in a disconnect btw active patient in the dashboard

edit: actually it’s when you don’t change the day in the calendar view but have changed patients in the dashboard

hi @whittech, here’s a fix, feel free to edit your code or wait for patch 3, thanks to @sjpadgett for making it straightforward

Awesome - thank you for knocking this out!