← Technical API reference

Backend resource · STATIC DECLARATIONS

Encounter API reference · mansoq-core

Static source contract for Encounter: 15 declared or inherited operation mappings, schema/field evidence and authorization/refusal references. Deployment and behavioral review remain explicit.

Static API contract — behavior review pending. Source baseline f6e9f05f76d4.

Enable JavaScript to inspect structured operation, parameter, schema and permission evidence. Download this reference and its evidence.

Declared route and availability

This resource is declared in mansoq-core at /api/v1/encounter/. verified core mount in config/urls.py A registered path and an indexed handler do not prove deployment availability, user permission or production readiness.

Operation map

Method Path Action Evidence
GET /api/v1/encounter/ list declared/inherited method
POST /api/v1/encounter/ create declared/inherited method
GET /api/v1/encounter/{external_id}/ retrieve declared/inherited method
PUT /api/v1/encounter/{external_id}/ update declared/inherited method
PATCH /api/v1/encounter/{external_id}/ partial_update declared/inherited method
POST /api/v1/encounter/{external_id}/set_tags/ set_tags @action declaration
POST /api/v1/encounter/{external_id}/remove_tags/ remove_tags @action declaration
GET /api/v1/encounter/emergency_board/ emergency_board @action declaration
POST /api/v1/encounter/{external_id}/triage/ triage @action declaration
POST /api/v1/encounter/{external_id}/restart/ restart @action declaration
GET /api/v1/encounter/{external_id}/organizations/ organizations @action declaration
POST /api/v1/encounter/{external_id}/organizations_add/ organizations_add @action declaration
DELETE /api/v1/encounter/{external_id}/organizations_remove/ organizations_remove @action declaration
POST /api/v1/encounter/{external_id}/set_facility_identifier/ set_facility_identifier @action declaration
POST /api/v1/encounter/{external_id}/set_care_team_members/ set_care_team_members @action declaration

list · GET

GET /api/v1/encounter/ — action list. static contract extracted; runtime/permission/payload behavior review pending.

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

response: EncounterListSpec. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
meta dict false No extra constraint extracted
id UUID4 false No extra constraint extracted
status StatusChoices true No extra constraint extracted
period PeriodSpec false No extra constraint extracted
hospitalization HospitalizationSpec | None false No extra constraint extracted
priority EncounterPriorityChoices true No extra constraint extracted
external_identifier str | None false No extra constraint extracted
discharge_summary_advice str | None false No extra constraint extracted
patient dict true No extra constraint extracted
facility dict true No extra constraint extracted
status_history dict true No extra constraint extracted
created_date datetime.datetime true No extra constraint extracted
modified_date datetime.datetime true No extra constraint extracted
tags list[dict] false No extra constraint extracted
current_location dict | None false No extra constraint extracted
care_team list[dict] false No extra constraint extracted
encounter_class ClassChoices true No extra constraint extracted

Observed authorization checks: can_view_patient_obj, get_filtered_encounters. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters.

create · POST

POST /api/v1/encounter/ — action create. static contract extracted; runtime/permission/payload behavior review pending.

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

request: EncounterCreateSpec. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
meta dict false No extra constraint extracted
id UUID4 false No extra constraint extracted
status StatusChoices true No extra constraint extracted
period PeriodSpec false No extra constraint extracted
hospitalization HospitalizationSpec | None false No extra constraint extracted
priority EncounterPriorityChoices true No extra constraint extracted
external_identifier str | None false No extra constraint extracted
discharge_summary_advice str | None false No extra constraint extracted
extensions dict false No extra constraint extracted
patient UUID4 true No extra constraint extracted
facility UUID4 true No extra constraint extracted
organizations list[UUID4] false No extra constraint extracted
appointment UUID4 | None false No extra constraint extracted
encounter_class ClassChoices true No extra constraint extracted

response: EncounterRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
meta dict false No extra constraint extracted
permissions list[str] false No extra constraint extracted
id UUID4 false No extra constraint extracted
status StatusChoices true No extra constraint extracted
period PeriodSpec false No extra constraint extracted
hospitalization HospitalizationSpec | None false No extra constraint extracted
priority EncounterPriorityChoices true No extra constraint extracted
external_identifier str | None false No extra constraint extracted
discharge_summary_advice str | None false No extra constraint extracted
patient dict true No extra constraint extracted
facility dict true No extra constraint extracted
status_history dict true No extra constraint extracted
created_date datetime.datetime true No extra constraint extracted
modified_date datetime.datetime true No extra constraint extracted
tags list[dict] false No extra constraint extracted
current_location dict | None false No extra constraint extracted
care_team list[dict] false No extra constraint extracted
encounter_class ClassChoices true No extra constraint extracted
appointment dict false No extra constraint extracted
created_by dict false No extra constraint extracted
updated_by dict false No extra constraint extracted
organizations list[dict] false No extra constraint extracted
location_history list[dict] false No extra constraint extracted
extensions dict true No extra constraint extracted

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_create_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to create encounter; ValidationError (dynamic detail; inspect source); ValidationError: Patient does not exist; ValidationError: Facility does not exist; ValidationError: Encounter already has an associated booking; ValidationError: Encounter creation failed, try again after a while.

