7c98566579
Removed the legacy indicator layout, unused chart helpers, styles and exports, the card-actions component, fetch-all and explanatory comments; one pager shared by the four worklists, shared filter-row styles, one FHIR name and CURP reader, downloads through export/, the concept-map editor on Material controls.
367 lines
13 KiB
HTML
367 lines
13 KiB
HTML
<section class="page">
|
||
<a
|
||
mat-button
|
||
[routerLink]="['/indicadores', domain()]"
|
||
[queryParams]="domain() === 'tea' ? { seguimiento: id() } : null"
|
||
><mat-icon>arrow_back</mat-icon> Regresar</a
|
||
>
|
||
@if (domain() === 'tea') {
|
||
@if (tea.error()) {
|
||
<p class="muted" role="alert">No se encontró el paciente.</p>
|
||
} @else if (tea.value(); as t) {
|
||
@if (risk()) {
|
||
<h1>Análisis de riesgo TEA</h1>
|
||
@if (patientName(t.patient); as name) {
|
||
<p class="subtitle">{{ name }}</p>
|
||
}
|
||
} @else {
|
||
<h1>
|
||
{{ patientName(t.patient) ?? 'Paciente' }}
|
||
<code class="muted id">{{ t.patient.id!.slice(0, 10) }}</code>
|
||
</h1>
|
||
<dl class="summary">
|
||
@for (row of teaIdentity(); track $index) {
|
||
<div>
|
||
<dt>{{ row[0] }}</dt>
|
||
<dd>{{ row[1] }}</dd>
|
||
</div>
|
||
}
|
||
</dl>
|
||
}
|
||
<div class="actions">
|
||
<button
|
||
mat-stroked-button
|
||
type="button"
|
||
[disabled]="exporting() || (!risk() && norms.isLoading())"
|
||
(click)="download()"
|
||
>
|
||
Exportar PDF
|
||
</button>
|
||
@if (risk()) {
|
||
<a mat-stroked-button [routerLink]="['/indicadores', 'tea', 'pacientes', id()]"
|
||
>Expediente</a
|
||
>
|
||
} @else {
|
||
<a mat-stroked-button [routerLink]="['/indicadores', 'tea', 'pacientes', id(), 'riesgo']"
|
||
>Análisis de riesgo</a
|
||
>
|
||
}
|
||
</div>
|
||
@if (exportError()) {
|
||
<p class="muted" role="alert">No se pudo exportar el PDF.</p>
|
||
}
|
||
<div class="cards">
|
||
@for (section of teaSections(); track section.title) {
|
||
<app-tea-section [section]="section" class="wide">
|
||
@if (risk() && section.title === forestTitle) {
|
||
<mat-slide-toggle [checked]="onlyAltered()" (change)="onlyAltered.set($event.checked)"
|
||
>Solo zonas alteradas</mat-slide-toggle
|
||
>
|
||
}
|
||
@if (risk() && section.title === probabilityTitle && t.pairs.length) {
|
||
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
||
<mat-label>Par</mat-label>
|
||
<mat-select
|
||
[value]="selectedPair()?.key"
|
||
(selectionChange)="selectedKey.set($event.value)"
|
||
>
|
||
@for (pair of t.pairs; track pair.key) {
|
||
<mat-option [value]="pair.key">{{ pair.title }}</mat-option>
|
||
}
|
||
</mat-select>
|
||
</mat-form-field>
|
||
}
|
||
</app-tea-section>
|
||
}
|
||
</div>
|
||
} @else {
|
||
<app-loading [what]="risk() ? 'el análisis de riesgo' : 'el expediente'" />
|
||
}
|
||
} @else if (error()) {
|
||
<p class="muted" role="alert">No se encontró la paciente.</p>
|
||
} @else if (patient(); as p) {
|
||
<h1>
|
||
{{ identity().name ?? 'Paciente' }} <code class="muted id">{{ p.id!.slice(0, 10) }}</code>
|
||
</h1>
|
||
<dl class="summary">
|
||
<div>
|
||
<dt>CURP</dt>
|
||
<dd>{{ identity().curp ?? 'Sin dato' }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Expedientes</dt>
|
||
<dd>{{ identity().numbers.join(', ') || 'Sin dato' }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Fecha de nacimiento</dt>
|
||
<dd>{{ p.birthDate ?? 'Sin dato' }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Sexo</dt>
|
||
<dd>
|
||
{{ p.gender === 'female' ? 'Femenino' : p.gender === 'male' ? 'Masculino' : 'Sin dato' }}
|
||
</dd>
|
||
</div>
|
||
@if (cama(); as c) {
|
||
<div>
|
||
<dt>Grupo de edad</dt>
|
||
<dd>{{ c.ageGroup || 'No disponible' }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Escenario clínico</dt>
|
||
<dd>{{ c.scenario }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Estatus de seguimiento</dt>
|
||
<dd>
|
||
{{ c.status ?? 'Fuera de la lista (' + c.window + ' meses al ' + c.cutoff + ')' }}
|
||
</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Prioridad</dt>
|
||
<dd>{{ c.priority ?? 'No disponible' }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Días de mastografía a diagnóstico</dt>
|
||
<dd>{{ c.days ?? 'No disponible' }}</dd>
|
||
</div>
|
||
} @else {
|
||
@if (status()) {
|
||
<div>
|
||
<dt>Estatus de seguimiento</dt>
|
||
<dd>{{ status() }}</dd>
|
||
</div>
|
||
}
|
||
}
|
||
@if (p.deceasedDateTime) {
|
||
<div>
|
||
<dt>Defunción</dt>
|
||
<dd>{{ p.deceasedDateTime }}</dd>
|
||
</div>
|
||
}
|
||
</dl>
|
||
|
||
<div class="cards">
|
||
@if (cama(); as c) {
|
||
<mat-card appearance="outlined" data-section="mastografia">
|
||
<mat-card-header><mat-card-title>Mastografía</mat-card-title></mat-card-header>
|
||
<mat-card-content>
|
||
<h3>Última mastografía</h3>
|
||
<dl class="facts">
|
||
<div>
|
||
<dt>Categoría BI-RADS</dt>
|
||
<dd>{{ c.birads ?? 'No disponible' }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Fecha</dt>
|
||
<dd>{{ c.mammogram ?? 'No disponible' }}</dd>
|
||
</div>
|
||
</dl>
|
||
</mat-card-content>
|
||
</mat-card>
|
||
<mat-card appearance="outlined" data-section="histopatologia">
|
||
<mat-card-header><mat-card-title>Histopatología</mat-card-title></mat-card-header>
|
||
<mat-card-content>
|
||
<h3>Resultado histopatológico</h3>
|
||
<dl class="facts">
|
||
<div>
|
||
<dt>Resultado</dt>
|
||
<dd>{{ c.histology ?? 'No disponible' }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>Fecha de reporte de la biopsia</dt>
|
||
<dd>{{ c.biopsy ?? 'No disponible' }}</dd>
|
||
</div>
|
||
</dl>
|
||
</mat-card-content>
|
||
</mat-card>
|
||
}
|
||
<mat-card appearance="outlined">
|
||
<mat-card-header><mat-card-title>Historial médico</mat-card-title></mat-card-header>
|
||
<mat-card-content>
|
||
<table class="plain">
|
||
<thead>
|
||
<tr>
|
||
<th>Fecha</th>
|
||
<th>Tipo</th>
|
||
<th>Detalle</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@for (h of history(); track $index) {
|
||
<tr>
|
||
<td class="nowrap">{{ h.date }}</td>
|
||
<td>{{ h.kind }}</td>
|
||
<td>
|
||
{{ h.text }}
|
||
@if (h.code && h.code !== h.text) {
|
||
<span class="muted">({{ h.code }})</span>
|
||
}
|
||
</td>
|
||
</tr>
|
||
} @empty {
|
||
<tr>
|
||
<td colspan="3" class="muted">Sin registros.</td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
</mat-card-content>
|
||
</mat-card>
|
||
|
||
<mat-card appearance="outlined">
|
||
<mat-card-header><mat-card-title>Pruebas y resultados</mat-card-title></mat-card-header>
|
||
<mat-card-content>
|
||
<table class="plain">
|
||
<thead>
|
||
<tr>
|
||
<th>Toma</th>
|
||
<th>Estudio</th>
|
||
<th>Reporte</th>
|
||
<th>Resultados</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@for (t of tests(); track $index) {
|
||
<tr>
|
||
<td class="nowrap">{{ t.date }}</td>
|
||
<td>{{ t.kind }}</td>
|
||
<td class="nowrap">{{ t.reported ?? 'Pendiente' }}</td>
|
||
<td>{{ t.results.join(' · ') || '—' }}</td>
|
||
</tr>
|
||
} @empty {
|
||
<tr>
|
||
<td colspan="4" class="muted">Sin estudios.</td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
</mat-card-content>
|
||
</mat-card>
|
||
|
||
<mat-card appearance="outlined" class="wide">
|
||
<mat-card-header
|
||
><mat-card-title>Riesgos y recomendaciones</mat-card-title></mat-card-header
|
||
>
|
||
<mat-card-content>
|
||
@if (models().length) {
|
||
<table class="plain">
|
||
<thead>
|
||
<tr>
|
||
<th>Modelo</th>
|
||
<th>Fecha índice</th>
|
||
<th>Horizonte</th>
|
||
<th>Probabilidad</th>
|
||
<th>IC 95 %</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@for (m of models(); track m.model) {
|
||
@for (p of m.predictions; track p.years) {
|
||
<tr>
|
||
<td>{{ $first ? m.text : '' }}</td>
|
||
<td>{{ $first ? m.index : '' }}</td>
|
||
<td>{{ p.years }} {{ p.years === 1 ? 'año' : 'años' }}</td>
|
||
<td>{{ p.p * 100 | number: '1.1-2' }} %</td>
|
||
<td>
|
||
@if (p.low !== undefined) {
|
||
{{ p.low * 100 | number: '1.1-2' }}–{{ p.high! * 100 | number: '1.1-2' }}
|
||
%
|
||
} @else {
|
||
—
|
||
}
|
||
</td>
|
||
</tr>
|
||
}
|
||
}
|
||
</tbody>
|
||
</table>
|
||
<app-plot [figure]="curve()" [height]="300" />
|
||
} @else {
|
||
<p class="muted">Sin evaluación de un modelo en producción.</p>
|
||
}
|
||
</mat-card-content>
|
||
</mat-card>
|
||
|
||
@if (recurrenceModel(); as rm) {
|
||
<mat-card appearance="outlined" class="wide" data-section="recurrencia">
|
||
<mat-card-header
|
||
><mat-card-title>Pronóstico y recomendaciones</mat-card-title></mat-card-header
|
||
>
|
||
<mat-card-content>
|
||
<h3>Análisis de recurrencia</h3>
|
||
<table class="plain">
|
||
<thead>
|
||
<tr>
|
||
<th>Horizonte</th>
|
||
<th>Probabilidad de recurrencia</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@for (p of rm.predictions; track p.years) {
|
||
<tr>
|
||
<td>{{ p.years | number: '1.0-1' }} {{ p.years === 1 ? 'año' : 'años' }}</td>
|
||
<td class="num">{{ p.p * 100 | number: '1.1-1' }} %</td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
@if (recurrence.isLoading()) {
|
||
<app-loading what="las curvas de recurrencia" [figure]="true" />
|
||
} @else if (recurrence.value(); as s) {
|
||
<h3>Escenario clínico de la paciente</h3>
|
||
<ul class="scenarios">
|
||
@for (name of s.scenarios; track name) {
|
||
<li>{{ name }}</li>
|
||
}
|
||
</ul>
|
||
@for (f of s.figures; track f.title) {
|
||
<h4>{{ f.title }}</h4>
|
||
<app-plot [figure]="f.figure" [height]="340" />
|
||
} @empty {
|
||
<p class="muted">
|
||
Sus escenarios no tienen recaídas suficientes para trazar curvas.
|
||
</p>
|
||
}
|
||
<app-factores [rows]="s.factors" />
|
||
} @else if (recurrence.error()) {
|
||
<p class="muted" role="alert">No se pudo leer el informe del modelo.</p>
|
||
}
|
||
</mat-card-content>
|
||
</mat-card>
|
||
}
|
||
@if (models().some((m) => m.model.endsWith('.survival') && m.scenarios.length)) {
|
||
<mat-card appearance="outlined" class="wide" data-section="supervivencia">
|
||
<mat-card-header><mat-card-title>Riesgo de muerte</mat-card-title></mat-card-header>
|
||
<mat-card-content>
|
||
<h3>Análisis de supervivencia</h3>
|
||
@if (survival.isLoading()) {
|
||
<app-loading what="las curvas de supervivencia" [figure]="true" />
|
||
} @else if (survival.value(); as s) {
|
||
<h3>Escenario clínico de la paciente</h3>
|
||
<ul class="scenarios">
|
||
@for (name of s.scenarios; track name) {
|
||
<li>{{ name }}</li>
|
||
}
|
||
</ul>
|
||
@for (f of s.figures; track f.title) {
|
||
<h4>{{ f.title }}</h4>
|
||
<app-plot [figure]="f.figure" [height]="340" />
|
||
} @empty {
|
||
<p class="muted">
|
||
Sus escenarios no tienen fallecimientos suficientes para trazar curvas.
|
||
</p>
|
||
}
|
||
<app-factores [rows]="s.factors" />
|
||
} @else if (survival.error()) {
|
||
<p class="muted" role="alert">No se pudo leer el informe del modelo.</p>
|
||
}
|
||
</mat-card-content>
|
||
</mat-card>
|
||
}
|
||
</div>
|
||
} @else if (loading()) {
|
||
<app-loading what="el expediente" />
|
||
}
|
||
</section>
|