FHIR: every URL the API emits hangs from one base, set by FHIR_BASE_URL

The code systems, value sets and the extensions (cut-offs, report id, interval, quartiles) each wrote the domain by
hand. They now derive from webapi.fhir_base, a leaf module so metrics and durations can use it without a cycle. The
default is unchanged; the WebApp still reads the same URLs by exact match, so changing the domain goes to both.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 02:54:23 -06:00
parent 6d01742a85
commit 1d52da79e4
5 changed files with 64 additions and 9 deletions
+6 -5
View File
@@ -42,6 +42,7 @@ from sqlalchemy import (
)
from webapi.cama_analysis.stats import wilson
from webapi.fhir_base import STRUCTURE
AGGREGATION_VERSION = "md19.1" # the unit-row contract the publication views read
TOTAL = "total"
@@ -665,11 +666,11 @@ def _from_counts(definition: MeasureDefinition, report_id: int, counts: dict, by
# --- the contract --------------------------------------------------------------------------------------------------
POPULATION_SYSTEM = "http://terminology.hl7.org/CodeSystem/measure-population"
EVENT_CUTOFF = "https://isssteleon.org/fhir/StructureDefinition/corte-evento"
KNOWLEDGE_CUTOFF = "https://isssteleon.org/fhir/StructureDefinition/corte-conocimiento"
HISTORY_ENTRY = "https://isssteleon.org/fhir/StructureDefinition/reporte-id"
INTERVAL_LOW = "https://isssteleon.org/fhir/StructureDefinition/ic-bajo"
INTERVAL_HIGH = "https://isssteleon.org/fhir/StructureDefinition/ic-alto"
EVENT_CUTOFF = f"{STRUCTURE}/corte-evento"
KNOWLEDGE_CUTOFF = f"{STRUCTURE}/corte-conocimiento"
HISTORY_ENTRY = f"{STRUCTURE}/reporte-id"
INTERVAL_LOW = f"{STRUCTURE}/ic-bajo"
INTERVAL_HIGH = f"{STRUCTURE}/ic-alto"
def _populations(definition: MeasureDefinition, counts: Counts) -> list[dict]: