Draft: Feat/doctor consultation

Title (semantic)

feat(dashboard): add doctor consultation status to patient dashboard API

Description

This merge request enhances the Patient Dashboard API by adding a structured Doctor Consultation object with an explicit status field.

The dashboard API now returns consultation details required to correctly represent the Doctor Consultation stage in the patient visit progress tracker.

Changes Introduced

  • Added consultation object to the dashboard response:

    • doctor_name
    • consulted_at
    • status (PENDING | IN_PROGRESS | COMPLETED)
  • Implemented backend logic to determine consultation status:

    • PENDING → No consultation record exists
    • IN_PROGRESS → Consultation record exists but not finalized
    • COMPLETED → Consultation has a valid consulted_at timestamp

Purpose

Previously, the frontend inferred consultation completion based on field presence. This update centralizes visit stage logic in the backend, ensuring:

  • Backend acts as the source of truth
  • Accurate patient visit progress tracking
  • Cleaner frontend implementation without guessing logic

Checklist

  • The feature has been fully implemented.
  • Tests for the new feature are included and passing.
  • User documentation/guides have been updated (if applicable).
  • Impact on existing functionality has been considered.

Related Issue(s)

Closes #

Edited by Kushal Lagichetty

Merge request reports

Loading