> ## Documentation Index
> Fetch the complete documentation index at: https://hmis-docs.derrickmugabwa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Record a visit diagnosis



## OpenAPI

````yaml /openapi-staff.yaml post /outpatient-visits/{outpatientVisit}/diagnoses
openapi: 3.1.0
info:
  title: HMIS Staff Workflow API
  version: 1.0.0
  description: >-
    Clinic-scoped patient registration, appointments, outpatient visits, and
    clinical workspace operations.
servers:
  - url: https://jaliprohmis.derrickmugabwa.dev/api/v1
    description: HMIS staging API
security:
  - bearerAuth: []
tags:
  - name: Staff patients
  - name: Staff appointments
  - name: Staff outpatient visits
  - name: Staff clinical workspace
paths:
  /outpatient-visits/{outpatientVisit}/diagnoses:
    post:
      tags:
        - Staff clinical workspace
      summary: Record a visit diagnosis
      operationId: createStaffClinicalDiagnosis
      parameters:
        - $ref: '#/components/parameters/VisitId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiagnosisRequest'
      responses:
        '201':
          $ref: '#/components/responses/ObjectResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    VisitId:
      name: outpatientVisit
      in: path
      required: true
      schema:
        type: integer
  schemas:
    DiagnosisRequest:
      type: object
      required:
        - icd_title
        - diagnosis_type
        - certainty
      properties:
        icd_uri:
          type:
            - string
            - 'null'
        icd_code:
          type:
            - string
            - 'null'
          maxLength: 32
        icd_title:
          type: string
          maxLength: 255
        diagnosis_type:
          type: string
          enum:
            - primary
            - secondary
            - differential
        certainty:
          type: string
          enum:
            - confirmed
            - provisional
            - ruled_out
        notes:
          type:
            - string
            - 'null'
          maxLength: 1000
    ObjectEnvelope:
      type: object
      properties:
        data:
          type: object
          additionalProperties: true
  responses:
    ObjectResponse:
      description: Resource returned.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ObjectEnvelope'
    ValidationError:
      description: Request validation or workflow transition failed.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum staff token

````