{"openapi":"3.1.0","info":{"title":"KodeMed Server API","description":"Clinical Case Processing Server - WebSocket management and configuration API.","contact":{"name":"Mieres IT Support","email":"support@kodemed.ch"},"license":{"name":"Proprietary","url":"https://kodemed.ch/license"},"version":"2026.5.15.59502"},"servers":[{"url":"https://demo-server.kodemed.ch","description":"KodeMed Server"}],"security":[{"openIdConnectAuth":[]}],"tags":[{"name":"Coding Sessions","description":"API for managing coding sessions"},{"name":"Configuration","description":"Server Configuration API"},{"name":"Instances","description":"DLL Instance Management API"},{"name":"Audit","description":"Audit trail API for tracking changes"},{"name":"Undo History","description":"API for managing undo history per case"}],"paths":{"/api/v1/layouts/{layoutId}":{"get":{"tags":["layout-controller"],"operationId":"getLayout","parameters":[{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SharedLayoutResponse"}}}}}},"put":{"tags":["layout-controller"],"operationId":"updateLayout","parameters":[{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLayoutRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SharedLayoutResponse"}}}}}},"delete":{"tags":["layout-controller"],"operationId":"deleteLayout","parameters":[{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/api/v1/layouts/sync":{"get":{"tags":["layout-controller"],"operationId":"getSyncedLayouts","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SavedLayout"}}}}}}},"put":{"tags":["layout-controller"],"operationId":"syncLayouts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncLayoutsRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SyncResponse"}}}}}}},"/api/v1/admin/settings/feedback":{"get":{"tags":["admin-feedback-settings-controller"],"operationId":"get","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Projection"}}}}}},"put":{"tags":["admin-feedback-settings-controller"],"operationId":"update","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Update"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/layouts":{"post":{"tags":["layout-controller"],"operationId":"createLayout","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLayoutRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ShareLayoutResponse"}}}}}}},"/api/v1/layouts/{layoutId}/regenerate-code":{"post":{"tags":["layout-controller"],"operationId":"regenerateShareCode","parameters":[{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ShareLayoutResponse"}}}}}}},"/api/v1/layouts/{layoutId}/import":{"post":{"tags":["layout-controller"],"operationId":"recordImport","parameters":[{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/api/v1/instances/{instanceId}/message":{"post":{"tags":["Instances"],"summary":"Send message to specific instance","operationId":"sendMessage","parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSocketMessage"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/api/v1/instances/broadcast":{"post":{"tags":["Instances"],"summary":"Broadcast message to all connected instances","operationId":"broadcastMessage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSocketMessage"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/api/v1/feedback":{"post":{"tags":["feedback-controller"],"operationId":"submit","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session":{"post":{"tags":["Coding Sessions"],"summary":"Create coding session","description":"Creates a new coding session with clinical data. HIS REST integrations send source=API and format=spiges; DLL/UI callers may omit those fields for backward compatibility.","operationId":"createSession","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodingSessionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CodingSessionResponse"}}}}},"callbacks":{"sessionComplete":{"{$server-config:webhookUrl}":{}}}}},"/api/v1/coding/session/{sessionId}/save":{"post":{"tags":["Coding Sessions"],"summary":"Save progress","description":"Save current progress without completing the session","operationId":"saveProgress","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session/{sessionId}/complete":{"post":{"tags":["Coding Sessions"],"summary":"Complete session","description":"Completes a coding session with the result data","operationId":"completeSession","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session/{sessionId}/change":{"post":{"tags":["Coding Sessions"],"summary":"Record change","description":"Record a case change for audit trail","operationId":"recordChange","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session/{sessionId}/case/{caseId}/undo":{"get":{"tags":["Undo History"],"summary":"Get case undo history","description":"Gets the undo history for a specific case","operationId":"getCaseHistory","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CaseHistoryResponse"}}}}}},"post":{"tags":["Undo History"],"summary":"Undo last action","description":"Undoes the last action for a case","operationId":"undoLastAction","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UndoResponse"}}}}}},"delete":{"tags":["Undo History"],"summary":"Clear case undo history","description":"Clears all undo history for a case","operationId":"clearCaseHistory","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session/{sessionId}/case/{caseId}/undo/{actionId}":{"post":{"tags":["Undo History"],"summary":"Undo specific action","description":"Undoes a specific action by its ID","operationId":"undoById","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"actionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UndoResponse"}}}}}}},"/api/v1/coding/session/{sessionId}/case/{caseId}/undo/record":{"post":{"tags":["Undo History"],"summary":"Record undo action","description":"Records a new action in the undo history for a case","operationId":"recordAction","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session/{sessionId}/cancel":{"post":{"tags":["Coding Sessions"],"summary":"Cancel session","description":"Cancels a coding session","operationId":"cancelSession","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/admin/webhook-failures/{id}/replay":{"post":{"tags":["admin-webhook-failure-controller"],"operationId":"replay","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/admin/settings/feedback/test":{"post":{"tags":["admin-feedback-settings-controller"],"operationId":"test","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/api/v1/admin/integration-profiles":{"get":{"tags":["admin-integration-profile-controller"],"operationId":"list","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Response"}}}}}}},"post":{"tags":["admin-integration-profile-controller"],"operationId":"create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/admin/integration-profiles/{slug}/test-webhook":{"post":{"tags":["admin-integration-profile-controller"],"operationId":"testWebhook","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestWebhookResponse"}}}}}}},"/api/v1/admin/integration-profiles/{slug}":{"get":{"tags":["admin-integration-profile-controller"],"operationId":"get_1","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}},"delete":{"tags":["admin-integration-profile-controller"],"operationId":"delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}},"patch":{"tags":["admin-integration-profile-controller"],"operationId":"patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/license/status":{"get":{"tags":["license-controller"],"operationId":"status","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/api/v1/layouts/public":{"get":{"tags":["layout-controller"],"operationId":"getPublicLayouts","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LayoutListResponse"}}}}}}},"/api/v1/layouts/my-shared":{"get":{"tags":["layout-controller"],"operationId":"getMySharedLayouts","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SharedLayoutResponse"}}}}}}}},"/api/v1/layouts/code/{shareCode}":{"get":{"tags":["layout-controller"],"operationId":"getLayoutByCode","parameters":[{"name":"shareCode","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SharedLayoutResponse"}}}}}}},"/api/v1/integration/csp":{"get":{"tags":["integration-csp-controller"],"operationId":"get_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CspResponse"}}}}}}},"/api/v1/instances":{"get":{"tags":["Instances"],"summary":"Get all connected instances","description":"Returns list of all registered DLL instances","operationId":"getAllInstances","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InstanceInfoDto"}}}}}}}},"/api/v1/instances/{instanceId}":{"get":{"tags":["Instances"],"summary":"Get instance by ID","operationId":"getInstance","parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InstanceInfoDto"}}}}}}},"/api/v1/instances/count":{"get":{"tags":["Instances"],"summary":"Get connected instance count","operationId":"getConnectedCount","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"integer","format":"int32"}}}}}}},"/api/v1/config":{"get":{"tags":["Configuration"],"summary":"Get server configuration for DLL clients","description":"Returns complete server configuration including URLs for all services. DLL clients can use this to discover DataServer URL and other settings when they only have the main server URL configured.","operationId":"getConfig","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ServerConfigDto"}}}}}}},"/api/v1/coding/sessions":{"get":{"tags":["Coding Sessions"],"summary":"Get recent sessions","description":"Gets coding sessions from the last N days (default 7)","operationId":"getRecentSessions","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":7}},{"name":"completedOnly","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/sessions/{sessionId}/status":{"get":{"tags":["Coding Sessions"],"summary":"Get session status","description":"Gets the online/offline status of a session","operationId":"getSessionStatus","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/sessions/{sessionId}/data":{"get":{"tags":["Coding Sessions"],"summary":"Get historical session data","description":"Gets the data from a specific historical session (read-only)","operationId":"getHistoricalSessionData","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/xml":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}}}}},"/api/v1/coding/session/{sessionId}":{"get":{"tags":["Coding Sessions"],"summary":"Get session info","description":"Gets session metadata without the full clinical data","operationId":"getSession","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session/{sessionId}/result":{"get":{"tags":["Coding Sessions"],"summary":"Get session result","description":"Gets the result metadata after session completion","operationId":"getSessionResult","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/session/{sessionId}/result/data":{"get":{"tags":["Coding Sessions"],"summary":"Get session result data","description":"Gets the raw result data after session completion","operationId":"getSessionResultData","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/xml":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}}}}},"/api/v1/coding/session/{sessionId}/data":{"get":{"tags":["Coding Sessions"],"summary":"Get session data","description":"Gets the raw clinical data for a session","operationId":"getSessionData","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/xml":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}}}}},"/api/v1/coding/session/{sessionId}/case/{caseId}/undo/count":{"get":{"tags":["Undo History"],"summary":"Get undo count","description":"Gets the number of undoable actions for a case","operationId":"getUndoCount","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/last-session":{"get":{"tags":["Coding Sessions"],"summary":"Get last session","description":"Gets the last completed coding session for the current user (read-only)","operationId":"getLastSession","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/last-session/data":{"get":{"tags":["Coding Sessions"],"summary":"Get last session data","description":"Gets the data from the last completed session (read-only)","operationId":"getLastSessionData","responses":{"200":{"description":"OK","content":{"application/xml":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}}}}},"/api/v1/coding/history":{"get":{"tags":["Coding Sessions"],"summary":"Get session history","description":"Gets the coding session history for the current user","operationId":"getSessionHistory","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/health":{"get":{"tags":["Coding Sessions"],"summary":"Health check","description":"Check coding service health","operationId":"health","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/api/v1/coding/clients":{"get":{"tags":["Coding Sessions"],"summary":"List connected clients","description":"Lists connected CodingClient instances with user info and status","operationId":"getConnectedClients","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/coding/active":{"get":{"tags":["Coding Sessions"],"summary":"Check active session","description":"Checks if the user has any active coding session","operationId":"checkActiveSession","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/audit/status":{"get":{"tags":["Audit"],"summary":"Get audit status","description":"Check if audit trail is enabled","operationId":"getAuditStatus","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/api/v1/audit/session/{sessionId}":{"get":{"tags":["Audit"],"summary":"Get session audit trail","description":"Retrieve all changes made during a coding session","operationId":"getSessionAuditTrail","parameters":[{"name":"sessionId","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Session not found or audit disabled","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CaseChangeEntity"}}}}},"200":{"description":"Audit trail retrieved","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CaseChangeEntity"}}}}}}}},"/api/v1/audit/case/{caseId}":{"get":{"tags":["Audit"],"summary":"Get case audit trail","description":"Retrieve all changes made to a specific case across all sessions","operationId":"getCaseAuditTrail","parameters":[{"name":"caseId","in":"path","description":"Case ID (fall_id)","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Case not found or audit disabled","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CaseChangeEntity"}}}}},"200":{"description":"Audit trail retrieved","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CaseChangeEntity"}}}}}}}},"/api/v1/admin/webhook-failures":{"get":{"tags":["admin-webhook-failure-controller"],"operationId":"list_1","parameters":[{"name":"profileSlug","in":"query","required":false,"schema":{"type":"string"}},{"name":"outstanding","in":"query","required":false,"schema":{"type":"boolean","default":false}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":50}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageResponseFailureResponse"}}}}}}},"/api/v1/admin/webhook-failures/{id}":{"get":{"tags":["admin-webhook-failure-controller"],"operationId":"get_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}},"delete":{"tags":["admin-webhook-failure-controller"],"operationId":"delete_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"CreateLayoutRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"layout":{"type":"array","items":{"$ref":"#/components/schemas/LayoutItem"}},"isPublic":{"type":"boolean"}}},"LayoutItem":{"type":"object","properties":{"i":{"type":"string"},"x":{"type":"integer","format":"int32"},"y":{"type":"integer","format":"int32"},"w":{"type":"integer","format":"int32"},"h":{"type":"integer","format":"int32"},"minW":{"type":"integer","format":"int32"},"minH":{"type":"integer","format":"int32"},"maxW":{"type":"integer","format":"int32"},"maxH":{"type":"integer","format":"int32"},"isStatic":{"type":"boolean"}}},"SharedLayoutResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"layout":{"type":"array","items":{"$ref":"#/components/schemas/LayoutItem"}},"ownerId":{"type":"string"},"ownerName":{"type":"string"},"isPublic":{"type":"boolean"},"shareCode":{"type":"string"},"importCount":{"type":"integer","format":"int32"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"SavedLayout":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"layout":{"type":"array","items":{"$ref":"#/components/schemas/LayoutItem"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceId":{"type":"string"},"sourceOwnerId":{"type":"string"},"sourceOwnerName":{"type":"string"},"isImported":{"type":"boolean"}}},"SyncLayoutsRequest":{"type":"object","properties":{"layouts":{"type":"array","items":{"$ref":"#/components/schemas/SavedLayout"}}}},"SyncResponse":{"type":"object","properties":{"syncedCount":{"type":"integer","format":"int32"}}},"GitBucketUpdate":{"type":"object","properties":{"baseUrl":{"type":"string"},"repo":{"type":"string"},"milestoneTitle":{"type":"string"},"user":{"type":"string"},"password":{"type":"string"},"label":{"type":"string"}}},"SmtpUpdate":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"string"},"user":{"type":"string"},"password":{"type":"string"},"auth":{"type":"string"},"starttls":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"subjectPrefix":{"type":"string"}}},"Update":{"type":"object","properties":{"gitbucket":{"$ref":"#/components/schemas/GitBucketUpdate"},"smtp":{"$ref":"#/components/schemas/SmtpUpdate"}}},"ShareLayoutResponse":{"type":"object","properties":{"id":{"type":"string"},"shareCode":{"type":"string"},"shareUrl":{"type":"string"},"isPublic":{"type":"boolean"}}},"WebSocketMessage":{"type":"object","properties":{"type":{"type":"string"},"instanceId":{"type":"string"},"sessionId":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"integer","format":"int64"},"correlationId":{"type":"string"},"payload":{"type":"object","additionalProperties":{"type":"object"}},"error":{"type":"string"},"errorCode":{"type":"integer","format":"int32"}}},"FeedbackRequest":{"type":"object","properties":{"description":{"type":"string","maxLength":5000,"minLength":0},"currentUrl":{"type":"string"},"noPhiConfirmed":{"type":"boolean"}},"required":["description"]},"CodingSessionRequest":{"type":"object","description":"Create a coding session. Required fields differ by source: HIS REST integrations (source=API) must additionally set format=\"spiges\"; DLL / UI callers may omit format and source for backward compatibility.","properties":{"data":{"type":"string","description":"Case data, e.g. SPIGES XML. One or more <Fall> elements.","maxLength":5242880,"minLength":0},"format":{"type":"string","description":"Wire format of `data`. Required for HIS REST (source=API); today the only supported value is \"spiges\". Optional for DLL/UI callers (they implicitly use spiges).","example":"spiges","maxLength":50,"minLength":0},"instanceId":{"type":"string","description":"HIS-side correlator for the submitted `data` payload. ONE value per POST, regardless of how many SPIGES `<Fall>` cases ride inside `data` — they all belong to the same coding session and share this id. **MUST be unique across the HIS's active sessions**: a second POST with an instanceId still in use returns 409 Conflict with the existing sessionId in the response body. The id becomes free again once the original session completes / is cancelled / expires. Echoed back in the webhook as `instance_id` so the HIS can match the result against its original submission.","maxLength":100,"minLength":0},"dataHash":{"type":"string","maxLength":128,"minLength":0},"source":{"type":"string","description":"Channel that initiated the session. HIS REST integrations send \"API\". DLL/UI callers may omit (defaults to DLL).","enum":["API","DLL","BROWSER"],"example":"API","maxLength":20,"minLength":0},"targetUserId":{"type":"string","maxLength":100,"minLength":0},"forceClose":{"type":"boolean"}},"required":["data","instanceId"]},"CodingSessionResponse":{"type":"object","properties":{"sessionId":{"type":"string","description":"KodeMed-minted session UUID v4. Echoed in the webhook as `session_id`."},"redirectUrl":{"type":"string","description":"URL the HIS embeds in an iframe. The CSP allows the configured frame-ancestors per IntegrationProfile."},"status":{"type":"string"},"dataHash":{"type":"string"},"source":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","description":"Session expiry timestamp (ISO-8601). Null if no explicit expiry is set yet.","example":"2026-05-08T22:00:00Z"},"hasConflict":{"type":"boolean"},"conflictSessionId":{"type":"string"},"conflictInstanceId":{"type":"string"},"conflictCreatedAt":{"type":"string"},"conflictExpiresInMinutes":{"type":"integer","format":"int32"},"conflictMessage":{"type":"string"},"targetUserNotified":{"type":"boolean"},"existing":{"type":"boolean"}}},"UndoResponse":{"type":"object","properties":{"success":{"type":"boolean"},"actionId":{"type":"string"},"caseId":{"type":"string"},"actionType":{"type":"string"},"itemType":{"type":"string"},"itemId":{"type":"string"},"code":{"type":"string"},"itemData":{"type":"object"},"previousValue":{"type":"object"},"error":{"type":"string"}}},"RecordRequest":{"type":"object","properties":{"caseId":{"type":"string"},"actionType":{"type":"string"},"itemType":{"type":"string"},"itemId":{"type":"string"},"code":{"type":"string"},"catalog":{"type":"string"},"description":{"type":"string"},"itemData":{"type":"object"},"previousValue":{"type":"object"}}},"TestRequest":{"type":"object","properties":{"channel":{"type":"string"},"gitbucket":{"$ref":"#/components/schemas/GitBucketUpdate"},"smtp":{"$ref":"#/components/schemas/SmtpUpdate"}}},"CreateRequest":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"oidc":{"$ref":"#/components/schemas/OidcRequest"},"webhook":{"$ref":"#/components/schemas/WebhookRequest"},"embed":{"$ref":"#/components/schemas/EmbedRequest"},"spiges":{"$ref":"#/components/schemas/SpigesRequest"},"sla":{"$ref":"#/components/schemas/SlaRequest"}},"required":["displayName","enabled","oidc","slug"]},"EmbedRequest":{"type":"object","properties":{"cspFrameAncestors":{"type":"array","items":{"type":"string"}},"cookieSameSite":{"type":"string"}}},"OidcRequest":{"type":"object","properties":{"issuerUri":{"type":"string"},"audience":{"type":"string"},"userClaimPath":{"type":"string"},"rolesPrimaryClaimPath":{"type":"string"},"rolesFallbackClaimPath":{"type":"string"},"jwkSetUri":{"type":"string"}},"required":["issuerUri"]},"SlaRequest":{"type":"object","properties":{"expected":{"type":"string"}}},"SpigesRequest":{"type":"object","properties":{"version":{"type":"string"},"defaultEntId":{"type":"string"},"defaultBurnr":{"type":"string"}}},"WebhookRequest":{"type":"object","properties":{"url":{"type":"string"},"signing":{"type":"string","enum":["NONE","HMAC_SHA256"]},"secret":{"type":"string"},"retryMax":{"type":"integer","format":"int32"},"retryDelaysSeconds":{"type":"array","items":{"type":"integer","format":"int32"}},"eventTypes":{"type":"array","items":{"type":"string"}}}},"TestWebhookResponse":{"type":"object","properties":{"delivered":{"type":"boolean"},"httpStatus":{"type":"integer","format":"int32"},"durationMs":{"type":"integer","format":"int64"},"error":{"type":"string"}}},"EmbedPatch":{"type":"object","properties":{"cspFrameAncestors":{"type":"array","items":{"type":"string"}},"cookieSameSite":{"type":"string"}}},"OidcPatch":{"type":"object","properties":{"issuerUri":{"type":"string"},"audience":{"type":"string"},"userClaimPath":{"type":"string"},"rolesPrimaryClaimPath":{"type":"string"},"rolesFallbackClaimPath":{"type":"string"},"jwkSetUri":{"type":"string"}}},"PatchRequest":{"type":"object","properties":{"displayName":{"type":"string"},"enabled":{"type":"boolean"},"oidc":{"$ref":"#/components/schemas/OidcPatch"},"webhook":{"$ref":"#/components/schemas/WebhookPatch"},"embed":{"$ref":"#/components/schemas/EmbedPatch"},"spiges":{"$ref":"#/components/schemas/SpigesPatch"},"sla":{"$ref":"#/components/schemas/SlaPatch"}}},"SlaPatch":{"type":"object","properties":{"expected":{"type":"string"}}},"SpigesPatch":{"type":"object","properties":{"version":{"type":"string"},"defaultEntId":{"type":"string"},"defaultBurnr":{"type":"string"}}},"WebhookPatch":{"type":"object","properties":{"url":{"type":"string"},"signing":{"type":"string","enum":["NONE","HMAC_SHA256"]},"secret":{"type":"string"},"retryMax":{"type":"integer","format":"int32"},"retryDelaysSeconds":{"type":"array","items":{"type":"integer","format":"int32"}},"eventTypes":{"type":"array","items":{"type":"string"}}}},"LayoutListResponse":{"type":"object","properties":{"layouts":{"type":"array","items":{"$ref":"#/components/schemas/SharedLayoutResponse"}},"total":{"type":"integer","format":"int32"},"page":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalPages":{"type":"integer","format":"int32"}}},"CspResponse":{"type":"object","properties":{"frameAncestors":{"type":"array","items":{"type":"string"}},"cspDirective":{"type":"string"}}},"InstanceInfoDto":{"type":"object","properties":{"instanceId":{"type":"string"},"status":{"type":"string"},"connectedAt":{"type":"string"},"lastActivity":{"type":"string"},"disconnectedAt":{"type":"string"},"reconnectAttempts":{"type":"integer","format":"int32"},"clientVersion":{"type":"string"}}},"ServerConfigDto":{"type":"object","properties":{"serverVersion":{"type":"string"},"serverUrl":{"type":"string"},"dataServerUrl":{"type":"string"},"grouperServerUrl":{"type":"string"},"webSocketUrl":{"type":"string"},"codingUIUrl":{"type":"string"},"oauth2Url":{"type":"string"},"oauth2Realm":{"type":"string"},"oauth2ClientId":{"type":"string"},"disconnectTimeoutMinutes":{"type":"integer","format":"int32"},"heartbeatIntervalSeconds":{"type":"integer","format":"int32"},"reconnectIntervalSeconds":{"type":"integer","format":"int32"},"sessionExpiryMinutes":{"type":"integer","format":"int32"},"offlineTimeoutMinutes":{"type":"integer","format":"int32"},"persistenceEnabled":{"type":"boolean"},"auditEnabled":{"type":"boolean"},"retentionDays":{"type":"integer","format":"int32"},"hookEnabled":{"type":"boolean"},"hookUrl":{"type":"string"},"hookAuthType":{"type":"string"},"hookTimeoutSeconds":{"type":"integer","format":"int32"},"hookRetryCount":{"type":"integer","format":"int32"},"hookIncludeResultData":{"type":"boolean"},"hookIncludeOriginalData":{"type":"boolean"},"hookIncludeGrouperResults":{"type":"boolean"},"hookEvents":{"type":"string"}}},"CaseHistoryResponse":{"type":"object","properties":{"caseId":{"type":"string"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/UndoAction"}},"count":{"type":"integer","format":"int32"},"canUndo":{"type":"boolean"}}},"UndoAction":{"type":"object","properties":{"id":{"type":"string"},"caseId":{"type":"string"},"actionType":{"type":"string"},"itemType":{"type":"string"},"itemId":{"type":"string"},"code":{"type":"string"},"catalog":{"type":"string"},"description":{"type":"string"},"itemData":{"type":"object"},"previousValue":{"type":"object"},"timestamp":{"type":"string","format":"date-time"}}},"CaseChangeEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sessionId":{"type":"string"},"caseId":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"changeType":{"type":"string","enum":["DIAGNOSIS_ADDED","DIAGNOSIS_REMOVED","DIAGNOSIS_MODIFIED","DIAGNOSIS_REORDERED","PROCEDURE_ADDED","PROCEDURE_REMOVED","PROCEDURE_MODIFIED","PROCEDURE_REORDERED","MEDICATION_ADDED","MEDICATION_REMOVED","MEDICATION_MODIFIED","ADMIN_MODIFIED","CASE_CREATED","CASE_DELETED","OTHER"]},"fieldName":{"type":"string"},"codeValue":{"type":"string"},"oldValue":{"type":"string"},"newValue":{"type":"string"},"details":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"clientIp":{"type":"string"}}},"FailureResponse":{"type":"object","properties":{"id":{"type":"string"},"profileSlug":{"type":"string"},"sessionId":{"type":"string"},"instanceId":{"type":"string"},"eventType":{"type":"string"},"attempts":{"type":"integer","format":"int32"},"lastHttpStatus":{"type":"integer","format":"int32"},"lastError":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"replayedAt":{"type":"string","format":"date-time"},"lastReplaySucceeded":{"type":"boolean"}}},"PageResponseFailureResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FailureResponse"}},"page":{"type":"integer","format":"int32"},"size":{"type":"integer","format":"int32"},"totalItems":{"type":"integer","format":"int64"}}},"GitBucket":{"type":"object","properties":{"baseUrl":{"type":"string"},"repo":{"type":"string"},"milestoneTitle":{"type":"string"},"user":{"type":"string"},"passwordSet":{"type":"boolean"},"label":{"type":"string"}}},"Projection":{"type":"object","properties":{"gitbucket":{"$ref":"#/components/schemas/GitBucket"},"smtp":{"$ref":"#/components/schemas/Smtp"}}},"Smtp":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"string"},"user":{"type":"string"},"passwordSet":{"type":"boolean"},"auth":{"type":"string"},"starttls":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"subjectPrefix":{"type":"string"}}},"EmbedResponse":{"type":"object","properties":{"cspFrameAncestors":{"type":"array","items":{"type":"string"}},"cookieSameSite":{"type":"string"}}},"OidcResponse":{"type":"object","properties":{"issuerUri":{"type":"string"},"audience":{"type":"string"},"userClaimPath":{"type":"string"},"rolesPrimaryClaimPath":{"type":"string"},"rolesFallbackClaimPath":{"type":"string"},"jwkSetUri":{"type":"string"}}},"Response":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"oidc":{"$ref":"#/components/schemas/OidcResponse"},"webhook":{"$ref":"#/components/schemas/WebhookResponse"},"embed":{"$ref":"#/components/schemas/EmbedResponse"},"spiges":{"$ref":"#/components/schemas/SpigesResponse"},"sla":{"$ref":"#/components/schemas/SlaResponse"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"SlaResponse":{"type":"object","properties":{"expected":{"type":"string"}}},"SpigesResponse":{"type":"object","properties":{"version":{"type":"string"},"defaultEntId":{"type":"string"},"defaultBurnr":{"type":"string"}}},"WebhookResponse":{"type":"object","properties":{"url":{"type":"string"},"signing":{"type":"string","enum":["NONE","HMAC_SHA256"]},"signingConfigured":{"type":"boolean"},"retryMax":{"type":"integer","format":"int32"},"retryDelaysSeconds":{"type":"array","items":{"type":"integer","format":"int32"}},"eventTypes":{"type":"array","items":{"type":"string"}}}}},"securitySchemes":{"openIdConnectAuth":{"type":"openIdConnect","description":"OpenID Connect authentication","openIdConnectUrl":"https://sso.kodemed.ch/realms/kodemed/.well-known/openid-configuration"}}}}