Patient risk: a column per outcome, the index visit's sentence, and the model's details folded
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)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { RiesgoPacienteCacu } from './paciente-riesgo.models';
|
||||
import { LoteRiesgoCacu, RiesgoPacienteCacu } from './paciente-riesgo.models';
|
||||
|
||||
const CS = 'https://isssteleon.org/fhir/CodeSystem';
|
||||
export const INTERVALO = 'https://isssteleon.org/fhir/StructureDefinition/intervalo-confianza';
|
||||
@@ -38,9 +38,7 @@ export function riesgoCacuEjemplo(): any {
|
||||
|
||||
/** TEST ONLY. What the record shows from `riesgoCacuEjemplo()`. */
|
||||
export function riesgoCacuVista(): RiesgoPacienteCacu {
|
||||
return {
|
||||
simulado: true,
|
||||
riesgo: {
|
||||
const riesgo: LoteRiesgoCacu = {
|
||||
id: '12-42', modelo_nombre: 'modelo-cacu', modelo_version: '2.1.0', fecha_indice: '2026-06-01',
|
||||
evaluado_en: '2026-10-01T00:00:00Z', estado_lote: 'final', desenlace: 'cin2_mas', desenlace_texto: 'CIN2+ por biopsia',
|
||||
horizontes: [
|
||||
@@ -49,8 +47,10 @@ export function riesgoCacuVista(): RiesgoPacienteCacu {
|
||||
{ horizonte_anios: 5, probabilidad: 0.34, ic_bajo: 0.26, ic_alto: 0.44 },
|
||||
],
|
||||
estimando: null,
|
||||
},
|
||||
resultados_indice: null,
|
||||
sin_estimacion: null,
|
||||
};
|
||||
return { simulado: true, riesgo, riesgos: [riesgo] };
|
||||
}
|
||||
|
||||
/** TEST ONLY. `riesgoCacuEjemplo()` from a model whose scenario says what its number is (extension `estimando`). */
|
||||
@@ -68,3 +68,46 @@ export function riesgoCacuConEstimando(): any {
|
||||
] }];
|
||||
return data;
|
||||
}
|
||||
|
||||
export const RESULTADOS_INDICE = 'https://isssteleon.org/fhir/StructureDefinition/resultados-indice';
|
||||
|
||||
/** TEST ONLY. `riesgoCacuConEstimando()` plus a cancer `RiskAssessment` of the same visit, both with the index
|
||||
* cytology's results: the Bundle a patient scored by the CIN2+ and the cancer models gets. Cancer comes first, as
|
||||
* the newer batch would. */
|
||||
export function riesgoCacuDosDesenlaces(): any {
|
||||
const data = riesgoCacuConEstimando();
|
||||
const cin2 = data.entry[0].resource;
|
||||
const resultados = { url: RESULTADOS_INDICE, extension: [
|
||||
{ url: 'escamosas', valueString: 'LIEBG' }, { url: 'vph', valueString: 'POSITIVO' }] };
|
||||
cin2.extension.push(resultados);
|
||||
const cancer = structuredClone(cin2);
|
||||
cancer.id = '13-42';
|
||||
cancer.method.coding[0].code = 'modelo-cacu-cancer';
|
||||
cancer.extension[0].extension = cancer.extension[0].extension.map((e: any) =>
|
||||
e.url === 'outcome' ? { ...e, valueString: 'Cáncer: biopsia de carcinoma' } : e);
|
||||
cancer.prediction = [
|
||||
prediccion(0.004, '2026-06-01', '2027-06-01', [0.002, 0.008]),
|
||||
prediccion(0.009, '2026-06-01', '2029-06-01', [0.005, 0.016]),
|
||||
prediccion(0.015, '2026-06-01', '2031-06-01', [0.008, 0.028]),
|
||||
].map(p => ({ ...p, outcome: { coding: [{ system: 'https://isssteleon.org/fhir/CodeSystem/desenlace', code: 'cancer',
|
||||
display: 'Cáncer cervicouterino por biopsia' }] } }));
|
||||
data.entry.unshift({ fullUrl: 'http://localhost/cacu/fhir/RiskAssessment/13-42', resource: cancer });
|
||||
data.total = 2;
|
||||
return data;
|
||||
}
|
||||
|
||||
export const SIN_ESTIMACION = 'https://isssteleon.org/fhir/StructureDefinition/sin-estimacion';
|
||||
|
||||
/** TEST ONLY. `riesgoCacuConEstimando()` plus a current cancer model that didn't score her: a `RiskAssessment` with
|
||||
* no prediction, marked `sin-estimacion`. */
|
||||
export function riesgoCacuCancerSinEstimar(): any {
|
||||
const data = riesgoCacuConEstimando();
|
||||
const cancer = structuredClone(data.entry[0].resource);
|
||||
cancer.id = '13-42';
|
||||
delete cancer.prediction;
|
||||
cancer.extension = [{ url: SIN_ESTIMACION, extension: [{ url: 'desenlace', valueCode: 'cancer' },
|
||||
{ url: 'motivo', valueString: 'queda fuera de su población' }] }];
|
||||
data.entry.push({ fullUrl: 'http://localhost/cacu/fhir/RiskAssessment/13-42', resource: cancer });
|
||||
data.total = 2;
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user