{ "components": { "schemas": { "Body_add_clinical_validation": { "properties": { "file": { "contentMediaType": "application/octet-stream", "title": "File", "type": "string" } }, "required": [ "file" ], "title": "Body_add_clinical_validation", "type": "object" }, "Body_upload": { "properties": { "file": { "contentMediaType": "application/octet-stream", "title": "File", "type": "string" } }, "required": [ "file" ], "title": "Body_upload", "type": "object" }, "Condition": { "properties": { "column": { "title": "Column", "type": "string" }, "op": { "enum": [ "equals", "contains", "matches", "present" ], "title": "Op", "type": "string" }, "value": { "default": "", "title": "Value", "type": "string" } }, "required": [ "column", "op" ], "title": "Condition", "type": "object" }, "Correction": { "properties": { "field": { "enum": [ "record_number", "full_name", "curp", "nss", "birth_date", "sex", "postal_code" ], "title": "Field", "type": "string" }, "record": { "title": "Record", "type": "string" }, "value": { "title": "Value", "type": "string" } }, "required": [ "record", "field", "value" ], "title": "Correction", "type": "object" }, "Domain": { "enum": [ "cacu", "cama", "tea" ], "title": "Domain", "type": "string" }, "Extract": { "additionalProperties": false, "description": "Platform fields read from text, each kept with the text it was read from.\n\n`auto` asks the LLM when one is configured and answering, else applies `patterns`;\nwith neither, the row is held. Patterns are regexes with one group, per field (the\nLLM can propose them from sample documents); their values go through `values` and\n`formats` as in `map`.", "properties": { "column": { "title": "Column", "type": "string" }, "entity": { "enum": [ "identity", "death", "clinical_note", "cervical_cytology", "cervical_biopsy", "mammography", "breast_biopsy" ], "title": "Entity", "type": "string" }, "formats": { "additionalProperties": { "type": "string" }, "default": {}, "title": "Formats", "type": "object" }, "hints": { "default": "", "title": "Hints", "type": "string" }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "extract", "default": "extract", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "method": { "default": "auto", "enum": [ "auto", "llm", "patterns" ], "title": "Method", "type": "string" }, "patterns": { "additionalProperties": { "type": "string" }, "default": {}, "title": "Patterns", "type": "object" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] }, "values": { "additionalProperties": { "additionalProperties": { "type": "string" }, "type": "object" }, "default": {}, "title": "Values", "type": "object" } }, "required": [ "id", "column", "entity" ], "title": "Extract", "type": "object" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "title": "Detail", "type": "array" } }, "title": "HTTPValidationError", "type": "object" }, "Join": { "additionalProperties": false, "description": "Two inputs side by side where their columns match.", "properties": { "how": { "default": "inner", "enum": [ "inner", "left" ], "title": "How", "type": "string" }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "join", "default": "join", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "on": { "items": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "type": "string" }, { "type": "string" } ], "type": "array" }, "title": "On", "type": "array" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] } }, "required": [ "id", "on" ], "title": "Join", "type": "object" }, "Link": { "additionalProperties": false, "description": "Identity rows from every input, grouped into persons (Splink).\n\nTwo records are the same person when any rule holds (Splink's SQL rule syntax, `l.`\nand `r.` for the two records); persons are the connected groups. A person whose\nrecords disagree on birth date or sex is held for review as a whole. Pairs Splink\nscores above `review` that ended up apart are queued as possible matches.", "properties": { "fields": { "default": [ "record_number", "full_name", "curp", "nss", "birth_date", "sex" ], "items": { "type": "string" }, "title": "Fields", "type": "array" }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "link", "default": "link", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] }, "review": { "default": 0.5, "exclusiveMinimum": 0.0, "maximum": 1.0, "title": "Review", "type": "number" }, "rules": { "default": [], "items": { "type": "string" }, "title": "Rules", "type": "array" } }, "required": [ "id" ], "title": "Link", "type": "object" }, "Map": { "additionalProperties": false, "description": "Columns to platform fields, with the site's codes and date formats.", "properties": { "fields": { "additionalProperties": { "type": "string" }, "title": "Fields", "type": "object" }, "formats": { "additionalProperties": { "type": "string" }, "default": {}, "title": "Formats", "type": "object" }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "map", "default": "map", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] }, "values": { "additionalProperties": { "additionalProperties": { "type": "string" }, "type": "object" }, "default": {}, "title": "Values", "type": "object" } }, "required": [ "id", "fields" ], "title": "Map", "type": "object" }, "PersonDecision": { "properties": { "candidate": { "title": "Candidate", "type": "string" }, "person": { "title": "Person", "type": "string" }, "same": { "title": "Same", "type": "boolean" } }, "required": [ "person", "candidate", "same" ], "title": "PersonDecision", "type": "object" }, "Pipeline": { "properties": { "nodes": { "items": { "discriminator": { "mapping": { "extract": "#/components/schemas/Extract", "join": "#/components/schemas/Join", "link": "#/components/schemas/Link", "map": "#/components/schemas/Map", "read": "#/components/schemas/Read", "route": "#/components/schemas/Route", "source": "#/components/schemas/Source", "target": "#/components/schemas/Target" }, "propertyName": "kind" }, "oneOf": [ { "$ref": "#/components/schemas/Source" }, { "$ref": "#/components/schemas/Read" }, { "$ref": "#/components/schemas/Route" }, { "$ref": "#/components/schemas/Map" }, { "$ref": "#/components/schemas/Extract" }, { "$ref": "#/components/schemas/Join" }, { "$ref": "#/components/schemas/Link" }, { "$ref": "#/components/schemas/Target" } ] }, "title": "Nodes", "type": "array" } }, "required": [ "nodes" ], "title": "Pipeline", "type": "object" }, "Position": { "properties": { "x": { "title": "X", "type": "number" }, "y": { "title": "Y", "type": "number" } }, "required": [ "x", "y" ], "title": "Position", "type": "object" }, "Read": { "additionalProperties": false, "description": "Files in a column (PDF, Word, Excel, scans...) to text (MarkItDown, OCRmyPDF).", "properties": { "column": { "title": "Column", "type": "string" }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "read", "default": "read", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] } }, "required": [ "id", "column" ], "title": "Read", "type": "object" }, "Rejection": { "properties": { "entity": { "enum": [ "identity", "death", "clinical_note", "cervical_cytology", "cervical_biopsy", "mammography", "breast_biopsy" ], "title": "Entity", "type": "string" }, "reason": { "title": "Reason", "type": "string" }, "record": { "title": "Record", "type": "string" } }, "required": [ "entity", "record", "reason" ], "title": "Rejection", "type": "object" }, "Route": { "additionalProperties": false, "description": "Only the rows where every condition holds (e.g. reports titled \"Citolog\u00eda\").", "properties": { "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "route", "default": "route", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] }, "when": { "items": { "$ref": "#/components/schemas/Condition" }, "title": "When", "type": "array" } }, "required": [ "id", "when" ], "title": "Route", "type": "object" }, "RunRequest": { "properties": { "version": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Version" } }, "title": "RunRequest", "type": "object" }, "SavedPipeline": { "properties": { "pipeline": { "$ref": "#/components/schemas/Pipeline" }, "version": { "title": "Version", "type": "integer" } }, "required": [ "version", "pipeline" ], "title": "SavedPipeline", "type": "object" }, "Source": { "additionalProperties": false, "description": "One table, file set or API resource, copied as it is (dlt). Merged on the source's\nown primary key or `primary_key`; replaced whole when it has none.", "properties": { "args": { "additionalProperties": true, "default": {}, "title": "Args", "type": "object" }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "source", "default": "source", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] }, "primary_key": { "default": [], "items": { "type": "string" }, "title": "Primary Key", "type": "array" }, "resource": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Resource" }, "source": { "pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$", "title": "Source", "type": "string" }, "then": { "anyOf": [ { "pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$", "type": "string" }, { "type": "null" } ], "title": "Then" } }, "required": [ "id", "source" ], "title": "Source", "type": "object" }, "SourceRef": { "properties": { "args": { "additionalProperties": true, "default": {}, "title": "Args", "type": "object" }, "source": { "pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$", "title": "Source", "type": "string" } }, "required": [ "source" ], "title": "SourceRef", "type": "object" }, "Target": { "additionalProperties": false, "description": "Rows of platform fields into one platform entity, each row given its person by the\none `link` node among the inputs. Rule breaks are held for review.", "properties": { "entity": { "enum": [ "identity", "death", "clinical_note", "cervical_cytology", "cervical_biopsy", "mammography", "breast_biopsy" ], "title": "Entity", "type": "string" }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Id", "type": "string" }, "inputs": { "default": [], "items": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "type": "string" }, "title": "Inputs", "type": "array" }, "kind": { "const": "target", "default": "target", "title": "Kind", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" }, "position": { "anyOf": [ { "$ref": "#/components/schemas/Position" }, { "type": "null" } ] } }, "required": [ "id", "entity" ], "title": "Target", "type": "object" }, "Training": { "properties": { "as_of": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "As Of" } }, "title": "Training", "type": "object" }, "ValidationError": { "properties": { "ctx": { "title": "Context", "type": "object" }, "input": { "title": "Input" }, "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "title": "Location", "type": "array" }, "msg": { "title": "Message", "type": "string" }, "type": { "title": "Error Type", "type": "string" } }, "required": [ "loc", "msg", "type" ], "title": "ValidationError", "type": "object" }, "Version": { "properties": { "aliases": { "items": { "type": "string" }, "title": "Aliases", "type": "array" }, "created": { "title": "Created", "type": "integer" }, "metrics": { "additionalProperties": { "type": "number" }, "title": "Metrics", "type": "object" }, "params": { "additionalProperties": { "type": "string" }, "title": "Params", "type": "object" }, "reports": { "items": { "type": "string" }, "title": "Reports", "type": "array" }, "version": { "title": "Version", "type": "integer" } }, "required": [ "version", "created", "aliases", "metrics", "params", "reports" ], "title": "Version", "type": "object" } } }, "info": { "title": "ISSSTELEON", "version": "0.0.0" }, "openapi": "3.1.0", "paths": { "/domains": { "get": { "operationId": "domains", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Domain" }, "title": "Response Domains", "type": "array" } } }, "description": "Successful Response" } }, "summary": "Domains" } }, "/health": { "get": { "operationId": "health", "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Health", "type": "object" } } }, "description": "Successful Response" } }, "summary": "Health" } }, "/ingest/pipelines": { "get": { "operationId": "pipelines", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "additionalProperties": true, "type": "object" }, "title": "Response Pipelines", "type": "array" } } }, "description": "Successful Response" } }, "summary": "Pipelines", "tags": [ "ingest" ] } }, "/ingest/pipelines/{pipeline_id}": { "get": { "description": "A saved pipeline (latest by default), with its secrets masked.", "operationId": "pipeline", "parameters": [ { "in": "path", "name": "pipeline_id", "required": true, "schema": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Pipeline Id", "type": "string" } }, { "in": "query", "name": "version", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Version" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SavedPipeline" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Pipeline", "tags": [ "ingest" ] }, "put": { "description": "Saves a new version. Masked secrets sent back are kept as they were saved.", "operationId": "save_pipeline", "parameters": [ { "in": "path", "name": "pipeline_id", "required": true, "schema": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Pipeline Id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pipeline" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "integer" }, "title": "Response Save Pipeline", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Save Pipeline", "tags": [ "ingest" ] } }, "/ingest/pipelines/{pipeline_id}/nodes/{node_id}/rows": { "get": { "description": "What a node produced in the last run (empty if it produced nothing yet).", "operationId": "node_rows", "parameters": [ { "in": "path", "name": "pipeline_id", "required": true, "schema": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Pipeline Id", "type": "string" } }, { "in": "path", "name": "node_id", "required": true, "schema": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Node Id", "type": "string" } }, { "in": "query", "name": "limit", "required": false, "schema": { "default": 50, "maximum": 500, "minimum": 1, "title": "Limit", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "additionalProperties": true, "type": "object" }, "title": "Response Node Rows", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Node Rows", "tags": [ "ingest" ] } }, "/ingest/pipelines/{pipeline_id}/runs": { "post": { "description": "Starts the `ingest` job for this pipeline; follow it at /runs/{run_id}.", "operationId": "start_run", "parameters": [ { "in": "path", "name": "pipeline_id", "required": true, "schema": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Pipeline Id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Start Run", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Start Run", "tags": [ "ingest" ] } }, "/ingest/schema": { "get": { "description": "What the canvas draws with: every node kind's form, and the platform entities.", "operationId": "schema", "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": true, "title": "Response Schema", "type": "object" } } }, "description": "Successful Response" } }, "summary": "Schema", "tags": [ "ingest" ] } }, "/ingest/sources/preview": { "post": { "description": "The first rows a source node would load.", "operationId": "source_preview", "parameters": [ { "in": "query", "name": "limit", "required": false, "schema": { "default": 20, "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Source" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "items": { "additionalProperties": true, "type": "object" }, "title": "Response Source Preview", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Source Preview", "tags": [ "ingest" ] } }, "/ingest/sources/resources": { "post": { "description": "What a source offers (a database's tables...): also tests that it can be reached.", "operationId": "source_resources", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SourceRef" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "title": "Response Source Resources", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Source Resources", "tags": [ "ingest" ] } }, "/ingest/uploads": { "post": { "description": "A CSV, Excel or document file for a `filesystem` source: use `bucket_url`.", "operationId": "upload", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Upload", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Upload", "tags": [ "ingest" ] } }, "/models/{domain}": { "get": { "operationId": "models", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "type": "string" }, "title": "Response Models", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Models", "tags": [ "models" ] } }, "/models/{domain}/score": { "post": { "description": "Starts a risk batch from each model's champion; follow it at /runs.", "operationId": "score", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Score", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Score", "tags": [ "models" ] } }, "/models/{domain}/train": { "post": { "description": "Starts training a new version of every model of the domain; follow it at /runs.", "operationId": "train", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Training" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Train", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Train", "tags": [ "models" ] } }, "/models/{domain}/{name}/versions": { "get": { "operationId": "versions", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "in": "path", "name": "name", "required": true, "schema": { "title": "Name", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Version" }, "title": "Response Versions", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Versions", "tags": [ "models" ] } }, "/models/{domain}/{name}/versions/{version}/promote": { "post": { "description": "The version risk batches come from from now on; refused (409) without its three\nreports: technical validation, interpretability and clinical validation.", "operationId": "promote", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "in": "path", "name": "name", "required": true, "schema": { "title": "Name", "type": "string" } }, { "in": "path", "name": "version", "required": true, "schema": { "title": "Version", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": true, "title": "Response Promote", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Promote", "tags": [ "models" ] } }, "/models/{domain}/{name}/versions/{version}/reports/clinical_validation": { "post": { "description": "The clinical team's validation of a version: the third report promotion needs.", "operationId": "add_clinical_validation", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "in": "path", "name": "name", "required": true, "schema": { "title": "Name", "type": "string" } }, { "in": "path", "name": "version", "required": true, "schema": { "title": "Version", "type": "integer" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_add_clinical_validation" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": true, "title": "Response Add Clinical Validation", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Add Clinical Validation", "tags": [ "models" ] } }, "/review/conflicts": { "get": { "description": "Rows of one person and date that disagree; reject the wrong ones.", "operationId": "conflicts", "parameters": [ { "in": "query", "name": "entity", "required": true, "schema": { "enum": [ "identity", "death", "clinical_note", "cervical_cytology", "cervical_biopsy", "mammography", "breast_biopsy" ], "title": "Entity", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "additionalProperties": true, "type": "object" }, "title": "Response Conflicts", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Conflicts", "tags": [ "review" ] } }, "/review/corrections": { "post": { "description": "A corrected identity field of one record (e.g. a mistyped record number); linking\nuses it on the next run. Fixing the source too is still worth it.", "operationId": "correct", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Correction" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Correct", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Correct", "tags": [ "review" ] } }, "/review/held": { "get": { "description": "Rows a rule held, with the reasons and the values as they came.", "operationId": "held", "parameters": [ { "in": "query", "name": "entity", "required": true, "schema": { "enum": [ "identity", "death", "clinical_note", "cervical_cytology", "cervical_biopsy", "mammography", "breast_biopsy" ], "title": "Entity", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "additionalProperties": true, "type": "object" }, "title": "Response Held", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Held", "tags": [ "review" ] } }, "/review/persons": { "get": { "description": "Persons to settle (with their possible owners) and torn persons (with their\nrecords) left by a pipeline's link node.", "operationId": "persons", "parameters": [ { "in": "query", "name": "pipeline", "required": true, "schema": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Pipeline", "type": "string" } }, { "in": "query", "name": "node", "required": true, "schema": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", "title": "Node", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "items": { "additionalProperties": true, "type": "object" }, "type": "array" }, "title": "Response Persons", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Persons", "tags": [ "review" ] }, "post": { "description": "Whether a person and a possible owner are one patient; applied on the next run.", "operationId": "decide_persons", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PersonDecision" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Decide Persons", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Decide Persons", "tags": [ "review" ] } }, "/review/rejections": { "post": { "description": "This record's row must not reach silver; applied on the next run.", "operationId": "reject", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Rejection" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Reject", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Reject", "tags": [ "review" ] } }, "/runs/{run_id}": { "get": { "operationId": "run_status", "parameters": [ { "in": "path", "name": "run_id", "required": true, "schema": { "title": "Run Id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Run Status", "type": "object" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Run Status", "tags": [ "runs" ] } }, "/{domain}/fhir/Condition": { "get": { "description": "What clinical notes diagnosed.", "operationId": "search_condition", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "description": "Patient/, comma-separated", "in": "query", "name": "subject", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Patient/, comma-separated", "title": "Subject" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Condition", "tags": [ "fhir" ] } }, "/{domain}/fhir/DiagnosticReport": { "get": { "description": "Cervical cytologies and biopsies, as known by the last day with data.", "operationId": "search_diagnostic_report", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "description": "Patient/, comma-separated", "in": "query", "name": "subject", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Patient/, comma-separated", "title": "Subject" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Diagnostic Report", "tags": [ "fhir" ] } }, "/{domain}/fhir/Measure": { "get": { "description": "Every measure of the domain (none for a domain without them yet).", "operationId": "search_measure", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Measure", "tags": [ "fhir" ] } }, "/{domain}/fhir/Measure/{id}": { "get": { "operationId": "read_measure", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "in": "path", "name": "id", "required": true, "schema": { "title": "Id", "type": "string" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Read Measure", "tags": [ "fhir" ] } }, "/{domain}/fhir/MeasureReport": { "get": { "description": "The measure's summary report for each period asked for, evaluated over gold.", "operationId": "search_measure_report", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "description": "the Measure's id or canonical URL", "in": "query", "name": "measure", "required": true, "schema": { "description": "the Measure's id or canonical URL", "title": "Measure", "type": "string" } }, { "description": "semesters (2025-S1) or months (2025-03), comma-separated", "in": "query", "name": "reporting-period", "required": true, "schema": { "description": "semesters (2025-S1) or months (2025-03), comma-separated", "title": "Reporting-Period", "type": "string" } }, { "description": "count only what was known by then", "in": "query", "name": "as-of", "required": false, "schema": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "description": "count only what was known by then", "title": "As-Of" } }, { "description": "durations count to this day", "in": "query", "name": "event-cutoff", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "description": "durations count to this day", "title": "Event-Cutoff" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Measure Report", "tags": [ "fhir" ] } }, "/{domain}/fhir/Observation": { "get": { "description": "The results of cervical cytologies (Bethesda, adequacy, HPV).", "operationId": "search_observation", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "description": "Patient/, comma-separated", "in": "query", "name": "subject", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Patient/, comma-separated", "title": "Subject" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Observation", "tags": [ "fhir" ] } }, "/{domain}/fhir/Patient": { "get": { "description": "Patients; with `follow-up-window`, CaCu's follow-up list at the cut-off, filtered by\nstatus and in reading order, with what the list shows of each patient included.", "operationId": "search_patient", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "in": "query", "name": "_id", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": " Id" } }, { "description": "months: whoever had a cytology sampled within them up to the cut-off", "in": "query", "name": "follow-up-window", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "months: whoever had a cytology sampled within them up to the cut-off", "title": "Follow-Up-Window" } }, { "description": "default: the last day with data", "in": "query", "name": "follow-up-cutoff", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "description": "default: the last day with data", "title": "Follow-Up-Cutoff" } }, { "in": "query", "name": "follow-up-status", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Follow-Up-Status" } }, { "description": "one of ('-recent', '-risk-cin2', '-risk-cancer'); the list only", "in": "query", "name": "_sort", "required": false, "schema": { "default": "-recent", "description": "one of ('-recent', '-risk-cin2', '-risk-cancer'); the list only", "title": " Sort", "type": "string" } }, { "description": "years", "in": "query", "name": "risk-horizon", "required": false, "schema": { "default": 5.0, "description": "years", "title": "Risk-Horizon", "type": "number" } }, { "description": "any of ('DiagnosticReport:subject', 'RiskAssessment:subject', 'Observation:subject')", "in": "query", "name": "_revinclude", "required": false, "schema": { "default": [], "description": "any of ('DiagnosticReport:subject', 'RiskAssessment:subject', 'Observation:subject')", "items": { "type": "string" }, "title": " Revinclude", "type": "array" } }, { "description": "DiagnosticReport:result", "in": "query", "name": "_include:iterate", "required": false, "schema": { "default": [], "description": "DiagnosticReport:result", "items": { "type": "string" }, "title": " Include:Iterate", "type": "array" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Patient", "tags": [ "fhir" ] } }, "/{domain}/fhir/Patient/{id}": { "get": { "operationId": "read_patient", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "in": "path", "name": "id", "required": true, "schema": { "title": "Id", "type": "string" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Read Patient", "tags": [ "fhir" ] } }, "/{domain}/fhir/Procedure": { "get": { "description": "Colposcopies and treatments, as the timeline infers them.", "operationId": "search_procedure", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "description": "Patient/, comma-separated", "in": "query", "name": "subject", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Patient/, comma-separated", "title": "Subject" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Procedure", "tags": [ "fhir" ] } }, "/{domain}/fhir/RiskAssessment": { "get": { "description": "The champion models' risks, one per model and index date.", "operationId": "search_risk_assessment", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } }, { "description": "Patient/, comma-separated", "in": "query", "name": "subject", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Patient/, comma-separated", "title": "Subject" } }, { "in": "query", "name": "_count", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": " Count" } }, { "in": "query", "name": "_offset", "required": false, "schema": { "default": 0, "title": " Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Search Risk Assessment", "tags": [ "fhir" ] } }, "/{domain}/fhir/metadata": { "get": { "description": "What this base serves: built from the routes above, so it cannot drift from them.", "operationId": "metadata", "parameters": [ { "in": "path", "name": "domain", "required": true, "schema": { "$ref": "#/components/schemas/Domain" } } ], "responses": { "200": { "content": { "application/fhir+json": { "schema": { "type": "object" } } }, "description": "FHIR" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Metadata", "tags": [ "fhir" ] } } } }