e2ecaa027c
webapi/fhir/risk.py builds a patient's RiskAssessment for CaCu and CaMa; GET /cama/modelo/curvas serves the production version's survival curves; the cycle's estimator is generic by scenario; silver persona carries the date of death for CaMa; the import schema accepts it; the CaMa risk batches can be confirmed and voided.
12 lines
540 B
Python
12 lines
540 B
Python
"""CaMa's patients in FHIR R4: a patient's individual risk as a `RiskAssessment` (DEV only, simulated data), built by
|
|
`webapi.fhir.risk` with CaMa's outcomes: the mortality at each horizon from the model's index date."""
|
|
|
|
from webapi.fhir import risk
|
|
|
|
OUTCOMES = {"muerte": "Muerte por cualquier causa"}
|
|
|
|
|
|
def risk_assessment(pac_id: int, patient_risk, simulated: bool) -> dict:
|
|
"""The patient's current risk (`PatientRisk`) as a `RiskAssessment`."""
|
|
return risk.risk_assessment(pac_id, patient_risk, simulated, OUTCOMES, "muerte")
|