# KodeMed — GetResults() Return Format ## Overview `GetResults()` returns the complete coding session result as XML or JSON. The format is extensible to support multiple tariff systems. ### Supported Tariff Systems | Tariff | Status | Grouper | Since | |--------|--------|---------|-------| | **SwissDRG** | Production | SwissDRG Grouper | v1.0 | | **TARPSY** | Production | TARPSY Grouper | v1.0 | | **ST Reha** | Production | ST Reha Grouper | v1.0 | | **SPLG** | Planned | SPLG Grouper | Q2 2026 | --- ## Response Structure ### Root: `CodingResults` | Field | Type | Description | |-------|------|-------------| | `sessionId` | string | Unique coding session ID | | `startTime` | DateTime | Processing start | | `endTime` | DateTime | Processing end | | `durationMs` | long | Duration in milliseconds | | `success` | bool | Processing succeeded | | `errorMessage` | string | Error message (if failed) | | `warnings` | string[] | Processing warnings | ### Session Action | Field | Type | Description | |-------|------|-------------| | `codingAction` | enum | `Pending(0)`, `Applied(1)`, `Discarded(2)`, `Cancelled(3)`, `Timeout(4)`, `Error(5)` | | `applied` | bool | User applied changes | | `discarded` | bool | User discarded changes | | `cancelled` | bool | Session cancelled | ### Data | Field | Type | Description | |-------|------|-------------| | `resultData` | string | Final SpiGes data (modified if Applied, original otherwise) | | `originalData` | string | Original data before coding | | `modifiedData` | string | Modified data (only if Applied) | | `sourceFormat` | string | Input format used | | `enterpriseId` | long | Enterprise ID (BUR) | | `spiGesVersion` | string | SpiGes version | ### Statistics | Field | Type | Description | |-------|------|-------------| | `casesProcessed` | int | Number of cases | | `diagnosesCount` | int | Total diagnoses | | `treatmentsCount` | int | Total treatments | | `sitesCount` | int | Number of sites | ### `cases[]` — Per-Case Summary | Field | Type | Description | |-------|------|-------------| | `fallId` | long | Case ID | | `siteId` | string | Site BUR number | | `diagnosesCount` | int | Diagnoses in this case | | `treatmentsCount` | int | Treatments in this case | | `hasPsychiatry` | bool | Has psychiatric data (TARPSY) | | `hasNewborn` | bool | Has newborn data | ### `codingResults[]` — Grouper Results Per Case | Field | Type | Description | |-------|------|-------------| | `fallId` | long | Case ID | | `tariff` | string | **`SWISSDRG`**, **`TARPSY`**, **`STREHA`**, *`SPLG`* (future) | | `drgCode` | string | DRG/PCG code assigned | | `drgDescription` | string | Code description | | `mainDiagnosis` | string | Main diagnosis (ICD) | | `secondaryDiagnoses` | string[] | Secondary diagnoses | | `procedures` | string[] | Procedures (CHOP) | | `mdc` | string | Major Diagnostic Category | | `partition` | string | Medical / Surgical partition | | `costWeight` | decimal | Cost weight | | `baseCostWeight` | decimal | Base cost weight (catalogue) | | `effectiveCostWeight` | decimal | Effective cost weight (after LOS adjustment) | | `pccl` | int | Patient Clinical Complexity Level (0-4) | | `los` | int | Length of stay (days) | | `ltp` | int | Low trim point | | `htp` | int | High trim point | | `alos` | decimal | Average length of stay | | `dayRate` | decimal | Day rate for outliers | | `transferDiscount` | bool | Transfer discount applied | | `grouperVersion` | string | Grouper version used | | `grouperStatus` | string | Grouper status code | | `groupingSuccess` | bool | Grouping succeeded | | `groupingError` | string | Error message if failed | | `groupedAt` | DateTime | Timestamp of grouping | | `supplements[]` | object[] | Additional payments (code, description, amount, count) | | `flags` | string[] | Grouper flags/warnings | --- ## Tariff-Specific Fields ### SwissDRG All fields above are used. `tariff = "SWISSDRG"`. DRG codes follow SwissDRG catalogue (e.g., `I68A`, `B70B`). ### TARPSY Psychiatric cases. `tariff = "TARPSY"`. Uses PCG codes (e.g., `TP21A`). `pccl` not applicable. `los` is critical for per-diem calculation. ### ST Reha Rehabilitation cases. `tariff = "STREHA"`. Uses RCG codes (e.g., `TR01A`). Per-diem based cost model. ### SPLG (Planned) Spitalplanungsleistungsgrouper. `tariff = "SPLG"`. Will extend `codingResults[]` with SPLG-specific fields: | Field | Type | Description | |-------|------|-------------| | `splgCode` | string | SPLG group code | | `splgVersion` | string | SPLG catalogue version | | `ambulatory` | bool | Ambulatory flag | | `baseRate` | decimal | SPLG base rate | | `minutesOR` | int | Operating room minutes | | `complexity` | string | Complexity class | > **Note:** SPLG fields are subject to change as the specification is finalized by SwissDRG AG. --- ## Example Response (JSON) ```json { "sessionId": "a1b2c3d4-e5f6-7890", "success": true, "codingAction": 1, "applied": true, "casesProcessed": 1, "diagnosesCount": 4, "treatmentsCount": 2, "resultData": "...", "codingResults": [ { "fallId": 12345, "tariff": "SWISSDRG", "drgCode": "I68A", "drgDescription": "Non-specific cerebrovascular disorder...", "mainDiagnosis": "I63.9", "costWeight": 1.245, "pccl": 2, "los": 7, "ltp": 2, "htp": 18, "grouperVersion": "13.0", "groupingSuccess": true, "supplements": [ { "code": "ZE-2026-01.01", "description": "Alteplase", "amount": 1250.00, "count": 1 } ] } ] } ``` --- ## Roadmap | Version | Feature | |---------|---------| | Current | SwissDRG, TARPSY, ST Reha grouper results | | Q2 2026 | SPLG Spitalplanungsleistungsgrouper (integration test ready) | | Q3 2026 | Multi-tariff per case (DRG + SPLG) | | 2027 | Real-time grouper suggestions during coding | --- *KodeMed GmbH — https://kodemed.com*