ICD-10 Module¶
Integrate the ICD-10 coding module into your primary system. The module provides AI-assisted ICD-10 code suggestions based on diagnosis text.
Protocol Flow¶
| Step | Direction | Message | Description |
|---|---|---|---|
| 1 | iframe → PIS | UNOMED_READY |
Iframe ready (same as Radiology) |
| 2 | PIS → iframe | UNOMED_AUTH |
Send OAuth2 token |
| 3 | iframe → PIS | UNOMED_AUTH_ACK |
Auth successful |
| 4 | PIS → iframe | ICD10_INIT |
Send diagnosis text |
| 5 | iframe → PIS | ICD10_CODES_SELECTED |
User confirmed one or more codes |
| 6 | iframe → PIS | close-popapp |
After user confirms selection |
Note: The authentication (Steps 1-3) follows the same flow as Radiology (see Launch PopApp). ICD-10 uses UNOMED_READY, not a separate ready message.
User Flow¶
- User sees AI-generated code suggestions in 3 layers (progressive refinement)
- User selects one or more codes by clicking on them (checkbox selection)
- User clicks "Zurücksenden" (Send back) button to confirm selection
ICD10_CODES_SELECTEDis sent to PISclose-popappis sent automatically after confirmation
This allows users to review and select multiple codes before confirming.
Token Handling¶
UNOMED_READY is always sent when the iframe loads - even if a user is already cached. The PIS can then decide whether to send a token.
Recommended: Send a fresh token with expires_in on every UNOMED_READY:
The expires_in value (in seconds) comes from the OAuth2 token response. The frontend uses this value for the local cache. Without expires_in, a fallback of 12 hours is used.
Message Formats¶
ICD10_INIT (PIS → iframe):
{
"type": "ICD10_INIT",
"diagnosis": "Akuter Myokardinfarkt",
"patientId": "optional-patient-uuid",
"encounterId": "optional-encounter-id"
}
ICD10_CODES_SELECTED (iframe → PIS) - one or more codes:
{
"type": "ICD10_CODES_SELECTED",
"codes": [
{ "code": "I21.0", "description": "Akuter transmuraler Myokardinfarkt der Vorderwand", "confidence": "high" },
{ "code": "I21.1", "description": "Akuter transmuraler Myokardinfarkt der Hinterwand", "confidence": "medium" }
]
}
URL Format¶
For development:
Implementation Example¶
const iframe = document.getElementById('unomed-icd10');
const UNOMED_ORIGIN = 'https://app.unomed.ch';
window.addEventListener('message', (event) => {
if (event.origin !== UNOMED_ORIGIN) return;
// Step 1: Iframe ready - send authentication
if (event.data.type === 'UNOMED_READY') {
iframe.contentWindow.postMessage({
type: 'UNOMED_AUTH',
version: 1,
token: 'YOUR_OAUTH2_ACCESS_TOKEN',
expires_in: 43200 // Optional: token expiry in seconds
}, UNOMED_ORIGIN);
}
// Step 3: Auth successful - send diagnosis
if (event.data.type === 'UNOMED_AUTH_ACK') {
iframe.contentWindow.postMessage({
type: 'ICD10_INIT',
diagnosis: 'Akuter Myokardinfarkt'
}, UNOMED_ORIGIN);
}
// Step 5: One or more codes confirmed
if (event.data.type === 'ICD10_CODES_SELECTED') {
console.log('Selected codes:', event.data.codes);
// Save all codes to your system...
}
// Step 6: Close iframe
if (event.data.type === 'close-popapp') {
iframe.style.display = 'none';
}
});
Confidence Levels¶
| Level | Description |
|---|---|
high |
High match with diagnosis |
medium |
Moderate match |
low |
Low match |