> ## 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.

# Patch Professional Claim

> Applies non-destructive partial updates to an existing professional claim using RFC 6902 Add, Remove, and Replace operations. Shared resources (Patient, Facility, and Provider records) are not modified in-place; to modify those resources directly, use the Patient endpoints or edit them in CAIR directly.

Applies partial, non-destructive updates to an existing professional claim using standard **RFC 6902 JSON Patch** operations (`add`, `remove`, `replace`).

Use this endpoint when you want to update specific fields on an existing claim—such as adding a service line, updating a diagnosis code, changing a place of service code, or appending a secondary insurance policy—without providing or overwriting the entire claim payload.

***

### Key Principles

1. **Non-Destructive & Modular**: Any field or array not mentioned in your patch operations remains unchanged. Only the sections targeted by your patch operations are validated and updated on the claim.
2. **Standard RFC 6902 Operations**: You can perform `add`, `remove`, and `replace` operations using standard JSON Pointers.
3. **Array Precision**: You can append to arrays (e.g. `/cpt_codes_cms1500s/-`), update a specific index (e.g. `/cpt_codes_cms1500s/0/fee`), or remove an individual line (e.g. `/cpt_codes_cms1500s/1`).
4. **Target Matching**: The target claim is matched by `id` (your Patient Control Number). If no matching claim is found, the endpoint returns a **404 Not Found**.
5. **Shared Resources Are Not Mutated In-Place**: Patching `patient`, `service_location` (facility), or provider (`billing_provider`, `rendering_provider`, `ordering_provider`, `referring_provider`) fields on a claim resolves and links the claim to the matching resource (or creates a new one if no match exists), rather than overwriting the existing Patient, Facility, or Provider record. To modify an existing **Patient**, **Facility**, or **Provider** resource itself, use the **Patient endpoints** (`PUT /api/patient/{id}`) or **edit them in CAIR directly**.

***

### Query Parameters

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `attachmentId` | `string` | No | Optional ID of document references to associate with the claim. Can be specified multiple times. |

***

### Request Body Structure

```json theme={null}
{
  "id": "CLAIM-2026-001",
  "operations": [
    {
      "op": "replace",
      "path": "/total_charge",
      "value": "275.00"
    },
    {
      "op": "add",
      "path": "/cpt_codes_cms1500s/-",
      "value": {
        "cpt_code": { "code": "85025" },
        "fee": "75.00",
        "units": "1"
      }
    }
  ]
}
```

#### Body Fields

| Field | Type | Required | Description |
| :- | :- | :- | :- |
| `id` | `string` | **Yes** | The unique claim identifier / Patient Control Number of the claim to update. |
| `operations` | `array` | **Yes** | An array of RFC 6902 patch operations (`op: "add" \| "remove" \| "replace"`, `path: string`, `value?: any`). |

***

### JSON Path Reference & Examples for Each Data Element

Every field from the professional claim schema can be targeted via JSON Pointers. Below are example paths and operations for each data element:

#### 1. Claim Core & Billing Amounts

| Data Element | Example Path | Example Operation |
| :- | :- | :- |
| **Date of Service** | `/date_of_service` | `{"op": "replace", "path": "/date_of_service", "value": "2026-04-01"}` |
| **Total Charge** | `/total_charge` | `{"op": "replace", "path": "/total_charge", "value": "350.00"}` |
| **Accept Assignment** | `/accept_assignment` | `{"op": "replace", "path": "/accept_assignment", "value": true}` |
| **Patient Paid Amount** | `/patient_paid_amount` | `{"op": "replace", "path": "/patient_paid_amount", "value": 50.00}` |
| **CLIA Number** | `/clia_number` | `{"op": "add", "path": "/clia_number", "value": "12D3456789"}` `{"op": "remove", "path": "/clia_number"}` |

#### 2. Service Lines (CPT / HCPCS Codes)

