Feat: Funnel chart(stages) for real-time camp analytics
Issue Title: Patient Journey Funnel not displaying correct data in Camp Analytics Dashboard
Description:
The Patient Journey Funnel in the Analytics Dashboard is rendering correctly in the UI but is not displaying the actual data fetched from the backend APIs. All stages in the funnel currently show a count of 0 and a PENDING status, even though patients are registered in the selected medical camp.
For example, the Patients Registered card correctly shows 16 registered patients, but the Registration stage in the funnel still shows 0. This indicates that the funnel component is not correctly parsing or using the data returned from the APIs.
Expected Behavior:
The funnel chart should display real-time counts for each stage of the patient journey, including:
- Registration
- Doctor Assignment
- Vitals Collection
- Know Your Patient
- Waiting for Doctor
- Consultation
- Prescription
- Medicine Verification
- Counseling
The Registration stage should match the number of registered patients for the selected camp.
Current Behavior:
- Funnel stages render correctly in the UI.
- All stage counts remain 0.
- Status remains PENDING for all stages.
- API data appears to exist because the analytics cards display correct values.
Possible Cause:
The issue may be due to incorrect parsing of the API response from getPatientsByCamp() in CampFunnelChart.tsx. The component currently assumes the response format is { patients: [] }, while the API may be returning a direct array of patients.
Impact:
The funnel analytics are currently inaccurate and do not reflect the real patient flow in the medical camp, which affects the usefulness of the analytics dashboard.
Suggested Fix:
Ensure the patient data returned from the API is parsed correctly and used to calculate stage counts in the funnel chart.