3b246b4f1f
Rows name their patient with pac_id (a decimal string) or the legacy id_seudonimo. pac_id wins; an invalid pac_id is never replaced by the legacy field, and a page that repeats a patient or mixes both fields is not drawn or exported. The table, patient record, PDF and spreadsheet follow the announced identifier column and label. CaCu requests risk only with a pac_id.
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { Observable } from 'rxjs';
|
|
|
|
export type EstadoEvaluacionCacu = 'preliminary' | 'final';
|
|
export type TipoCensuraCacu = 'prevalente' | 'incidente' | 'izquierda' | 'derecha' | 'derechaBasal' | 'no_informativo';
|
|
|
|
export interface CohorteRiesgoCacu {
|
|
url: string;
|
|
version: string;
|
|
fecha_indice: string;
|
|
tipo_censura: TipoCensuraCacu | null;
|
|
c: number | null;
|
|
l: number | null;
|
|
r: number | null;
|
|
pap_0: string | null;
|
|
hpv_0: string | null;
|
|
}
|
|
|
|
export interface HorizonteRiesgoCacu {
|
|
horizonte_anios: number;
|
|
/** Transport values remain probabilities in [0, 1], never percentages. */
|
|
probabilidad: number;
|
|
ic_bajo?: number | null;
|
|
ic_alto?: number | null;
|
|
estado: EstadoEvaluacionCacu;
|
|
}
|
|
|
|
export interface LoteRiesgoCacu {
|
|
lote_id: number;
|
|
modelo_nombre: string;
|
|
modelo_version: string;
|
|
evaluado_en: string;
|
|
estado_lote: EstadoEvaluacionCacu;
|
|
horizontes: HorizonteRiesgoCacu[];
|
|
}
|
|
|
|
/** DEV-only contract from cacu_riesgo_paciente.md, 2026-10-28. */
|
|
export interface RiesgoPacienteCacu {
|
|
simulado: true;
|
|
cohorte: CohorteRiesgoCacu | null;
|
|
riesgo: LoteRiesgoCacu | null;
|
|
}
|
|
|
|
/** `null` when the patient has no risk data. */
|
|
export interface PacienteRiesgoProvider {
|
|
obtener(pacId: string): Observable<unknown>;
|
|
}
|
|
|
|
export type PacienteRiesgoEstado =
|
|
| { tipo: 'cargando' | 'no-disponible' | 'error' }
|
|
| { tipo: 'disponible'; datos: RiesgoPacienteCacu };
|