wording fixes

This commit is contained in:
Roberto Treviño Cervantes
2026-11-17 02:17:31 -06:00
parent 0a7234f5ef
commit 0571b5e6af
13 changed files with 973 additions and 7 deletions
+12
View File
@@ -31,6 +31,9 @@ class IsoJSONProvider(DefaultJSONProvider):
def create_app() -> Flask:
app = Flask(__name__)
app.json = IsoJSONProvider(app)
from webapi.cama_runtime import configure_cama_cohort
configure_cama_cohort(app)
# File sources travel inside the request; cap them per request.
app.config["MAX_CONTENT_LENGTH"] = int(os.environ.get("WEBAPI_MAX_UPLOAD_MB", "200")) * 1024 * 1024
@@ -93,8 +96,17 @@ def create_app() -> Flask:
from persistance.db import get_cacu_session
from webapi.patient_risk import patient_risk_blueprint
from webapi.risk_batches import risk_batches_blueprint
app.register_blueprint(follow_up_blueprint(get_cacu_session), url_prefix="/cacu")
app.register_blueprint(patient_risk_blueprint(cacu_repositories), url_prefix="/cacu")
app.register_blueprint(risk_batches_blueprint(cacu_repositories), url_prefix="/cacu")
# CaMa's follow-up list and analysis selection, over the breast screening cohort `configure_cama_cohort` reads.
from webapi.cama_analysis import analysis as cama_analysis_bp
from webapi.seguimiento_cama import blueprint_seguimiento_cama
app.register_blueprint(blueprint_seguimiento_cama(), url_prefix="/cama")
app.register_blueprint(cama_analysis_bp, url_prefix="/cama")
return app
+38 -5
View File
@@ -1,13 +1,18 @@
"""Model governance (ML, MLD, EL and VAR requirements): model versions and
their promotion, notebooks run on a cohort build, and the OCR extraction
jobs with their manual review queue.
their training and promotion, notebooks run on a cohort build, and the OCR
extraction jobs with their manual review queue.
Versions and artifacts live in MLflow (`models.io.registry`); training runs
elsewhere and registers its result through `POST /model-versions`, naming
the indicator kit cohort build it was trained on (`cohorte_armado_id`).
Versions and artifacts live in MLflow (`models.io.registry`). Training can
either run elsewhere and register its result through `POST /model-versions`
(naming the indicator kit cohort build it was trained on,
`cohorte_armado_id`), or be triggered in place through `POST
/model-versions/<domain>/<scenario>/train`, for a deployment with no
command-line access to run the `entrenar` compose profile by hand.
Notebooks (`models.pipelines.experiment`) run in the background on the build's
file alone and are kept as MLflow runs.
"""
import contextlib
import io
import json
import os
from concurrent.futures import ThreadPoolExecutor
@@ -84,6 +89,34 @@ def register_model_version():
return jsonify(registry.describe(body["domain"], body["scenario"], version)), 201
@governance_bp.post("/model-versions/<domain>/<scenario>/train")
def train_model_version(domain: str, scenario: str):
"""Exports the scenario's latest dbt cohort build, trains a PROD version on it unless one from the same file,
code and environment already exists, and tries to promote it: the same one-shot pipeline the `entrenar`
compose profile runs (`models run <domain> <scenario> --export --source dbt --environment prod --train
--promote`), over HTTP instead of a shell. 503 with no dbt manifest configured; 404 for a domain/scenario with
no trainer or whose cohort isn't exportable yet; 409 with the training's own version trained but not promoted
(it's missing its validation reports: attach them, then `/promote`)."""
from models.__main__ import main as models_main
manifest = os.environ.get("DBT_MANIFEST")
if not manifest:
return jsonify({"error": "No hay un manifest de dbt configurado."}), 503
argv = ["run", domain, scenario, "--export", "--source", "dbt", "--manifest", manifest, "--environment", "prod",
"--train", "--promote"]
out, err = io.StringIO(), io.StringIO()
try:
with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
code = models_main(argv)
except SystemExit as exit:
code = exit.code if isinstance(exit.code, int) else 1
output, error = out.getvalue().strip(), err.getvalue().strip()
if code == 0:
return jsonify({"output": output})
status = 404 if "no such model" in error else 409 if "not promoted, missing" in error else 503
return jsonify({"error": error or "No se pudo entrenar el modelo.", "output": output}), status
@governance_bp.patch("/model-versions/<domain>/<scenario>/<version>/reports")
def attach_reports(domain: str, scenario: str, version: str):
"""MLD-01/01b/03 documents, usually written after training."""
+168
View File
@@ -0,0 +1,168 @@
"""Aggregate and select the breast cohort through the same configured reader."""
from datetime import date
import hashlib
import hmac
import json
from flask import Blueprint, current_app, jsonify, request
from webapi.cama_cohort import COHORT, SCENARIO, THRESHOLD
analysis = Blueprint('cama_analysis', __name__)
BIRADS = ('BIRADS_4', 'BIRADS_4A', 'BIRADS_4B', 'BIRADS_4C', 'BIRADS_5', 'BIRADS_6')
AGES = ('MENOR_40', '40-49', '50-59', '60-69', '70+', 'SIN_DATO')
class SelectionError(Exception):
def __init__(self, message, status=400):
self.message, self.status = message, status
def read_cohort(cutoff):
reader = current_app.config.get('CAMA_COHORT_READER')
if not callable(reader):
raise SelectionError('Cohorte no disponible', 503)
try:
return reader(cutoff)
except Exception:
current_app.logger.exception('Breast cohort provider failed')
raise SelectionError('Cohorte no disponible', 503) from None
def cutoff_arg(args):
text = args.get('corte')
if not text:
raise SelectionError('Se requiere corte')
try:
value = date.fromisoformat(text)
if value.isoformat() != text or value.year == 9999:
raise ValueError()
return value
except ValueError:
raise SelectionError('Corte inválido') from None
def patient_access():
check = current_app.config.get('CAMA_COHORT_ACCESS')
if check is not None and (not callable(check) or not check(request)):
raise SelectionError('Acceso no autorizado', 403)
def revision_of(rows):
"""Identify the materialized cohort without exposing its patient identifiers."""
encoded = json.dumps(rows, sort_keys=True, separators=(',', ':'), ensure_ascii=False).encode()
return hashlib.sha256(encoded).hexdigest()
def cohort_request(args):
allowed = {'cohorte', 'revision', 'escenario', 'corte', 'meses', 'page', 'page_size', 'birads', 'grupo_edad'}
if set(args) - allowed or any(len(args.getlist(k)) != 1 for k in args):
raise SelectionError('Parámetros desconocidos o repetidos')
if args.get('cohorte') != COHORT or args.get('escenario') != SCENARIO:
raise SelectionError('Cohorte o escenario desconocido')
revision = args.get('revision', '')
if len(revision) != 64 or any(c not in '0123456789abcdef' for c in revision):
raise SelectionError('Revisión de cohorte inválida')
cutoff = cutoff_arg(args)
try:
months = int(args.get('meses', '3'))
page = int(args.get('page', '1'))
size = int(args.get('page_size', '50'))
if months not in (0, 1, 3, 6, 12) or page < 1 or not 1 <= size <= 200:
raise ValueError()
except ValueError:
raise SelectionError('Ventana o paginación inválida') from None
filters = {key: args.get(key) for key in ('birads', 'grupo_edad')}
if filters['birads'] not in (None, *BIRADS) or filters['grupo_edad'] not in (None, *AGES):
raise SelectionError('Filtro inválido')
return cutoff, months, page, size, filters, revision
def selected(args):
patient_access()
from werkzeug.datastructures import MultiDict
args = MultiDict(args)
if 'cohorte' not in args:
if any(key in args for key in ('revision', 'escenario')):
raise SelectionError('Contexto de cohorte incompleto')
if 'corte' not in args:
args['corte'] = date.today().isoformat()
cutoff = cutoff_arg(args)
rows = read_cohort(cutoff)
args.update({'cohorte': COHORT, 'escenario': SCENARIO, 'revision': revision_of(rows)})
else:
rows = None
cutoff, months, page, size, filters, revision = cohort_request(args)
if rows is None:
rows = read_cohort(cutoff)
if not hmac.compare_digest(revision, revision_of(rows)):
raise SelectionError('La cohorte cambió; actualiza el análisis', 409)
selected_rows = [row for row in rows if all(v is None or row[k] == v for k, v in filters.items())]
if months:
from webapi.seguimiento_cama import _desde
try:
since = _desde(cutoff, months)
except (ValueError, OverflowError):
raise SelectionError('Ventana inválida') from None
else:
since = min((date.fromisoformat(r['mastografia_fecha']) for r in rows), default=cutoff)
selected_rows = [r for r in selected_rows if since <= date.fromisoformat(r['mastografia_fecha']) <= cutoff]
# Every filtered selection is checked on the server after applying the window.
if len(selected_rows) < THRESHOLD and (selected_rows or any(filters.values())):
raise SelectionError('Selección no disponible', 403)
return cutoff, months, page, size, filters, since, selected_rows, revision
def selection_response(args, mode, patient=None):
cutoff, months, page, size, filters, since, rows, revision = selected(args)
options = [('birads', 'Categoría BI-RADS', BIRADS), ('grupo_edad', 'Grupo de edad', AGES)]
columns = [
{'clave': 'pac_id', 'etiqueta': 'Identificador de paciente'},
{'clave': 'grupo_edad', 'etiqueta': 'Grupo de edad'},
{'clave': 'birads', 'etiqueta': 'Última mastografía', 'detalles': [{'clave': 'mastografia_fecha', 'etiqueta': 'Fecha'}]},
{'clave': 'biopsia', 'etiqueta': 'Resultado histopatológico', 'detalles': [{'clave': 'biopsia_fecha', 'etiqueta': 'Fecha de reporte'}]},
]
meta = {'simulado': True, 'cohorte': COHORT, 'revision': revision, 'escenario': SCENARIO, 'corte': cutoff.isoformat(),
'ventana': {'meses': months, 'desde': since.isoformat(), 'hasta': cutoff.isoformat()},
'campo_ventana': 'mastografia_fecha', 'filtros': filters,
'filtros_disponibles': [{'clave': k, 'etiqueta': label, 'opciones': [{'codigo': v, 'etiqueta': v} for v in values]}
for k, label, values in options], 'columnas': columns}
if mode == 'patient':
found = next((row for row in rows if row['pac_id'] == patient), None)
if found is None:
raise SelectionError('Paciente no encontrado', 404)
return jsonify(**meta, item=found)
if mode == 'export':
if len(rows) > 5000:
raise SelectionError('La exportación supera el límite de 5000 registros', 413)
return jsonify(**meta, total_items=len(rows), items=rows)
return jsonify(**meta, paginacion={'page': page, 'page_size': size, 'total_items': len(rows),
'total_pages': (len(rows) + size - 1) // size},
items=rows[(page - 1) * size:page * size])
@analysis.get('/analisis/indicadores')
def indicators():
try:
if set(request.args) != {'corte'} or len(request.args.getlist('corte')) != 1:
raise SelectionError('Se requiere únicamente corte')
cutoff = cutoff_arg(request.args)
rows = read_cohort(cutoff)
groups = []
for code in BIRADS:
count = sum(r['birads'] == code for r in rows)
groups.append({'codigo': code, 'n': count if count >= THRESHOLD else None, 'suprimido': count < THRESHOLD})
return jsonify(simulado=True, cohorte=COHORT, revision=revision_of(rows), escenario=SCENARIO, corte=cutoff.isoformat(),
horizonte_dias=0, umbral_supresion=THRESHOLD, unidad='paciente',
denominador='pacientes elegibles con última mastografía reportada BI-RADS 4 a 6',
indicadores=[], grupos=groups)
except SelectionError as e:
return jsonify(error=e.message), e.status
@analysis.after_request
def no_cache(response):
response.headers['Cache-Control'] = 'no-store'
return response
+195
View File
@@ -0,0 +1,195 @@
"""Read the breast screening cohort from the existing silver tables.
The current silver tables keep only the last version of each fact. Filtering by
load date prevents future facts from appearing at an earlier cutoff, but cannot
restore a previous value after an update.
"""
from datetime import date, datetime, time, timedelta, timezone
from sqlalchemy import func, select
from sqlalchemy.orm import aliased
from webapi.orchestration.tables.cama import TABLAS
COHORT = "cama_birads_v1"
SCENARIO = "diagnostico"
THRESHOLD = 5
# `core/catalogos/cama.toml`'s `mastografia.resultados.birads`: the cohort is restricted to the codes that call
# for a biopsy (B4 and its subcategories, B5, B6); B0 to B3 fall out by not being in this map.
BIRADS = {"B4": "BIRADS_4", "B4A": "BIRADS_4A", "B4B": "BIRADS_4B", "B4C": "BIRADS_4C", "B5": "BIRADS_5", "B6": "BIRADS_6"}
def mastografias(t):
"""One row per mammogram taken, with the report that hangs from it (nulls when it has none): the Python
equivalent of `Transformation/models/cama/silver/cama_mastografias.sql`, kept independent of dbt's manifest
since this reader runs without one."""
toma, reporte, obs_birads = aliased(t.Procedimiento), aliased(t.Procedimiento), aliased(t.Observacion)
return (
select(
toma.procedimiento_id.label("procedimiento_id"),
toma.fuente_tabla.label("fuente_tabla"),
toma.fuente_id.label("fuente_id"),
toma.pac_id.label("pac_id"),
toma.fecha.label("fecha_toma"),
reporte.procedimiento_id.label("reporte_id"),
reporte.fecha.label("fecha_reporte"),
func.coalesce(obs_birads.valor_id, obs_birads.valor_fuente).label("birads"),
)
.select_from(toma)
.outerjoin(reporte, (reporte.padre_id == toma.procedimiento_id) & (reporte.estudio_id == "mastografia")
& (reporte.clase == "reporte"))
.outerjoin(obs_birads, (obs_birads.procedimiento_id == reporte.procedimiento_id)
& (obs_birads.resultado_id == "mastografia.birads"))
.where(toma.estudio_id == "mastografia", toma.clase == "toma")
)
def biopsias(t):
"""One row per biopsy report with its grade, its order and the mammogram that led to it, if found: mammogram
(toma) -> biopsy order -> biopsy report, by `padre_id`. The Python equivalent of
`Transformation/models/cama/silver/cama_biopsias.sql`, plus the mammogram's own date and patient (`fecha_toma`,
`toma_pac_id`), which the cohort's cross-check needs and the dbt model doesn't expose."""
reporte, orden, toma, obs_grado = (aliased(t.Procedimiento), aliased(t.Procedimiento), aliased(t.Procedimiento),
aliased(t.Observacion))
return (
select(
reporte.procedimiento_id.label("procedimiento_id"),
reporte.fuente_tabla.label("fuente_tabla"),
reporte.fuente_id.label("fuente_id"),
reporte.pac_id.label("pac_id"),
reporte.fecha.label("fecha_reporte"),
func.coalesce(obs_grado.valor_id, obs_grado.valor_fuente).label("grado"),
orden.fecha.label("fecha_solicitud"),
toma.procedimiento_id.label("toma_id"),
toma.fecha.label("fecha_toma"),
toma.pac_id.label("toma_pac_id"),
)
.select_from(reporte)
.outerjoin(obs_grado, (obs_grado.procedimiento_id == reporte.procedimiento_id)
& (obs_grado.resultado_id == "biopsia.grado"))
.outerjoin(orden, (orden.procedimiento_id == reporte.padre_id) & (orden.estudio_id == "biopsia")
& (orden.clase == "orden"))
.outerjoin(toma, (toma.procedimiento_id == orden.padre_id) & (toma.estudio_id == "mastografia")
& (toma.clase == "toma"))
.where(reporte.estudio_id == "biopsia", reporte.clase == "reporte")
)
def _date(value):
return date.fromisoformat(value) if isinstance(value, str) else value
def _known(value, cutoff):
if value is None:
return False
if isinstance(value, str):
value = datetime.fromisoformat(value)
if value.tzinfo is None:
value = value.replace(tzinfo=timezone.utc)
return value < datetime.combine(cutoff + timedelta(days=1), time.min, timezone.utc)
def _age_group(birth, cutoff):
if birth is None or birth > cutoff:
return "SIN_DATO"
age = cutoff.year - birth.year - ((cutoff.month, cutoff.day) < (birth.month, birth.day))
if age < 40:
return "MENOR_40"
if age >= 70:
return "70+"
return f"{age // 10 * 10}-{age // 10 * 10 + 9}"
class CamaCohort:
"""Materialize one row per eligible patient, using a caller-owned session."""
def __init__(self, session):
self.session = session
def rows(self, cutoff: date):
t = TABLAS
loads = {x.carga_id: x.inicio for x in self.session.execute(select(t.Carga)).scalars()}
procedures = {x.procedimiento_id: x for x in self.session.execute(select(t.Procedimiento)).scalars()}
observations = {(x.procedimiento_id, x.resultado_id): x for x in self.session.execute(select(t.Observacion)).scalars()}
people = {x.pac_id: x for x in self.session.execute(select(t.Persona)).scalars()}
def procedure_known(identifier):
p = procedures.get(identifier)
return bool(p and _known(loads.get(p.carga_id), cutoff))
def observation_known(identifier, result, patient):
o = observations.get((identifier, result))
return bool(o and o.pac_id == patient and _known(loads.get(o.carga_id), cutoff))
def load_time(record):
value = loads.get(record.carga_id) if record else None
return value.isoformat() if value else None
candidates = {}
for row in self.session.execute(mastografias(t)).mappings():
taken, reported = _date(row['fecha_toma']), _date(row['fecha_reporte'])
if not (taken and reported and taken <= reported <= cutoff and row['birads']
and procedure_known(row['procedimiento_id']) and procedure_known(row['reporte_id'])
and procedures[row['reporte_id']].pac_id == row['pac_id']
and observation_known(row['reporte_id'], 'mastografia.birads', row['pac_id'])):
continue
key = (taken, str(row['fuente_id']), reported, row['reporte_id'])
prior = candidates.get(row['pac_id'])
if prior is None or key > prior[0]:
candidates[row['pac_id']] = (key, row)
reports = {}
orders = {}
for p in procedures.values():
when = _date(p.fecha)
if (p.estudio_id != 'biopsia' or p.clase != 'orden' or not p.padre_id or not when
or when > cutoff or not procedure_known(p.procedimiento_id)):
continue
key = (p.pac_id, p.padre_id)
rank = (when, str(p.fuente_id), p.procedimiento_id)
if key not in orders or rank > orders[key][0]:
orders[key] = (rank, p)
for row in self.session.execute(biopsias(t)).mappings():
reported, ordered, taken = (_date(row['fecha_reporte']), _date(row['fecha_solicitud']),
_date(row['fecha_toma']))
procedure = procedures.get(row['procedimiento_id'])
order = procedures.get(procedure.padre_id) if procedure else None
if not (taken and reported and ordered and taken <= ordered <= reported <= cutoff and row['toma_id']
and row['pac_id'] == row['toma_pac_id'] and procedure_known(row['procedimiento_id'])
and order and order.pac_id == row['pac_id'] and procedure_known(order.procedimiento_id)):
continue
key = (row['pac_id'], row['toma_id'])
rank = (reported, str(row['fuente_id']), row['procedimiento_id'])
if key not in reports or rank > reports[key][0]:
reports[key] = (rank, row)
rows = []
for patient, (_, m) in candidates.items():
code = BIRADS.get(m['birads'])
if not code or patient not in people:
continue
b = reports.get((patient, m['procedimiento_id']))
b = b[1] if b and _date(b[1]['fecha_reporte']) >= _date(m['fecha_toma']) else None
order = procedures[procedures[b['procedimiento_id']].padre_id] if b else None
if not order:
found_order = orders.get((patient, m['procedimiento_id']))
order = found_order[1] if found_order and _date(found_order[1].fecha) >= _date(m['fecha_toma']) else None
grade = b['grado'] if b and observation_known(b['procedimiento_id'], 'biopsia.grado', patient) else None
rows.append({
'pac_id': str(patient), 'mastografia_fecha': _date(m['fecha_toma']).isoformat(),
'mastografia_reporte_fecha': _date(m['fecha_reporte']).isoformat(),
'birads': code, 'grupo_edad': _age_group(people[patient].fecha_nacimiento, cutoff),
'biopsia': grade, 'biopsia_fecha': _date(b['fecha_reporte']).isoformat() if b else None,
'biopsia_solicitud_fecha': _date(order.fecha).isoformat() if order else None,
'toma_carga_inicio': load_time(procedures[m['procedimiento_id']]),
'mastografia_reporte_carga_inicio': load_time(procedures[m['reporte_id']]),
'birads_carga_inicio': load_time(observations.get((m['reporte_id'], 'mastografia.birads'))),
'biopsia_solicitud_carga_inicio': load_time(order),
'biopsia_reporte_carga_inicio': load_time(procedures[b['procedimiento_id']]) if b else None,
'biopsia_resultado_carga_inicio': load_time(observations.get((b['procedimiento_id'], 'biopsia.grado')))
if b and observation_known(b['procedimiento_id'], 'biopsia.grado', patient) else None,
})
return sorted(rows, key=lambda row: (-date.fromisoformat(row['mastografia_fecha']).toordinal(), int(row['pac_id'])))
+12
View File
@@ -0,0 +1,12 @@
"""Configure the breast cohort using the shared persistence settings."""
from persistance.db import get_cama_session
from webapi.cama_cohort import CamaCohort
def configure_cama_cohort(app):
def read(cutoff):
with get_cama_session() as session:
return CamaCohort(session).rows(cutoff)
app.config['CAMA_COHORT_READER'] = read
+45
View File
@@ -0,0 +1,45 @@
"""Risk batches waiting for a clinical decision (ADR-MD-008): list the ones no one has confirmed or voided yet,
confirm one (`preliminary` -> `final`, visible on `/cacu/pacientes/<id>/riesgo`) or void it (`entered-in-error`).
`GET/POST /<domain>/riesgos/lotes...`. The route is always registered; who may act on it is an access rule still
to be defined, as `patient_risk.py` notes for reads.
"""
from flask import Blueprint, jsonify, request
from persistance.edges.gold import ERROR, FINAL
def risk_batches_blueprint(repositories) -> Blueprint:
"""The blueprint, to register with `url_prefix="/cacu"`. `repositories` is `persistance.cacu`."""
blueprint = Blueprint("risk_batches", __name__)
@blueprint.get("/riesgos/lotes")
def list_pending_batches():
"""Pending batches, newest first."""
return jsonify([_batch(b) for b in repositories.cohort_repository.pending_batches()])
@blueprint.post("/riesgos/lotes/<int:lote_id>/confirmar")
def confirm_batch(lote_id: int):
"""Moves every current evaluation of the batch to `final` (ADR-MD-008): a clinical decision, with its
reason. 404 if the batch doesn't exist or has no evaluation left to decide."""
return _decide(lote_id, FINAL)
@blueprint.post("/riesgos/lotes/<int:lote_id>/anular")
def void_batch(lote_id: int):
"""Moves every current evaluation of the batch to `entered-in-error`."""
return _decide(lote_id, ERROR)
def _decide(lote_id: int, estado: str):
reason = (request.get_json(silent=True) or {}).get("reason", "").strip()
if not reason:
return jsonify({"error": "se requiere un motivo"}), 400
changed = repositories.cohort_repository.change_state(lote_id, estado, reason)
if not changed:
return jsonify({"error": f"el lote {lote_id} no existe o ya no tiene evaluaciones vigentes"}), 404
return jsonify({"lote_id": lote_id, "evaluaciones_cambiadas": changed})
return blueprint
def _batch(batch) -> dict:
return {"lote_id": batch.lote_id, "modelo_nombre": batch.modelo_nombre, "modelo_version": batch.modelo_version,
"evaluado_en": batch.evaluado_en.isoformat(), "n_evaluaciones": batch.n_evaluaciones}
+46
View File
@@ -0,0 +1,46 @@
"""Patient follow-up for the configured breast cohort."""
import calendar
from datetime import date, timedelta
from flask import Blueprint, jsonify, request
from webapi.cama_analysis import SelectionError, selection_response
def _desde(corte, meses):
indice = corte.year * 12 + corte.month - 1 - meses
anio, mes = divmod(indice, 12)
if anio < 1:
raise ValueError("la ventana excede el rango de fechas admitido")
anterior = date(anio, mes + 1, min(corte.day, calendar.monthrange(anio, mes + 1)[1]))
return anterior + timedelta(days=1)
def blueprint_seguimiento_cama():
blueprint = Blueprint("cama_seguimiento", __name__)
@blueprint.after_request
def no_cache(response):
response.headers["Cache-Control"] = "no-store"
return response
def respond(mode, patient=None):
try:
return selection_response(request.args, mode, patient)
except SelectionError as error:
return jsonify(error=error.message), error.status
@blueprint.get("/seguimiento")
def seguimiento():
return respond('list')
@blueprint.get("/seguimiento/exportacion")
def exportacion():
return respond('export')
@blueprint.get("/pacientes/<pac_id>")
def paciente(pac_id):
return respond('patient', pac_id)
return blueprint