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:
2026-11-08 17:28:24 -06:00
committed by rockdrigo
parent 8f84253205
commit ea228da7b4
42 changed files with 18123 additions and 1338 deletions
+13
View File
@@ -183,6 +183,19 @@ def test_tea_patient_keeps_the_source_id_and_reimport_updates_it(client):
assert paciente["pac_sexo"] == "M"
def test_an_import_into_a_domain_without_measures_queues_no_recomputation(client):
"""The cycle computes no TEA measures, so a TEA import saves its rows and asks for no recomputation.
Fails if the import queues every domain it writes to: the queue refuses TEA and the import answers 500.
"""
source = _json_source([{"pac_id_hospital": "T-NO-RECALC", "pac_sexo": "F"}], target="tea.Pacientes")
response = client.post("/imports/commit", json={"sources": [source]})
assert response.status_code == 200
body = response.get_json()
assert body["results"][0]["created"] == 1
assert body["indicadores_en_recalculo"] is False
@pytest.fixture
def sql_source_db(tmp_path):
db_path = tmp_path / "external_source.db"