> ## 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 a FHIR R4 Bundle into an MS-DRG ($classify)

> 
FHIR front door for the deterministic DRG classifier. Send a Bundle containing
the encounter's `Condition` resources (ICD-10-CM codings; principal marked via
`Encounter.diagnosis` rank 1, else first-listed), optional `Procedure`
resources (ICD-10-PCS codings), a minimal `Patient` (only `gender` is read),
and optionally an `Encounter` (`hospitalization.dischargeDisposition` maps to
discharge status).

**Patient identifiers are dropped at the boundary** — names, identifiers,
addresses and telecom are never read and never stored; the response attests
this with `fhir_identifiers_dropped`. The submitted Bundle is not persisted.

Returns a FHIR `Parameters` resource carrying the DRG code, description and
grouper version. Malformed or unclassifiable input returns an
`OperationOutcome` — never a partial result.
    



## OpenAPI

````yaml /api/openapi-commercial.yaml post /api/v1/fhir/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/fhir/drg/$classify:
    post:
      tags:
        - DRG
      summary: Classify a FHIR R4 Bundle into an MS-DRG ($classify)
      description: >-

        FHIR front door for the deterministic DRG classifier. Send a Bundle
        containing

        the encounter's `Condition` resources (ICD-10-CM codings; principal
        marked via

        `Encounter.diagnosis` rank 1, else first-listed), optional `Procedure`

        resources (ICD-10-PCS codings), a minimal `Patient` (only `gender` is
        read),

        and optionally an `Encounter` (`hospitalization.dischargeDisposition`
        maps to

        discharge status).


        **Patient identifiers are dropped at the boundary** — names,
        identifiers,

        addresses and telecom are never read and never stored; the response
        attests

        this with `fhir_identifiers_dropped`. The submitted Bundle is not
        persisted.


        Returns a FHIR `Parameters` resource carrying the DRG code, description
        and

        grouper version. Malformed or unclassifiable input returns an

        `OperationOutcome` — never a partial result.
            
      operationId: v1_fhir_drg_classify_create
      responses:
        '200':
          description: FHIR Parameters with the DRG result
        '400':
          description: OperationOutcome — invalid or unclassifiable Bundle
        '401':
          description: Authentication required
        '429':
          description: Rate or monthly limit reached
      security:
        - api_key_auth: []
        - jwt_auth: []
components:
  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

````