ConceptMap editor, names and CURP shown, catalog codes read

This commit is contained in:
Roberto Treviño
2026-11-25 16:17:23 -06:00
parent 9fc0666d66
commit 9b02641804
27 changed files with 901 additions and 87 deletions
+421 -44
View File
@@ -67,8 +67,7 @@
"curp",
"nss",
"birth_date",
"sex",
"postal_code"
"sex"
],
"title": "Field",
"type": "string"
@@ -101,21 +100,34 @@
},
"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`.",
"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 the ConceptMap\nand `formats` as in `map`.",
"properties": {
"column": {
"title": "Column",
"type": "string"
},
"concept_map": {
"anyOf": [
{
"maxLength": 40,
"pattern": "^[a-z][a-z0-9_]*$",
"type": "string"
},
{
"type": "null"
}
],
"title": "Concept Map"
},
"entity": {
"enum": [
"identity",
"death",
"clinical_note",
"cervical_cytology",
"cervical_biopsy",
"mammography",
"breast_biopsy"
"breast_biopsy",
"clinical_note",
"death"
],
"title": "Entity",
"type": "string"
@@ -187,17 +199,6 @@
"type": "null"
}
]
},
"values": {
"additionalProperties": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"default": {},
"title": "Values",
"type": "object"
}
},
"required": [
@@ -208,6 +209,86 @@
"title": "Extract",
"type": "object"
},
"Fhir": {
"additionalProperties": false,
"description": "FHIR R4 Bundles a standard hospital sent (a column of their JSON) as rows of one\nentity: identity, death or a study (core.fhir_in). The sender's own codes go through\nits ConceptMap.",
"properties": {
"column": {
"default": "doc",
"title": "Column",
"type": "string"
},
"concept_map": {
"anyOf": [
{
"maxLength": 40,
"pattern": "^[a-z][a-z0-9_]*$",
"type": "string"
},
{
"type": "null"
}
],
"title": "Concept Map"
},
"entity": {
"enum": [
"identity",
"cervical_cytology",
"cervical_biopsy",
"mammography",
"breast_biopsy",
"clinical_note",
"death"
],
"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": "fhir",
"default": "fhir",
"title": "Kind",
"type": "string"
},
"label": {
"default": "",
"title": "Label",
"type": "string"
},
"position": {
"anyOf": [
{
"$ref": "#/components/schemas/Position"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"entity"
],
"title": "Fhir",
"type": "object"
},
"HTTPValidationError": {
"properties": {
"detail": {
@@ -376,8 +457,21 @@
},
"Map": {
"additionalProperties": false,
"description": "Columns to platform fields, with the site's codes and date formats.",
"description": "Columns to platform fields, the site's codes translated by its ConceptMap\n(core.concept_map), and its date formats.",
"properties": {
"concept_map": {
"anyOf": [
{
"maxLength": 40,
"pattern": "^[a-z][a-z0-9_]*$",
"type": "string"
},
{
"type": "null"
}
],
"title": "Concept Map"
},
"fields": {
"additionalProperties": {
"type": "string"
@@ -429,17 +523,6 @@
"type": "null"
}
]
},
"values": {
"additionalProperties": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"default": {},
"title": "Values",
"type": "object"
}
},
"required": [
@@ -479,6 +562,7 @@
"discriminator": {
"mapping": {
"extract": "#/components/schemas/Extract",
"fhir": "#/components/schemas/Fhir",
"join": "#/components/schemas/Join",
"link": "#/components/schemas/Link",
"map": "#/components/schemas/Map",
@@ -505,6 +589,9 @@
{
"$ref": "#/components/schemas/Extract"
},
{
"$ref": "#/components/schemas/Fhir"
},
{
"$ref": "#/components/schemas/Join"
},
@@ -602,12 +689,12 @@
"entity": {
"enum": [
"identity",
"death",
"clinical_note",
"cervical_cytology",
"cervical_biopsy",
"mammography",
"breast_biopsy"
"breast_biopsy",
"clinical_note",
"death"
],
"title": "Entity",
"type": "string"
@@ -837,12 +924,12 @@
"entity": {
"enum": [
"identity",
"death",
"clinical_note",
"cervical_cytology",
"cervical_biopsy",
"mammography",
"breast_biopsy"
"breast_biopsy",
"clinical_note",
"death"
],
"title": "Entity",
"type": "string"
@@ -1052,6 +1139,139 @@
"summary": "Health"
}
},
"/ingest/concept-maps": {
"get": {
"description": "Every ConceptMap a site saved: its id, latest version and when.",
"operationId": "concept_maps",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Response Concept Maps",
"type": "array"
}
}
},
"description": "Successful Response"
}
},
"summary": "Concept Maps",
"tags": [
"ingest"
]
}
},
"/ingest/concept-maps/{map_id}": {
"get": {
"description": "A site's codes in platform terms (FHIR R4B ConceptMap), latest version.",
"operationId": "get_concept_map",
"parameters": [
{
"in": "path",
"name": "map_id",
"required": true,
"schema": {
"maxLength": 40,
"pattern": "^[a-z][a-z0-9_]*$",
"title": "Map Id",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"title": "Response Get Concept Map",
"type": "object"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Get Concept Map",
"tags": [
"ingest"
]
},
"put": {
"description": "Saves a new version of a ConceptMap. Its groups target the systems platform fields\ntake codes from, and only codes those fields allow (core.concept_map).",
"operationId": "save_concept_map",
"parameters": [
{
"in": "path",
"name": "map_id",
"required": true,
"schema": {
"maxLength": 40,
"pattern": "^[a-z][a-z0-9_]*$",
"title": "Map Id",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"title": "Doc",
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": {
"type": "integer"
},
"title": "Response Save Concept Map",
"type": "object"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Save Concept Map",
"tags": [
"ingest"
]
}
},
"/ingest/pipelines": {
"get": {
"operationId": "pipelines",
@@ -1139,7 +1359,7 @@
]
},
"put": {
"description": "Saves a new version. Masked secrets sent back are kept as they were saved.",
"description": "Saves a new version. Masked secrets sent back are kept as they were saved; every\nConceptMap a node names must exist.",
"operationId": "save_pipeline",
"parameters": [
{
@@ -1852,12 +2072,12 @@
"schema": {
"enum": [
"identity",
"death",
"clinical_note",
"cervical_cytology",
"cervical_biopsy",
"mammography",
"breast_biopsy"
"breast_biopsy",
"clinical_note",
"death"
],
"title": "Entity",
"type": "string"
@@ -1955,12 +2175,12 @@
"schema": {
"enum": [
"identity",
"death",
"clinical_note",
"cervical_cytology",
"cervical_biopsy",
"mammography",
"breast_biopsy"
"breast_biopsy",
"clinical_note",
"death"
],
"title": "Entity",
"type": "string"
@@ -2200,6 +2420,77 @@
]
}
},
"/{domain}/fhir": {
"post": {
"description": "A standard hospital's Bundle: checked as FHIR, kept as sent in the sender's inbox,\nand placed by the sender's pipeline (a run starts; follow it at the Location).",
"operationId": "post_bundle",
"parameters": [
{
"in": "path",
"name": "domain",
"required": true,
"schema": {
"$ref": "#/components/schemas/Domain"
}
},
{
"description": "the sender's pipeline (its fhir nodes read this inbox)",
"in": "query",
"name": "sender",
"required": true,
"schema": {
"description": "the sender's pipeline (its fhir nodes read this inbox)",
"maxLength": 40,
"pattern": "^[a-z][a-z0-9_]*$",
"title": "Sender",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"description": "a FHIR R4 batch or transaction Bundle",
"title": "Bundle",
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/fhir+json": {
"schema": {
"type": "object"
}
}
},
"description": "FHIR"
},
"202": {
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Bundle",
"tags": [
"fhir"
]
}
},
"/{domain}/fhir/Condition": {
"get": {
"description": "What clinical notes diagnosed.",
@@ -2288,7 +2579,7 @@
},
"/{domain}/fhir/DiagnosticReport": {
"get": {
"description": "Cervical cytologies and biopsies, as known by the last day with data.",
"description": "The domain's reports (each study of the catalog with a report), as known by the last\nday with data.",
"operationId": "search_diagnostic_report",
"parameters": [
{
@@ -2372,6 +2663,92 @@
]
}
},
"/{domain}/fhir/Encounter": {
"get": {
"description": "Consultations: each study of the catalog without a report, as an encounter.",
"operationId": "search_encounter",
"parameters": [
{
"in": "path",
"name": "domain",
"required": true,
"schema": {
"$ref": "#/components/schemas/Domain"
}
},
{
"description": "Patient/<id>, comma-separated",
"in": "query",
"name": "subject",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Patient/<id>, 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 Encounter",
"tags": [
"fhir"
]
}
},
"/{domain}/fhir/Measure": {
"get": {
"description": "Every measure of the domain (none for a domain without them yet).",
@@ -2620,7 +2997,7 @@
},
"/{domain}/fhir/Observation": {
"get": {
"description": "The results of cervical cytologies (Bethesda, adequacy, HPV).",
"description": "Every result of the domain's reports, one per field of the catalog.",
"operationId": "search_observation",
"parameters": [
{