CaCu's and CaMa's measures answered on request from dbt's semantic layer as FHIR MeasureReports, with the period and both cut-offs in the question; the route is /<domain>/indicadores
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Lo que recibe cada paso del ciclo."""
|
||||
|
||||
import os
|
||||
from collections.abc import Mapping
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import date
|
||||
@@ -7,6 +8,12 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
def manifiesto_de_dbt() -> Path | None:
|
||||
"""The deployment's dbt manifest, from `DBT_MANIFEST`."""
|
||||
ruta = os.environ.get("DBT_MANIFEST")
|
||||
return Path(ruta) if ruta else None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Contexto:
|
||||
"""Lo que recibe un paso: el proyecto y las opciones del ciclo.
|
||||
@@ -26,6 +33,9 @@ class Contexto:
|
||||
corte: date | None = None
|
||||
permitir_sin_definir: bool = False
|
||||
parametros: Path | None = None
|
||||
# The `manifest.json` of `dbt compile`: the measures are defined there (`webapi.metrics`), and from it the cycle
|
||||
# creates their event models (`modelos`) and seeds the publication catalog (`definiciones`).
|
||||
dbt_manifest: Path | None = field(default_factory=manifiesto_de_dbt)
|
||||
# Los estimadores de riesgo por cohorte (`cohorte_url` -> objeto con `estimar(columnas, filas)`, `procedencia()`
|
||||
# y `desenlace`; ADR-MD-008). Sin ellos, el paso `estimar` no hace nada.
|
||||
estimadores: Mapping[str, Any] = field(default_factory=dict, compare=False, repr=False)
|
||||
|
||||
Reference in New Issue
Block a user