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
+247
View File
@@ -0,0 +1,247 @@
<section class="page">
<h1>Revisión</h1>
<p class="subtitle">
Lo que la carga retuvo para que una persona decida. Cada decisión queda registrada y se aplica
en la siguiente ejecución.
</p>
@if (message()) {
<p class="message" role="status">{{ message() }}</p>
}
<mat-tab-group animationDuration="0ms">
<mat-tab [label]="'Retenidos (' + (held.value()?.length ?? 0) + ')'">
<div class="bar">
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Entidad</mat-label>
<mat-select [value]="entity()" (selectionChange)="entity.set($event.value)">
@for (e of entities; track e[0]) {
<mat-option [value]="e[0]">{{ e[1] }}</mat-option>
}
</mat-select>
</mat-form-field>
</div>
<table class="plain card">
<thead>
<tr>
<th>Canalización</th>
<th>Motivo</th>
<th>Valores como llegaron</th>
<th></th>
</tr>
</thead>
<tbody>
@for (row of held.value() ?? []; track row['_record']) {
<tr>
<td>{{ row['_pipeline'] }} · {{ row['_target'] }}</td>
<td>{{ reasons(row) }}</td>
<td class="values">
@for (v of values(row) | keyvalue; track v.key) {
<span
><b>{{ v.key }}</b
>: {{ text(v.value) }}</span
>
}
</td>
<td>
<button
mat-stroked-button
[disabled]="decided().has($any(row['_record']))"
(click)="rejectRow(entity(), $any(row['_record']), reasons(row))"
>
Rechazar
</button>
</td>
</tr>
} @empty {
<tr>
<td colspan="4" class="muted">Nada retenido.</td>
</tr>
}
</tbody>
</table>
</mat-tab>
<mat-tab [label]="'Conflictos (' + (conflicts.value()?.length ?? 0) + ')'">
<div class="bar">
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Entidad</mat-label>
<mat-select [value]="entity()" (selectionChange)="entity.set($event.value)">
@for (e of entities; track e[0]) {
<mat-option [value]="e[0]">{{ e[1] }}</mat-option>
}
</mat-select>
</mat-form-field>
<span class="muted"
>Registros de una misma paciente y fecha que no coinciden: rechace los equivocados.</span
>
</div>
<table class="plain card">
<thead>
<tr>
<th>Paciente</th>
<th>Valores</th>
<th></th>
</tr>
</thead>
<tbody>
@for (row of conflicts.value() ?? []; track row['_record']) {
<tr>
<td>
<code>{{ text(row['person_id']).slice(0, 10) }}</code>
</td>
<td class="values">
@for (v of values(row) | keyvalue; track v.key) {
<span
><b>{{ v.key }}</b
>: {{ text(v.value) }}</span
>
}
</td>
<td>
<button
mat-stroked-button
[disabled]="decided().has($any(row['_record']))"
(click)="rejectRow(entity(), $any(row['_record']), 'conflicto')"
>
Rechazar
</button>
</td>
</tr>
} @empty {
<tr>
<td colspan="3" class="muted">Sin conflictos.</td>
</tr>
}
</tbody>
</table>
</mat-tab>
<mat-tab label="Personas">
<div class="bar">
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Canalización</mat-label>
<mat-select
[value]="pipeline()"
(selectionChange)="pipeline.set($event.value); node.set(undefined)"
>
@for (p of pipelines.value() ?? []; track p['pipeline_id']) {
<mat-option [value]="p['pipeline_id']">{{ p['pipeline_id'] }}</mat-option>
}
</mat-select>
</mat-form-field>
@if ((links.value() ?? []).length > 1) {
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Nodo de vinculación</mat-label>
<mat-select [value]="link()" (selectionChange)="node.set($event.value)">
@for (l of links.value() ?? []; track l) {
<mat-option [value]="l">{{ l }}</mat-option>
}
</mat-select>
</mat-form-field>
}
@if (pipeline()) {
<button
mat-flat-button
(click)="apply()"
[disabled]="!!run() && !['SUCCESS', 'FAILURE', 'CANCELED'].includes(run())"
>
Aplicar decisiones (ejecutar)
</button>
@if (run()) {
<span class="muted">Ejecución: {{ run() }}</span>
}
}
</div>
@if (persons.value(); as p) {
<h2>Posibles pacientes duplicadas ({{ p['to_settle'].length }})</h2>
@for (entry of p['to_settle']; track entry['person']) {
<div class="card person">
<div>
<b>Registro</b> <code>{{ text(entry['person']).slice(0, 10) }}</code> ·
{{ text(entry['record_number']) }} · {{ text(entry['full_name']) }} ·
{{ text(entry['birth_date']) }}
</div>
@for (c of candidates(entry); track c['candidate']) {
<div class="candidate">
<span
>¿Es <code>{{ text(c['candidate']).slice(0, 10) }}</code> ({{
text(c['record_number'])
}}
· {{ text(c['full_name']) }} · {{ text(c['birth_date']) }})?
<span class="muted"
>{{ c['reason'] }}
@if (c['probability'] !== null) {
· p = {{ $any(c['probability']) | number: '1.2-2' }}
}
</span></span
>
<button
mat-stroked-button
[disabled]="decided().has(entry['person'] + '|' + c['candidate'])"
(click)="decide($any(entry['person']), $any(c['candidate']), true)"
>
Misma paciente
</button>
<button
mat-stroked-button
[disabled]="decided().has(entry['person'] + '|' + c['candidate'])"
(click)="decide($any(entry['person']), $any(c['candidate']), false)"
>
Distintas
</button>
</div>
}
</div>
} @empty {
<p class="muted">Nada que decidir.</p>
}
<h2>Registros que no coinciden en fecha de nacimiento o sexo ({{ p['torn'].length }})</h2>
@for (entry of p['torn']; track entry['person']) {
<div class="card person">
@for (r of records(entry); track r['_record']) {
<div class="candidate">
<span class="values">
@for (v of values(r) | keyvalue; track v.key) {
<span
><b>{{ v.key }}</b
>: {{ text(v.value) }}</span
>
}
</span>
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="small">
<mat-label>Campo</mat-label>
<mat-select #field value="record_number">
@for (f of fields; track f) {
<mat-option [value]="f">{{ f }}</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="small">
<mat-label>Valor correcto</mat-label>
<input matInput #value />
</mat-form-field>
<button
mat-stroked-button
(click)="fix($any(r['_record']), field.value, value.value)"
>
Corregir
</button>
<button
mat-stroked-button
[disabled]="decided().has($any(r['_record']))"
(click)="rejectRow('identity', $any(r['_record']), 'identidad equivocada')"
>
Rechazar
</button>
</div>
}
</div>
} @empty {
<p class="muted">Nada que decidir.</p>
}
}
</mat-tab>
</mat-tab-group>
</section>