Conditional gates: conditional/computed expression; inspect pinned declaration comparison settings.MAX_ACTIVE_ENCOUNTERS_PER_PATIENT_IN_FACILITY.

retrieve · GET

GET /api/v1/encounter/{external_id}/ — action retrieve. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

response: EncounterRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.

The declared field table is shown at its first occurrence in this reference; this operation links the same schema.

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_view_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to view this patient.

Direct refusal present: the handler/helper contains a top-level raise. Review whether the operation is intentionally disabled or only performs validation before relying on it.

update · PUT

PUT /api/v1/encounter/{external_id}/ — action update. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

request: EncounterUpdateSpec. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
meta dict false No extra constraint extracted
id UUID4 false No extra constraint extracted
status StatusChoices true No extra constraint extracted
period PeriodSpec false No extra constraint extracted
hospitalization HospitalizationSpec | None false No extra constraint extracted
priority EncounterPriorityChoices true No extra constraint extracted
external_identifier str | None false No extra constraint extracted
discharge_summary_advice str | None false No extra constraint extracted
extensions dict false No extra constraint extracted

response: EncounterRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.

The declared field table is shown at its first occurrence in this reference; this operation links the same schema.

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to update encounter; ValidationError (dynamic detail; inspect source); ValidationError: Patient does not exist; ValidationError: Facility does not exist.

Conditional gates: conditional/computed expression; inspect pinned declaration comparison settings.MAX_ACTIVE_ENCOUNTERS_PER_PATIENT_IN_FACILITY.

partial_update · PATCH

PATCH /api/v1/encounter/{external_id}/ — action partial_update. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

request: EncounterUpdateSpec. Declared fields below; inherited fields are retained in the schema inventory.

The declared field table is shown at its first occurrence in this reference; this operation links the same schema.

response: EncounterRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.

The declared field table is shown at its first occurrence in this reference; this operation links the same schema.

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; ValidationError (dynamic detail; inspect source); ValidationError: Patient does not exist; ValidationError: Facility does not exist; PermissionDenied: You do not have permission to update encounter.

Conditional gates: conditional/computed expression; inspect pinned declaration comparison settings.MAX_ACTIVE_ENCOUNTERS_PER_PATIENT_IN_FACILITY.

set_tags · POST

POST /api/v1/encounter/{external_id}/set_tags/ — action set_tags. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

decorator request: TagRequest. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
tags list[UUID4] false No extra constraint extracted

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj, can_view_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; RestFrameworkValidationError (dynamic detail; inspect source); PermissionDenied: You do not have permission to update encounter; PermissionDenied: You do not have permission to view this patient.

Direct refusal present: the handler/helper contains a top-level raise. Review whether the operation is intentionally disabled or only performs validation before relying on it.

remove_tags · POST

POST /api/v1/encounter/{external_id}/remove_tags/ — action remove_tags. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

body validation: TagRequest. Declared fields below; inherited fields are retained in the schema inventory.

The declared field table is shown at its first occurrence in this reference; this operation links the same schema.

decorator request: TagRequest. Declared fields below; inherited fields are retained in the schema inventory.

The declared field table is shown at its first occurrence in this reference; this operation links the same schema.

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj, can_view_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to update encounter; PermissionDenied: You do not have permission to view this patient.

Direct refusal present: the handler/helper contains a top-level raise. Review whether the operation is intentionally disabled or only performs validation before relying on it.

emergency_board · GET

In-progress emergency encounters of a facility in board order.

GET /api/v1/encounter/emergency_board/ — action emergency_board. static contract extracted; runtime/permission/payload behavior review pending.

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query facility not declared at read site direct indexing; validation may be upstream
query patient not declared at read site direct indexing; validation may be upstream

Observed authorization checks: get_filtered_encounters, can_view_patient_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: ValidationError (dynamic detail; inspect source); PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters.

triage · POST

Record a triage level from the facility's configured triage scale.

