Aller au contenu principal

WP-07 Diagnostic orders and results

Load AGENTS.md, contracts.md, and this file. Tech specs: api/diagnostics.md, app/diagnostics.md, exchange/diagnostics.md. Implement only when the user asks and WP-01 plus WP-02 have landed.

Group G2. May run beside WP-05.

Owns​

  • afia-api/src/main/java/health/afia/app/diagnostics/
  • afia-api/src/test/java/health/afia/app/diagnostics/
  • afia-app/lib/presentation/diagnostics/
  • afia-app/lib/data/diagnostics/
  • afia-app/lib/domain/diagnostics/

Features: F-11 receive imaging orders, F-12 read imaging exams, F-13 track lab analyses, F-14 publish lab results, F-20 create diagnostic order.

Reserved paths: /api/v1/afia/orders, /api/v1/afia/worklists.

Must not write​

  • EndpointUri.java, api_config.dart, docs/api-map.md
  • health.afia.app.patient.results
  • Appointment or encounter persistence
  • Two public APIs for imaging and lab

Depends on​

WP-01 and WP-02. An order has patientId. encounterId is optional.

Done when​

  1. DiagnosticOrder and DiagnosticResult match contracts.md.
  2. kind is IMAGING or LAB. That is the only write-API split.
  3. POST /api/v1/afia/orders creates an order. F-20 is inferred. Keep the body to patientId, kind, and optional encounterId.
  4. GET /api/v1/afia/worklists?kind= returns orders for the caller role.
  5. POST /api/v1/afia/orders/{id}/results stores one result. A patient caller is rejected.
  6. Tests cover both kinds on the same types.
  7. cd afia-api && mvn test passes.
  8. cd afia-app && flutter test passes.

Do not invent screens​

Landing copy is receive, consult, analyses, and results. Do not name PACS viewers or analyzer panels. One worklist UI with a kind filter is enough until WP-10.