Aller au contenu principal

WP-06 API spec

The module is in afia-api. Contract type: Encounter in contracts.md. Wire: exchange/encounter.md.

Usage​

A clinician creates and updates notes on /api/v1/afia/clinician/encounters. The encounter points at an appointmentId from WP-05. A patient caller is rejected.

Domain​

  • Encounter at health.afia.app.clinician.encounter.Encounter. Contract Encounter.

Persistence​

EncounterEntity table encounter. Columns match the contract fields only. Do not persist appointments here.

HTTP DTOs​

  • EncounterRequestDto inbound. appointmentId, notes.
  • EncounterResponseDto outbound. Contract Encounter fields.

Mappers​

EncounterMapper.toResponse(Encounter) -> EncounterResponseDto
EncounterMapper.toDomain(EncounterEntity) -> Encounter

Services​

EncounterService
writeEncounterNote(session, appointmentId, notes) -> Encounter
updateNotes(session, encounterId, notes) -> Encounter

This is the sketch operation AgendaService.writeEncounterNote. WP-06 owns it.

Controllers​

  • EncounterController on reserved /api/v1/afia/clinician/encounters.

Does not do​

Appointment persistence, profiles, or diagnostics. Patient-facing note editors. Flutter types. SOAP templates.