Uploaded image for project: 'EMR API'
  1. EMR API
  2. EA-138

Failed to load all the patients if one patient is missing in the lastViewedPatient list.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Could
    • Resolution: Change Request Cancelled
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Complexity:
      Low

      Description

      Consider this following scenario 

      1. Search for Patient-A
      2. Search for Patient-B
      3. Search for Patient-C
      4. 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.

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  suthagar23 Suthagar Kailayapathy
                  Reporter:
                  suthagar23 Suthagar Kailayapathy
                  Watchers:
                  Daniel Kayiwa, Suthagar Kailayapathy
                  Designated Committer:
                  Suthagar Kailayapathy
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: