686580af81
The record reads every RiskAssessment of the patient. CaCu's table always has the LIEAG+ and cancer columns, each
risk with its interval in parentheses; a column with no current model says "No disponible", and one whose model
didn't estimate her says so, with the reason under the table. Another outcome (a survival model's death) shows only
when she has its risk, with its own index date in its header. The models' details fold under the table, without the
interval's method; the collapsible curves draw one line per outcome with the index date on the x axis, under a
sentence that words the index cytology's results and each outcome's risk at the longest common horizon.
(cherry picked from commit 73b88de0ca)
75 lines
2.9 KiB
TypeScript
75 lines
2.9 KiB
TypeScript
import { Observable } from 'rxjs';
|
|
|
|
export type EstadoEvaluacionCacu = 'preliminary' | 'final';
|
|
|
|
/** The domain whose patient's risk is read: its FHIR endpoint is `/<dominio>/fhir`. CaCu unless said otherwise. */
|
|
export type DominioRiesgo = 'cacu' | 'cama';
|
|
|
|
export interface HorizonteRiesgoCacu {
|
|
/** Years from the risk's index date: the length of the prediction's `whenPeriod`; 0 is the immediate risk. */
|
|
horizonte_anios: number;
|
|
/** Transport values remain probabilities in [0, 1], never percentages. */
|
|
probabilidad: number;
|
|
ic_bajo?: number | null;
|
|
ic_alto?: number | null;
|
|
}
|
|
|
|
/** What the model's number is (the scenario's `[estimand]`, extension `estimando`); each field may be missing. */
|
|
export interface EstimandoRiesgo {
|
|
/** e.g. "Riesgo acumulado"; also `method.text`. */
|
|
quantity?: string;
|
|
description?: string;
|
|
outcome?: string;
|
|
index_date?: string;
|
|
/** The unit the horizons are counted in, e.g. "años". */
|
|
horizons_unit?: string;
|
|
}
|
|
|
|
/** The results of the cytology sampled on the risk's index date (extension `resultados-indice`), as recorded. */
|
|
export interface ResultadosIndice {
|
|
escamosas?: string;
|
|
glandulares?: string;
|
|
/** `POSITIVO`, `NEGATIVO` or `INDETERMINADO`. */
|
|
vph?: string;
|
|
}
|
|
|
|
/** The view of one FHIR `RiskAssessment` (`GET /cacu/fhir/RiskAssessment?subject=Patient/<pac_id>`). */
|
|
export interface LoteRiesgoCacu {
|
|
/** The resource's id, `<lote_id>-<pac_id>`. */
|
|
id: string;
|
|
modelo_nombre: string;
|
|
modelo_version: string;
|
|
/** The model's index date for this patient (the predictions' `whenPeriod.start`): the horizons count from it. */
|
|
fecha_indice: string;
|
|
evaluado_en: string;
|
|
estado_lote: EstadoEvaluacionCacu;
|
|
/** The prediction's outcome code (e.g. `cin2_mas`) and its display. */
|
|
desenlace: string;
|
|
desenlace_texto: string | null;
|
|
horizontes: HorizonteRiesgoCacu[];
|
|
/** `null` for a model whose scenario doesn't say. */
|
|
estimando: EstimandoRiesgo | null;
|
|
/** `null` when no cytology was sampled on the index date (or the domain doesn't give it). */
|
|
resultados_indice: ResultadosIndice | null;
|
|
/** Why a current model of this outcome has no risk for her (extension `sin-estimacion`; then `horizontes` is
|
|
* empty and `fecha_indice` too); `null` when it scored her. */
|
|
sin_estimacion: string | null;
|
|
}
|
|
|
|
/** DEV-only: the patient's current `RiskAssessment` of each outcome, from a `searchset` Bundle tagged `simulado`.
|
|
* `riesgos` holds them CIN2+ first, then cancer, then any other; `riesgo` is the first. */
|
|
export interface RiesgoPacienteCacu {
|
|
simulado: true;
|
|
riesgo: LoteRiesgoCacu;
|
|
riesgos: LoteRiesgoCacu[];
|
|
}
|
|
|
|
/** The raw FHIR answer (a Bundle), or `null` when the patient has no risk data. */
|
|
export interface PacienteRiesgoProvider {
|
|
obtener(pacId: string, dominio?: DominioRiesgo): Observable<unknown>;
|
|
}
|
|
|
|
export type PacienteRiesgoEstado =
|
|
| { tipo: 'cargando' | 'no-disponible' | 'error' }
|
|
| { tipo: 'disponible'; datos: RiesgoPacienteCacu };
|