TEA on its new staging: silver load, ten measures answered on request with the status at the period's end, several groups and column strata, and FHIR R4 endpoints for measures, follow-up and patient summary

This commit is contained in:
2026-11-12 15:21:25 -06:00
parent c430a5bd11
commit a0407e41d6
55 changed files with 2609 additions and 790 deletions
+8 -2
View File
@@ -7,7 +7,7 @@ from datetime import date, datetime
from enum import Enum
from typing import Annotated, Any, Optional, Type
from pydantic import BeforeValidator, StringConstraints, ValidationInfo
from pydantic import BeforeValidator, Field, StringConstraints, ValidationInfo
from core.columns import HOSPITAL_ID_LENGTH
from extraction import ExtractionError
@@ -140,7 +140,7 @@ CodigoPostal = Annotated[str, StringConstraints(pattern=r"^[0-9]{5}$")]
def edf_file(v: Any) -> Any:
"""`eeg_estudio.eeg_estudio`: an EDF file MNE can open (TEA amendment).
"""`eeg.eeg_estudio`: an EDF file MNE can open (TEA amendment).
JSON sources may carry it base64-encoded."""
if v is None or (isinstance(v, str) and not v.strip()):
return None
@@ -168,3 +168,9 @@ FlexDate = Annotated[Optional[date], BeforeValidator(coerce_date)]
RequiredDate = Annotated[date, BeforeValidator(required_date)]
PostalCode = Annotated[Optional[CodigoPostal], BeforeValidator(coerce_postal_code)]
EdfFile = Annotated[Optional[bytes], BeforeValidator(edf_file)]
def Bounded(kind: type, low: float | None = None, high: float | None = None): # noqa: N802 (used like a type)
"""An optional number within [low, high], either bound open when None: a score or a count out of range is a
validation error, not a stored value."""
return Optional[Annotated[kind, Field(ge=low, le=high)]]