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

# Full knowledge resolution

> Resolve the complete L1-L6 knowledge stack for a facility and service in a single call

The `/v1/knowledge/resolve` endpoint chains all six knowledge layers to return a complete billing context — geographic adjustments, payment system, billing form, payer rules, service classification, and an expected payment estimate.

## Request

```bash theme={null}
curl -X POST https://api-dev.rcintell.com/v1/knowledge/resolve \
  -H "X-API-Key: $RCI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ccn": "170001",
    "cpt": "99213",
    "payer": "Medicare",
    "care_setting": "outpatient"
  }'
```

### Parameters

| Field              | Type      | Required | Description                                                                                                        |
| ------------------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `ccn`              | string    | Yes      | 6-digit Medicare Provider Number                                                                                   |
| `lines`            | object\[] | No       | Claim procedure lines (max 25). Same shape as `POST /v1/knowledge/payment-calc/claim`. Authoritative when present. |
| `dx`               | string\[] | No       | ICD-10-CM diagnosis codes (preferred)                                                                              |
| `cpt`              | string    | No       | Single CPT/HCPCS (legacy). Ignored when `lines` is sent. Enables L5/L6 for one code.                               |
| `dx_codes`         | string\[] | No       | Legacy DX alias. Ignored when `dx` is sent.                                                                        |
| `payer`            | string    | No       | Payer name — defaults to Medicare                                                                                  |
| `care_setting`     | string    | No       | `inpatient`, `outpatient`, `office`, `home_health`, `snf`                                                          |
| `place_of_service` | string    | No       | Claim-level POS default (e.g. `11`, `22`)                                                                          |
| `date_of_service`  | string    | No       | `YYYY-MM-DD` for NCCI versioning                                                                                   |

Locked claim-shaped example:

```bash theme={null}
curl -X POST https://api-dev.rcintell.com/v1/knowledge/resolve \
  -H "X-API-Key: $RCI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ccn": "170001",
    "payer": "Medicare",
    "dx": ["M17.11", "E11.9"],
    "lines": [
      {"code": "99213", "units": 1},
      {"code": "36415", "units": 1}
    ]
  }'
```

<Note>
  If you omit both `cpt` and `lines`, layers L5 (Service Group) and L6 (Service) are skipped. You still get L1 through L4 — useful when you need facility context without a specific procedure. `layers` and `payment_estimate` remain the first-line view for existing clients; `dx` / `lines` / `ncci_*` are the claim-shaped fields.
</Note>

## Response structure

```json theme={null}
{
  "ccn": "170001",
  "facility_name": "Sunflower Medical Center",
  "layers": [
    { "layer": "l1_location", "data": { "state": "KS", "gpci": { "pw_gpci": 1.0, "pe_gpci": 0.904, "mp_gpci": 0.504 } } },
    { "layer": "l2_facility_type", "data": { "payment_system": "IPPS / OPPS", "billing_form": "UB-04 (CMS-1450) / 837I" } },
    { "layer": "l3_care_setting", "data": { "care_setting": "outpatient" } },
    { "layer": "l4_payer", "data": { "payer_name": "Medicare" } },
    { "layer": "l5_service_group", "data": { "name": "Evaluation & Management" } },
    { "layer": "l6_service", "data": { "cpt": "99213" } }
  ],
  "payment_estimate": {
    "estimated_payment": 75.0,
    "methodology": "MPFS"
  },
  "dx": ["M17.11", "E11.9"],
  "lines": [
    {
      "line_id": "1",
      "code": "99213",
      "units": 1,
      "l5": { "layer": "l5_service_group" },
      "l6": { "layer": "l6_service", "cpt": "99213" },
      "coverage": null
    },
    {
      "line_id": "2",
      "code": "36415",
      "units": 1,
      "l5": { "layer": "l5_service_group" },
      "l6": { "layer": "l6_service", "cpt": "36415" },
      "coverage": null
    }
  ],
  "ncci_conflicts": [],
  "ncci_clean": true
}
```

### Response fields

| Field              | Description                                                                  |
| ------------------ | ---------------------------------------------------------------------------- |
| `layers`           | L1–L4 always; L5/L6 for the **first line** only (legacy clients)             |
| `payment_estimate` | Physician RVU estimate for the first line                                    |
| `facility_name`    | Facility name if registered in your tenant                                   |
| `dx`               | Normalized unique ICD-10-CM from `dx` (or legacy `dx_codes`)                 |
| `lines`            | Per-line `l5` / `l6` / LCD `coverage`. Empty when no `cpt`/`lines` were sent |
| `ncci_conflicts`   | PTP conflicts across unique codes on the claim                               |
| `ncci_clean`       | `true` when there are no PTP conflicts (or fewer than two codes)             |

Claim dollars (four-block MPFS/OPPS/CLFS/DME, packaging) stay on `POST /v1/knowledge/payment-calc/claim`. Resolve is knowledge, not payment composition.

## Partial resolution

The resolver adapts to whatever inputs you provide:

| Inputs provided                          | Layers returned                                              |
| ---------------------------------------- | ------------------------------------------------------------ |
| `ccn` only                               | L1, L2, L3 (inferred), L4 (Medicare default)                 |
| `ccn` + `payer`                          | L1, L2, L3, L4 (payer-specific)                              |
| `ccn` + `cpt`                            | L1–L6; `lines` has one row; `payment_estimate` for that code |
| `ccn` + `lines[]` + `dx[]`               | L1–L4 plus per-line L5/L6, LCD DX match, NCCI PTP            |
| `ccn` + `cpt` + `payer` + `care_setting` | All six layers, fully contextualized                         |

<Warning>
  The `ccn` field must be exactly 6 digits. Providing an invalid CCN returns a structured error with `is_valid: false` and `validation_errors` explaining what went wrong.
</Warning>

## Single-layer access

If you only need one layer, use the single-layer endpoint instead:

```bash theme={null}
curl https://api-dev.rcintell.com/v1/knowledge/layers/170001/l1 \
  -H "X-API-Key: $RCI_API_KEY"
```

Dependencies are resolved automatically — requesting L6 still runs L1 internally to get GPCI values.