| Data Element | Example Path | Example Operation |
| :- | :- | :- |
| **Append Service Line** | `/cpt_codes_cms1500s/-` | `{"op": "add", "path": "/cpt_codes_cms1500s/-", "value": {"cpt_code": {"code": "99214"}, "fee": "200.00", "units": "1"}}` |
| **Update Service Fee** | `/cpt_codes_cms1500s/0/fee` | `{"op": "replace", "path": "/cpt_codes_cms1500s/0/fee", "value": "175.00"}` |
| **Update Units** | `/cpt_codes_cms1500s/0/units` | `{"op": "replace", "path": "/cpt_codes_cms1500s/0/units", "value": "2"}` |
| **Add Modifier 1** | `/cpt_codes_cms1500s/0/mod1` | `{"op": "add", "path": "/cpt_codes_cms1500s/0/mod1", "value": "25"}` |
| **Remove Modifier** | `/cpt_codes_cms1500s/0/mod2` | `{"op": "remove", "path": "/cpt_codes_cms1500s/0/mod2"}` |
| **Add NDC Drug Info** | `/cpt_codes_cms1500s/0/ndc_information` | `{"op": "add", "path": "/cpt_codes_cms1500s/0/ndc_information", "value": {"ndc_code": "00000000001", "ndc_quantity": "2", "ndc_quantity_unit": "ML"}}` |
| **Remove Service Line** | `/cpt_codes_cms1500s/1` | `{"op": "remove", "path": "/cpt_codes_cms1500s/1"}` |
| **Replace Entire Array** | `/cpt_codes_cms1500s` | `{"op": "replace", "path": "/cpt_codes_cms1500s", "value": [...]}` |

#### 3. Diagnosis Codes (ICD-10)

| Data Element | Example Path | Example Operation |
| :- | :- | :- |
| **Append Diagnosis** | `/icd_codes_cms1500s/-` | `{"op": "add", "path": "/icd_codes_cms1500s/-", "value": {"icd_code": {"code": "M54.5"}}}` |
| **Update Primary Diagnosis** | `/icd_codes_cms1500s/0/icd_code/code` | `{"op": "replace", "path": "/icd_codes_cms1500s/0/icd_code/code", "value": "M54.2"}` |
| **Remove Secondary Diagnosis** | `/icd_codes_cms1500s/1` | `{"op": "remove", "path": "/icd_codes_cms1500s/1"}` |

#### 4. Patient Information & Insurance Policies

> **Important:** The Claim PATCH endpoint does **not** modify an existing Patient resource's demographics, contact details, or address in-place (patching `/patient` resolves/links the claim to a matching patient record). If you want to update a patient's demographics, phone number, email, or address, use the **Patient endpoints** (`PUT /api/patient/{id}`) or **edit the patient in CAIR directly**.

| Data Element | Example Path | Example Operation |
| :- | :- | :- |
| **Re-link Claim to Patient ID** | `/patient/id` | `{"op": "replace", "path": "/patient/id", "value": "PAT-1002"}` |
| **Append Policy (Secondary)** | `/patient/policies/-` | `{"op": "add", "path": "/patient/policies/-", "value": {"id": "SEC999", "priority_type": "secondary", "insurance_plan": {"payer_name": "Aetna", "payer_id": "60054"}}}` |
| **Update Member ID on Policy** | `/patient/policies/0/num` | `{"op": "replace", "path": "/patient/policies/0/num", "value": "W123456789"}` |
| **Update Prior Authorization** | `/patient/policies/0/prior_authorization` | `{"op": "add", "path": "/patient/policies/0/prior_authorization", "value": "AUTH98765"}` |
| **Remove a Policy** | `/patient/policies/1` | `{"op": "remove", "path": "/patient/policies/1"}` |

#### 5. Providers & Service Location

> **Important:** The Claim PATCH endpoint does **not** modify existing Provider or Facility (`Location`) records in-place. Patching provider NPIs or facility identifiers re-links the claim's care team or facility reference to the matching resource (or creates a new Practitioner/Location when no match exists), while claim-level fields like `taxonomy_code` and `place_of_service` are updated on the claim itself. To modify an existing Provider or Facility resource's name or address, **edit the resource in CAIR directly**.

