{"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 all available conditions from the database.\n\nArgs:\n db (AsyncDatabaseConnection): Database connection.\n\nReturns:\n list[Condition]: List of all conditions.", "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}": {"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": {"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/ConfigurationCustomCodeResponse"}}}}, "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/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\nRaises:\n HTTPException: 400 if a system is not provided\n HTTPException: 400 if a code is not provided\n HTTPException: 404 if the configuration can't be found\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/ConfigurationCustomCodeResponse"}}}}, "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_number,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/{system}/{code}": {"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 system (str): System of the custom code.\n code (str): Code 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 system is not provided\n HTTPException: 400 if code 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": "configuration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Configuration Id"}}, {"name": "system", "in": "path", "required": true, "schema": {"type": "string", "title": "System"}}, {"name": "code", "in": "path", "required": true, "schema": {"type": "string", "title": "Code"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConfigurationCustomCodeResponse"}}}}, "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_refined_files_to_s3: 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}/section-processing": {"patch": {"tags": ["configurations"], "summary": "Update Section Processing", "description": "Update a section entry for a configuration.\n\nArgs:\n configuration_id (UUID): ID of the configuration to update\n section (UpdateSectionInput): Updated section info\n user (DbUser): The logged-in user\n db (AsyncDatabaseConnection): 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 section processing can't be updated\n\nReturns:\n UpdateSectionProcessingResponse: The message to show the user", "operationId": "updateConfigurationSectionProcessing", "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/UpdateSectionInput"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "string", "title": "Response Updateconfigurationsectionprocessing"}}}}, "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}/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/demo/upload": {"post": {"tags": ["demo"], "summary": "Demo Upload", "description": "Handles the demo upload workflow for eICR refinement.\n\nSteps:\n1. Obtain the demo 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 (`independent_testing`) 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"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IndependentTestUploadResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/demo/download/{filename}": {"get": {"tags": ["demo"], "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/EventResponse"}}}}, "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 Custom Codes CSV Upload", "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": {"$ref": "#/components/schemas/UploadCustomCodesResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"AddCustomCodeInput": {"properties": {"code": {"type": "string", "title": "Code"}, "system": {"type": "string", "enum": ["loinc", "snomed", "icd-10", "rxnorm", "other"], "title": "System"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["code", "system", "name"], "title": "AddCustomCodeInput", "description": "Input model for adding a custom code to a configuration."}, "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": {"$ref": "#/components/schemas/ConditionEntry"}, "type": "array", "title": "Included Conditions"}, "condition_name": {"type": "string", "title": "Condition Name"}}, "type": "object", "required": ["id", "included_conditions", "condition_name"], "title": "AssociateCodesetResponse"}, "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": {"type": "string", "format": "uuid", "title": "Condition Id"}, "action_text": {"type": "string", "title": "Action Text"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "username", "configuration_name", "configuration_version", "condition_id", "action_text", "created_at"], "title": "AuditEvent"}, "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_uploadEcr": {"properties": {"uploaded_file": {"anyOf": [{"type": "string", "contentMediaType": "application/octet-stream"}, {"type": "null"}], "title": "Uploaded File"}}, "type": "object", "title": "Body_uploadEcr"}, "Condition": {"properties": {"code": {"type": "string", "title": "Code"}, "display_name": {"type": "string", "title": "Display Name"}, "refined_eicr": {"type": "string", "title": "Refined Eicr"}, "refined_rr": {"type": "string", "title": "Refined Rr"}, "stats": {"items": {"type": "string"}, "type": "array", "title": "Stats"}}, "type": "object", "required": ["code", "display_name", "refined_eicr", "refined_rr", "stats"], "title": "Condition"}, "ConditionEntry": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}}, "type": "object", "required": ["id"], "title": "ConditionEntry"}, "ConfigurationCustomCodeResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "display_name": {"type": "string", "title": "Display Name"}, "code_sets": {"items": {"$ref": "#/components/schemas/DbTotalConditionCodeCount"}, "type": "array", "title": "Code Sets"}, "custom_codes": {"items": {"$ref": "#/components/schemas/DbConfigurationCustomCode"}, "type": "array", "title": "Custom Codes"}}, "type": "object", "required": ["id", "display_name", "code_sets", "custom_codes"], "title": "ConfigurationCustomCodeResponse"}, "ConfigurationStatusUpdateResponse": {"properties": {"configuration_id": {"type": "string", "format": "uuid", "title": "Configuration Id"}, "status": {"$ref": "#/components/schemas/DbConfigurationStatus"}}, "type": "object", "required": ["configuration_id", "status"], "title": "ConfigurationStatusUpdateResponse"}, "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"}, "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"}, "DbConfigurationCustomCode": {"properties": {"code": {"type": "string", "title": "Code"}, "system": {"type": "string", "enum": ["LOINC", "SNOMED", "ICD-10", "RxNorm", "Other"], "title": "System"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["code", "system", "name"], "title": "DbConfigurationCustomCode"}, "DbConfigurationSectionProcessing": {"properties": {"include": {"type": "boolean", "title": "Include"}, "narrative": {"type": "boolean", "title": "Narrative"}, "action": {"$ref": "#/components/schemas/DbSectionAction"}, "name": {"type": "string", "title": "Name"}, "code": {"type": "string", "title": "Code"}, "versions": {"items": {"type": "string"}, "type": "array", "title": "Versions"}}, "type": "object", "required": ["include", "narrative", "action", "name", "code", "versions"], "title": "DbConfigurationSectionProcessing"}, "DbConfigurationStatus": {"type": "string", "enum": ["draft", "inactive", "active"]}, "DbSectionAction": {"type": "string", "enum": ["retain", "refine"]}, "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"}, "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"}, "EventResponse": {"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": "EventResponse"}, "GetConditionCode": {"properties": {"code": {"type": "string", "title": "Code"}, "system": {"type": "string", "title": "System"}, "description": {"type": "string", "title": "Description"}}, "type": "object", "required": ["code", "system", "description"], "title": "GetConditionCode"}, "GetConditionResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "display_name": {"type": "string", "title": "Display Name"}, "available_systems": {"items": {"type": "string"}, "type": "array", "title": "Available Systems"}, "codes": {"items": {"$ref": "#/components/schemas/GetConditionCode"}, "type": "array", "title": "Codes"}}, "type": "object", "required": ["id", "display_name", "available_systems", "codes"], "title": "GetConditionResponse"}, "GetConditionsResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "display_name": {"type": "string", "title": "Display Name"}}, "type": "object", "required": ["id", "display_name"], "title": "GetConditionsResponse"}, "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/DbConfigurationCustomCode"}, "type": "array", "title": "Custom Codes"}, "section_processing": {"items": {"$ref": "#/components/schemas/DbConfigurationSectionProcessing"}, "type": "array", "title": "Section Processing"}, "deduplicated_codes": {"items": {"type": "string"}, "type": "array", "title": "Deduplicated Codes"}, "all_versions": {"items": {"$ref": "#/components/schemas/GetConfigurationResponseVersion"}, "type": "array", "title": "All Versions"}, "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", "deduplicated_codes", "all_versions", "version", "active_configuration_id", "active_version", "latest_version", "is_locked", "locked_by"], "title": "GetConfigurationResponse"}, "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"}, "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"}, "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"}}, "type": "object", "required": ["id", "display_name", "canonical_url", "version", "associated"], "title": "IncludedCondition"}, "IndependentTestUploadResponse": {"properties": {"message": {"type": "string", "title": "Message"}, "conditions_without_matching_configs": {"items": {"type": "string"}, "type": "array", "title": "Conditions Without Matching Configs"}, "conditions_without_active_configs": {"items": {"type": "string"}, "type": "array", "title": "Conditions Without Active Configs"}, "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"}}, "type": "object", "required": ["message", "conditions_without_matching_configs", "conditions_without_active_configs", "refined_conditions_found", "refined_conditions", "unrefined_eicr", "refined_download_key"], "title": "IndependentTestUploadResponse"}, "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"}, "UpdateCustomCodeInput": {"properties": {"system": {"type": "string", "title": "System"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "new_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "New Code"}, "new_system": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "New System"}, "new_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "New Name"}}, "type": "object", "required": ["system", "code", "name", "new_code", "new_system", "new_name"], "title": "UpdateCustomCodeInput", "description": "Input model when updating a config's custom code."}, "UpdateSectionInput": {"properties": {"code": {"type": "string", "title": "Code"}, "include": {"type": "boolean", "title": "Include"}, "narrative": {"type": "boolean", "title": "Narrative"}, "action": {"$ref": "#/components/schemas/DbSectionAction"}}, "type": "object", "required": ["code", "include", "narrative", "action"], "title": "UpdateSectionInput", "description": "Model for a single section processing update."}, "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": {"code": {"type": "string", "title": "Code"}, "system": {"type": "string", "enum": ["LOINC", "SNOMED", "ICD-10", "RxNorm", "Other"], "title": "System"}, "name": {"type": "string", "title": "Name"}, "row": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Row"}}, "type": "object", "required": ["code", "system", "name"], "title": "UploadCustomCodesPreviewItem", "description": "Validated CSV row ready for confirmation."}, "UploadCustomCodesPreviewResponse": {"properties": {"preview": {"anyOf": [{"items": {"$ref": "#/components/schemas/UploadCustomCodesPreviewItem"}, "type": "array"}, {"type": "null"}], "title": "Preview"}, "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"}, "errors": {"anyOf": [{"items": {"additionalProperties": true, "type": "object"}, "type": "array"}, {"type": "null"}], "title": "Errors"}}, "type": "object", "title": "UploadCustomCodesPreviewResponse", "description": "Validated CSV preview model for delayed confirmation."}, "UserResponse": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "username": {"type": "string", "title": "Username"}, "jurisdiction_id": {"type": "string", "title": "Jurisdiction Id"}}, "type": "object", "required": ["id", "username", "jurisdiction_id"], "title": "UserResponse", "description": "User information to send to the client."}, "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"}, "ConfirmUploadCustomCodesInput": {"type": "object", "properties": {"custom_codes": {"type": "array", "items": {"$ref": "#/components/schemas/UploadCustomCodesPreviewItem"}}}, "required": ["custom_codes"], "title": "ConfirmUploadCustomCodesInput"}}}}