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

# Classify ICD-10 codes to a DRG

> 
Classify ICD-10-CM diagnosis codes and ICD-10-PCS procedure codes into an MS-DRG code
using the vhdrg classification engine.

**No LLM cost** — this endpoint uses deterministic rule-based classification.

Supported MS-DRG versions: v36 (FY2019) through v40 (FY2023), and v43 (FY2026).
CMS grouper data for v41/v42 is not shipped by the vhdrg engine.
    



## OpenAPI

````yaml /api/openapi-commercial.yaml post /api/v1/drg/classify/
openapi: 3.0.3
info:
  title: Healthproximate API
  version: 1.0.0
  description: >-
    DRG classification, OMOP vocabulary services and a PHI-safe LLM gateway.


    Generated by `manage.py export_commercial_openapi` from an explicit
    operation allowlist (`app/openapi_commercial.py`). An endpoint appears here
    because someone published it, never because it exists.
  contact:
    email: admin@valiancehealth.ai
servers:
  - url: https://api.v2.healthproximate.com
security: []
tags:
  - name: DRG
    description: MS-DRG classification from coded input, free clinical text, or FHIR.
  - name: Vocabulary
    description: OMOP concept search, coding, translation and hierarchy resolution.
  - name: Gateway
    description: >-
      PHI-safe LLM access. Text is redacted before any model sees it and
      re-hydrated in the answer, and every response carries a receipt.
paths:
  /api/v1/drg/classify/:
    post:
      tags:
        - DRG
      summary: Classify ICD-10 codes to a DRG
      description: >-

        Classify ICD-10-CM diagnosis codes and ICD-10-PCS procedure codes into
        an MS-DRG code

        using the vhdrg classification engine.


        **No LLM cost** — this endpoint uses deterministic rule-based
        classification.


        Supported MS-DRG versions: v36 (FY2019) through v40 (FY2023), and v43
        (FY2026).

        CMS grouper data for v41/v42 is not shipped by the vhdrg engine.
            
      operationId: v1_drg_classify_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DRGClassifyRequestRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DRGClassifyRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DRGClassifyRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DRGClassifyResponse'
              examples:
                SimplePneumonia:
                  value:
                    primary_drg: '195'
                    description: SIMPLE PNEUMONIA AND PLEURISY WITHOUT CC/MCC
                    mdc: '04'
                    type: M
                    all_candidates:
                      - '195'
                      - '000'
                    version: v40
                    fiscal_year: FY 2023
                    input:
                      dx_codes:
                        - J189
                        - J310
                      gender: F
                      is_alive: true
                      pr_codes: []
                    response_time_ms: 12
                  summary: Simple Pneumonia
          description: DRG classification result
        '400':
          description: Invalid request
        '401':
          description: Authentication required
        '500':
          description: Internal server error
      security:
        - api_key_auth: []
        - jwt_auth: []
components:
  schemas:
    DRGClassifyRequestRequest:
      type: object
      description: Request serializer for direct DRG classification endpoint.
      properties:
        dx_codes:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 10
          description: ICD-10-CM diagnosis codes. First code is principal diagnosis.
          minItems: 1
        pr_codes:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 10
          default: []
          description: ICD-10-PCS procedure codes (7 characters each).
        gender:
          allOf:
            - $ref: '#/components/schemas/GenderEnum'
          default: F
          description: |-
            Patient gender: "F" (female) or "M" (male)

            * `F` - F
            * `M` - M
        is_alive:
          type: boolean
          default: true
          description: Whether the patient was discharged alive
        version:
          allOf:
            - $ref: '#/components/schemas/VersionEnum'
          default: v40
          description: |-
            MS-DRG version (default: v40, FY 2023)

            * `v36` - v36
            * `v37` - v37
            * `v38` - v38
            * `v39` - v39
            * `v40` - v40
            * `v43` - v43
      required:
        - dx_codes
    DRGClassifyResponse:
      type: object
      description: Response serializer for direct DRG classification endpoint.
      properties:
        primary_drg:
          type: string
          description: Primary DRG code (3-digit string)
        description:
          type: string
          description: DRG description
        mdc:
          type: string
          description: Major Diagnostic Category
        type:
          type: string
          description: 'DRG type: M (Medical) or P (Procedural)'
        all_candidates:
          type: array
          items:
            type: string
          description: All candidate DRG codes
        version:
          type: string
          description: MS-DRG version used
        fiscal_year:
          type: string
          description: Fiscal year for the version
        input:
          allOf:
            - $ref: '#/components/schemas/DRGClassifyInput'
          description: Echo of the input parameters
        response_time_ms:
          type: integer
          description: Response time in milliseconds
      required:
        - all_candidates
        - description
        - fiscal_year
        - input
        - mdc
        - primary_drg
        - response_time_ms
        - type
        - version
    GenderEnum:
      enum:
        - F
        - M
      type: string
      description: |-
        * `F` - F
        * `M` - M
    VersionEnum:
      enum:
        - v36
        - v37
        - v38
        - v39
        - v40
        - v43
      type: string
      description: |-
        * `v36` - v36
        * `v37` - v37
        * `v38` - v38
        * `v39` - v39
        * `v40` - v40
        * `v43` - v43
    DRGClassifyInput:
      type: object
      description: Serializer for the input echo in DRG classification response.
      properties:
        dx_codes:
          type: array
          items:
            type: string
        pr_codes:
          type: array
          items:
            type: string
        gender:
          type: string
        is_alive:
          type: boolean
      required:
        - dx_codes
        - gender
        - is_alive
        - pr_codes
  securitySchemes:
    api_key_auth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for organization authentication. Obtain from the organization
        settings or API key management endpoint.
    jwt_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT access token obtained from /login/ endpoint

````