| Data Element | Example Path | Example Operation |
| :- | :- | :- |
| **Billing Taxonomy Code** | `/billing_provider/taxonomy_code` | `{"op": "replace", "path": "/billing_provider/taxonomy_code", "value": "207Q00000X"}` |
| **Rendering Provider NPI** | `/rendering_provider/npi` | `{"op": "replace", "path": "/rendering_provider/npi", "value": "1112223334"}` |
| **Add Referring Provider** | `/referring_provider` | `{"op": "add", "path": "/referring_provider", "value": {"npi": "1234567890", "first_name": "John", "last_name": "Doe"}}` |
| **Remove Referring Provider** | `/referring_provider` | `{"op": "remove", "path": "/referring_provider"}` |
| **Add Ordering Provider** | `/ordering_provider` | `{"op": "add", "path": "/ordering_provider", "value": {"npi": "0987654321", "taxonomy_code": "207R00000X"}}` |
| **Place of Service Code** | `/service_location/place_of_service/code` | `{"op": "replace", "path": "/service_location/place_of_service/code", "value": "11"}` |

#### 6. Condition Codes & Additional Notes

| Data Element | Example Path | Example Operation |
| :- | :- | :- |
| **Add Condition Code** | `/claim_condition_codes/-` | `{"op": "add", "path": "/claim_condition_codes/-", "value": {"code": "01"}}` |
| **Add Additional Information** | `/claim_additional_information/-` | `{"op": "add", "path": "/claim_additional_information/-", "value": {"code": "ADD", "text": "Medical necessity documentation attached"}}` |
| **Injury Cause (Auto Accident)** | `/injury_cause_reasons` | `{"op": "replace", "path": "/injury_cause_reasons", "value": {"employment_related": false, "auto_accident": true, "other": false, "state": "CA", "accident_date": "2026-03-10"}}` |

***

### Complete Example

```json theme={null}
PATCH /api/claim/professional/v1
{
  "id": "CLAIM-2026-001",
  "operations": [
    {
      "op": "replace",
      "path": "/total_charge",
      "value": "225.00"
    },
    {
      "op": "replace",
      "path": "/cpt_codes_cms1500s/0/fee",
      "value": "150.00"
    },
    {
      "op": "add",
      "path": "/cpt_codes_cms1500s/-",
      "value": {
        "cpt_code": { "code": "85025" },
        "fee": "75.00",
        "units": "1"
      }
    },
    {
      "op": "add",
      "path": "/clia_number",
      "value": "12D3456789"
    }
  ]
}
```

### Response

```json theme={null}
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "information",
      "code": "informational",
      "details": {
        "text": "All OK"
      }
    }
  ]
}
```


## OpenAPI

````yaml PATCH /api/claim/professional/v1
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/claim/professional/v1:
    patch:
      summary: Patch an existing professional claim using JSON Patch
      description: >-
        Applies non-destructive partial updates to an existing professional
        claim using RFC 6902 Add, Remove, and Replace operations. Shared
        resources (Patient, Facility, and Provider records) are not modified
        in-place; to modify those resources directly, use the Patient endpoints
        or edit them in CAIR directly.
      parameters:
        - name: attachmentId
          in: query
          description: >-
            Optional ID of document references to associate with the claim. Can
            be specified multiple times.
          required: false
          schema:
            type: string
      requestBody:
        description: RFC 6902 JSON Patch request for professional claim
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: >-
                    Unique identifier / Patient Control Number of the claim to
                    update
                operations:
                  type: array
                  description: Array of JSON Patch operations
                  items:
                    type: object
                    properties:
                      op:
                        type: string
                        enum:
                          - add
                          - remove
                          - replace
                        description: The patch operation to perform
                      path:
                        type: string
                        description: >-
                          JSON Pointer path to target field (e.g. /total_charge,
                          /cpt_codes_cms1500s/-)
                      value:
                        description: Value to add or replace
                    required:
                      - op
                      - path
              required:
                - id
                - operations
      responses:
        '200':
          $ref: 9b335bc7-6a60-477b-b455-0219ac958f08
        '400':
          $ref: 9c844766-80f2-4222-9946-a34af0107364
        '401':
          $ref: fe2cf6b0-e52f-4ea4-b54a-0e4af7fa185f
        '404':
          $ref: 563ec006-d654-4665-9afd-d9fbd775bbfa
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.