WP-12 exchange
New fields and read projections. Envelope: envelope.md.
Workflow
- A screen GETs its home or dashboard projection.
- The projection service reads owner services and returns counts and short lists.
- A patient GETs
/notifications. Items newer thanlastSeenAtareunread. - The patient POSTs
/notifications/seen. The API setslastSeenAton the account. - Writes stay in owner packages: rating, order schedule, and user status.
Wire
GET /api/v1/afia/patient/home
res { data: { "nextVisit", "latestResults", "unpaidInvoices", "openAlerts", "unreadCount" }, ... }
GET /api/v1/afia/clinician/dashboard
res { data: { "todayCount", "waitingCount", "urgentCount", "nextVisits", "openAlerts" }, ... }
GET /api/v1/afia/admin/dashboard
res { data: { "userCount", "activeCount", "structureCount", "transactionTotal", "recentUsers" }, ... }
GET /api/v1/afia/worklists/summary?kind=IMAGING
res { data: { "kind", "pending", "urgent", "scheduledToday", "toValidate", "sent" }, ... }
GET /api/v1/afia/notifications
res { data: [ { "id", "kind", "title", "at", "refId", "unread" } ], ... }
POST /api/v1/afia/notifications/seen
res { data: { "lastSeenAt" }, ... }
POST /api/v1/afia/appointments/{id}/rating
req { "stars" }
res { data: { "id", ..., "rating" }, ... }
GET /api/v1/afia/clinician/agenda?from=&to=
res { data: [ { "id", "patientId", "clinicianId", "slot", "status", "reason", "mode", "priority", "clinicName", "specialty" } ], ... }
PATCH /api/v1/afia/orders/{id}/schedule
req { "scheduledAt" }
res { data: { "id", "kind", "status", "examName", "requestedAt", "orderedBy", "structureName", "scheduledAt" }, ... }
PATCH /api/v1/afia/admin/users/{id}/status
req { "status" }
res { data: { "id", "displayName", "roles", "status", "createdAt" }, ... }
Vitals add "unit", "measuredAt", "status". Invoices add "createdAt", "currency", "reference", "clinicianName". Profiles and search cards add the fields in api/api-enrichment.md.
Errors: missing session, wrong role, stars outside 1 to 5, rating a visit that has not ended, unknown order, unknown user.
Ownership
WP-12 writes health.afia.app.notifications, stitch-parity.yaml, and lib/*/care/. It edits owner packages to add fields. Shared language is the owner types in contracts.md.
Does not do
Push delivery. Notification storage. Screens. Charts. Video session state. NNI is ADR 0013 / AFIA-38 on the patient profile, not this enrichment cut.