{"openapi": "3.1.0", "info": {"title": "DIBBs eCR Refiner", "description": "Please visit the repo for more info: https://github.com/CDCgov/dibbs-ecr-refiner", "version": "1.0.0"}, "paths": {"/api/user": {"get": {"tags": ["user"], "summary": "Get User", "description": "Returns the current logged-in user's information.\n\nReads user info from the session or token.\n\nReturns:\n JSON object with user claims if authenticated.\n\nRaises:\n HTTPException 401 if user not authenticated.", "operationId": "getUser", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/UserResponse"}, {"type": "null"}], "title": "Response Getuser"}}}}}}}, "/api/v1/conditions/": {"get": {"tags": ["conditions"], "summary": "Get Conditions", "description": "Fetches a summary of all available conditions from the database and returns them as a list.\n\nArgs:\n db (AsyncDatabaseConnection): Database connection.\n\nReturns:\n list[GetConditionsResponse]: List of all condition summaries.", "operationId": "getConditions", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/GetConditionsResponse"}, "type": "array", "title": "Response Getconditions"}}}}}}}, "/api/v1/conditions/{condition_id}": {"get": {"tags": ["conditions"], "summary": "Get Condition", "description": "Returns information about a given condition.\n\nArgs:\n condition_id (UUID): ID of the condition\n db (AsyncDatabaseConnection): Database connection.\n\nRaises:\n HTTPException: 404 if no condition is found\n\nReturns:\n GetCondition: Info about the condition", "operationId": "getCondition", "parameters": [{"name": "condition_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Condition Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GetConditionResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/": {"get": {"tags": ["configurations"], "summary": "Get Configurations", "description": "Returns a list of configurations based on the logged-in user.\n\nReturns:\n List of configuration objects.", "operationId": "getConfigurations", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/GetConfigurationsResponse"}, "type": "array", "title": "Response Getconfigurations"}}}}}}, "post": {"tags": ["configurations"], "summary": "Create Configuration", "description": "Create a new configuration for a jurisdiction.", "operationId": "createConfiguration", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateConfigInput"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateConfigurationResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/serialized": {"get": {"tags": ["configurations"], "summary": "Get Serialized Configuration", "description": "Given an active configuration ID, fetches and returns the serialized configuration file content from S3.\n\nArgs:\n configuration_id (UUID): The active configuration ID\n user (DbUser): The logged-in user\n app_config (AppConfig): The required application environment variables\n db (AsyncDatabaseConnection): The database connection\n logger (Logger): The standard app logger\n\nRaises:\n HTTPException: 403 if not running locally\n HTTPException: 404 if configuration cannot be found in the user's jurisdiction\n HTTPException: 400 if the configuration's status is not `active`\n HTTPException: 404 if the configuration's primary condition is not found\n\nReturns:\n Response: The serialized configuration file content", "operationId": "getSerializedConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SerializedFiles"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}": {"get": {"tags": ["configurations"], "summary": "Get Configuration", "description": "Get a single configuration by its ID including all associated conditions.", "operationId": "getConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GetConfigurationResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/code-sets": {"put": {"tags": ["configurations"], "summary": "Associate Condition Codeset With Configuration", "description": "Associate a specified code set with the given configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration\n body (AssociateCodesetInput): payload containing a condition_id\n user (dict[str, Any], optional): User making the request\n db (AsyncDatabaseConnection, optional): Database connection\n\nRaises:\n HTTPException: 404 if configuration is not found in JD\n HTTPException: 404 if configuration is not found\n HTTPException: 409 if configuration is not a draft and therefore not editable\n HTTPException: 500 if configuration cannot be updated\n\nReturns:\n AssociateCodesetResponse: ID of updated configuration, the full list of included conditions,\n and the condition_name", "operationId": "associateConditionWithConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AssociateCodesetInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AssociateCodesetResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/code-sets/{condition_id}": {"delete": {"tags": ["configurations"], "summary": "Remove Condition Codeset From Configuration", "description": "Remove a specified code set from the given configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration\n condition_id (UUID): ID of the condition to remove\n user (DbUser): User making the request\n db (AsyncDatabaseConnection): Database connection\n\nRaises:\n HTTPException: 404 if configuration is not found in JD\n HTTPException: 404 if condition is not found\n HTTPException: 409 if trying to remove the main condition\n HTTPException: 409 if configuration is not a draft and therefore not editable\n HTTPException: 500 if configuration is cannot be updated\n\nReturns:\n AssociateCodesetResponse: ID of updated configuration and the full list\n of included conditions plus condition_name", "operationId": "disassociateConditionWithConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}, {"name": "condition_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Condition Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AssociateCodesetResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/custom-codes/{id}": {"get": {"tags": ["configurations"], "summary": "Get Custom Code", "description": "Fetch a custom code by its ID.\n\nArgs:\n configuration_id (UUID): The associated configuration ID\n id (UUID): The custom code ID\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): The database connection\n\nRaises:\n HTTPException: 404 if configuration can't be found\n\nReturns:\n CustomCodeResponse: The custom code response object", "operationId": "getCustomCode", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomCodeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["configurations"], "summary": "Delete Custom Code", "description": "Delete a custom code from a configuration.\n\nArgs:\n configuration_id (UUID): The ID of the configuration to modify.\n id (str): The ID of the custom code.\n user (dict[str, Any]): The logged-in user.\n db (AsyncDatabaseConnection): The database connection.\n\nRaises:\n HTTPException: 400 if id is not provided\n HTTPException: 404 if configuration can't be found\n HTTPException: 409 if configuration is not a draft and therefore not editable\n HTTPException: 500 if configuration can't be updated\n\nReturns:\n ConfigurationCustomCodeResponse: The updated configuration", "operationId": "deleteCustomCodeFromConfiguration", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Id"}}, {"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomCodeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/custom-codes": {"post": {"tags": ["configurations"], "summary": "Add Custom Code", "description": "Add a user-defined custom code to a configuration.\n\nArgs:\n configuration_id (UUID): The ID of the configuration to update.\n body (AddCustomCodeInput): The custom code information provided by the user.\n user (dict[str, Any]): The logged-in user.\n db (AsyncDatabaseConnection): The database connection.\n\nRaises:\n HTTPException: 404 if configuration isn't found\n HTTPException: 409 if configuration is not a draft and therefore not editable\n HTTPException: 500 if custom code can't be added\n\nReturns:\n ConfigurationCustomCodeResponse: Updated configuration", "operationId": "addCustomCodeToConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AddCustomCodeInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomCodeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["configurations"], "summary": "Edit Custom Code", "description": "Modify a configuration's custom code based on system_key/code pair.\n\nArgs:\n configuration_id (UUID): The ID of the configuration to modify.\n body (UpdateCustomCodeInput): User-provided object containing custom code info.\n user (dict[str, Any]): The logged-in user.\n db (AsyncDatabaseConnection): The database connection.\n logger (Logger): The system logger.\n\nRaises:\n HTTPException: 409 if configuration is not a draft and therefore not editable\n HTTPException: 500 if the configuration can't be updated\n\nReturns:\n ConfigurationCustomCodeResponse: The updated configuration.", "operationId": "editCustomCodeFromConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateCustomCodeInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomCodeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/custom-codes/upload": {"post": {"tags": ["configurations"], "summary": "Upload Custom Codes Csv", "description": "Accepts a CSV payload in JSON body.\n\nExpected CSV headers:\n code,code_system,display_name\n\nReturns:\n UploadCustomCodesResponse", "operationId": "uploadCustomCodesCsv", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UploadCustomCodesCsvInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UploadCustomCodesPreviewResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/custom-codes/confirm": {"post": {"tags": ["configurations"], "summary": "Confirm Upload Custom Codes Csv", "description": "Confirm and save custom codes from preview list.", "operationId": "confirmUploadCustomCodesCsv", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConfirmUploadCustomCodesInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CustomCodeResponse"}, "title": "Response Confirmuploadcustomcodescsv"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/custom-codes/bulk-delete": {"post": {"tags": ["configurations"], "summary": "Bulk Delete Custom Codes", "description": "Deletes custom codes in bulk for a given configuration.\n\nArgs:\n configuration_id (UUID): The ID of the configuration to modify.\n body (BulkDeleteCustomCodesInput): The input body containing IDs of the custom codes.\n user (DbUser): The logged-in user.\n db (AsyncDatabaseConnection): The database connection.\n\nRaises:\n HTTPException: 404 if configuration can't be found\n HTTPException: 409 if configuration is not a draft and therefore not editable\n HTTPException: 500 if configuration can't be updated\n\nReturns:\n ConfigurationCustomCodeResponse: The updated configuration", "operationId": "deleteCustomCodes", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BulkDeleteCustomCodesInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CustomCodeResponse"}, "title": "Response Deletecustomcodes"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/custom-codes/validate": {"post": {"tags": ["configurations"], "summary": "Validate Custom Code", "description": "Determines whether a custom code update is valid or not.\n\nIf the desired code is already associated with the configuration, then the update is\ninvalid.\n\nArgs:\n configuration_id (UUID): The configuration ID\n body (ValidateCustomCodeInput): Body including the code to validate\n user (DbUser, optional): The logged in user\n db (AsyncDatabaseConnection, optional): The database connection\n\nReturns:\n bool: Returns True if the code has not been used, otherwise returns False", "operationId": "validateCustomCodeFromConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ValidateCustomCodeInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ValidateCustomCodeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/export": {"get": {"tags": ["configurations"], "summary": "Get Configuration Export", "description": "Create a CSV export of a configuration and all associated codes.", "operationId": "getConfigurationExport", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/test": {"post": {"tags": ["configurations"], "summary": "Run Configuration Test", "description": "Runs an inline test of a given configuration against an eICR/RR pair.\n\nThis endpoint orchestrates the validation and refinement process by:\n1. Handling file input, either from a user upload or a default sample file.\n2. Calling the `inline_testing` service, which validates that the specified\n configuration's condition is reportable in the provided file.\n3. Handling the service response:\n - If validation fails, raises a 400 Bad Request with a specific error.\n - If successful, proceeds with the returned refined document.\n4. Packaging the original eICR, RR, and the single refined eICR into a\n new in-memory zip archive.\n5. Uploading the archive to S3 and generating a pre-signed download URL.\n6. Returning a `ConfigurationTestResponse` with the download URL and details\n of the successful refinement.\n\nArgs:\n id: The ID of the configuration to test.\n uploaded_file: An optional user-provided zip file with an eICR and RR.\n create_output_zip: Dependency to create a zip archive in memory.\n upload_zip: Dependency to upload the archive to S3.\n user: The authenticated user making the request.\n db: The database connection.\n sample_zip_path: Path to the default sample zip file.\n logger: The application logger.\n\nReturns:\n A response object containing the original eICR, a URL to download the\n zipped results, and details about the refined condition.", "operationId": "runInlineConfigurationTest", "requestBody": {"content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_runInlineConfigurationTest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConfigurationTestResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/sections": {"post": {"tags": ["configurations"], "summary": "Insert Custom Section", "description": "Create a new custom section for a given configuration ID.\n\nArgs:\n configuration_id (UUID): The ID of the configuration\n section_input (CustomSectionInput): Desired properties of the section\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): The database connection", "operationId": "addCustomSection", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AddSectionInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "string", "title": "Response Addcustomsection"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["configurations"], "summary": "Delete Custom Section", "description": "Delete a custom section.\n\nArgs:\n configuration_id (UUID): ID of the configuration with custom section to delete\n section_input (DeleteCustomSectionInput): Custom section deletion input\n user (DbUser): The logged in user\n db (AsyncDatabaseConnection): The database connection\n\nRaises:\n HTTPException: 404 if configuration isn't found\n HTTPException: 409 if configuration isn't a draft\n HTTPException: 404 if custom section code to delete isn't found\n\nReturns:\n str: Deleted custom section code", "operationId": "deleteCustomSection", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeleteSectionInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "string", "title": "Response Deletecustomsection"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["configurations"], "summary": "Update Section", "description": "Update a section entry for a configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n section_input (SectionUpdateInput): Updated section info\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): Database connection\n\nRaises:\n HTTPException: 400 if the code is not valid, code is in use,\n name is in use, the section is system-skipped\n (`DisabledSection`) and therefore not configurable, the\n narrative/action combination is unsupported (e.g.\n narrative=\"reconstruct\" or \"keep_on_match\" with\n action=\"retain\"), narrative \"reconstruct\" targets a\n section without a registered reconstructor, or the\n section can carry a trigger code and was sent with\n include=False\n HTTPException: 404 if configuration isn't found\n HTTPException: 409 if configuration is not a draft and therefore not editable\n HTTPException: 500 if section processing can't be updated\n\nReturns:\n UpdateSectionProcessingResponse: The message to show the user", "operationId": "updateSection", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SectionUpdateInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateSectionProcessingResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/activate": {"patch": {"tags": ["configurations"], "summary": "Activate Configuration", "description": "Activate the specified configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n user (DbUser): The logged-in user\n logger (Logger): The standard logger\n db (AsyncDatabaseConnection): Database connection\n\nRaises:\n HTTPException: 400 if configuration can't be activated because of its current state\n HTTPException: 404 if configuration can't be found\n HTTPException: 500 if configuration can't be activated by the server\n\nReturns:\n ActivateConfigurationResponse: Metadata about the activated condition for confirmation", "operationId": "activateConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConfigurationStatusUpdateResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/deactivate": {"patch": {"tags": ["configurations"], "summary": "Deactivate Configuration", "description": "Deactivate the specified configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n user (DbUser): The logged-in user\n logger (Logger): The standard application logger\n db (AsyncDatabaseConnection): Database connection\n\nRaises:\n HTTPException: 400 if configuration can't be deactivated because of its current state\n HTTPException: 404 if configuration can't be found\n HTTPException: 500 if configuration can't be deactivated by the server\n\nReturns:\n ConfigurationStatusUpdateResponse: Metadata about the activated condition for confirmation", "operationId": "deactivateConfiguration", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConfigurationStatusUpdateResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/acquire-lock": {"post": {"tags": ["configurations"], "summary": "Acquire Configuration Lock", "description": "Acquire config lock for user.\n\nArgs:\n configuration_id (UUID): ID of the configuration to lock\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): Database connection\n\nReturns:\n Response: 204 No Content on success", "operationId": "acquireConfigurationLock", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/release-lock": {"post": {"tags": ["configurations"], "summary": "Release Configuration Lock", "description": "Release config lock if held by user.\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): Database connection", "operationId": "releaseConfigurationLock", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/set-status": {"post": {"tags": ["configurations"], "summary": "Set Codes Status", "description": "Sets selected codes to the specified `status` for the given configuration ID.\n\nIf `update_beyond_rendered_set` is false, we update status for only the specified\n`code_ids` within the rendered page.\n\nIf `update_beyond_rendered_set` is true, we skip any codes within `code_ids_to_skip`\nand update status for all other codes that don't get clipped away by the passed-in filters\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n update_beyond_rendered_set (bool): Whether the action should be only within the rendered codes or include all codes.\n code_ids (list[UUID]): List of code IDs to specifically action. Used in the \"within cursor\" flow.\n code_ids_to_skip (list[UUID]): List of code IDs to skip since they've been manually actioned by the user.\n filters (FilterInput): Filter input coming from the client to build the \"complete\" set of codes to bulk select\n status (Literal['included', 'excluded'): Set codes as 'included' or 'excluded'\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): Database connection\n\nRaises:\n HTTPException: 404 if configuration can't be found\n\nReturns:\n list[UUID]: Code IDs that had their status changed", "operationId": "setCodesStatus", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}, {"name": "update_beyond_rendered_set", "in": "query", "required": true, "schema": {"type": "boolean", "title": "Update Beyond Rendered Set"}}, {"name": "status", "in": "query", "required": true, "schema": {"enum": ["included", "excluded"], "type": "string", "title": "Status"}}, {"name": "search", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Search"}}, {"name": "code_systems", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "string"}, "default": [], "title": "Code Systems"}}, {"name": "sources", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "string"}, "default": [], "title": "Sources"}}, {"name": "statuses", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "string"}, "default": [], "title": "Statuses"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_setCodesStatus"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "string", "format": "uuid"}, "title": "Response Setcodesstatus"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/codes": {"get": {"tags": ["configurations"], "summary": "Get Codes", "description": "Fetches all codes associated with a configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n filters (FilterInput): Filter input coming from the client\n cursor (str | None): The cursor for the page to start from\n user (DbUser): The logged-in user\n logger (Logger): The standard logger\n db (AsyncDatabaseConnection): Database connection", "operationId": "getCodes", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}, {"name": "cursor", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Cursor"}}, {"name": "search", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Search"}}, {"name": "code_systems", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "string"}, "default": [], "title": "Code Systems"}}, {"name": "sources", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "string"}, "default": [], "title": "Sources"}}, {"name": "statuses", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "string"}, "default": [], "title": "Statuses"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CodesResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/code-counts": {"get": {"tags": ["configurations"], "summary": "Get Code Counts", "description": "Fetch code count information for a configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): Database connection\n\nRaises:\n HTTPException: 404 if configuration can't be found\n HTTPException: 500 if code count metadata can't be fetched\n\nReturns:\n CodeCountsResponse: Object containing code count info", "operationId": "getCodeCounts", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CodeCountsResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/configurations/{configuration_id}/filters": {"get": {"tags": ["configurations"], "summary": "Get Code Filters", "description": "Fetches code filter information for the client to display.\n\nArgs:\n configuration_id (UUID): The configuration ID\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): The database connection\n\nRaises:\n HTTPException: 404 if the configuration couldn't be found\n\nReturns:\n CodeFilterOptions: The code filters", "operationId": "getCodeFilters", "parameters": [{"name": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CodeFilterOptions"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/simulator/discover-configurations": {"post": {"tags": ["simulator"], "summary": "Discover Configurations", "description": "Detects reportable conditions found in `uploaded_file` and matches them with existing configurations.\n\nConfigurations are returned to the client.\n\nArgs:\n uploaded_file (UploadFile | None, optional): The eCR file package uploaded by the user.\n simulator_zip_path (Path, optional): The path to the demo zip file.\n user (DbUser, optional): The logged in user.\n db (AsyncDatabaseConnection, optional): The database connection.\n logger (Logger, optional): The app logger.\n\nReturns:\n DiscoveredConfigurationsResponse: Matching configurations, grouped by condition.", "operationId": "discoverConfigurations", "requestBody": {"content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_discoverConfigurations"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveredConfigurationsResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/simulator/upload": {"post": {"tags": ["simulator"], "summary": "Simulator Upload", "description": "Handles the simulator upload workflow for eICR refinement.\n\nSteps:\n1. Obtain the simulator eICR ZIP file (either uploaded by user or from local sample in\n refiner/assets/demo/mon-mothma-covid-influenza.zip).\n2. Read and validate the XML files (eICR and RR) from the ZIP (XMLFiles object).\n3. Call the service layer (`simulator`) to orchestrate the refinement workflow.\n4. For each unique reportable condition code found in the RR (and having a configuration),\n build a refined XML document and collect metadata. The code used is the actual code\n from the RR that triggered the match, not a canonical or database code.\n5. Package all refined and original files into a ZIP.\n6. Upload the ZIP to S3 and get a download URL.\n7. Construct and return the response model for the frontend, including per-condition\n refinement results and a link to the ZIP of outputs.\n\nAny exceptions during file processing or workflow execution are caught and mapped to HTTP errors.", "operationId": "uploadEcr", "requestBody": {"content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_uploadEcr"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SimulatorUploadResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/simulator/download/{filename}": {"get": {"tags": ["simulator"], "summary": "Download Refined Ecr", "description": "Stream refined eCR zip from S3 by filename.\n\nThe client provides only the filename (e.g. `_refined_ecr.zip`). The\nserver constructs the S3 object key based on the authenticated user.", "operationId": "downloadRefinedEcr", "parameters": [{"name": "filename", "in": "path", "required": true, "schema": {"type": "string", "title": "Filename"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/events/": {"get": {"tags": ["events"], "summary": "Get Events", "description": "Returns a list of all events for a jurisdiction, ordered from newest to oldest.\n\nArgs:\n user (DbUser): The user making the request.\n db (AsyncDatabaseConnection): Database connection.\n logger (Logger): Standard logger.\n page (int): page of events to return to the client.\n canonical_url (str | None): An optional filter on the condition.\n\nReturns:\n EventResponse: A bundle with\n - Total page count\n - The list of AuditEvents relevant for the (optional) filter\n - The list of condition information with potentially filter-able data", "operationId": "getEvents", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "default": 1, "title": "Page"}}, {"name": "canonical_url", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Canonical Url"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EventsResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/events/{event_id}/custom-code-uploads": {"get": {"tags": ["events"], "summary": "Get Custom Code Upload Events", "description": "Returns a list of all custom code upload events associated with a parent event ID.\n\nArgs:\n event_id (UUID): The parent event\n user (DbUser): The logged in user\n db (AsyncDatabaseConnection): The database connection\n\nRaises:\n HTTPException: 404 if event with requested ID is not found or does not belong to user's jurisdiction", "operationId": "getCustomCodeUploadEvents", "parameters": [{"name": "event_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Event Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CustomCodeUploadEventResponse"}, "title": "Response Getcustomcodeuploadevents"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/events/export": {"get": {"tags": ["events"], "summary": "Get Events Export", "description": "Generate a CSV export of all events within a jurisdiction.\n\nArgs:\n timezone (str): The user's IANA timezone\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): The database connection\n canonical_url (str | None): An optional canonical URL to filter the export by condition\n\nReturns:\n Response: The generated CSV file", "operationId": "get_events_export_api_v1_events_export_get", "parameters": [{"name": "canonical_url", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Canonical Url"}}, {"name": "timezone", "in": "query", "required": false, "schema": {"type": "string", "default": "UTC", "title": "Timezone"}}], "responses": {"200": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/events/{event_id}/codes/export": {"get": {"tags": ["events"], "summary": "Get Event Codes Export", "description": "Exports the historical condition codes associated with a code-set event.", "operationId": "get_event_codes_export_api_v1_events__event_id__codes_export_get", "parameters": [{"name": "event_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Event Id"}}], "responses": {"200": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/releases/": {"get": {"tags": ["releases"], "summary": "Get Releases Data", "description": "Hook to get release data from GitHub and serve it to the frontend.\n\nReturns:\n ReleasesResponse: Reponse of release information in a list of ReleaseMetadata", "operationId": "getReleases", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReleasesResponse"}}}}}}}, "/api/v1/code-systems/": {"get": {"tags": ["code-systems"], "summary": "Get Code Systems", "description": "Returns a list of supported code systems.\n\nReturns:\n List of code system.", "operationId": "getCodeSystems", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/CodeSystemsReponse"}, "type": "array", "title": "Response Getcodesystems"}}}}}}}, "/api/v1/notifications": {"patch": {"tags": ["app-notifications"], "summary": "Update User Notifications", "description": "Updates notification acknowledgement state for the current user.", "operationId": "updateUserNotifications", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateUserNotificationsRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tes/diff-details": {"get": {"tags": ["tes"], "summary": "Get Tes Updates", "description": "Returns a list of all TES updates, ordered from newest to oldest.\n\nArgs:\n db (AsyncDatabaseConnection): Database connection.\n\nReturns:\n TesResponse: A bundle with a list of TesUpdates, including\n - The version\n - The when it was created", "operationId": "getTesUpdates", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TesResponse"}}}}}}}, "/api/v1/tes/": {"get": {"tags": ["tes"], "summary": "Get Tes Diff Details", "description": "Returns a list of all TES updates, ordered from newest to oldest.\n\nArgs:\n cur_version: Version to compare on.\n prev_version: Version to compare against. Potentially an empty string if we're in the \"baseline\" TES version\n db (AsyncDatabaseConnection): Database connection.\n\nReturns:\n list[TesDiffResponse]: A bundle with a list of TesDiffResponse, including\n - The condition metadata across the versions\n - The number of added and removed codes", "operationId": "getTesDiffDetails", "parameters": [{"name": "cur_version", "in": "query", "required": true, "schema": {"type": "string", "title": "Cur Version"}}, {"name": "prev_version", "in": "query", "required": true, "schema": {"type": "string", "title": "Prev Version"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/TesDiffConditionDetails"}, "title": "Response Gettesdiffdetails"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tes/export": {"get": {"tags": ["tes"], "summary": "Export Tes Condition Diff", "description": "Generates and exports a CSV of condition diffs between specified TES versions.\n\nArgs:\n cur_version(str) : The ceiling TES version to compare against\n prev_version(str) : The floor TES version to compare against\n canonical_url(str) : The condition diff being requested\n db (AsyncDatabaseConnection) : The db connection.\n\nReturns:\n Response: an HTTP response that gives the browser a CSV file to download", "operationId": "exportConditionDiff", "parameters": [{"name": "cur_version", "in": "query", "required": true, "schema": {"type": "string", "title": "Cur Version"}}, {"name": "prev_version", "in": "query", "required": true, "schema": {"type": "string", "title": "Prev Version"}}, {"name": "canonical_url", "in": "query", "required": true, "schema": {"type": "string", "title": "Canonical Url"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tes/configurations-to-update": {"get": {"tags": ["tes"], "summary": "Get Configurations To Update", "description": "Collects information needed to render the TES configs that need updating for a given TES release.\n\nArgs:\n db (AsyncDatabaseConnection) : The db connection.\n\nReturns:\n TesConfigsToUpdateResponse: information about TES configs to update,\n with a list of existing drafts and drafts to create", "operationId": "getConfigurationsToUpdate", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TesConfigsToUpdateResponse"}}}}}}}}, "components": {"schemas": {"AddCustomCodeInput": {"properties": {"code": {"type": "string", "title": "Code"}, "display": {"type": "string", "title": "Display"}, "system_id": {"type": "string", "format": "uuid", "title": "System Id"}}, "type": "object", "required": ["code", "display", "system_id"], "title": "AddCustomCodeInput", "description": "Input model for adding a custom code to a configuration."}, "AddSectionInput": {"properties": {"code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["code", "name"], "title": "AddSectionInput", "description": "Request body for adding a section."}, "AssociateCodesetInput": {"properties": {"condition_id": {"type": "string", "format": "uuid", "title": "Condition Id"}}, "type": "object", "required": ["condition_id"], "title": "AssociateCodesetInput", "description": "Condition association input model."}, "AssociateCodesetResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "included_conditions": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Included Conditions"}, "condition_name": {"type": "string", "title": "Condition Name"}}, "type": "object", "required": ["id", "included_conditions", "condition_name"], "title": "AssociateCodesetResponse", "description": "Response from adding a code set to a config."}, "AuditEvent": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "username": {"type": "string", "title": "Username"}, "configuration_name": {"type": "string", "title": "Configuration Name"}, "configuration_version": {"type": "integer", "title": "Configuration Version"}, "condition_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Condition Id"}, "action_text": {"type": "string", "title": "Action Text"}, "code_count": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Code Count"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "has_custom_code_upload_events": {"type": "boolean", "title": "Has Custom Code Upload Events"}}, "type": "object", "required": ["id", "username", "configuration_name", "configuration_version", "condition_id", "action_text", "code_count", "created_at", "has_custom_code_upload_events"], "title": "AuditEvent", "description": "An event returned by the DB function."}, "Body_discoverConfigurations": {"properties": {"uploaded_file": {"anyOf": [{"type": "string", "contentMediaType": "application/octet-stream"}, {"type": "null"}], "title": "Uploaded File"}}, "type": "object", "title": "Body_discoverConfigurations"}, "Body_runInlineConfigurationTest": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "uploaded_file": {"anyOf": [{"type": "string", "contentMediaType": "application/octet-stream"}, {"type": "null"}], "title": "Uploaded File"}}, "type": "object", "required": ["id"], "title": "Body_runInlineConfigurationTest"}, "Body_setCodesStatus": {"properties": {"code_ids_to_skip": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Code Ids To Skip"}, "code_ids": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Code Ids"}}, "type": "object", "required": ["code_ids_to_skip", "code_ids"], "title": "Body_setCodesStatus"}, "Body_uploadEcr": {"properties": {"body": {"type": "string", "title": "Body"}, "uploaded_file": {"anyOf": [{"type": "string", "contentMediaType": "application/octet-stream"}, {"type": "null"}], "title": "Uploaded File"}}, "type": "object", "required": ["body"], "title": "Body_uploadEcr"}, "BulkDeleteCustomCodesInput": {"properties": {"ids": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Ids"}, "ids_to_skip": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Ids To Skip"}, "delete_all": {"type": "boolean", "title": "Delete All"}}, "type": "object", "required": ["ids", "ids_to_skip", "delete_all"], "title": "BulkDeleteCustomCodesInput", "description": "Input model for a bulk custom codes deletion request."}, "CodeCategoryCompletenessStatus": {"properties": {"category": {"type": "string", "title": "Category"}, "name": {"type": "string", "title": "Name"}, "completeness": {"$ref": "#/components/schemas/CodeCategoryStatus"}}, "type": "object", "required": ["category", "name", "completeness"], "title": "CodeCategoryCompletenessStatus", "description": "Code category completeness status model."}, "CodeCategoryStatus": {"type": "string", "enum": ["not included", "partially complete", "fully complete"]}, "CodeCountsResponse": {"properties": {"total_code_count": {"type": "integer", "title": "Total Code Count"}, "total_code_sets_count": {"type": "integer", "title": "Total Code Sets Count"}, "total_excluded_codes_count": {"type": "integer", "title": "Total Excluded Codes Count"}, "total_custom_codes_count": {"type": "integer", "title": "Total Custom Codes Count"}, "primary_condition_rctc_count": {"type": "integer", "title": "Primary Condition Rctc Count"}}, "type": "object", "required": ["total_code_count", "total_code_sets_count", "total_excluded_codes_count", "total_custom_codes_count", "primary_condition_rctc_count"], "title": "CodeCountsResponse", "description": "Code count information to return to the client."}, "CodeFilterOptions": {"properties": {"code_systems": {"items": {"$ref": "#/components/schemas/CodeSystemFilterOption"}, "type": "array", "title": "Code Systems"}, "sources": {"items": {"$ref": "#/components/schemas/SourceFilterOption"}, "type": "array", "title": "Sources"}, "statuses": {"items": {"$ref": "#/components/schemas/StatusFilterOption"}, "type": "array", "title": "Statuses"}}, "type": "object", "required": ["code_systems", "sources", "statuses"], "title": "CodeFilterOptions", "description": "Model to represent all filter options available to the client."}, "CodeResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "condition_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Condition Id"}, "source": {"items": {"type": "string"}, "type": "array", "title": "Source"}, "code": {"type": "string", "title": "Code"}, "description": {"type": "string", "title": "Description"}, "system_id": {"type": "string", "format": "uuid", "title": "System Id"}, "system_name": {"type": "string", "title": "System Name"}, "status": {"type": "string", "enum": ["Included", "Excluded"], "title": "Status"}, "is_custom": {"type": "boolean", "title": "Is Custom"}, "is_trigger_code": {"type": "boolean", "title": "Is Trigger Code"}}, "type": "object", "required": ["id", "condition_id", "source", "code", "description", "system_id", "system_name", "status", "is_custom", "is_trigger_code"], "title": "CodeResponse", "description": "Code object to return to the client."}, "CodeSetStatus": {"type": "string", "enum": ["not expanded", "partially complete", "fully complete"]}, "CodeSystemFilterOption": {"properties": {"system_id": {"type": "string", "format": "uuid", "title": "System Id"}, "system_name": {"type": "string", "title": "System Name"}, "code_count": {"type": "integer", "title": "Code Count"}}, "type": "object", "required": ["system_id", "system_name", "code_count"], "title": "CodeSystemFilterOption", "description": "Model to represent a code system filter option."}, "CodeSystemsReponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "key": {"type": "string", "title": "Key"}, "display_name": {"type": "string", "title": "Display Name"}, "oid": {"type": "string", "title": "Oid"}}, "type": "object", "required": ["id", "key", "display_name", "oid"], "title": "CodeSystemsReponse", "description": "Display information needed for code system information on the frontend."}, "CodedConcept": {"properties": {"code": {"type": "string", "title": "Code"}, "display": {"type": "string", "title": "Display"}}, "type": "object", "required": ["code", "display"], "title": "CodedConcept", "description": "Code / display name minimal representation of a codeable concept."}, "CodedDataLabels": {"properties": {"retain": {"type": "string", "const": "Keep original", "title": "Retain", "default": "Keep original"}, "refine": {"type": "string", "const": "Refine", "title": "Refine", "default": "Refine"}}, "type": "object", "title": "CodedDataLabels", "description": "Enum class to type the narrative actions possible for the frontend."}, "CodesLimitResponse": {"properties": {"codes_limit": {"type": "integer", "const": 100, "title": "Codes Limit", "default": 100}}, "type": "object", "title": "CodesLimitResponse", "description": "Utility class to help Orval ship these values to the frontend."}, "CodesResponse": {"properties": {"next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Next Cursor"}, "codes": {"items": {"$ref": "#/components/schemas/CodeResponse"}, "type": "array", "title": "Codes"}, "codes_limit": {"$ref": "#/components/schemas/CodesLimitResponse"}}, "type": "object", "required": ["next_cursor", "codes", "codes_limit"], "title": "CodesResponse", "description": "Codes and metadata to return to the client."}, "CompletenessStatus": {"properties": {"code_set_status": {"$ref": "#/components/schemas/CodeSetStatus"}, "code_category_statuses": {"items": {"$ref": "#/components/schemas/CodeCategoryCompletenessStatus"}, "type": "array", "title": "Code Category Statuses"}}, "type": "object", "required": ["code_set_status", "code_category_statuses"], "title": "CompletenessStatus", "description": "Condition completeness status model."}, "Condition": {"properties": {"code": {"type": "string", "title": "Code"}, "display_name": {"type": "string", "title": "Display Name"}, "refined_eicr": {"type": "string", "title": "Refined Eicr"}, "stats": {"items": {"type": "string"}, "type": "array", "title": "Stats"}, "render_diff": {"type": "boolean", "title": "Render Diff"}}, "type": "object", "required": ["code", "display_name", "refined_eicr", "stats", "render_diff"], "title": "Condition", "description": "Model for a Condition."}, "ConfigurationStatusUpdateResponse": {"properties": {"configuration_id": {"type": "string", "format": "uuid", "title": "Configuration Id"}, "status": {"$ref": "#/components/schemas/DbConfigurationStatus"}}, "type": "object", "required": ["configuration_id", "status"], "title": "ConfigurationStatusUpdateResponse", "description": "Response model for updating the status a configuration."}, "ConfigurationTestResponse": {"properties": {"original_eicr": {"type": "string", "title": "Original Eicr"}, "refined_download_key": {"type": "string", "title": "Refined Download Key"}, "condition": {"$ref": "#/components/schemas/Condition"}}, "type": "object", "required": ["original_eicr", "refined_download_key", "condition"], "title": "ConfigurationTestResponse", "description": "Model to represent the response provided to the client when in-line testing is run."}, "ConfirmUploadCustomCodesInput": {"properties": {"custom_codes": {"items": {"$ref": "#/components/schemas/AddCustomCodeInput"}, "type": "array", "title": "Custom Codes"}}, "type": "object", "required": ["custom_codes"], "title": "ConfirmUploadCustomCodesInput", "description": "Payload used to confirm a previously validated CSV import."}, "CreateConfigInput": {"properties": {"condition_id": {"type": "string", "format": "uuid", "title": "Condition Id"}}, "type": "object", "required": ["condition_id"], "title": "CreateConfigInput", "description": "Body required to create a new configuration."}, "CreateConfigurationResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["id", "name"], "title": "CreateConfigurationResponse", "description": "Configuration creation response model."}, "CustomCodeResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "display": {"type": "string", "title": "Display"}, "code": {"type": "string", "title": "Code"}, "system_id": {"type": "string", "format": "uuid", "title": "System Id"}, "system_name": {"type": "string", "title": "System Name"}}, "type": "object", "required": ["id", "display", "code", "system_id", "system_name"], "title": "CustomCodeResponse", "description": "Custom code object to return to the client."}, "CustomCodeUploadEventResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "system_display_name": {"type": "string", "title": "System Display Name"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["id", "system_display_name", "code", "name"], "title": "CustomCodeUploadEventResponse", "description": "Response model for a custom code upload event."}, "DbCode": {"properties": {"code": {"type": "string", "title": "Code"}, "display": {"type": "string", "title": "Display"}, "system_id": {"type": "string", "format": "uuid", "title": "System Id"}, "system_name": {"type": "string", "title": "System Name"}}, "type": "object", "required": ["code", "display", "system_id", "system_name"], "title": "DbCode", "description": "Model for all coded information stored in the codes table."}, "DbCodeSystem": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "key": {"type": "string", "title": "Key"}, "display_name": {"type": "string", "title": "Display Name"}, "oid": {"type": "string", "title": "Oid"}}, "type": "object", "required": ["id", "key", "display_name", "oid"], "title": "DbCodeSystem", "description": "A code system row from the `systems` table."}, "DbConfigurationSectionProcessing": {"properties": {"include": {"type": "boolean", "title": "Include"}, "narrative": {"$ref": "#/components/schemas/DbNarrativeAction"}, "action": {"$ref": "#/components/schemas/DbSectionAction"}, "name": {"type": "string", "title": "Name"}, "code": {"type": "string", "title": "Code"}, "versions": {"items": {"type": "string"}, "type": "array", "title": "Versions"}, "section_type": {"$ref": "#/components/schemas/DbSectionType"}}, "type": "object", "required": ["include", "narrative", "action", "name", "code", "versions", "section_type"], "title": "DbConfigurationSectionProcessing", "description": "Section Processing instructions for a Configuration.\n\n`name` is the section's name.\n`code` is the LOINC code for the section.\n`versions` is a list of versions this section appears in.\n`section_type` is an indicator as to how the section was created."}, "DbConfigurationStatus": {"type": "string", "enum": ["draft", "inactive", "active"]}, "DbNarrativeAction": {"type": "string", "enum": ["retain", "remove", "reconstruct", "keep_on_match"]}, "DbSectionAction": {"type": "string", "enum": ["retain", "refine"]}, "DbSectionType": {"type": "string", "enum": ["standard", "custom"]}, "DbTotalConditionCodeCount": {"properties": {"condition_id": {"type": "string", "format": "uuid", "title": "Condition Id"}, "display_name": {"type": "string", "title": "Display Name"}, "total_codes": {"type": "integer", "title": "Total Codes"}}, "type": "object", "required": ["condition_id", "display_name", "total_codes"], "title": "DbTotalConditionCodeCount", "description": "Total code count model."}, "DeleteSectionInput": {"properties": {"code": {"type": "string", "title": "Code"}}, "type": "object", "required": ["code"], "title": "DeleteSectionInput", "description": "Request body to delete a section."}, "DisabledSection": {"type": "string", "enum": ["83910-0", "88085-6"], "title": "DisabledSection", "description": "These sections are preserved intact in every refined document.\n\nThey sit outside the normal refinement workflow not because the\nrefiner needs to protect them, but because we don't yet have a\nreal-world authoring contract to refine against:\n\n- Reportability Response Information (88085-6) is defined by the\n eICR STU 3.1.1 IG as a section the PHA populates after eICR\n receipt, as part of internal data integration -- not something\n the HCO authors at eICR generation time. It's sketched in the\n IG but is not part of eICRs flowing through AIMS today.\n\n- Emergency Outbreak Information (83910-0) has a defined section\n template and a deliberately generic Observation structure\n (\"unknown until the time of the outbreak,\" per the IG). There\n is no settled EHR implementation pattern, and the next outbreak\n will likely shape how this section actually appears in\n production.\n\nSkipping is the easier path for now and produces Schematron-valid\noutput. We can revisit -- per section, independently -- if and\nwhen either becomes something we actually see in real documents.\n\nThe Enum is the single source of truth: used at runtime to derive\nSECTION_PROCESSING_SKIP, and at the API boundary so Orval ships\nthe concrete LOINC codes to the frontend as const values rather\nthan as plain `string[]`."}, "DiscoveredConfigurationSet": {"properties": {"name": {"type": "string", "title": "Name"}, "condition_id": {"type": "string", "format": "uuid", "title": "Condition Id"}, "versions": {"items": {"$ref": "#/components/schemas/DiscoveredConfigurationVersion"}, "type": "array", "title": "Versions"}}, "type": "object", "required": ["name", "condition_id", "versions"], "title": "DiscoveredConfigurationSet", "description": "Model to represent a set of discovered configurations."}, "DiscoveredConfigurationVersion": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "version": {"type": "integer", "title": "Version"}, "status": {"$ref": "#/components/schemas/DbConfigurationStatus"}}, "type": "object", "required": ["id", "version", "status"], "title": "DiscoveredConfigurationVersion", "description": "Model to represent individual discovered configurations."}, "DiscoveredConfigurationsResponse": {"properties": {"sets": {"items": {"$ref": "#/components/schemas/DiscoveredConfigurationSet"}, "type": "array", "title": "Sets"}}, "type": "object", "required": ["sets"], "title": "DiscoveredConfigurationsResponse", "description": "Model to represent the sets of discovered configurations to return to the client."}, "EventFilterOption": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "canonical_url": {"type": "string", "title": "Canonical Url"}}, "type": "object", "required": ["id", "name", "canonical_url"], "title": "EventFilterOption", "description": "Conditions returned to the user to be used for filtering events."}, "EventsResponse": {"properties": {"audit_events": {"items": {"$ref": "#/components/schemas/AuditEvent"}, "type": "array", "title": "Audit Events"}, "configuration_options": {"items": {"$ref": "#/components/schemas/EventFilterOption"}, "type": "array", "title": "Configuration Options"}, "total_pages": {"type": "integer", "title": "Total Pages"}}, "type": "object", "required": ["audit_events", "configuration_options", "total_pages"], "title": "EventsResponse", "description": "Response needed for the audit log page."}, "FileInfoResponse": {"properties": {"max_for_diff_rendering_mb": {"type": "integer", "const": 2, "title": "Max For Diff Rendering Mb", "default": 2}, "max_for_uncompressed_mb": {"type": "integer", "const": 15, "title": "Max For Uncompressed Mb", "default": 15}}, "type": "object", "title": "FileInfoResponse", "description": "Utility class to help Orval ship these values to the frontend."}, "GetConditionResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "display_name": {"type": "string", "title": "Display Name"}, "completeness_status": {"$ref": "#/components/schemas/CompletenessStatus"}, "codes": {"items": {"$ref": "#/components/schemas/DbCode"}, "type": "array", "title": "Codes"}, "systems": {"items": {"$ref": "#/components/schemas/CodeSystemsReponse"}, "type": "array", "title": "Systems"}}, "type": "object", "required": ["id", "display_name", "completeness_status", "codes", "systems"], "title": "GetConditionResponse", "description": "Condition response model."}, "GetConditionsResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "display_name": {"type": "string", "title": "Display Name"}, "rsg_codes": {"items": {"$ref": "#/components/schemas/CodedConcept"}, "type": "array", "title": "Rsg Codes"}}, "type": "object", "required": ["id", "display_name", "rsg_codes"], "title": "GetConditionsResponse", "description": "Conditions response model."}, "GetConfigurationResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "draft_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Draft Id"}, "is_draft": {"type": "boolean", "title": "Is Draft"}, "condition_id": {"type": "string", "format": "uuid", "title": "Condition Id"}, "condition_canonical_url": {"type": "string", "title": "Condition Canonical Url"}, "display_name": {"type": "string", "title": "Display Name"}, "status": {"$ref": "#/components/schemas/DbConfigurationStatus"}, "code_sets": {"items": {"$ref": "#/components/schemas/DbTotalConditionCodeCount"}, "type": "array", "title": "Code Sets"}, "included_conditions": {"items": {"$ref": "#/components/schemas/IncludedCondition"}, "type": "array", "title": "Included Conditions"}, "custom_codes": {"items": {"$ref": "#/components/schemas/CustomCodeResponse"}, "type": "array", "title": "Custom Codes"}, "section_processing": {"items": {"$ref": "#/components/schemas/DbConfigurationSectionProcessing"}, "type": "array", "title": "Section Processing"}, "all_versions": {"items": {"$ref": "#/components/schemas/GetConfigurationResponseVersion"}, "type": "array", "title": "All Versions"}, "rsg_codes": {"items": {"$ref": "#/components/schemas/DbCode"}, "type": "array", "title": "Rsg Codes"}, "version": {"type": "integer", "title": "Version"}, "active_configuration_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Active Configuration Id"}, "active_version": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Active Version"}, "latest_version": {"type": "integer", "title": "Latest Version"}, "is_locked": {"type": "boolean", "title": "Is Locked"}, "locked_by": {"anyOf": [{"$ref": "#/components/schemas/LockedByUser"}, {"type": "null"}]}}, "type": "object", "required": ["id", "draft_id", "is_draft", "condition_id", "condition_canonical_url", "display_name", "status", "code_sets", "included_conditions", "custom_codes", "section_processing", "all_versions", "rsg_codes", "version", "active_configuration_id", "active_version", "latest_version", "is_locked", "locked_by"], "title": "GetConfigurationResponse", "description": "Model for a configuration response."}, "GetConfigurationResponseVersion": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "version": {"type": "integer", "title": "Version"}, "condition_canonical_url": {"type": "string", "title": "Condition Canonical Url"}, "status": {"$ref": "#/components/schemas/DbConfigurationStatus"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "created_by": {"type": "string", "title": "Created By"}, "last_activated_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Activated At"}, "last_activated_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Last Activated By"}}, "type": "object", "required": ["id", "version", "condition_canonical_url", "status", "created_at", "created_by", "last_activated_at", "last_activated_by"], "title": "GetConfigurationResponseVersion", "description": "Model representing a version of a configuration."}, "GetConfigurationsResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "status": {"$ref": "#/components/schemas/DbConfigurationStatus"}}, "type": "object", "required": ["id", "name", "status"], "title": "GetConfigurationsResponse", "description": "Model for a user-defined configuration."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "IncludedCondition": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "display_name": {"type": "string", "title": "Display Name"}, "canonical_url": {"type": "string", "title": "Canonical Url"}, "version": {"type": "string", "title": "Version"}, "associated": {"type": "boolean", "title": "Associated"}, "code_set_status": {"$ref": "#/components/schemas/CodeSetStatus"}}, "type": "object", "required": ["id", "display_name", "canonical_url", "version", "associated", "code_set_status"], "title": "IncludedCondition", "description": "Model for a condition that is associated with a configuration."}, "LockedByUser": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "email": {"type": "string", "title": "Email"}}, "type": "object", "required": ["id", "name", "email"], "title": "LockedByUser", "description": "LockedByUser response to provide user information."}, "NarrativeDataLabels": {"properties": {"retain": {"type": "string", "const": "Keep original", "title": "Retain", "default": "Keep original"}, "keep_on_match": {"type": "string", "const": "Keep on match", "title": "Keep On Match", "default": "Keep on match"}, "reconstruct": {"type": "string", "const": "Reconstruct", "title": "Reconstruct", "default": "Reconstruct"}, "remove": {"type": "string", "const": "Exclude", "title": "Remove", "default": "Exclude"}}, "type": "object", "title": "NarrativeDataLabels", "description": "Enum class to type the narrative actions possible for the frontend."}, "NarrativeOnlySection": {"type": "string", "enum": ["10154-3", "29299-5", "10164-2", "10187-3"], "title": "NarrativeOnlySection", "description": "These sections have no entry match rules in the eICR specification.\n\nThey are conveyed via the narrative block only. Configuring them for\n\"refine\" is meaningless (there is nothing to match against), so the UI\ndisables the refine toggle for them and the refinement plan normalizes\n\"refine\" -> \"retain\" for these codes (see refine.py). The Enum values\nremain the single source of truth shipped to the frontend. A unit test\nguards that this enum stays in sync with the spec catalog (every code\nlisted here has has_match_rules=False in the catalog, and every catalog\nsection with has_match_rules=False is listed here)."}, "NotificationKeys": {"type": "string", "enum": ["most_recent_app_update", "most_recent_tes_update"], "title": "NotificationKeys", "description": "Enum class to type the values of the notifications possible for actioning on the frontend."}, "NotificationsToRender": {"properties": {"to_render": {"additionalProperties": {"type": "boolean"}, "propertyNames": {"$ref": "#/components/schemas/NotificationKeys"}, "type": "object", "title": "To Render"}}, "type": "object", "required": ["to_render"], "title": "NotificationsToRender", "description": "Map of booleans for each of the notificaiton keys as to whether to render frontend banners."}, "ReconstructableSection": {"type": "string", "enum": ["30954-2", "11450-4", "11369-6", "29549-3", "18776-5"], "title": "ReconstructableSection", "description": "These sections support the \"reconstruct\" narrative action.\n\nResults, Problems, Immunizations, Medications Administered, and Plan of\nTreatment are enabled. Make sure to update unit tests to ensure only\ncertain sections are reconstructable."}, "Release": {"properties": {"id": {"type": "string", "title": "Id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "name": {"type": "string", "title": "Name"}, "release_notes": {"items": {"$ref": "#/components/schemas/ReleaseNotes"}, "type": "array", "title": "Release Notes"}, "prerelease": {"type": "boolean", "title": "Prerelease"}, "url": {"type": "string", "title": "Url"}}, "type": "object", "required": ["id", "created_at", "name", "release_notes", "prerelease", "url"], "title": "Release", "description": "Type for release information sent to the frontend."}, "ReleaseNotes": {"properties": {"id": {"type": "string", "title": "Id"}, "header": {"type": "string", "title": "Header"}, "content": {"type": "string", "title": "Content"}}, "type": "object", "required": ["id", "header", "content"], "title": "ReleaseNotes", "description": "Content of a release note from GitHub."}, "ReleasesResponse": {"properties": {"releases": {"items": {"$ref": "#/components/schemas/Release"}, "type": "array", "title": "Releases"}}, "type": "object", "required": ["releases"], "title": "ReleasesResponse", "description": "Response for releases as returned through the GitHub API."}, "SectionUpdateInput": {"properties": {"include": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Include"}, "narrative": {"anyOf": [{"$ref": "#/components/schemas/DbNarrativeAction"}, {"type": "null"}]}, "action": {"anyOf": [{"$ref": "#/components/schemas/DbSectionAction"}, {"type": "null"}]}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "current_code": {"type": "string", "title": "Current Code"}, "new_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "New Code"}}, "type": "object", "required": ["current_code"], "title": "SectionUpdateInput", "description": "Input model for updating a section's processing instructions."}, "SerializedFile": {"properties": {"key": {"type": "string", "title": "Key"}, "content": {"type": "string", "title": "Content"}}, "type": "object", "required": ["key", "content"], "title": "SerializedFile", "description": "An individual serialized file."}, "SerializedFiles": {"properties": {"active": {"$ref": "#/components/schemas/SerializedFile"}, "current": {"$ref": "#/components/schemas/SerializedFile"}, "metadata": {"$ref": "#/components/schemas/SerializedFile"}}, "type": "object", "required": ["active", "current", "metadata"], "title": "SerializedFiles", "description": "Dataclass for serialized file data."}, "SimulatorUploadResponse": {"properties": {"message": {"type": "string", "title": "Message"}, "refined_conditions_found": {"type": "integer", "title": "Refined Conditions Found"}, "refined_conditions": {"items": {"$ref": "#/components/schemas/Condition"}, "type": "array", "title": "Refined Conditions"}, "unrefined_eicr": {"type": "string", "title": "Unrefined Eicr"}, "refined_download_key": {"type": "string", "title": "Refined Download Key"}, "file_info_response": {"$ref": "#/components/schemas/FileInfoResponse"}}, "type": "object", "required": ["message", "refined_conditions_found", "refined_conditions", "unrefined_eicr", "refined_download_key", "file_info_response"], "title": "SimulatorUploadResponse", "description": "Model for the response when uploading a document in the simulate testing suite."}, "SourceFilterOption": {"properties": {"condition_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Condition Id"}, "source": {"type": "string", "title": "Source"}, "code_count": {"type": "integer", "title": "Code Count"}}, "type": "object", "required": ["condition_id", "source", "code_count"], "title": "SourceFilterOption", "description": "Model to represent a source filter option."}, "StatusFilterOption": {"properties": {"label": {"type": "string", "enum": ["Included", "Excluded"], "title": "Label"}, "status": {"type": "string", "enum": ["included", "excluded"], "title": "Status"}, "code_count": {"type": "integer", "title": "Code Count"}}, "type": "object", "required": ["label", "status", "code_count"], "title": "StatusFilterOption", "description": "Model to represent a status filter option."}, "TesConfigToUpdate": {"properties": {"configuration_id": {"type": "string", "format": "uuid", "title": "Configuration Id"}, "configuration_name": {"type": "string", "title": "Configuration Name"}, "codesets_to_update": {"items": {"type": "string"}, "type": "array", "title": "Codesets To Update"}, "configuration_tes_version": {"type": "string", "title": "Configuration Tes Version"}}, "type": "object", "required": ["configuration_id", "configuration_name", "codesets_to_update", "configuration_tes_version"], "title": "TesConfigToUpdate", "description": "A configuration to update with new TES codes."}, "TesConfigsToUpdateResponse": {"properties": {"existing_drafts": {"items": {"$ref": "#/components/schemas/TesConfigToUpdate"}, "type": "array", "title": "Existing Drafts"}, "drafts_to_create": {"items": {"$ref": "#/components/schemas/TesConfigToUpdate"}, "type": "array", "title": "Drafts To Create"}}, "type": "object", "required": ["existing_drafts", "drafts_to_create"], "title": "TesConfigsToUpdateResponse", "description": "The response needed for rendering of the TES update configuration page."}, "TesDiffConditionDetails": {"properties": {"canonical_url": {"type": "string", "title": "Canonical Url"}, "display_name": {"type": "string", "title": "Display Name"}, "added_code_total": {"type": "integer", "title": "Added Code Total"}, "removed_code_total": {"type": "integer", "title": "Removed Code Total"}, "is_new": {"type": "boolean", "title": "Is New"}}, "type": "object", "required": ["canonical_url", "display_name", "added_code_total", "removed_code_total", "is_new"], "title": "TesDiffConditionDetails", "description": "A condition within a TES diff, with details for the diff page to display."}, "TesResponse": {"properties": {"tes_updates": {"items": {"$ref": "#/components/schemas/TesUpdate"}, "type": "array", "title": "Tes Updates"}}, "type": "object", "required": ["tes_updates"], "title": "TesResponse", "description": "Response needed for the TES updates page."}, "TesUpdate": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "version": {"type": "string", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "version", "created_at"], "title": "TesUpdate", "description": "All metadata for a TES update needed for the frontend."}, "TriggerCodeSection": {"type": "string", "enum": ["10160-0", "11369-6", "11450-4", "18776-5", "29549-3", "30954-2", "42346-7", "46240-8", "47519-4"], "title": "TriggerCodeSection", "description": "These sections can carry an eICR trigger code template.\n\nThe eICR IG defines trigger code templates for these sections, so a\ntrigger code \u2014 the coded evidence of *why* the document was\ngenerated \u2014 can appear in any of them. Removing a section strips\nevery `` it holds and marks it `nullFlavor=\"NI\"` (see\n`create_minimal_section`), so a jurisdiction that turned all of\nthese off would emit a document with no trigger codes anywhere and\nfail Schematron validation.\n\nIn practice this is unlikely: nearly all RCTC codes from the eRSD\nare carried in the reporting specification groupers, and the\nadditional context groupers widen that further, so a configuration\nwould normally match the trigger code and keep the section. This\npolicy exists to close the foot-gun, not because we expect\njurisdictions to walk into it.\n\nThe refiner therefore forces `include=True` for these sections.\nEvery other setting stays under jurisdiction control \u2014 coded data\nmay still be refined or retained, and the narrative may be\nretained, removed, kept on match, or reconstructed.\n\nMembership is IG-derived, not a judgement call: the codes here are\nthe union of `specification.get_trigger_code_sections()` across\nevery supported eICR version. The union matters because a\nconfiguration is authored once and applied to whichever version\narrives. The Enum is spelled out rather than computed so Orval\nships concrete LOINC codes to the frontend, and so a change to the\nIG manifest surfaces as a failing drift test rather than silently\nrelaxing every jurisdiction's configuration. A unit test guards\nthat this enum stays in sync with the specification."}, "UpdateCustomCodeInput": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "system_id": {"type": "string", "format": "uuid", "title": "System Id"}, "code": {"type": "string", "title": "Code"}, "display": {"type": "string", "title": "Display"}}, "type": "object", "required": ["id", "system_id", "code", "display"], "title": "UpdateCustomCodeInput", "description": "Input model when updating a config's custom code."}, "UpdateSectionProcessingResponse": {"properties": {"section_updated_code": {"type": "string", "title": "Section Updated Code"}, "disabled_section": {"items": {"$ref": "#/components/schemas/DisabledSection"}, "type": "array", "title": "Disabled Section"}, "narrative_only_section": {"items": {"$ref": "#/components/schemas/NarrativeOnlySection"}, "type": "array", "title": "Narrative Only Section"}, "reconstructable_section": {"items": {"$ref": "#/components/schemas/ReconstructableSection"}, "type": "array", "title": "Reconstructable Section"}, "trigger_code_section": {"items": {"$ref": "#/components/schemas/TriggerCodeSection"}, "type": "array", "title": "Trigger Code Section"}, "narrative_data_labels": {"$ref": "#/components/schemas/NarrativeDataLabels"}, "coded_data_labels": {"$ref": "#/components/schemas/CodedDataLabels"}}, "type": "object", "required": ["section_updated_code", "disabled_section", "narrative_only_section", "reconstructable_section", "trigger_code_section", "narrative_data_labels", "coded_data_labels"], "title": "UpdateSectionProcessingResponse", "description": "Section with information for a custom section update."}, "UpdateUserNotificationsRequest": {"properties": {"key": {"$ref": "#/components/schemas/NotificationKeys"}}, "type": "object", "required": ["key"], "title": "UpdateUserNotificationsRequest", "description": "Request to update notification acknowledgement state for the current user."}, "UploadCustomCodesCsvInput": {"properties": {"csv_text": {"type": "string", "title": "Csv Text", "description": "Full CSV contents as UTF-8 text"}, "filename": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Filename"}}, "type": "object", "required": ["csv_text"], "title": "UploadCustomCodesCsvInput", "description": "Input model for Custom Code CSV."}, "UploadCustomCodesPreviewItem": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "code": {"type": "string", "title": "Code"}, "system_id": {"type": "string", "format": "uuid", "title": "System Id"}, "system_name": {"type": "string", "title": "System Name"}, "display": {"type": "string", "title": "Display"}, "row": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Row"}}, "type": "object", "required": ["id", "code", "system_id", "system_name", "display"], "title": "UploadCustomCodesPreviewItem", "description": "Validated CSV row ready for confirmation."}, "UploadCustomCodesPreviewResponse": {"properties": {"preview_items": {"items": {"$ref": "#/components/schemas/UploadCustomCodesPreviewItem"}, "type": "array", "title": "Preview Items"}, "codes_processed": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Codes Processed"}, "total_custom_codes_in_configuration": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Total Custom Codes In Configuration"}, "code_systems": {"items": {"$ref": "#/components/schemas/DbCodeSystem"}, "type": "array", "title": "Code Systems"}}, "type": "object", "required": ["preview_items", "code_systems"], "title": "UploadCustomCodesPreviewResponse", "description": "Validated CSV preview for delayed confirmation; only valid if preview."}, "UserResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "username": {"type": "string", "title": "Username"}, "jurisdiction_id": {"type": "string", "title": "Jurisdiction Id"}, "notifications": {"$ref": "#/components/schemas/NotificationsToRender"}}, "type": "object", "required": ["id", "username", "jurisdiction_id", "notifications"], "title": "UserResponse", "description": "User information to send to the client."}, "ValidateCustomCodeInput": {"properties": {"current_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Current Code"}, "desired_code": {"type": "string", "title": "Desired Code"}}, "type": "object", "required": ["current_code", "desired_code"], "title": "ValidateCustomCodeInput", "description": "Input model when validating a config's custom code."}, "ValidateCustomCodeResponse": {"properties": {"valid": {"type": "boolean", "title": "Valid"}}, "type": "object", "required": ["valid"], "title": "ValidateCustomCodeResponse", "description": "Validation response model."}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}, "input": {"title": "Input"}, "ctx": {"type": "object", "title": "Context"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}}}