Skip to main content

WP-05 exchange

One Appointment row. Two HTTP faces. Envelope: envelope.md.

Workflow​

  1. A patient lists appointments on /api/v1/afia/appointments.
  2. The patient requests a slot with clinicianId and slot.
  3. The API inserts one Appointment row.
  4. A clinician GETs /api/v1/afia/clinician/agenda for a day and sees the same rows.
  5. /api/v1/afia/clinician/patients lists patients who have an appointment with that clinician. It does not copy PatientProfile storage.

Wire​

GET /api/v1/afia/appointments

res { data: [ { "id", "patientId", "clinicianId", "slot", "status" } ], ... }

POST /api/v1/afia/appointments

req { "clinicianId", "slot" }
res { data: { "id", "patientId", "clinicianId", "slot", "status" }, ... }

GET /api/v1/afia/clinician/agenda?day=

res { data: [ { "id", "patientId", "clinicianId", "slot", "status" } ], ... }

GET /api/v1/afia/clinician/patients

res { data: [ { "patientId" } ], ... }

Errors: missing session, wrong role, unknown clinician, slot conflict (when status rules land).

Ownership​

WP-05 writes health.afia.app.patient.appointment, health.afia.app.clinician.agenda, and lib/*/booking/ plus the two presentation folders. Shared language is Appointment.

Does not do​

Encounter JSON. A second appointment resource. Class internals. Invented calendar widgets.