DRG Coder & Validator
The DRG products are being released. This page describes the contract they are built to; details may still change before release.
Najeeb DRG Coder & Validator assigns an AR-DRG (Australian Refined Diagnosis Related Group) to an inpatient episode from its diagnoses, procedures and patient details.
- Checks the provider's DRG against Najeeb's own and explains any difference.
- Recalculates after review, so you also see the DRG left once Najeeb's decisions are applied.
The DRG solution comes in three products that share the same objects, so you integrate once and reuse them everywhere:
| Product | What it does | How you call it |
|---|---|---|
| Stand-alone DRG Coder | Groups one episode on demand, and compares it with a provider DRG when you send one | POST /drg/group |
| Pre-auth DRG Coder | Calculates the DRGs of an inpatient prior authorization while it is processed and reviewed | drg_enabled: true on POST /approval-request/create |
| Claims Batch DRG Validator | Calculates the DRGs of every inpatient claim in a batch | drg_enabled: true on the batch upload |
The Four DRGs
A prior authorization or claim can carry up to four DRGs. Each answers a different question.
| DRG | Who sets it | What it is | Where you find it |
|---|---|---|---|
| Provider DRG | The provider (HCP) | The DRG the provider calculated and billed | provider_drg |
| Claimed DRG | Najeeb | The DRG of the whole request: every diagnosis and every procedure sent. Compared with the provider DRG. | drg.claimed |
| Approved DRG | Najeeb | The DRG of the diagnoses and only the approved procedures, after Najeeb's AI review and any later decision. Compared with the claimed DRG. | drg.approved |
| Settled DRG | The payer | The DRG and weight the payer and provider agree on after review | settled_drg |
Example:
- A provider bills F10B: a coronary stent, admitted for a heart attack.
- Najeeb's claimed DRG is also F10B, so the provider DRG matches.
- The AI rejects the stent, so the approved DRG is F60A, a medical DRG for the same admission without the procedure.
- After review, the payer records the settled DRG both sides agree on.
DRG Mode
DRG results can be for reference only, or can affect decisions. Najeeb sets this per account.
| Mode | DRGs calculated and returned | Effect on decisions |
|---|---|---|
SHADOW (default, shadow billing) | Yes | None. Results are for reference: they add issues and notes, never a rejection reason, and never change automation. |
PRODUCTION | Yes | An invalid provider DRG rejects every item with NPHIES reason AD-3-4 "Incorrect DRG calculated". See Invalid DRG and mismatch. |
Every DRG result carries the mode it was calculated under, so you always know whether it can affect a decision.
Invalid DRG and mismatch
| Case | What it means | SHADOW | PRODUCTION |
|---|---|---|---|
| Invalid DRG | The provider DRG cannot be a DRG: not in AR-DRG V9.0, an error DRG (960Z, 961Z, 963Z), a version other than 9, or malformed | PROVIDER_DRG_INVALID and DRG_REJECTION_SHADOW issues | PROVIDER_DRG_INVALID and DRG_REJECTION_APPLIED issues, and AD-3-4 on every item |
| DRG mismatch | A valid provider DRG that differs from Najeeb's claimed DRG | PROVIDER_DRG_* comparison issue | PROVIDER_DRG_* comparison issue. Never a rejection. |
An invalid provider DRG never rejects your request. It is stored as sent, and Najeeb still calculates its own DRGs.
Classification and Code Sets
| Item | Version |
|---|---|
| DRG classification | AR-DRG Version 9.0 (drg_version = 9) |
| Diagnosis codes | ICD-10-AM |
| Procedure codes | SBS V3 (Saudi Billing System), sent in items[].nphies_code |
Najeeb translates SBS V3 procedure codes to ACHI (10th Edition), the procedure classification AR-DRG is built on, before grouping. Results always report back the SBS codes you sent.
Access
DRG coding is a setting of your Najeeb account, switched on separately for each product. Contact Najeeb to enable it.
| Product | When DRG is not enabled for your account |
|---|---|
| Stand-alone DRG Coder | Requests are rejected with 403 (E_DRG_014) |
| Pre-auth DRG Coder | The prior authorization is processed as usual. When it was sent with drg_enabled: true, its drg results have status: ERROR with issue E_DRG_014 |
| Claims Batch DRG Validator | The batch is processed as usual. Its inpatient claims' drg results have status: ERROR with issue E_DRG_014 |
When DRG is enabled, the Pre-auth and Claims Batch products still calculate DRGs only for requests sent with drg_enabled: true.
How the DRG Is Assigned
- Major Diagnostic Category (MDC): the principal diagnosis places the episode in a body system, for example MDC
05, circulatory system. - Adjacent DRG (ADRG): procedures and the principal diagnosis select the base group, for example
F10(interventional coronary procedures). - DRG split: the episode's complexity score, built from the additional diagnoses, selects the final DRG within the base group, for example
F10A(major complexity) orF10B(minor complexity).
Why an episode can have no procedures
items can be empty. Many inpatient episodes are medical: the patient is treated without an operation or a procedure that affects grouping, for example pneumonia treated with antibiotics. These episodes are grouped on the diagnoses and the patient details alone, and receive a medical DRG. This is also why the approved DRG becomes a medical DRG when every procedure is rejected.
Common Objects
All DRG products use the objects below.
DRG Reference Object (provider_drg, settled_drg)
| Parameter | Type | Required | Description | Accepted Values |
|---|---|---|---|---|
drg_version | string | No | AR-DRG version of the code | 9 (default). Any other version makes a provider DRG invalid |
drg_code | string | Yes, when the object is sent | The DRG code | Up to 16 characters. A provider DRG is never rejected for its format: see Invalid DRG and mismatch. A settled DRG must be a valid AR-DRG V9.0 code (E_DRG_020 otherwise) |
drg_weight | number | No | Relative weight. Optional during shadow billing. Stored and returned, not checked. | 0–100, up to 4 decimals |
null for the object, or for any of its fields, is read exactly as not sent.
"provider_drg": {
"drg_version": "9",
"drg_code": "F10B",
"drg_weight": 1.2345
}
In responses, provider_drg also has:
source:REQUEST, orITEMwhen the DRG was found on a service linevalidity:VALIDorINVALID
settled_drg also has settled_at.
DRG Info Object (drg_info)
Grouping inputs that are not part of a standard encounter. Every field is optional, and null is read exactly as not sent.
| Parameter | Type | Required | Description | Accepted Values |
|---|---|---|---|---|
separation_mode | Enum | No | How the episode ended. No default | See Separation Mode |
leave_days | integer | No | Days of leave during the stay | 0 or more, less than the stay length. Default 0 |
length_of_stay | integer | No | Length of stay in days. See Length of stay | 1 or more |
same_day_flag | boolean | No | Admitted and separated on the same day. Derived from the dates when not sent | true, false |
admission_weight | integer | No | Weight on admission, in grams. Used only for patients under 1 year old | 100–9999 |
mechanical_ventilation_hours | integer | No | Hours of mechanical ventilation | 0 or more, not more than the stay in hours |
"drg_info": {
"separation_mode": "09",
"leave_days": 0,
"length_of_stay": 3,
"same_day_flag": false,
"admission_weight": null,
"mechanical_ventilation_hours": 0
}
admission_weight is null here because the patient is an adult; it is used only for patients under 1 year old.
drg_info.drg_version, drg_info.provider_drg_code and drg_info.provider_drg_weight, from an earlier version of this page, are still accepted as aliases of the provider_drg fields. When both are sent, provider_drg wins. Use provider_drg in new integrations.
Issue Object (issues)
Every error, warning and note is reported as an issue, in the same shape at every level: the prior authorization or claim, each item, and each DRG result.
| Field | Type | Always present | Description |
|---|---|---|---|
level | Enum | Yes | ERROR, WARNING or INFO. See Severity Levels |
code | string | Yes | Stable issue code. See Issue Codes |
message | string | Yes | Explanation |
field | string | No | The request field it is about, for example diagnoses[2].code, items[0].nphies_code, provider_drg.drg_code |
value | string or number | No | The value sent in that field |
DRG Result Object
One calculation of the grouper. drg.claimed and drg.approved hold one each, and the Stand-alone DRG Coder returns one.
| Field | Type | Description |
|---|---|---|
drg_request_id | number | Najeeb's ID for this calculation. Use it with Get DRG Result |
kind | Enum | CLAIMED, APPROVED or STANDALONE. See Kind |
is_current | boolean | true for the latest calculation of its kind. Always false for STANDALONE |
mode | Enum | SHADOW or PRODUCTION, at the time of calculation |
calculated_at | string | ISO-8601 DateTime |
trigger | Enum | What caused the calculation. See Trigger |
status | Enum | GROUPED, UNGROUPABLE or ERROR. See Status |
drg_version | string | AR-DRG version used |
drg_result | object | See DRG Result Fields. null when status is ERROR |
diagnoses | array | Each diagnosis with code, type, name (ICD-10-AM term), valid and used_for_grouping |
items | array | Each procedure grouped, with erp_item_id, nphies_code, achi_code, mapping_equivalence (1 exact, 2 SBS narrower, 4 inexact), valid and used_for_grouping |
issues | array | Issues of this calculation |
DRG Result Fields
| Field | Type | Description |
|---|---|---|
najeeb_drg_code | string | DRG assigned by Najeeb |
najeeb_drg_description | string | DRG long description, up to 80 characters |
najeeb_drg_weight | number | Always null for now: DRG weights are not loaded yet. Keep the field; it will be filled without a change to the API |
mdc_code | string | Major Diagnostic Category, "00"–"23". Always a string |
mdc_description | string | MDC description |
grouper_status | string | "00"–"09". See Grouper Status |
grouper_status_description | string | Grouper status description |
ungroupable | boolean | true when the episode grouped to an error DRG |
complexity | number | Episode Clinical Complexity Score, rounded to the nearest 0.5. Range 0–32 |
complexity_raw | number | The same score with 6 decimals |
provider_drg | object | The provider DRG at the time of calculation, or null |
settled_drg | object | The settled DRG at the time of calculation, or null |
compared_with | Enum | What this DRG was compared with: PROVIDER (claimed and stand-alone), CLAIMED (approved), or null when there was nothing to compare |
compared_drg_code | string | The DRG it was compared with |
matching | boolean | Whether the two DRGs are equal. null when compared_with is null |
matching_reason | Enum | Why they match or differ. See Matching Reason |
matching_split_reason | Enum | For DIFFERENT_ADRG and DIFFERENT_SPLIT: the kind of test that separates them. See Split Reason |
matching_test | string | The AR-DRG test they part on, in words, for example complexity score >= 4 |
matching_message | string | Najeeb's explanation of the difference |
values_used | object | Values the grouper used: age_years, age_days, length_of_stay, same_day_flag, admission_weight. age_days and admission_weight are null for patients 1 year old or older |