POST /api/v1/encounter/{external_id}/triage/ — action triage. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

decorator request: TriageRecordSpec. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
system str true min_length: 1
code str true min_length: 1

Observed authorization checks: can_update_encounter_clinical_data, can_view_patient_obj, get_filtered_encounters. Helper/queryset evidence is included; this is not proof of complete security review.

Explicit response statuses in observed code: status.HTTP_201_CREATED. Other branches/framework exception handling may differ.

Declared refusal/error evidence: PermissionDenied: You do not have permission to triage encounter; ValidationError (dynamic detail; inspect source); PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters.

restart · POST

Moves the encounter to from a completed state to an in progress state

POST /api/v1/encounter/{external_id}/restart/ — action restart. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

Observed authorization checks: can_restart_encounter_obj, can_view_patient_obj, get_filtered_encounters. Helper/queryset evidence is included; this is not proof of complete security review.

Explicit response statuses in observed code: status.HTTP_204_NO_CONTENT. Other branches/framework exception handling may differ.

Declared refusal/error evidence: PermissionDenied: You do not have permission to update encounter; ValidationError: Encounter is not in a completed state; ValidationError (dynamic detail; inspect source); PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters.

organizations · GET

Returns organizations associated with the encounter

GET /api/v1/encounter/{external_id}/organizations/ — action organizations. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_view_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to view this patient.

Direct refusal present: the handler/helper contains a top-level raise. Review whether the operation is intentionally disabled or only performs validation before relying on it.

organizations_add · POST

POST /api/v1/encounter/{external_id}/organizations_add/ — action organizations_add. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

decorator responses: FacilityOrganizationReadSpec. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
meta dict false No extra constraint extracted
id UUID4 false No extra constraint extracted
active bool false No extra constraint extracted
name str true No extra constraint extracted
description str false No extra constraint extracted
metadata dict false No extra constraint extracted
org_type FacilityOrganizationTypeChoices true No extra constraint extracted
parent UUID4 | None false No extra constraint extracted
created_by dict | None false No extra constraint extracted
updated_by dict | None false No extra constraint extracted
system_generated bool true No extra constraint extracted
level_cache int false No extra constraint extracted
has_children bool true No extra constraint extracted

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: Organization Incompatible with Encounter; ValidationError: Organization already exists; PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to update encounter.

organizations_remove · DELETE

DELETE /api/v1/encounter/{external_id}/organizations_remove/ — action organizations_remove. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: PermissionDenied: Organization Incompatible with Encounter; ValidationError: Organization does not exist; PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to update encounter.

set_facility_identifier · POST

POST /api/v1/encounter/{external_id}/set_facility_identifier/ — action set_facility_identifier. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

Observed authorization checks: can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Declared refusal/error evidence: ValidationError (dynamic detail; inspect source); PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to update encounter.

set_care_team_members · POST

POST /api/v1/encounter/{external_id}/set_care_team_members/ — action set_care_team_members. static contract extracted; runtime/permission/payload behavior review pending.

Path and deployment-context parameters:

Location Parameter Type Required
path external_id router lookup string; semantic ID validation requires handler/schema review true

Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):

Location Field Declared/inferred read type Requiredness evidence
query patient not declared at read site direct indexing; validation may be upstream
query facility not declared at read site direct indexing; validation may be upstream

decorator request: EncounterCareTeamMemberWriteSpec. Declared fields below; inherited fields are retained in the schema inventory.

Field Type Required Constraints
members list[EncounterCareTeamMemberSpec] true No extra constraint extracted

decorator responses: EncounterRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.

The declared field table is shown at its first occurrence in this reference; this operation links the same schema.

Observed authorization checks: can_view_encounter_obj, can_view_patient_obj, get_filtered_encounters, can_update_encounter_obj. Helper/queryset evidence is included; this is not proof of complete security review.

Explicit response statuses in observed code: status.HTTP_200_OK. Other branches/framework exception handling may differ.

Declared refusal/error evidence: ValidationError (dynamic detail; inspect source); PermissionDenied: Treating doctor does not have permission on encounter; PermissionDenied: User cannot access patient; PermissionDenied: Cannot access encounters; PermissionDenied: You do not have permission to update encounter.

Integration review checklist

Confirm the installed route and full schema; review authentication, organization/facility scoping, all accepted fields, value-state and date/time semantics, idempotency, pagination, response/exception branches and the allowed correction/reversal workflow. Test positive and negative cases with synthetic data. This source reference does not establish external certification or replace an illustrated user procedure.

Pinned source evidence

Links require access to the private source repository.