# OHN-54 OpenAPI 3.1 contract (generated from module.json; keep in step with backend/modules/ohn-54/api/app.ts)
"openapi": "3.1.0"
"info":
  "title": "OHN-54 Appointments and Teleconsultation"
  "version": "1.1.1"
  "description": "Schedules, slots, booking, waiting list, attendance, video rooms and WebRTC signalling. Tokens from the platform gateway (module key appointments). Request bodies and queries are strict: an unknown key or a bad value is 422 domain_validation_failed with zod-style details.details {formErrors, fieldErrors}. Idempotency-Key is required on every write except signalling. The TypeScript-only synthetic sign-in is not served; the gateway issues tokens."
"servers":
  - "url": "https://opeshealthnetwork.com"
"paths":
  "/api/ohn/v1/appointments/policy":
    "get":
      "operationId": "OHN_54_API_001"
      "summary": "Configured policy"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/schedules":
    "get":
      "operationId": "OHN_54_API_002"
      "summary": "List schedules (own facility)"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "security":
        - "bearer": []
    "post":
      "operationId": "OHN_54_API_003"
      "summary": "Publish a schedule and generate slots"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Schedule"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/schedules/{id}/retire":
    "post":
      "operationId": "OHN_54_API_004"
      "summary": "Retire a schedule"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Step"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/services":
    "get":
      "operationId": "OHN_54_API_005"
      "summary": "Bookable services and facilities"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/slots":
    "get":
      "operationId": "OHN_54_API_006"
      "summary": "Search slots"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "service_type"
          "in": "query"
          "schema":
            "type": "string"
            "pattern": "^[a-z][a-z0-9_]{1,47}$"
        - "name": "facility_id"
          "in": "query"
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "date"
          "in": "query"
          "schema":
            "type": "string"
            "format": "date"
        - "name": "mode"
          "in": "query"
          "schema":
            "type": "string"
            "enum":
              - "in_person"
              - "video"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/slots/{id}/block":
    "post":
      "operationId": "OHN_54_API_007"
      "summary": "Close or reopen a slot"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Block"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/day":
    "get":
      "operationId": "OHN_54_API_008"
      "summary": "Facility day view"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "date"
          "in": "query"
          "required": true
          "schema":
            "type": "string"
            "format": "date"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/mine":
    "get":
      "operationId": "OHN_54_API_009"
      "summary": "My appointments"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments":
    "post":
      "operationId": "OHN_54_API_010"
      "summary": "Book"
      "responses":
        "200":
          "description": "Appointment"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Appointment"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Book"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}":
    "get":
      "operationId": "OHN_54_API_011"
      "summary": "Appointment"
      "responses":
        "200":
          "description": "Appointment"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Appointment"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}/history":
    "get":
      "operationId": "OHN_54_API_012"
      "summary": "Appointment history"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}/reschedule":
    "post":
      "operationId": "OHN_54_API_013"
      "summary": "Reschedule"
      "responses":
        "200":
          "description": "Appointment"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Appointment"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Reschedule"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}/cancel":
    "post":
      "operationId": "OHN_54_API_014"
      "summary": "Cancel"
      "responses":
        "200":
          "description": "Appointment"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Appointment"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Cancel"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}/check-in":
    "post":
      "operationId": "OHN_54_API_015"
      "summary": "Check in"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Step"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}/no-show":
    "post":
      "operationId": "OHN_54_API_016"
      "summary": "Record no-show"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Step"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}/complete":
    "post":
      "operationId": "OHN_54_API_017"
      "summary": "Complete"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Step"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/{id}/encounter":
    "post":
      "operationId": "OHN_54_API_018"
      "summary": "Link OHN-09 encounter"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/EncounterLink"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/waitlist":
    "get":
      "operationId": "OHN_54_API_019"
      "summary": "Waiting list"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "security":
        - "bearer": []
    "post":
      "operationId": "OHN_54_API_020"
      "summary": "Join waiting list"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Waitlist"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/waitlist/{id}/withdraw":
    "post":
      "operationId": "OHN_54_API_021"
      "summary": "Withdraw"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Step"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/reports/{rid}":
    "get":
      "operationId": "OHN_54_API_022"
      "summary": "Report"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "rid"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "enum":
              - "OHN-54-R001"
              - "OHN-54-R002"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/reports/{rid}/export":
    "get":
      "operationId": "OHN_54_API_023"
      "summary": "Signed CSV"
      "responses":
        "200":
          "description": "CSV, header X-OHN54-Signature: hmac-sha256=<hex>"
          "content":
            "text/csv":
              "schema":
                "type": "string"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "rid"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "enum":
              - "OHN-54-R001"
              - "OHN-54-R002"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/audit":
    "get":
      "operationId": "OHN_54_API_024"
      "summary": "Audit trail"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/synthetic-token":
    "post":
      "operationId": "OHN_54_API_025"
      "summary": "Synthetic sign-in (non-production)"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/SyntheticToken"
  "/api/ohn/v1/teleconsult/rooms/{id}":
    "get":
      "operationId": "OHN_54_API_026"
      "summary": "Room state"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "security":
        - "bearer": []
  "/api/ohn/v1/teleconsult/rooms/{id}/consent":
    "post":
      "operationId": "OHN_54_API_027"
      "summary": "Record video consent"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Consent"
      "security":
        - "bearer": []
  "/api/ohn/v1/teleconsult/rooms/{id}/join":
    "post":
      "operationId": "OHN_54_API_028"
      "summary": "Enter waiting room"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Empty"
      "security":
        - "bearer": []
  "/api/ohn/v1/teleconsult/rooms/{id}/leave":
    "post":
      "operationId": "OHN_54_API_029"
      "summary": "Leave"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Empty"
      "security":
        - "bearer": []
  "/api/ohn/v1/teleconsult/rooms/{id}/admit":
    "post":
      "operationId": "OHN_54_API_030"
      "summary": "Admit patient"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Empty"
      "security":
        - "bearer": []
  "/api/ohn/v1/teleconsult/rooms/{id}/end":
    "post":
      "operationId": "OHN_54_API_031"
      "summary": "End call"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Empty"
      "security":
        - "bearer": []
  "/api/ohn/v1/teleconsult/rooms/{id}/signals":
    "get":
      "operationId": "OHN_54_API_032"
      "summary": "Poll signalling"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "after"
          "in": "query"
          "schema":
            "type": "integer"
            "minimum": 0
      "security":
        - "bearer": []
    "post":
      "operationId": "OHN_54_API_033"
      "summary": "Send signalling"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": false
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Signal"
      "security":
        - "bearer": []
  "/api/ohn/v1/teleconsult/rooms/{id}/notes":
    "get":
      "operationId": "OHN_54_API_034"
      "summary": "Notes"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "security":
        - "bearer": []
    "post":
      "operationId": "OHN_54_API_035"
      "summary": "Add note"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
        - "name": "Idempotency-Key"
          "in": "header"
          "required": true
          "schema":
            "type": "string"
            "maxLength": 255
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Note"
      "security":
        - "bearer": []
  "/health/ohn-54":
    "get":
      "operationId": "OHN_54_API_036"
      "summary": "Health"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "Version conflict, invalid transition, slot full, outside change window"
        "422":
          "description": "Validation failed"
  "/api/ohn/v1/appointments/booking-settings":
    "get":
      "operationId": "OHN_54_API_037"
      "summary": "Booking mode settings of the own facility (staff)"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
    "post":
      "operationId": "OHN_54_API_038"
      "summary": "Set the booking mode (instant | request) for the facility (*) or a service"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/BookingSetting"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests":
    "post":
      "operationId": "OHN_54_API_039"
      "summary": "Patient (or guardian for a dependant) requests a slot or a preferred window"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/AppointmentRequestInput"
      "responses":
        "200":
          "description": "OK"
        "201":
          "description": "Created"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
    "get":
      "operationId": "OHN_54_API_040"
      "summary": "Requests: own and dependants (patient) or the facility (staff); ?state=open|requested|...&practitioner_id="
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}":
    "get":
      "operationId": "OHN_54_API_041"
      "summary": "One request"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/history":
    "get":
      "operationId": "OHN_54_API_042"
      "summary": "Request history (append-only)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/slots":
    "get":
      "operationId": "OHN_54_API_043"
      "summary": "Free slots fitting the request (staff)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/accept":
    "post":
      "operationId": "OHN_54_API_044"
      "summary": "Accept: the held or a chosen slot is booked at once (staff)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/RequestAccept"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/decline":
    "post":
      "operationId": "OHN_54_API_045"
      "summary": "Decline with a reason (staff)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/RequestDecline"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/propose":
    "post":
      "operationId": "OHN_54_API_046"
      "summary": "Propose another time; the slot is held for the patient (staff)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/RequestPropose"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/confirm":
    "post":
      "operationId": "OHN_54_API_047"
      "summary": "Patient confirms the proposed time"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Step"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/reject-proposal":
    "post":
      "operationId": "OHN_54_API_048"
      "summary": "Patient turns the proposal down; the request waits for a new answer"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/RequestPatientStep"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/requests/{id}/withdraw":
    "post":
      "operationId": "OHN_54_API_049"
      "summary": "Patient withdraws the request"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/RequestPatientStep"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/follow-ups":
    "post":
      "operationId": "OHN_54_API_050"
      "summary": "Clinician asks to see the patient again within a window (optional held slot, OHN-55 enrolment link)"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/FollowUpInput"
      "responses":
        "200":
          "description": "OK"
        "201":
          "description": "Created"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
    "get":
      "operationId": "OHN_54_API_051"
      "summary": "Follow-ups: own and dependants (patient) or the facility (staff); ?state=open|overdue|booked|completed|cancelled"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/follow-ups/{id}":
    "get":
      "operationId": "OHN_54_API_052"
      "summary": "One follow-up"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/follow-ups/{id}/history":
    "get":
      "operationId": "OHN_54_API_053"
      "summary": "Follow-up history (append-only)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/follow-ups/{id}/slots":
    "get":
      "operationId": "OHN_54_API_054"
      "summary": "Free slots inside the follow-up window"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/follow-ups/{id}/book":
    "post":
      "operationId": "OHN_54_API_055"
      "summary": "Book a slot for the follow-up (patient, guardian or staff)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/FollowUpBook"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/follow-ups/{id}/cancel":
    "post":
      "operationId": "OHN_54_API_056"
      "summary": "Cancel an open follow-up with a reason (staff)"
      "parameters":
        - "name": "id"
          "in": "path"
          "required": true
          "schema":
            "type": "string"
            "format": "uuid"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/FollowUpCancel"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/specialties":
    "get":
      "operationId": "OHN_54_API_057"
      "summary": "Specialties offered (declared on schedules)"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/directory":
    "get":
      "operationId": "OHN_54_API_058"
      "summary": "Clinicians by specialty, service and mode with booking mode and next free time"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/dependants":
    "get":
      "operationId": "OHN_54_API_059"
      "summary": "Dependants the signed-in guardian may act for (OHN-19)"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/clinician/inbox":
    "get":
      "operationId": "OHN_54_API_060"
      "summary": "My appointments: requests to answer, today, follow-ups due (staff; ?practitioner_id=&date=)"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
  "/api/ohn/v1/appointments/maintenance/expire":
    "post":
      "operationId": "OHN_54_API_061"
      "summary": "Expire lapsed requests and proposals now (staff; also runs lazily)"
      "requestBody":
        "required": true
        "content":
          "application/json":
            "schema":
              "$ref": "#/components/schemas/Empty"
      "responses":
        "200":
          "description": "OK"
        "401":
          "description": "Unauthenticated"
          "content":
            "application/json":
              "schema":
                "$ref": "#/components/schemas/Error"
        "403":
          "description": "Denied by policy, or representation_denied (OHN-19)"
        "404":
          "description": "Not found or not in scope"
        "409":
          "description": "version_conflict, invalid_transition, slot_full, slot_unavailable, request_required, instant_booking, already_requested, already_open, request_expired"
        "422":
          "description": "Validation failed"
        "503":
          "description": "OHN-19 unavailable (dependant path)"
      "security":
        - "bearer": []
