Follow-up list: a case's survival is 1 at 0 years, at the index date
This commit is contained in:
@@ -256,7 +256,11 @@ def _probabilidades_por_paciente() -> dict[str, dict[int, list[dict]]]:
|
||||
continue
|
||||
destino = found.setdefault(clave, {})
|
||||
for pac_id, horizontes in por_paciente.items():
|
||||
destino.setdefault(pac_id, [_horizonte(h, complemento=clave == "supervivencia") for h in horizontes])
|
||||
filas = [_horizonte(h, complemento=clave == "supervivencia") for h in horizontes]
|
||||
if clave == "supervivencia" and filas and not any(f["horizonte_anios"] == 0 for f in filas):
|
||||
# at the index date every patient is alive
|
||||
filas.insert(0, {"horizonte_anios": 0.0, "probabilidad": 1.0, "ic_bajo": 1.0, "ic_alto": 1.0})
|
||||
destino.setdefault(pac_id, filas)
|
||||
return found
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user