Buscando el análisis de recurrencia…
} + @if (r === null) {Todavía no hay un modelo de recurrencia en producción.
} + @if (r) { + @if (r.escenarios.length === 0) {Todavía no hay escenarios clínicos de recurrencia para mostrar.
} + @else { + + + @if (figura(); as figure) {Se muestran al elegir un escenario clínico.
} +Buscando los escenarios clínicos…
} + @if (m === null) {Todavía no hay un modelo de supervivencia en producción.
} + @if (m) { + @if (m.escenarios.length === 0) {Todavía no hay escenarios clínicos con pacientes suficientes para mostrar.
} + @else { + + @let l = lectura(); + @if (l?.tipo === 'cargando') {Calculando con los datos más recientes…
} + @if (l?.tipo === 'rechazada') {{{ $any(l).motivo }}
} + @if (l?.tipo === 'error') {No se pudo calcular la supervivencia de este escenario.
} + @if (figura(); as figure) {Se muestran al elegir un escenario clínico.
} +Factores de riesgo de este escenario
+ @if (definitorios().length) { +Sin factores de riesgo identificados en este escenario.
+} diff --git a/src/app/features/indicadores/paciente-detalle/cama/cama-factores-riesgo.component.scss b/src/app/features/indicadores/paciente-detalle/cama/cama-factores-riesgo.component.scss new file mode 100644 index 0000000..ba7c256 --- /dev/null +++ b/src/app/features/indicadores/paciente-detalle/cama/cama-factores-riesgo.component.scss @@ -0,0 +1,9 @@ +:host { display: block; } +.title { font-weight: 600; margin: 0 0 .5rem; } +.group { display: flex; gap: .5rem; align-items: flex-start; margin: .25rem 0; } +.marker { color: var(--mat-sys-error, #b3261e); line-height: 1.9; } +ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; } +li { border: 1px solid var(--mat-sys-error, #b3261e); border-radius: 1rem; padding: .15rem .7rem; font-size: .9rem; } +li.robust { background: var(--mat-sys-error, #b3261e); color: var(--mat-sys-on-error, #fff); } +li.suggestive { background: transparent; color: var(--mat-sys-error, #b3261e); } +.none { color: var(--mat-sys-outline, #777); margin: 0; } diff --git a/src/app/features/indicadores/paciente-detalle/cama/cama-factores-riesgo.component.ts b/src/app/features/indicadores/paciente-detalle/cama/cama-factores-riesgo.component.ts new file mode 100644 index 0000000..8e61ec7 --- /dev/null +++ b/src/app/features/indicadores/paciente-detalle/cama/cama-factores-riesgo.component.ts @@ -0,0 +1,26 @@ +import { Component, computed, input } from '@angular/core'; +import { FilaFactores } from './cama-curvas.service'; + +export interface EntradaFactor { texto: string; robusto: boolean; } + +/** The entries of a summary cell, `Variable=Categoría (robusto|sugerente, porcentaje)` separated by `;`. */ +export function entradasDe(celda: string): EntradaFactor[] { + return celda.split(';').map(e => e.trim()).filter(Boolean).map(texto => ({ texto, robusto: /\(\s*robusto\b/i.test(texto) })); +} + +/** + * The risk factors of one clinical scenario, from its row of the scenario summary: the factors present in at least 95 % of the scenario + * and those in 50 to 95 %, a robust one solid and a suggestive one outlined. A scenario with none says so, in grey. + */ +@Component({ + selector: 'app-cama-factores-riesgo', + templateUrl: './cama-factores-riesgo.component.html', + styleUrl: './cama-factores-riesgo.component.scss', +}) +export class CamaFactoresRiesgo { + readonly fila = input{{ recommendationsUnavailable }}
+ @if (p.idField === 'pac_id') {{{ recommendationsUnavailable }}
+{{ recommendationsUnavailable }}
+Buscando los escenarios clínicos de recurrencia de la paciente…
} - @if (r === null) {Todavía no hay un modelo de recurrencia en producción.
} - @if (r) { - @if (r.escenarios.length === 0) {La paciente no cumple ninguno de los escenarios clínicos del análisis de recurrencia.
} - @for (f of r.escenarios; track f.cohorte + f.escenario) {Buscando los escenarios clínicos de la paciente…
} - @if (lista === null) {Todavía no hay un modelo de supervivencia en producción.
} - @if (lista) { - @for (nombre of lista; track nombre) {Calculando {{ escenario() }} con los datos más recientes…
} - @if (l.tipo === 'rechazada') {{{ escenario() }}: {{ l.motivo }}
} - @if (l.tipo === 'error') {No se pudo calcular la supervivencia de {{ escenario() }}.
} - @if (figura(); as figure) {Sin horizontes evaluados en el lote vigente.
} - @if (dominio() === 'cama' && pacId(); as id) { -Recomendaciones no disponibles.
diff --git a/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.ts b/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.ts index d7af53f..cd4626e 100644 --- a/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.ts +++ b/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.ts @@ -1,13 +1,12 @@ import { Component, computed, effect, inject, input } from '@angular/core'; import { DecimalPipe } from '@angular/common'; -import { CamaSupervivenciaPaciente } from './cama/cama-supervivencia-paciente.component'; import { DominioRiesgo } from './paciente-riesgo.models'; import { PacienteRiesgoState } from './paciente-riesgo.state'; import { tieneIntervalo } from './paciente-riesgo.validation'; @Component({ selector: 'app-paciente-riesgo-tabla', - imports: [DecimalPipe, CamaSupervivenciaPaciente], + imports: [DecimalPipe], providers: [PacienteRiesgoState], templateUrl: './paciente-riesgo-tabla.html', styleUrl: './paciente-riesgo-tabla.scss', diff --git a/src/app/features/indicadores/paciente-identidad.spec.ts b/src/app/features/indicadores/paciente-identidad.spec.ts index f52d03f..a7db11f 100644 --- a/src/app/features/indicadores/paciente-identidad.spec.ts +++ b/src/app/features/indicadores/paciente-identidad.spec.ts @@ -75,8 +75,8 @@ describe('Tabla de seguimiento con pac_id', () => { // Opening a CaMa record asks for the patient's risk; in these tests nobody has one. afterEach(() => { http.match(r => r.url === '/cama/fhir/RiskAssessment').forEach(r => { if (!r.cancelled) r.flush({ resourceType: 'Bundle', type: 'searchset', total: 0 }); }); - // The record also asks for the recurrence figures of the patient; there is no model for them here. - http.match(r => r.url === '/cama/modelo/recurrencia').forEach(r => { if (!r.cancelled) r.flush({ error: 'sin recurrencia' }, { status: 404, statusText: 'Not Found' }); }); + // The record asks for the two analyses of the patient (survival's menu and recurrence's); there is no model for them here. + http.match(r => r.url.startsWith('/cama/modelo/')).forEach(r => { if (!r.cancelled) r.flush({ error: 'sin modelo' }, { status: 404, statusText: 'Not Found' }); }); fixture.destroy(); http.verify(); }); const root = () => fixture.nativeElement as HTMLElement;