Skip to content

Draft: Resolve "Preserve Doctor Details and Consultation Data in Analytics After Unregistration"

Shanmukha varma Lanke requested to merge doctor-details into develop

Description

This MR fixes an issue where doctors disappear from the camp analytics section after they are unregistered from a camp.

Previously, the analytics logic fetched doctors only from the current camp registration list. When a doctor was unregistered, the doctor–camp relationship was removed, which caused the doctor to no longer appear in analytics, even if they had already consulted patients during that camp. This resulted in the loss of visibility of historical consultation data.

This change updates the analytics logic so that doctors are fetched based on consultation records associated with the selected camp, rather than relying only on active camp registrations. As a result, if a doctor has consultation records in that camp, their details will continue to appear in the analytics section even after they are unregistered.

The analytics view will continue to display:

  • Doctor name
  • Specialization
  • Number of patients consulted

The camp registration list remains unchanged and will still display only currently registered doctors.

These changes ensure that historical consultation data is preserved for analytics and reporting purposes while keeping the existing system behavior intact. Minimal modifications were made to the existing backend query and API logic, and no major frontend changes were required since the UI already supports displaying the returned doctor analytics data.

Merge request reports

Loading