Details
-
Bug
-
Status: Closed
-
Could
-
Resolution: Change Request Cancelled
-
None
-
None
-
Low
-
Description
Consider this following scenario
- Search for Patient-A
- Search for Patient-B
- Search for Patient-C
- Search for Patient-D
Then somehow, We deleted or removed the patient-B from the system. So the system couldn't find the Patient-B thorough the existing location uuid.
After that when you go to the findPatient dashboard, you can only see the Patient-A. But you should see the list of Patient-A, Patient-C, and Patient-D.
Dev Notes
The reason was, In the EMRAPI module - this line of code contains an API throw mechanism. So when this method checks for Patient-B in the order (since it was also viewed recently), it will throw the exception. See more here,
ERROR - PatientViewedEventListener$1.run(66) |2018-07-10 13:37:37,652| Failed to update the user's last viewed patients property org.openmrs.api.APIException: failed to find a patient with uuid:80977eec-dcaf-4d0e-bcf3-0feb7ef95916 or the patient is not yet saved at org.openmrs.module.emrapi.event.PatientViewedEventListener.processMessage(PatientViewedEventListener.java:86) at org.openmrs.module.emrapi.event.PatientViewedEventListener$1.run(PatientViewedEventListener.java:63) at org.openmrs.api.context.Daemon$5.run(Daemon.java:286)
So the last viewed patient list can’t contain the patients after that patient-B.
We should add a debug log to that line instead of throwing an exception.