> ## Documentation Index
> Fetch the complete documentation index at: https://omniloy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update clinical note

> Updates an existing clinical note with AI-generated content, feedback, or metadata. Used to store AI-generated clinical documentation, link to conversation threads, and capture user feedback for quality improvement.




## OpenAPI

````yaml /openapi/openapi.yaml patch /v1/clinical-notes/{id}
openapi: 3.0.3
info:
  title: Sofia Clinical Documentation API
  version: 1.0.0
  description: >
    Comprehensive AI-powered clinical documentation platform that includes
    ICD-10 medical coding, transcription management, AI conversation threads,
    and clinical note generation with support for various clinical templates
    (SOAP, BIRP, etc.).
servers:
  - url: https://{your-prod-endpoint}
    description: Production (provided after deployment)
  - url: https://{your-dev-endpoint}
    description: Development (provided upon request)
security:
  - bearerAuth: []
paths:
  /v1/clinical-notes/{id}:
    patch:
      summary: Update clinical note
      description: >
        Updates an existing clinical note with AI-generated content, feedback,
        or metadata. Used to store AI-generated clinical documentation, link to
        conversation threads, and capture user feedback for quality improvement.
      operationId: updateClinicalNote
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
          description: The clinical note UUID
          example: note_def456ghi
        - in: header
          name: x-doctor
          schema:
            type: string
          required: true
          description: Doctor identifier for tracking and auditing
          example: dr_123
        - in: header
          name: x-patient
          schema:
            type: string
          required: false
          description: Patient identifier for tracking and auditing
          example: pt_456
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClinicalNoteUpdateRequest'
            example:
              template: SOAP
              ai_generated_content:
                subjective: Patient reports chest pain radiating to left arm
                objective: BP 140/90, HR 88, RR 18, O2 sat 98% on RA
                assessment: R/O myocardial infarction
                plan: Admit to CCU, serial troponins, cardiology consult
              feedback: Well structured note
              report_thread_id: thread_xyz789
              report_run_id:
                - run_001
                - run_002
      responses:
        '200':
          description: Clinical note updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClinicalNoteUpdateResponse'
              example:
                id: note_def456ghi
                user_id: usr_123456789
                group_id: grp_987654321
                transcription_id: trans_abc123xyz
                template: SOAP
                ai_generated_content:
                  subjective: Patient reports chest pain radiating to left arm
                  objective: BP 140/90, HR 88, RR 18, O2 sat 98% on RA
                  assessment: R/O myocardial infarction
                  plan: Admit to CCU, serial troponins, cardiology consult
                feedback: Well structured note
                report_thread_id: thread_xyz789
                report_run_id:
                  - run_001
                  - run_002
                created_at: '2023-10-09T10:00:00.000Z'
                updated_at: '2023-10-09T10:05:00.000Z'
        '400':
          description: Bad request (invalid data format)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Clinical note not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error: Not Found
                details: Clinical note with id 'note_def456ghi' not found
components:
  schemas:
    ClinicalNoteUpdateRequest:
      type: object
      properties:
        template:
          type: string
          description: Clinical note format template (e.g., SOAP, BIRP, DAP, GIRP)
          example: SOAP
        ai_generated_content:
          type: object
          description: Structured clinical data generated by AI (schema varies by template)
          additionalProperties: true
          example:
            subjective: Patient reports chest pain radiating to left arm
            objective: BP 140/90, HR 88, RR 18, O2 sat 98% on RA
            assessment: R/O myocardial infarction
            plan: Admit to CCU, serial troponins, cardiology consult
        feedback:
          type: string
          description: User comments or feedback on the clinical note
          example: Well structured note
        report_thread_id:
          type: string
          description: Thread ID that generated this content
          example: thread_xyz789
        report_run_id:
          type: array
          description: Array of run IDs involved in generating this content
          items:
            type: string
          example:
            - run_001
            - run_002
    ClinicalNoteUpdateResponse:
      type: object
      required:
        - id
        - user_id
        - group_id
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Clinical note unique identifier
          example: note_def456ghi
        user_id:
          type: string
          description: User identifier
          example: usr_123456789
        group_id:
          type: string
          description: Group/organization identifier
          example: grp_987654321
        transcription_id:
          type: string
          description: Associated transcription identifier
          example: trans_abc123xyz
        template:
          type: string
          description: Clinical note format template
          example: SOAP
        ai_generated_content:
          type: object
          description: Structured clinical data
          additionalProperties: true
          example:
            subjective: Patient reports chest pain radiating to left arm
            objective: BP 140/90, HR 88, RR 18, O2 sat 98% on RA
            assessment: R/O myocardial infarction
            plan: Admit to CCU, serial troponins, cardiology consult
        feedback:
          type: string
          description: User feedback
          example: Well structured note
        report_thread_id:
          type: string
          description: Associated thread ID
          example: thread_xyz789
        report_run_id:
          type: array
          description: Associated run IDs
          items:
            type: string
          example:
            - run_001
            - run_002
        created_at:
          type: string
          format: date-time
          description: Timestamp when note was created
          example: '2023-10-09T10:00:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when note was last updated
          example: '2023-10-09T10:05:00.000Z'
    Error:
      type: object
      required:
        - success
        - error
        - details
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always false for error responses
        error:
          type: string
          description: Error name/type
          example: Bad Request
        details:
          type: string
          description: Detailed error message
          example: Either medical_note or pdf_file must be provided
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token for API authentication

````