API Documentation
Eonum provides a RESTful HTTPS API access to the Casematch platform with JSON responses. Configuration of rules and user settings is done in the browser based front-end. Most API calls are private and hence clients ĥave to authorize themselves. If you have any questions or need help to integrate our platform into your system please send an email to info@eonum.ch.
To test the API on the command line using curl:
Choose a year / SwissDRG version
Via the URL path /:year (e.g. /2024), the API allows you to select the SwissDRG version by its application year to use for your requests. The available years/versions can be retrieved under: /versions.json.Choose your language
Most API calls provide the parameter locale which can be used to select a language.locale=[de|fr|it|en]
Provided languages:
de | German - fully supported, default and fallback language |
fr | French - fully supported |
it | Itailan - partially supported. no translations for interface texts and rules |
en | English - partially supported. no translations for ICD/CHOP/DRG catalogues and rules. |
Authentication
- Automatic expiration after some hours.
- Login invalidates old authentication token and creates a new one.
- Logout invalidates the authentication token.
- Password or user setting changes invalidate the old token and generate a new one.
Login
Method: POST
Login using user name and password. Retrieve an authentication token.
Parameters:
user_name | user name |
password | password as set in the web interface |
Sample login using curl:
Use the API with the authentication token
In order to authenticate yourself for API calls that require authentication you have to add the user authentication token as a query string parameter:Logout
Method: POST
Logout using the authentication token. The token is invalidated and can no longer be used:
Parameters:
user_token | user authentication token. |
Sample logout using curl:
The patient case URL format
Many API calls (all single patient case POST functions) provide the parameter pc which is a description of a patient case with all relevant information for the SwissDRG Grouper . Since 2018 the preferred format for patient cases is the new SwissDRG Batch / URL 2017 format as documented here: SwissDRG Batchgrouper Format 2017 . The URL 2017 format differs from the Batchgrouper 2017 format by the use of different (URL compatible) separators: '_' (underscore) instead of ';' (semicola) for top level column separators, '-' (hyphen) instead of '|' (pipe) for list item separators, '$' (dollar sign) instead of ':' (colon) for structure separators. The new 2017 format includes admission and exit dates and drugs (ATC) codes necessary for the calculation of supplements (Zusatzentgelte) and used as input in some of our prediction models. The same format (URL 2017) can be used when creating links to the WebGUI version of the Casematch platform. (Code proposals : /coding_proposals?locale=it , Case analysis : /patient_cases/analyzenew?locale=it ). ALL the characters used in the URL patient case format are allowed in an URI and do not have to be escaped. If the URL format is invalid and cannot be parsed an HTML status 400 with the following response is sent:
However the old format is still available. You can find further documentation on the old format and the used variables (still applicable to the new format) and their calculation in the SwissDRG Grouper documentation ( German , French , Italian )
The old / deprecated URL format is defined by the following state chart:
AI34221_65_0_0_M_01_00_1_0_I48.10_Z921_-_8954$$20141212_
XY9868098_23_0_0_W_01_00_1_0_A09.9_O091_-_
345897345_24_0_0_M_11_07_3_0_K85.11_-_
345897345_24_0_0_M_11_07_3_0_K85.11_J80_I490_-_889720$B_99B712$$20141215_0017_
Note:
The variables in detail:
- case_number - Chiave del caso
-
Beliebiger eindeutiger Schlüssel
Tipo di dato : string - age_years - Età in anni
-
BFS-medstat: "1.1.V03"
BFS Variable 1.1.V03
Spiges: "alter: Età all’ammissione"
Età in anni compiuti al momento dell’ammissione (data di ammissione-data di nascita)
Tipo di dato : number
Range: von 0.0 bis 135.0 - age_days - Età in giorni
-
BFS-medstat: "age_days"
Alter bei Eintritt berechnet aus den BFS Variablen 1.2.V01 und 1.1.V02.
Spiges: "alter_u1: Età in giorni dei bambini sotto 1 anno"
Età di ingresso in giorni. Da indicare per i bambini che hanno meno di un anno. Il giorno di ammissione non deve essere conteggiato (calcolo: giorno di ammissione - compleanno).
Questa informazione è obbligatoria per il raggruppamento dei dati SpiGes secondo SwissDRG, TARPSY, ST-Reha e GPPO. Tuttavia, è facoltativa per il caricamento sulla piattaforma SpiGes. Viene aggiunta automaticamente durante il download.
Tipo di dato : number
Range: von 0.0 bis 365.0 - adm_weight - Peso all'ammissione
-
BFS-medstat: "4.5.V01"
BFS Variable 2.2.V04 / 4.5.V01
Spiges: "aufnahmegewicht: Peso all’ammissione"
In grammi. Peso all’ammissione dei lattanti (bambini fino a 12 mesi!). In caso di nascita durante la degenza attuale, il peso alla nascita (variabile geburtsgewicht) deve corrispondere al peso all’ammissione inserito in questo campo.
Tipo di dato : number
Range: von 0.0 bis 99999.0 - sex - Sesso
-
BFS-medstat: "1.1.V01"
BFS Variable 1.1.V01 (1 -> M, 2 -> W)
Spiges: "geschlecht"
Sesso della persona. Per i cambiamenti di sesso indicare quello valido ai sensi del diritto civile al momento dell’ammissione.
Tipo di dato : string
Possible values: M W U - adm_mode - Genere di ammissione
-
BFS Variablen 1.2.V03 und 1.2.V02 (Umrechnung gemäss Grouperdokumentation SwissDRG)
Tipo di dato : string
Possible values: 01 11 06 99 - sep_mode - Genere di uscita
-
BFS Variable 1.5.V02 und 1.5.V03 (Umrechnung gemäss SwissDRG Grouperdokumentation)
Tipo di dato : string
Possible values: 07 06 04 00 99 - los - Durata della degenza in giorni
-
Berechnung anhand der BFS Variablen 1.5.V01, 1.2.V01 und 1.3.V04
Tipo di dato : number
Range: von 1.0 bis 99999.0 - hmv - Durata della respirazione assistita in ore
-
BFS-medstat: "4.4.V01"
BFS 4.4.V01
Spiges: "beatmung: Durata della ventilazione artificiale"
La durata in ore della ventilazione è calcolata per unità di cure intense in base alle regole del manuale di codifica in vigore. In questo campo non figurano informazioni sul tipo di ventilazione artificiale. Definizione secondo la Società svizzera di medicina intensiva (SSMI). I dati figurano nel set della SSMI.
Tipo di dato : number
Range: von 0.0 bis 99999.0 - main_diagnosis - Diagnosi principale
-
Tipo di dato : code - diagnoses - Diagnosi
-
Diagnosi principale e diagnosi secondarie
Tipo di dato : Array Of code - procedures - Procedure
-
BFS Variablen 4.3
Tipo di dato : Array Of code
Sending BFS data
All POST API calls providing the parameter
pc
alternatively support the retrieval of patient data using the more extensive format used by the BFS / OFS (Bundesamt für Statistik).
Using the more detailed BFS format allows for more detailed and extended checks in the rule based analysis.
The format is documented here:
German
or
French and Italian.
BFS data is sent using the following parameters. All parameters represent one line (delimited with '|') in a BFS formatted export:
mb | MB minimal data set. Required. |
md | MD data set. Diagnoses and procedures. Optional. |
mn | MN data set. Newborns. Optional |
mp | MP data set. Psychiatric cases. Optional |
mf | MF data set. Case costs. Optional |
API call 'statistical_analyses' - Statistical analysis of a coding of a patient case
Creates a statistical analysis of a coding of a patient case and responds with a JSON representation of the result. The result of the analysis is not persisted on the server.URL: api/v1/statistical_analyses
Method: POST
Example call:
The API call 'analyze' provides the core functionality of Casematch for the analysis of single patient cases. The provided patient case is grouped and analyzed with the statistical model and the user defined rules.
Parameters:
locale | language (optional), See here |
pc | patient case in the URL format. See here |
mb, [md, mn, mp, mf] | patient case in the BFS format. See here |
user_token | user authentication token. See here |
Pretty printed sample response:
The second component are the 'grouper_results'. All grouper outputs are stored here:
- drg - DRG
-
Tipo di dato : code - mdc - MDC
-
MDC - Major Diagnostic Category
Tipo di dato : string - pccl - PCCL
-
PCCL - Patient Complexity and Comorbidity Level
Tipo di dato : number
Range: von 0.0 bis 4.0 - ecw - Cost-weight effettivo
-
Tipo di dato : number
Range: von 0.0 bis 99999.0 - partition - partizione
-
DRG Partition (M -> Medizinisch, A -> Andere, O -> Operativ)
Tipo di dato : string
Possible values: M O A - case_flag - Cost weight flag
-
Tipo di dato : string
Possible values: 01 02 03 04 05
- stat_drg - DRG statistico
-
Tipo di dato : code - rank - Similarity index
-
Similarity index: Rank of the grouped DRG in the calculated model. A rank of 1 means that the grouped DRG is also statistically the most likely DRG. Statistical and grouped DRG match.
Tipo di dato : number
Range: von -1.0 bis 1000.0 - top_ranks - Similar DRGs
-
List of the five most similar DRGs according to the statistical model.
Tipo di dato : Array Of string - likelihood -
-
Similarity of this case to the grouped DRG: This measure is calculated as an assignment probability in the statistical model. All values are in the interval [0,1] and all similarity measures of all possible DRGs for one case add up to 1.
Tipo di dato : number
Range: von 0.0 bis 1.0 - model_train_number -
-
Tipo di dato : number
Range: von 0.0 bis
API call 'rule_based_analysis' - Rule based analysis of a coding of a patient case
Creates a rule based analysis of a coding of a patient case and responds with a JSON representation of the result. The analysis result is not persisted on the server.URL: api/v1/rule_based_analyses
Method: POST
Example call:
The resource 'rules_analysis' provides a list of all rules that apply to the provided coding. Rules can also be based on the statistical analysis of the patient case. Hence a combined analysis (rule-based and statistical) based only on this resource can be made. The configuration of all rules is done in the web front end and is not a part of the API. Each rule has an associated unique name, a color, a category name, a level (info, warning, error) and a description. The description may contain HTML markup (currently only links).
Parameters:
locale | language (optional), See here |
pc | patient case in the URL format. See here |
mb, [md, mn, mp, mf] | patient case in the BFS format. See here |
user_token | user authentication token. See here |
Pretty printed sample response:
API call 'coding_proposals' - Propose codes for a patient case
Creates coding proposals for a coding of a patient case and responds with a JSON representation of the resource. The resource is not persisted on the server.URL: api/v1/coding_proposals
Method: POST
Example call:
Login required.
The API call 'propose' generates a list of related diagnoses and procedures based on the context of the provided coding (parameter 'pc').
Parameters:
Pretty printed sample response:
API call 'predictions' - Predict length of stay and scenarios for a patient case
Predicts the length of stay and scenarios for a patient case in the context of a precoding and responds with a JSON representation of the resource. October 2019: Currently the scenarios / simulations is just a mockup. Integration with the ML backend is planned for Winter 2019/2020. The resource is not persisted on the server.URL: api/v1/predictions
Method: POST
Example call:
Login required.
The API call 'predictions' generates predictions based on the context of the provided patient case (parameter 'pc').
Parameters:
Pretty printed sample response: