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

# Analyze Patient Chart

> Analyzes patient chart documents and generates comprehensive medical coding and documentation reports

## Delivery

To receive results from this endpoint, you must enable [Webhooks](../claims/webhook-delivery) on your organization.


## OpenAPI

````yaml POST /api/analyze-patient-chart
openapi: 3.1.0
info:
  title: Cair Health APIs
  description: APIs for the Cair Health platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://forecaster.cairhealth.com
security:
  - bearerAuth: []
paths:
  /api/analyze-patient-chart:
    post:
      description: >-
        Analyzes patient chart documents and generates comprehensive medical
        coding and documentation reports
      parameters:
        - name: content-type
          in: header
          description: >-
            Content type of the patient chart file (e.g., 'application/pdf',
            'image/jpeg', 'text/plain')
          required: true
          schema:
            type: string
        - name: content-disposition
          in: header
          description: >-
            Content disposition header with filename parameter (e.g.,
            'attachment; filename="patient-chart.pdf"')
          required: false
          schema:
            type: string
        - name: generate_coding_report
          in: query
          description: 'Whether to generate coding report (default: true)'
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_time_based_requirements_report
          in: query
          description: 'Whether to generate time-based requirements report (default: true)'
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_telehealth_documentation_report
          in: query
          description: 'Whether to generate telehealth documentation report (default: true)'
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_documentation_discrepancy_report
          in: query
          description: 'Whether to generate documentation discrepancy report (default: true)'
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_authentication_report
          in: query
          description: 'Whether to generate authentication report (default: true)'
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_diagnosis_procedure_report_alignment
          in: query
          description: >-
            Whether to generate diagnosis-procedure alignment report (default:
            true)
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_modifier_bundling_report
          in: query
          description: 'Whether to generate modifier bundling report (default: true)'
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_ncd_lcd_analysis
          in: query
          description: 'Whether to generate NCD/LCD analysis report (default: true)'
          required: false
          schema:
            type: boolean
            default: true
        - name: generate_suggestions_for_fixing_issues_report
          in: query
          description: >-
            Whether to generate suggestions for fixing issues report (default:
            true)
          required: false
          schema:
            type: boolean
            default: true
      requestBody:
        description: Raw content of the patient chart document to be analyzed
        content:
          application/pdf:
            schema:
              type: string
              format: binary
              description: Binary content of a PDF document
          image/jpeg:
            schema:
              type: string
              format: binary
              description: Binary content of a JPEG image
          image/png:
            schema:
              type: string
              format: binary
              description: Binary content of a PNG image
          text/plain:
            schema:
              type: string
              description: Plain text content
        required: true
      responses:
        '200':
          description: Patient chart analysis completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  reportId:
                    type: string
                    description: Unique identifier for the patient chart analysis
                  success:
                    type: boolean
                    description: Whether the patient chart analysis was successful
              example:
                report_id: '1234567890'
                success: true
        '400':
          description: Invalid request or file processing error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: No file content provided
        '401':
          description: Unauthorized access or invalid organization ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Organization not found
        '500':
          description: Server error or analysis failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to analyze patient chart
                details: Chat API connection failed
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````