"components":
  "securitySchemes":
    "bearer":
      "type": "http"
      "scheme": "bearer"
      "bearerFormat": "JWT"
  "schemas":
    "Error":
      "type": "object"
      "required":
        - "error"
      "properties":
        "error":
          "type": "string"
        "message":
          "type": "string"
        "details": {}
    "Schedule":
      "type": "object"
      "additionalProperties": false
      "required":
        - "facility_name"
        - "practitioner_id"
        - "practitioner_name"
        - "service_type"
        - "mode"
        - "slot_minutes"
        - "from_date"
        - "to_date"
        - "weekdays"
        - "day_start"
        - "day_end"
      "properties":
        "facility_name":
          "type": "string"
          "minLength": 2
          "maxLength": 120
        "practitioner_id":
          "type": "string"
          "format": "uuid"
        "practitioner_name":
          "type": "string"
          "minLength": 2
          "maxLength": 120
        "service_type":
          "type": "string"
          "pattern": "^[a-z][a-z0-9_]{1,47}$"
        "mode":
          "type": "string"
          "enum":
            - "in_person"
            - "video"
        "slot_minutes":
          "type": "integer"
          "minimum": 5
          "maximum": 240
        "from_date":
          "type": "string"
          "format": "date"
        "to_date":
          "type": "string"
          "format": "date"
        "weekdays":
          "type": "array"
          "minItems": 1
          "maxItems": 7
          "items":
            "type": "integer"
            "minimum": 1
            "maximum": 7
        "day_start":
          "type": "string"
          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
        "day_end":
          "type": "string"
          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
    "Book":
      "type": "object"
      "additionalProperties": false
      "required":
        - "slot_id"
      "properties":
        "slot_id":
          "type": "string"
          "format": "uuid"
        "patient_id":
          "type": "string"
          "format": "uuid"
        "reason":
          "type": "string"
          "maxLength": 200
        "overbook":
          "type": "boolean"
        "waitlist_id":
          "type": "string"
          "format": "uuid"
    "Reschedule":
      "type": "object"
      "additionalProperties": false
      "required":
        - "slot_id"
        - "expected_version"
      "properties":
        "slot_id":
          "type": "string"
          "format": "uuid"
        "expected_version":
          "type": "integer"
          "minimum": 1
    "Cancel":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
        - "reason"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "reason":
          "type": "string"
          "minLength": 2
          "maxLength": 200
    "Step":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
    "Block":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
        - "blocked"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "blocked":
          "type": "boolean"
    "Waitlist":
      "type": "object"
      "additionalProperties": false
      "required":
        - "organization_id"
        - "service_type"
        - "earliest"
        - "latest"
      "properties":
        "organization_id":
          "type": "string"
          "format": "uuid"
        "patient_id":
          "type": "string"
          "format": "uuid"
        "service_type":
          "type": "string"
          "pattern": "^[a-z][a-z0-9_]{1,47}$"
        "mode":
          "type": "string"
          "enum":
            - "in_person"
            - "video"
        "earliest":
          "type": "string"
          "format": "date"
        "latest":
          "type": "string"
          "format": "date"
    "EncounterLink":
      "type": "object"
      "additionalProperties": false
      "required":
        - "encounter_id"
      "properties":
        "encounter_id":
          "type": "string"
          "format": "uuid"
    "Consent":
      "type": "object"
      "additionalProperties": false
      "required":
        - "statement_version"
        - "agree"
      "properties":
        "statement_version":
          "const": "OHN-54-VC-1.0"
        "agree":
          "const": true
    "Signal":
      "type": "object"
      "additionalProperties": false
      "required":
        - "kind"
        - "payload"
      "properties":
        "kind":
          "type": "string"
          "enum":
            - "offer"
            - "answer"
            - "ice"
            - "hangup"
        "payload":
          "type": "object"
          "description": "SDP {type,sdp} or ICE candidate; at most 16 KB"
    "Note":
      "type": "object"
      "additionalProperties": false
      "required":
        - "body"
      "properties":
        "body":
          "type": "string"
          "minLength": 1
          "maxLength": 2000
    "Empty":
      "type": "object"
      "additionalProperties": false
      "required": []
      "properties": {}
    "SyntheticToken":
      "type": "object"
      "additionalProperties": false
      "required":
        - "principal_id"
        - "role"
        - "jurisdiction"
        - "organization_id"
        - "purpose"
      "properties":
        "principal_id":
          "type": "string"
          "format": "uuid"
        "role":
          "type": "string"
          "enum":
            - "patient"
            - "clinician"
            - "scheduler"
        "jurisdiction":
          "type": "string"
          "format": "uuid"
        "organization_id":
          "type": "string"
          "format": "uuid"
        "purpose":
          "type": "string"
    "Appointment":
      "type": "object"
      "properties":
        "id":
          "type": "string"
          "format": "uuid"
        "organization_id":
          "type": "string"
          "format": "uuid"
        "facility_name":
          "type": "string"
        "practitioner_id":
          "type": "string"
          "format": "uuid"
        "practitioner_name":
          "type": "string"
        "service_type":
          "type": "string"
        "mode":
          "type": "string"
          "enum":
            - "in_person"
            - "video"
        "start_at":
          "type": "string"
          "format": "date-time"
        "end_at":
          "type": "string"
          "format": "date-time"
        "slot_id":
          "type": "string"
          "format": "uuid"
        "patient_id":
          "type": "string"
          "format": "uuid"
        "reason":
          "type":
            - "string"
            - "null"
        "state":
          "type": "string"
          "enum":
            - "booked"
            - "checked_in"
            - "in_consultation"
            - "completed"
            - "cancelled"
            - "no_show"
        "overbooked":
          "type": "boolean"
        "encounter_id":
          "type":
            - "string"
            - "null"
        "reminder_status":
          "type": "string"
          "enum":
            - "none"
            - "scheduled"
            - "event_only"
            - "failed"
        "room_state":
          "type":
            - "string"
            - "null"
        "version":
          "type": "integer"
        "patient_can_change":
          "type": "boolean"
    "BookingSetting":
      "type": "object"
      "additionalProperties": false
      "required":
        - "service_type"
        - "booking_mode"
      "properties":
        "service_type":
          "type": "string"
          "description": "* for every service, or a service code"
        "booking_mode":
          "enum":
            - "instant"
            - "request"
        "request_expiry_hours":
          "type": "integer"
          "minimum": 1
          "maximum": 720
    "AppointmentRequestInput":
      "type": "object"
      "additionalProperties": false
      "properties":
        "slot_id":
          "type": "string"
          "format": "uuid"
        "organization_id":
          "type": "string"
          "format": "uuid"
        "service_type":
          "type": "string"
        "mode":
          "enum":
            - "in_person"
            - "video"
        "practitioner_id":
          "type": "string"
          "format": "uuid"
        "preferred_from":
          "type": "string"
          "format": "date"
        "preferred_to":
          "type": "string"
          "format": "date"
        "time_of_day":
          "enum":
            - "any"
            - "morning"
            - "afternoon"
        "patient_id":
          "type": "string"
          "format": "uuid"
          "description": "a dependant (OHN-19 permit required)"
        "reason":
          "type": "string"
          "maxLength": 200
    "RequestAccept":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "slot_id":
          "type": "string"
          "format": "uuid"
        "note":
          "type": "string"
    "RequestDecline":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
        - "reason"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "reason":
          "type": "string"
          "minLength": 2
          "maxLength": 200
    "RequestPropose":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
        - "slot_id"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "slot_id":
          "type": "string"
          "format": "uuid"
        "note":
          "type": "string"
    "RequestPatientStep":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "reason":
          "type": "string"
    "FollowUpInput":
      "type": "object"
      "additionalProperties": false
      "required":
        - "patient_id"
        - "service_type"
        - "mode"
        - "reason"
        - "due_from"
        - "due_to"
      "properties":
        "patient_id":
          "type": "string"
          "format": "uuid"
        "service_type":
          "type": "string"
        "mode":
          "enum":
            - "in_person"
            - "video"
        "reason":
          "type": "string"
          "minLength": 2
          "maxLength": 200
        "due_from":
          "type": "string"
          "format": "date"
        "due_to":
          "type": "string"
          "format": "date"
        "practitioner_id":
          "type": "string"
          "format": "uuid"
        "practitioner_name":
          "type": "string"
        "facility_name":
          "type": "string"
        "same_clinician":
          "type": "boolean"
        "slot_id":
          "type": "string"
          "format": "uuid"
        "source_appointment_id":
          "type": "string"
          "format": "uuid"
        "source_encounter_id":
          "type": "string"
          "format": "uuid"
        "programme_enrolment_id":
          "type": "string"
          "format": "uuid"
          "description": "OHN-55 enrolment (read through the OHN-55 API)"
        "programme_code":
          "type": "string"
        "programme_next_visit_due":
          "type": "string"
          "format": "date"
    "FollowUpBook":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
        - "slot_id"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "slot_id":
          "type": "string"
          "format": "uuid"
    "FollowUpCancel":
      "type": "object"
      "additionalProperties": false
      "required":
        - "expected_version"
        - "reason"
      "properties":
        "expected_version":
          "type": "integer"
          "minimum": 1
        "reason":
          "type": "string"
          "minLength": 2
          "maxLength": 200
