One shell with the current look: indicators, follow-up list and patient view from FHIR; /conectar canvas; /revision; Playwright page tests

This commit is contained in:
Roberto Treviño
2026-11-25 10:21:30 -06:00
parent 70b6d6c646
commit cd7bbaf11a
70 changed files with 5459 additions and 182 deletions
+145
View File
@@ -0,0 +1,145 @@
<section class="page">
<a mat-button [routerLink]="['/indicadores', domain()]"
><mat-icon>arrow_back</mat-icon> Regresar</a
>
@if (error()) {
<p class="muted" role="alert">No se encontró la paciente.</p>
} @else if (patient(); as p) {
<h1>
Paciente <code>{{ p.id!.slice(0, 10) }}</code>
</h1>
<dl class="summary">
<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>
<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">
<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">Ningún modelo vigente la ha evaluado.</p>
}
</mat-card-content>
</mat-card>
</div>
} @else if (loading()) {
<p class="muted">Cargando…</p>
}
</section>