{"openapi":"3.1.0","info":{"title":"LOSPOR API","version":"8.4.0","description":"Complete V1 contract for LOSPOR web, native mobile, PWA, administrators, and integrations."},"servers":[{"url":"https://api.lospor.org","description":"LOSPOR reference deployment"},{"url":"http://localhost:3002","description":"Local development or self-hosted node"}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"paths":{"/health/live":{"get":{"operationId":"get_health_live","summary":"Check whether the API process is alive","tags":["health"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/health/ready":{"get":{"operationId":"get_health_ready","summary":"Check API and database readiness","tags":["health"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/capabilities":{"get":{"operationId":"get_v1_capabilities","summary":"Read API synchronization capabilities","tags":["capabilities"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capabilities"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/institutions":{"get":{"operationId":"get_v1_institutions","summary":"List selectable institutions","tags":["institutions"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Institution"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/check-pending":{"get":{"operationId":"get_v1_auth_check_pending","summary":"Check whether the signed-in account is pending","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/session":{"get":{"operationId":"get_v1_auth_session","summary":"Read the current browser session","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_auth_session","summary":"Create a browser session","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"delete_v1_auth_session","summary":"End the current browser session","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/logout":{"post":{"operationId":"post_v1_auth_logout","summary":"Revoke the current bearer or browser session","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/token":{"post":{"operationId":"post_v1_auth_token","summary":"Create a mobile bearer token","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/register":{"post":{"operationId":"post_v1_auth_register","summary":"Register an account","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/verify-email":{"get":{"operationId":"get_v1_auth_verify_email","summary":"Verify an email address","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/verify-email/resend":{"post":{"operationId":"post_v1_auth_verify_email_resend","summary":"Resend email verification","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/password-reset/request":{"post":{"operationId":"post_v1_auth_password_reset_request","summary":"Request a password reset","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/auth/password-reset/confirm":{"post":{"operationId":"post_v1_auth_password_reset_confirm","summary":"Set a new password","tags":["auth"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetConfirmRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases":{"get":{"operationId":"get_v1_cases","summary":"List accessible cases","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"take","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseListResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_cases","summary":"Create an idempotent clinical case draft","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"x-idempotency-key","in":"header","required":false,"schema":{"type":"string"},"description":"Stable client draft identity"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseCreateRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseMutationResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/demo":{"get":{"operationId":"get_v1_cases_demo","summary":"Create or read the demonstration case","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}":{"get":{"operationId":"get_v1_cases_id","summary":"Read a case","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"patch_v1_cases_id","summary":"Save one or more case sections","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-lospor-preop-revision","in":"header","required":false,"schema":{"type":"integer","minimum":0},"description":"Last acknowledged section revision"},{"name":"x-lospor-intraop-revision","in":"header","required":false,"schema":{"type":"integer","minimum":0},"description":"Last acknowledged section revision"},{"name":"x-lospor-postop-revision","in":"header","required":false,"schema":{"type":"integer","minimum":0},"description":"Last acknowledged section revision"},{"name":"x-lospor-force-update","in":"header","required":false,"schema":{"type":"boolean"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePatchRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"delete_v1_cases_id","summary":"Delete a case","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/version":{"get":{"operationId":"get_v1_cases_id_version","summary":"Read current section revisions","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseVersion"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/calculations":{"get":{"operationId":"get_v1_cases_id_calculations","summary":"List accepted pediatric calculations","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PediatricCalculation"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_cases_id_calculations","summary":"Recompute and accept a pediatric calculation","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PediatricCalculationRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PediatricCalculation"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/finalize":{"post":{"operationId":"post_v1_cases_id_finalize","summary":"Finalize a case and create its immutable snapshot","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/unfinalize":{"post":{"operationId":"post_v1_cases_id_unfinalize","summary":"Resume editing a finalized case","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/lock":{"post":{"operationId":"post_v1_cases_id_lock","summary":"Acquire a case editing lease","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LockRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LockResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"patch_v1_cases_id_lock","summary":"Refresh or reclaim a case editing lease","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LockRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LockResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"delete_v1_cases_id_lock","summary":"Release or force-release a case editing lease","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LockReleaseRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/events":{"post":{"operationId":"post_v1_cases_id_events","summary":"Append an idempotent intraoperative event","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-lospor-intraop-revision","in":"header","required":false,"schema":{"type":"integer"}},{"name":"x-lospor-source","in":"header","required":false,"schema":{"type":"string","enum":["web","mobile","ai","import"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventMutationResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"operationId":"put_v1_cases_id_events","summary":"Replace and reconcile the complete event log","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-lospor-intraop-revision","in":"header","required":false,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventMutationResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/events/{eventId}":{"put":{"operationId":"put_v1_cases_id_events_eventId","summary":"Update an intraoperative event","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-lospor-intraop-revision","in":"header","required":false,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventMutationResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"delete_v1_cases_id_events_eventId","summary":"Delete an intraoperative event","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-lospor-intraop-revision","in":"header","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventMutationResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/transfer":{"post":{"operationId":"post_v1_cases_id_transfer","summary":"Offer a case transfer","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transfer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"patch_v1_cases_id_transfer","summary":"Accept or decline a case transfer","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferDecisionRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transfer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/transfers/pending":{"get":{"operationId":"get_v1_cases_transfers_pending","summary":"List pending case transfers","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Transfer"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/users/colleagues":{"get":{"operationId":"get_v1_users_colleagues","summary":"List colleagues eligible for transfer","tags":["users"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/ai/advise":{"post":{"operationId":"post_v1_cases_id_ai_advise","summary":"Generate case-specific AI advice","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ai/advise":{"post":{"operationId":"post_v1_ai_advise","summary":"Generate AI advice from supplied structured data","tags":["ai"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ai/read-labs":{"post":{"operationId":"post_v1_ai_read_labs","summary":"Extract laboratory values from an uploaded image","tags":["ai"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JsonObject"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/vitals-scan":{"post":{"operationId":"post_v1_cases_id_vitals_scan","summary":"Extract preoperative vitals from an image","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/print-token":{"post":{"operationId":"post_v1_cases_id_print_token","summary":"Create a short-lived print token","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/print-data":{"get":{"operationId":"get_v1_cases_id_print_data","summary":"Read printable case data","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"print_token","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cases/{id}/pdf":{"get":{"operationId":"get_v1_cases_id_pdf","summary":"Download a case PDF","tags":["cases"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"print_token","in":"query","required":false,"schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["en","bg"]}}],"responses":{"200":{"description":"PDF document","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/search/icd10":{"get":{"operationId":"get_v1_search_icd10","summary":"Search ICD-10 diagnoses","tags":["search"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"locale","in":"query","required":false,"schema":{"type":"string","enum":["en","bg"],"default":"en"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/search/procedures":{"get":{"operationId":"get_v1_search_procedures","summary":"Search procedure terminology","tags":["search"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/search/drugs":{"get":{"operationId":"get_v1_search_drugs","summary":"Search medication terminology","tags":["search"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/library/{category}":{"get":{"operationId":"get_v1_library_category","summary":"Read an option-library category","tags":["library"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"category","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LibraryOption"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/clinical/pediatric/rules":{"get":{"operationId":"get_v1_clinical_pediatric_rules","summary":"Read pediatric capabilities, reviewed rules, and unavailable calculators","tags":["clinical"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/clinical/rules/runtime":{"get":{"operationId":"get_v1_clinical_rules_runtime","summary":"Read the effective mode-specific personal, institution, or platform ruleset","tags":["clinical"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["ADULT","PEDIATRIC"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/clinical/rules/workbench":{"get":{"operationId":"get_v1_clinical_rules_workbench","summary":"Read mode-specific rulesets in the caller's active management scope","tags":["clinical"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["ADULT","PEDIATRIC"]}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["PLATFORM","INSTITUTION","USER"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_clinical_rules_workbench","summary":"Copy, edit, publish, select, or clear a clinical ruleset","tags":["clinical"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/user":{"get":{"operationId":"get_v1_user","summary":"Read the current account","tags":["user"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"patch_v1_user","summary":"Update account and clinical preferences","tags":["user"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/user/accept-terms":{"patch":{"operationId":"patch_v1_user_accept_terms","summary":"Accept the current terms","tags":["user"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/user/delete":{"post":{"operationId":"post_v1_user_delete","summary":"Soft-delete the current account","tags":["user"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/user/export":{"get":{"operationId":"get_v1_user_export","summary":"Download the complete personal data archive","tags":["user"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"ZIP archive","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/locale":{"post":{"operationId":"post_v1_locale","summary":"Set the browser locale","tags":["locale"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","enum":["en","bg"]}},"required":["locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/custom-terms":{"get":{"operationId":"get_v1_custom_terms","summary":"Search institution custom terms","tags":["custom-terms"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JsonObject"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_custom_terms","summary":"Create an institution custom term","tags":["custom-terms"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"term":{"type":"string"},"termType":{"type":"string"}},"required":["term","termType"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/user/institution-request":{"get":{"operationId":"get_v1_user_institution_request","summary":"Read the current institution-change request","tags":["user"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstitutionChangeRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_user_institution_request","summary":"Request a move to another institution","tags":["user"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"institutionId":{"type":"string"}},"required":["institutionId"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstitutionChangeRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/role-request":{"get":{"operationId":"get_v1_role_request","summary":"Read the current role-elevation request","tags":["role-request"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_role_request","summary":"Request department-head access","tags":["role-request"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/export/dictionary":{"get":{"operationId":"get_v1_export_dictionary","summary":"Download the LOSPOR data dictionary","tags":["export"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/export/omop":{"get":{"operationId":"get_v1_export_omop","summary":"Download an OMOP CDM export","tags":["export"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"caseId","in":"query","required":false,"schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","csv"],"default":"json"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Complete OMOP JSON or CSV export","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportLimitError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/metadata":{"get":{"operationId":"get_v1_research_metadata","summary":"Read research capabilities, action scopes, and permissions","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchMetadata"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/query":{"post":{"operationId":"post_v1_research_query","summary":"Run an aggregate-only structured research cohort query","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchQueryRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchQueryResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/cases/query":{"post":{"operationId":"post_v1_research_cases_query","summary":"List pseudonymous case rows inside the case-inspection scope","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchQueryRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchCaseQueryResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/compare":{"post":{"operationId":"post_v1_research_compare","summary":"Compare two research cohorts with disclosure control","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchComparisonRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchComparisonResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/benchmarks":{"post":{"operationId":"post_v1_research_benchmarks","summary":"Calculate disclosure-controlled cohort trends and benchmarks","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchBenchmarkRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchBenchmarkResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/quality":{"get":{"operationId":"get_v1_research_quality","summary":"Read disclosure-controlled research data-quality indicators","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchQualityResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/cases/{id}":{"get":{"operationId":"get_v1_research_cases_id","summary":"Read a safe pseudonymous research case","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchCaseDetail"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/cohorts":{"get":{"operationId":"get_v1_research_cohorts","summary":"List visible saved research cohorts","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SavedResearchCohort"}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_research_cohorts","summary":"Save a research cohort","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedResearchCohortRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedResearchCohort"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/cohorts/{id}":{"get":{"operationId":"get_v1_research_cohorts_id","summary":"Read a saved research cohort","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedResearchCohort"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"patch_v1_research_cohorts_id","summary":"Update an owned saved research cohort","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedResearchCohortPatch"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedResearchCohort"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"delete_v1_research_cohorts_id","summary":"Delete an owned saved research cohort","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/exports":{"get":{"operationId":"get_v1_research_exports","summary":"List immutable research export history","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResearchExportRecord"}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_research_exports","summary":"Queue an immutable finalized-case research export","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchExportRequest"}}}},"responses":{"202":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchExportRecord"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/exports/{id}":{"get":{"operationId":"get_v1_research_exports_id","summary":"Read immutable research export status","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchExportRecord"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/exports/{id}/download":{"get":{"operationId":"get_v1_research_exports_id_download","summary":"Stream a completed immutable research export artifact","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Research export file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"headers":{"Content-Disposition":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer","minimum":0}},"X-LOSPOR-Export-Complete":{"schema":{"type":"boolean"}},"X-LOSPOR-Export-Rows":{"schema":{"type":"integer","minimum":0}},"X-LOSPOR-Export-As-Of":{"schema":{"type":"string","format":"date-time"}},"X-LOSPOR-Export-Snapshot-SHA256":{"schema":{"type":"string"}},"X-LOSPOR-Export-SHA256":{"schema":{"type":"string"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/grants":{"get":{"operationId":"get_v1_research_grants","summary":"List research access grants","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResearchGrant"}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_research_grants","summary":"Create a research access grant","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchGrantRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchGrant"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/grants/{id}":{"patch":{"operationId":"patch_v1_research_grants_id","summary":"Update a research access grant","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchGrantPatch"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchGrant"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"delete_v1_research_grants_id","summary":"Revoke a research access grant","tags":["research"],"x-lospor-explicit-contract":true,"x-lospor-stability":"stable","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/clinical-rules":{"get":{"operationId":"get_v1_admin_clinical_rules","summary":"Compatibility alias for the clinical-rules workbench","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"post_v1_admin_clinical_rules","summary":"Compatibility alias for clinical-rules workbench actions","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/users":{"get":{"operationId":"get_v1_admin_users","summary":"List users for administration","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","parameters":[{"name":"pending","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/users/{id}":{"patch":{"operationId":"patch_v1_admin_users_id","summary":"Update a user role or institution","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"delete_v1_admin_users_id","summary":"Delete a user account","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/users/{id}/approve":{"post":{"operationId":"post_v1_admin_users_id_approve","summary":"Approve a registered user","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/institution-requests":{"get":{"operationId":"get_v1_admin_institution_requests","summary":"List pending institution-change requests","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InstitutionChangeRequest"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/institution-requests/{id}":{"post":{"operationId":"post_v1_admin_institution_requests_id","summary":"Approve or reject an institution change","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["APPROVE","REJECT"]}},"required":["decision"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstitutionChangeRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/role-requests":{"get":{"operationId":"get_v1_admin_role_requests","summary":"List role-elevation requests","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleRequest"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/role-requests/{id}":{"patch":{"operationId":"patch_v1_admin_role_requests_id","summary":"Approve or reject a role request","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["approve","reject"]}},"required":["action"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/audit-logs":{"get":{"operationId":"get_v1_admin_audit_logs","summary":"List paged audit history","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"admin","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"action","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditLog"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/repair-relational":{"post":{"operationId":"post_v1_admin_repair_relational","summary":"Repair relational projections in batches","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"maintenance","parameters":[{"name":"caseId","in":"query","required":false,"schema":{"type":"string"}},{"name":"batch","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/admin/maintenance/seed-option-library":{"post":{"operationId":"post_v1_admin_maintenance_seed_option_library","summary":"Synchronize the canonical option catalog","tags":["admin"],"x-lospor-explicit-contract":true,"x-lospor-stability":"maintenance","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonObject"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Revision, ownership, or uniqueness conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request is valid but cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"schemas":{"ApiError":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"requestId":{"type":"string","format":"uuid"},"details":{}},"required":["error"],"additionalProperties":false},"Message":{"type":"object","properties":{"message":{"type":"string"},"ok":{"type":"boolean"}},"additionalProperties":false},"IdResponse":{"type":"object","properties":{"id":{"type":"string"},"caseCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"revision":{"type":"integer","minimum":0}},"required":["id"],"additionalProperties":false},"Pagination":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"skip":{"type":"integer","minimum":0},"take":{"type":"integer","minimum":1}},"required":["total","skip","take"],"additionalProperties":false},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"title":{"type":"string"},"role":{"type":"string"},"institutionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"preferences":{"type":"object","additionalProperties":true}},"required":["id","email","name","role"],"additionalProperties":false},"Institution":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"}},"required":["id","name","city","country"],"additionalProperties":false},"LoginRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":1}},"required":["email","password"],"additionalProperties":false},"RegisterRequest":{"type":"object","properties":{"title":{"type":"string"},"firstName":{"type":"string","minLength":1},"lastName":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"institutionId":{"type":"string"},"acceptedTerms":{"type":"boolean","const":true},"password":{"type":"string","minLength":12}},"required":["firstName","lastName","email","acceptedTerms","password"],"additionalProperties":false},"EmailRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"}},"required":["email"],"additionalProperties":false},"PasswordResetConfirmRequest":{"type":"object","properties":{"token":{"type":"string","minLength":1},"password":{"type":"string","minLength":12}},"required":["token","password"],"additionalProperties":false},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"integer","minimum":1}},"required":["access_token","token_type","expires_in"],"additionalProperties":false},"SessionResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"expires":{"type":"string","format":"date-time"}},"additionalProperties":false},"CaseSection":{"type":"object","additionalProperties":true},"PreopCaseSection":{"type":"object","properties":{"ageValue":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"ageUnit":{"anyOf":[{"type":"string","enum":["DAYS","MONTHS","YEARS"]},{"type":"null"}]}},"additionalProperties":true},"CaseCreateRequest":{"type":"object","properties":{"clinicalMode":{"type":"string","enum":["ADULT","PEDIATRIC"],"default":"ADULT"},"clinicalRulesVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"preop":{"$ref":"#/components/schemas/PreopCaseSection"},"intraop":{"$ref":"#/components/schemas/CaseSection"},"postop":{"$ref":"#/components/schemas/CaseSection"}},"required":["preop"],"additionalProperties":false},"CasePatchRequest":{"type":"object","properties":{"status":{"type":"string","enum":["DRAFT","IN_PROGRESS","AWAITING_REVIEW"]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"clinicalMode":{"type":"string","enum":["ADULT","PEDIATRIC"]},"clinicalRulesVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"preop":{"$ref":"#/components/schemas/PreopCaseSection"},"intraop":{"$ref":"#/components/schemas/CaseSection"},"postop":{"$ref":"#/components/schemas/CaseSection"},"forceUpdate":{"type":"boolean"}},"additionalProperties":false},"CaseSummary":{"type":"object","properties":{"id":{"type":"string"},"caseCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"clinicalMode":{"type":"string","enum":["ADULT","PEDIATRIC"]},"clinicalRulesVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","IN_PROGRESS","AWAITING_REVIEW","COMPLETE"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"preop":{"anyOf":[{"$ref":"#/components/schemas/PreopCaseSection"},{"type":"null"}]},"intraop":{"anyOf":[{"$ref":"#/components/schemas/CaseSection"},{"type":"null"}]},"postop":{"anyOf":[{"$ref":"#/components/schemas/CaseSection"},{"type":"null"}]}},"required":["id","status","createdAt","updatedAt"],"additionalProperties":false},"CaseDetail":{"allOf":[{"$ref":"#/components/schemas/CaseSummary"},{"type":"object","properties":{"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"institution":{"anyOf":[{"$ref":"#/components/schemas/Institution"},{"type":"null"}]},"user":{"$ref":"#/components/schemas/User"}},"additionalProperties":true}]},"CaseListResponse":{"type":"object","properties":{"cases":{"type":"array","items":{"$ref":"#/components/schemas/CaseSummary"}},"total":{"type":"integer","minimum":0},"skip":{"type":"integer","minimum":0},"take":{"type":"integer","minimum":1}},"required":["cases","total","skip","take"],"additionalProperties":false},"CaseMutationResponse":{"type":"object","properties":{"id":{"type":"string"},"caseCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"clinicalMode":{"type":"string","enum":["ADULT","PEDIATRIC"]},"clinicalRulesVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"preopUpdatedAt":{"type":"string","format":"date-time"},"preopRevision":{"type":"integer","minimum":0},"rejectedFields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"reason":{"type":"string"}},"required":["path"],"additionalProperties":false}}},"required":["id"],"additionalProperties":false},"CaseVersion":{"type":"object","properties":{"updatedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["DRAFT","IN_PROGRESS","AWAITING_REVIEW","COMPLETE"]},"clinicalRevision":{"type":"integer","minimum":0},"eventRevision":{"type":"integer","minimum":0},"relationalRevision":{"type":"integer","minimum":0},"preopUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"intraopUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"postopUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"preopRevision":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"intraopRevision":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"postopRevision":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["updatedAt","status","clinicalRevision","eventRevision","relationalRevision","preopUpdatedAt","intraopUpdatedAt","postopUpdatedAt","preopRevision","intraopRevision","postopRevision"],"additionalProperties":false},"LockRequest":{"type":"object","properties":{"deviceId":{"type":"string","minLength":1,"maxLength":256}},"required":["deviceId"],"additionalProperties":false},"LockReleaseRequest":{"type":"object","properties":{"deviceId":{"type":"string","minLength":1,"maxLength":256},"force":{"type":"boolean"}},"additionalProperties":false},"LockResponse":{"type":"object","properties":{"acquired":{"type":"boolean"},"locked":{"type":"boolean"},"yours":{"type":"boolean"},"extended":{"type":"boolean"},"holderName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["acquired","locked"],"additionalProperties":false},"ReleaseResponse":{"type":"object","properties":{"released":{"type":"boolean"},"forced":{"type":"boolean"}},"required":["released"],"additionalProperties":false},"Event":{"type":"object","required":["type","ts"],"properties":{"id":{"type":"string"},"ts":{"type":"string","format":"date-time"},"type":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","maxLength":200},"label":{"type":"string","maxLength":200},"dose":{"oneOf":[{"type":"string"},{"type":"number"}]},"unit":{"type":"string","maxLength":40},"rate":{"oneOf":[{"type":"string"},{"type":"number"}]},"volume":{"oneOf":[{"type":"string"},{"type":"number"}]},"category":{"type":"string","maxLength":80},"fluidId":{"type":"string","minLength":1,"maxLength":200},"fluidEntryMode":{"type":"string","enum":["VOLUME","RATE"]},"bagVolumeMl":{"type":"number","minimum":0,"maximum":1000000},"administeredVolumeMl":{"type":"number","minimum":0,"maximum":1000000},"drugRoute":{"type":"string","maxLength":40},"concentration":{"type":"string","maxLength":80},"concentrationValue":{"type":"number","minimum":0},"concentrationUnit":{"type":"string","enum":["PERCENT","MCG_PER_ML","MG_PER_ML","IU_PER_ML","MMOL_PER_ML","MEQ_PER_ML"]},"formulation":{"type":"string","enum":["HYPOBARIC","ISOBARIC","HYPERBARIC"]},"calculationBasis":{"type":"string","enum":["FLAT","NONE","TBW","IBW","BSA_M2"]},"calculationWeightKg":{"type":"number","exclusiveMinimum":0},"calculationMethod":{"type":"string","minLength":1,"maxLength":80},"clinicalRuleKey":{"type":"string","minLength":1,"maxLength":240},"clinicalRuleVersion":{"type":"string","minLength":1,"maxLength":160},"clinicalRuleSourceIds":{"type":"array","maxItems":64,"items":{"type":"string","minLength":1,"maxLength":240}},"clinicalPresetId":{"type":"string","minLength":1,"maxLength":240},"clinicalPresetVersion":{"type":"integer","minimum":1},"clinicalPresetScope":{"type":"string","enum":["PLATFORM","INSTITUTION","USER"]}},"additionalProperties":true},"EventMutationResponse":{"type":"object","properties":{"event":{"$ref":"#/components/schemas/Event"},"revision":{"type":"integer","minimum":0},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"TransferRequest":{"type":"object","properties":{"toUserId":{"type":"string","minLength":1}},"required":["toUserId"],"additionalProperties":false},"TransferDecisionRequest":{"type":"object","properties":{"action":{"type":"string","enum":["accept","decline"]}},"required":["action"],"additionalProperties":false},"Transfer":{"type":"object","properties":{"id":{"type":"string"},"caseId":{"type":"string"},"fromUserId":{"type":"string"},"toUserId":{"type":"string"},"status":{"type":"string","enum":["PENDING","ACCEPTED","DECLINED"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","caseId","fromUserId","toUserId","status"],"additionalProperties":false},"SearchResult":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"label":{"type":"string"},"labelEn":{"type":"string"},"labelBg":{"type":"string"},"group":{"type":"string"},"domain":{"type":"string"}},"additionalProperties":false},"LibraryOption":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":true}},"required":["id","category","value","label"],"additionalProperties":false},"PediatricCapabilities":{"type":"object","properties":{"enabled":{"type":"boolean"},"productionReady":{"type":"boolean"},"minimumClientVersion":{"type":"string"},"rulesetVersion":{"type":"string"}},"required":["enabled","productionReady","minimumClientVersion","rulesetVersion"],"additionalProperties":false},"Capabilities":{"type":"object","properties":{"apiVersion":{"type":"string"},"serviceVersion":{"type":"string"},"catalogVersion":{"type":"string"},"minimumSupportedClients":{"type":"object","additionalProperties":{"type":"string"}},"compatibilityPaths":{"type":"object","additionalProperties":{"type":"string"}},"features":{"type":"object","additionalProperties":true}},"additionalProperties":false},"PediatricCalculationRequest":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"MOSTELLER_BSA"},"inputs":{"type":"object","properties":{"heightCm":{"type":"number","exclusiveMinimum":0},"weightKg":{"type":"number","exclusiveMinimum":0}},"required":["heightCm","weightKg"],"additionalProperties":false}},"required":["kind","inputs"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"MAINTENANCE_FLUID"},"inputs":{"type":"object","properties":{"weightKg":{"type":"number","exclusiveMinimum":0},"age":{"anyOf":[{"type":"object","properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["DAYS","MONTHS","YEARS"]}},"required":["value","unit"],"additionalProperties":false},{"type":"null"}]}},"required":["weightKg"],"additionalProperties":false}},"required":["kind","inputs"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"RCUK_RESUSCITATION"},"inputs":{"type":"object","properties":{"weightKg":{"type":"number","exclusiveMinimum":0}},"required":["weightKg"],"additionalProperties":false}},"required":["kind","inputs"],"additionalProperties":false}]},"PediatricCalculation":{"type":"object","properties":{"id":{"type":"string"},"caseId":{"type":"string"},"kind":{"type":"string","enum":["MOSTELLER_BSA","MAINTENANCE_FLUID","RCUK_RESUSCITATION"]},"inputs":{"type":"object","additionalProperties":true},"outputs":{"type":"object","additionalProperties":true},"ruleVersion":{"type":"string"},"sourceRefs":{"type":"array","items":{"type":"string"}},"acceptedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"acceptedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","caseId","kind","inputs","outputs","ruleVersion","sourceRefs","createdAt"],"additionalProperties":false},"RoleRequest":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"status":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","userId","status"],"additionalProperties":false},"InstitutionChangeRequest":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"requestedInstitutionId":{"type":"string"},"previousInstitutionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolvedById":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","userId","requestedInstitutionId","status"],"additionalProperties":false},"AuditLog":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"action":{"type":"string"},"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"detail":{},"createdAt":{"type":"string","format":"date-time"}},"required":["id","action","createdAt"],"additionalProperties":false},"ExportLimitError":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","const":"EXPORT_LIMIT_EXCEEDED"},"matchingCases":{"type":"integer","minimum":0},"exportedCases":{"type":"integer","const":0},"exportLimit":{"type":"integer","const":5000},"complete":{"type":"boolean","const":false}},"required":["error","code","matchingCases","exportedCases","exportLimit","complete"],"additionalProperties":false},"ResearchNumberRange":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"ResearchDateRange":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"additionalProperties":false},"ResearchCohortFilters":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["DRAFT","IN_PROGRESS","AWAITING_REVIEW","COMPLETE"]}},"clinicalModes":{"type":"array","items":{"type":"string","enum":["ADULT","PEDIATRIC"]}},"finalized":{"$ref":"#/components/schemas/ResearchDateRange"},"ageDays":{"$ref":"#/components/schemas/ResearchNumberRange"},"ageYears":{"$ref":"#/components/schemas/ResearchNumberRange"},"bmi":{"$ref":"#/components/schemas/ResearchNumberRange"},"durationMinutes":{"$ref":"#/components/schemas/ResearchNumberRange"},"aldreteTotal":{"$ref":"#/components/schemas/ResearchNumberRange"},"painScore":{"$ref":"#/components/schemas/ResearchNumberRange"},"sex":{"type":"array","items":{"type":"string"}},"asa":{"type":"array","items":{"type":"string"}},"emergency":{"type":"boolean"},"highRisk":{"type":"boolean"},"ponv":{"type":"boolean"},"diagnosisCodes":{"type":"array","items":{"type":"string"}},"diagnosisText":{"type":"string"},"comorbidityCodes":{"type":"array","items":{"type":"string"}},"comorbidityText":{"type":"string"},"procedureCodes":{"type":"array","items":{"type":"string"}},"procedureText":{"type":"string"},"procedureGroups":{"type":"array","items":{"type":"string"}},"techniques":{"type":"array","items":{"type":"string"}},"positions":{"type":"array","items":{"type":"string"}},"airwayDevices":{"type":"array","items":{"type":"string"}},"monitoring":{"type":"array","items":{"type":"string"}},"medications":{"type":"array","items":{"type":"string"}},"atcCodes":{"type":"array","items":{"type":"string"}},"complications":{"type":"array","items":{"type":"string"}},"dispositions":{"type":"array","items":{"type":"string"}},"mappingStatuses":{"type":"array","items":{"type":"string"}},"minimumCompleteness":{"type":"number","minimum":0,"maximum":100}},"additionalProperties":false},"ResearchCohort":{"type":"object","properties":{"version":{"type":"integer","const":1},"filters":{"$ref":"#/components/schemas/ResearchCohortFilters"}},"required":["version","filters"],"additionalProperties":false},"ResearchQueryRequest":{"type":"object","properties":{"cohort":{"$ref":"#/components/schemas/ResearchCohort"},"ResearchPaginationRequest":{"type":"object","properties":{"skip":{"type":"integer","minimum":0,"default":0},"take":{"type":"integer","minimum":1,"maximum":200,"default":50}},"additionalProperties":false},"ResearchPagination":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"skip":{"type":"integer","minimum":0},"take":{"type":"integer","minimum":1,"maximum":200},"hasMore":{"type":"boolean"}},"required":["total","skip","take","hasMore"],"additionalProperties":false},"ResearchSort":{"type":"object","properties":{"field":{"type":"string","enum":["finalizedAt","ageYears","ageDays","durationMinutes","asa"]},"direction":{"type":"string","enum":["asc","desc"]}},"required":["field","direction"],"additionalProperties":false},"savedCohortId":{"type":"string","minLength":1},"pagination":{"$ref":"#/components/schemas/ResearchPaginationRequest"},"metrics":{"type":"array","items":{"type":"string","enum":["caseCount","pediatricRate","meanAgeYears","meanAgeDays","meanBmi","meanDurationMinutes","emergencyRate","highRiskRate","complicationRate","ponvRate","meanAldrete","meanPainScore","mappingCoverage","fieldCompleteness"]}},"distributions":{"type":"array","items":{"type":"string","enum":["sex","asa","status","clinicalMode","procedure","diagnosis","technique","airway","disposition","complication"]}},"sort":{"$ref":"#/components/schemas/ResearchSort"}},"required":["cohort"],"additionalProperties":false},"ResearchCountDisclosure":{"type":"object","properties":{"value":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"lowerBound":{"type":"integer","minimum":0},"upperBound":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"exact":{"type":"boolean"},"suppressed":{"type":"boolean"}},"required":["value","lowerBound","upperBound","exact","suppressed"],"additionalProperties":false},"ResearchMetric":{"type":"object","properties":{"id":{"type":"string","enum":["caseCount","pediatricRate","meanAgeYears","meanAgeDays","meanBmi","meanDurationMinutes","emergencyRate","highRiskRate","complicationRate","ponvRate","meanAldrete","meanPainScore","mappingCoverage","fieldCompleteness"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"numerator":{"anyOf":[{"type":"number"},{"type":"null"}]},"denominator":{"anyOf":[{"type":"number"},{"type":"null"}]},"unit":{"type":"string","enum":["count","percent","years","days","kg/m2","minutes","score"]},"suppressed":{"type":"boolean"}},"required":["id","value","suppressed"],"additionalProperties":false},"ResearchDistributionBucket":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"labelEn":{"type":"string"},"labelBg":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"percent":{"anyOf":[{"type":"number"},{"type":"null"}]},"suppressed":{"type":"boolean"}},"required":["key","label","count","percent","suppressed"],"additionalProperties":false},"ResearchDistribution":{"type":"object","properties":{"id":{"type":"string","enum":["sex","asa","status","clinicalMode","procedure","diagnosis","technique","airway","disposition","complication"]},"buckets":{"type":"array","items":{"$ref":"#/components/schemas/ResearchDistributionBucket"}}},"required":["id","buckets"],"additionalProperties":false},"ResearchCaseSummary":{"type":"object","properties":{"id":{"type":"string"},"researchId":{"type":"string"},"status":{"type":"string","enum":["DRAFT","IN_PROGRESS","AWAITING_REVIEW","COMPLETE"]},"clinicalMode":{"type":"string","enum":["ADULT","PEDIATRIC"]},"clinicalRulesVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"period":{"anyOf":[{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}$"},{"type":"null"}]},"ageValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"ageUnit":{"anyOf":[{"type":"string","enum":["DAYS","MONTHS","YEARS"]},{"type":"null"}]},"ageApproxDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"ageYears":{"anyOf":[{"type":"number"},{"type":"null"}]},"sex":{"anyOf":[{"type":"string"},{"type":"null"}]},"asa":{"anyOf":[{"type":"string"},{"type":"null"}]},"diagnosis":{"anyOf":[{"type":"string"},{"type":"null"}]},"diagnosisCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"diagnosisLabelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"diagnosisLabelBg":{"anyOf":[{"type":"string"},{"type":"null"}]},"procedure":{"anyOf":[{"type":"string"},{"type":"null"}]},"procedureCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"procedureLabelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"procedureLabelBg":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"number"},{"type":"null"}]},"technique":{"type":"array","items":{"type":"string"}},"disposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"complications":{"type":"integer","minimum":0},"completeness":{"type":"number","minimum":0,"maximum":100}},"required":["id","researchId","status","clinicalMode","clinicalRulesVersion","period","ageValue","ageUnit","ageApproxDays","ageYears","sex","asa","diagnosis","diagnosisCode","procedure","procedureCode","durationMinutes","technique","disposition","complications","completeness"],"additionalProperties":false},"ResearchQueryResponse":{"type":"object","properties":{"apiVersion":{"type":"integer","const":1},"source":{"type":"string","enum":["LOSPOR","OMOP"]},"cohort":{"$ref":"#/components/schemas/ResearchCohort"},"matchingCases":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"matchingCaseCount":{"$ref":"#/components/schemas/ResearchCountDisclosure"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/ResearchMetric"}},"distributions":{"type":"array","items":{"$ref":"#/components/schemas/ResearchDistribution"}},"cases":{"type":"array","items":{"$ref":"#/components/schemas/ResearchCaseSummary"}},"pagination":{"anyOf":[{"$ref":"#/components/schemas/ResearchPagination"},{"type":"null"}]},"generatedAt":{"type":"string","format":"date-time"}},"required":["apiVersion","source","cohort","matchingCases","matchingCaseCount","metrics","distributions","cases","pagination","generatedAt"],"additionalProperties":false},"ResearchCaseQueryResponse":{"type":"object","properties":{"apiVersion":{"type":"integer","const":1},"source":{"type":"string","enum":["LOSPOR","OMOP"]},"cohort":{"$ref":"#/components/schemas/ResearchCohort"},"matchingCases":{"type":"integer","minimum":0},"cases":{"type":"array","items":{"$ref":"#/components/schemas/ResearchCaseSummary"}},"pagination":{"$ref":"#/components/schemas/ResearchPagination"},"generatedAt":{"type":"string","format":"date-time"}},"required":["apiVersion","source","cohort","matchingCases","cases","pagination","generatedAt"],"additionalProperties":false},"ResearchCaseDetail":{"allOf":[{"$ref":"#/components/schemas/ResearchCaseSummary"},{"type":"object","properties":{"demographics":{"type":"object","additionalProperties":true},"diagnoses":{"type":"array","items":{"type":"object","additionalProperties":true}},"comorbidities":{"type":"array","items":{"type":"object","additionalProperties":true}},"procedures":{"type":"array","items":{"type":"object","additionalProperties":true}},"medications":{"type":"array","items":{"type":"object","additionalProperties":true}},"labs":{"type":"array","items":{"type":"object","additionalProperties":true}},"intraoperative":{"type":"object","additionalProperties":true},"postoperative":{"type":"object","additionalProperties":true},"timeline":{"type":"array","items":{"type":"object","additionalProperties":true}},"quality":{"type":"object","additionalProperties":true}},"additionalProperties":false}]},"ResearchComparisonRequest":{"type":"object","properties":{"left":{"$ref":"#/components/schemas/ResearchCohort"},"right":{"$ref":"#/components/schemas/ResearchCohort"},"metrics":{"type":"array","items":{"type":"string","enum":["caseCount","pediatricRate","meanAgeYears","meanAgeDays","meanBmi","meanDurationMinutes","emergencyRate","highRiskRate","complicationRate","ponvRate","meanAldrete","meanPainScore","mappingCoverage","fieldCompleteness"]}}},"required":["left","right"],"additionalProperties":false},"ResearchComparisonMetric":{"type":"object","properties":{"id":{"type":"string"},"left":{"$ref":"#/components/schemas/ResearchMetric"},"right":{"$ref":"#/components/schemas/ResearchMetric"},"absoluteDifference":{"anyOf":[{"type":"number"},{"type":"null"}]},"relativeDifferencePercent":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","left","right","absoluteDifference","relativeDifferencePercent"],"additionalProperties":false},"ResearchComparisonResponse":{"type":"object","properties":{"leftCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"rightCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"leftCaseCount":{"$ref":"#/components/schemas/ResearchCountDisclosure"},"rightCaseCount":{"$ref":"#/components/schemas/ResearchCountDisclosure"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/ResearchComparisonMetric"}},"generatedAt":{"type":"string","format":"date-time"}},"required":["leftCount","rightCount","leftCaseCount","rightCaseCount","metrics","generatedAt"],"additionalProperties":false},"ResearchBenchmarkPoint":{"type":"object","properties":{"period":{"type":"string"},"institutionId":{"type":"string"},"institutionLabel":{"type":"string"},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"caseCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"caseCountDisclosure":{"$ref":"#/components/schemas/ResearchCountDisclosure"},"previousValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"absoluteChange":{"anyOf":[{"type":"number"},{"type":"null"}]},"relativeChangePercent":{"anyOf":[{"type":"number"},{"type":"null"}]},"suppressed":{"type":"boolean"}},"required":["period","value","caseCount","caseCountDisclosure","previousValue","absoluteChange","relativeChangePercent","suppressed"],"additionalProperties":false},"ResearchBenchmarkRequest":{"type":"object","properties":{"cohort":{"$ref":"#/components/schemas/ResearchCohort"},"interval":{"type":"string","enum":["month","quarter","year"]},"metric":{"type":"string","enum":["caseCount","pediatricRate","meanAgeYears","meanAgeDays","meanBmi","meanDurationMinutes","emergencyRate","highRiskRate","complicationRate","ponvRate","meanAldrete","meanPainScore","mappingCoverage","fieldCompleteness"]},"institutionIds":{"type":"array","items":{"type":"string"}},"compareWithPreviousPeriod":{"type":"boolean"}},"required":["cohort","interval","metric"],"additionalProperties":false},"ResearchBenchmarkResponse":{"type":"object","properties":{"metric":{"type":"string"},"interval":{"type":"string","enum":["month","quarter","year"]},"points":{"type":"array","items":{"$ref":"#/components/schemas/ResearchBenchmarkPoint"}},"generatedAt":{"type":"string","format":"date-time"}},"required":["metric","interval","points","generatedAt"],"additionalProperties":false},"ResearchQualityField":{"type":"object","properties":{"section":{"type":"string"},"field":{"type":"string"},"present":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"absent":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"notApplicable":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"completeness":{"anyOf":[{"type":"number"},{"type":"null"}]},"suppressed":{"type":"boolean"}},"required":["section","field","present","absent","notApplicable","completeness","suppressed"],"additionalProperties":false},"ResearchQualityMapping":{"type":"object","properties":{"domain":{"type":"string"},"mapped":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"sourceOnly":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"unmapped":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"coverage":{"anyOf":[{"type":"number"},{"type":"null"}]},"suppressed":{"type":"boolean"}},"required":["domain","mapped","sourceOnly","unmapped","coverage","suppressed"],"additionalProperties":false},"ResearchQualityResponse":{"type":"object","properties":{"totalCases":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"totalCaseCount":{"$ref":"#/components/schemas/ResearchCountDisclosure"},"finalizedCases":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"snapshotCoverage":{"anyOf":[{"type":"number"},{"type":"null"}]},"relationalDriftCases":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"impossibleTimelineCases":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"suppressed":{"type":"boolean"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ResearchQualityField"}},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/ResearchQualityMapping"}},"generatedAt":{"type":"string","format":"date-time"}},"required":["totalCases","totalCaseCount","finalizedCases","snapshotCoverage","relationalDriftCases","impossibleTimelineCases","suppressed","fields","mappings","generatedAt"],"additionalProperties":false},"ResearchPermissionSet":{"type":"object","properties":{"query":{"type":"boolean"},"inspectCases":{"type":"boolean"},"compare":{"type":"boolean"},"benchmark":{"type":"boolean"},"savePrivateCohorts":{"type":"boolean"},"shareInstitutionCohorts":{"type":"boolean"},"export":{"type":"boolean"},"exportOmop":{"type":"boolean"},"manageAccess":{"type":"boolean"}},"required":["query","inspectCases","compare","benchmark","savePrivateCohorts","shareInstitutionCohorts","export","exportOmop","manageAccess"],"additionalProperties":false},"ResearchScope":{"type":"object","properties":{"kind":{"type":"string","enum":["OWN","INSTITUTION","GRANT","ALL"]},"institutionIds":{"type":"array","items":{"type":"string"}},"institutionLabels":{"type":"array","items":{"type":"string"}}},"required":["kind","institutionIds","institutionLabels"],"additionalProperties":false},"ResearchActionScopes":{"type":"object","properties":{"query":{"$ref":"#/components/schemas/ResearchScope"},"inspectCases":{"$ref":"#/components/schemas/ResearchScope"},"export":{"$ref":"#/components/schemas/ResearchScope"},"exportOmop":{"$ref":"#/components/schemas/ResearchScope"}},"required":["query","inspectCases","export","exportOmop"],"additionalProperties":false},"ResearchMetadata":{"type":"object","properties":{"apiVersion":{"type":"integer","const":1},"source":{"type":"string","enum":["LOSPOR","OMOP"]},"sourceLabel":{"type":"string"},"sourceVersion":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"dataFreshnessAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"scope":{"$ref":"#/components/schemas/ResearchScope"},"scopes":{"$ref":"#/components/schemas/ResearchActionScopes"},"permissions":{"$ref":"#/components/schemas/ResearchPermissionSet"},"suppressionThreshold":{"type":"integer","minimum":1},"defaultCohort":{"$ref":"#/components/schemas/ResearchCohort"},"supportedMetrics":{"type":"array","items":{"type":"string"}},"supportedDistributions":{"type":"array","items":{"type":"string"}},"supportedExports":{"type":"array","items":{"type":"string","enum":["csv","json","omop-csv","omop-json"]}}},"required":["apiVersion","source","sourceLabel","sourceVersion","generatedAt","dataFreshnessAt","scope","scopes","permissions","suppressionThreshold","defaultCohort","supportedMetrics","supportedDistributions","supportedExports"],"additionalProperties":false},"SavedResearchCohort":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"visibility":{"type":"string","enum":["PRIVATE","INSTITUTION"]},"definition":{"$ref":"#/components/schemas/ResearchCohort"},"ownerId":{"type":"string"},"institutionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastRunAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","description","visibility","definition","ownerId","institutionId","createdAt","updatedAt","lastRunAt"],"additionalProperties":false},"ResearchExportRecord":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"format":{"type":"string","enum":["csv","json","omop-csv","omop-json"]},"status":{"type":"string","enum":["PENDING","RUNNING","COMPLETE","FAILED"]},"definition":{"$ref":"#/components/schemas/ResearchCohort"},"rowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"checksum":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"filename":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}]},"byteSize":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"asOf":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"definitionHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"snapshotHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"matchingCases":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"sourceCommit":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"generatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revisionManifestVersion":{"type":"integer","minimum":1},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"artifactAvailable":{"type":"boolean"},"legacy":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","format","status","definition","rowCount","checksum","error","filename","asOf","definitionHash","snapshotHash","matchingCases","sourceCommit","contentType","byteSize","sourceVersion","generatedAt","revisionManifestVersion","expiresAt","artifactAvailable","legacy","createdAt","completedAt"],"additionalProperties":false},"SavedResearchCohortRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"visibility":{"type":"string","enum":["PRIVATE","INSTITUTION"]},"institutionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"definition":{"$ref":"#/components/schemas/ResearchCohort"}},"required":["name","definition"],"additionalProperties":false},"SavedResearchCohortPatch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"visibility":{"type":"string","enum":["PRIVATE","INSTITUTION"]},"institutionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"definition":{"$ref":"#/components/schemas/ResearchCohort"}},"additionalProperties":false},"ResearchExportRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"format":{"type":"string","enum":["csv","json","omop-csv","omop-json"]},"definition":{"$ref":"#/components/schemas/ResearchCohort","description":"Must select finalized cases only (statuses = [COMPLETE])."}},"required":["name","format","definition"],"additionalProperties":false},"ResearchGrantRequest":{"type":"object","properties":{"userId":{"type":"string"},"institutionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"allInstitutions":{"type":"boolean"},"canInspectCases":{"type":"boolean"},"canExport":{"type":"boolean"},"canExportOmop":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["userId"],"additionalProperties":false},"ResearchGrantPatch":{"type":"object","properties":{"canInspectCases":{"type":"boolean"},"canExport":{"type":"boolean"},"canExportOmop":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revoked":{"type":"boolean"}},"additionalProperties":false},"ResearchGrant":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"institutionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"allInstitutions":{"type":"boolean"},"canInspectCases":{"type":"boolean"},"canExport":{"type":"boolean"},"canExportOmop":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"user":{"type":"object","additionalProperties":true},"institution":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"grantedBy":{"type":"object","additionalProperties":true}},"required":["id","userId","institutionId","allInstitutions","canInspectCases","canExport","canExportOmop","expiresAt","revokedAt","createdAt","updatedAt"],"additionalProperties":true},"ResearchExportCleanup":{"type":"object","properties":{"expiredArtifacts":{"type":"integer","minimum":0},"workingArtifacts":{"type":"integer","minimum":0},"failures":{"type":"integer","minimum":0}},"required":["expiredArtifacts","workingArtifacts","failures"],"additionalProperties":false},"ResearchExportWorkerResponse":{"type":"object","properties":{"processed":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"ids":{"type":"array","items":{"type":"string"}},"cleanup":{"$ref":"#/components/schemas/ResearchExportCleanup"}},"required":["processed","failed","ids","cleanup"],"additionalProperties":false},"JsonObject":{"type":"object","additionalProperties":true}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"lospor_session"}},"headers":{"PreopRevision":{"schema":{"type":"integer"},"description":"Current preoperative revision"},"IntraopRevision":{"schema":{"type":"integer"},"description":"Current intraoperative revision"},"PostopRevision":{"schema":{"type":"integer"},"description":"Current postoperative revision"}}}}