293 lines
10 KiB
HTML
293 lines
10 KiB
HTML
<section class="page">
|
|
<h1>Revisión</h1>
|
|
<p class="subtitle">
|
|
Registros retenidos durante la carga que requieren una decisión. 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 $index) {
|
|
<tr>
|
|
<td>{{ row['_pipeline'] }} · {{ row['_target'] }}</td>
|
|
<td>{{ said(row) }}</td>
|
|
<td class="values">
|
|
@for (v of values(row) | keyvalue; track v.key) {
|
|
<span
|
|
><b>{{ title(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 $index) {
|
|
<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>{{ title(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]="'Documentos no reconocidos (' + (unrecognised.value()?.length ?? 0) + ')'">
|
|
<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)">
|
|
@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>
|
|
</div>
|
|
<p class="muted">
|
|
Documentos recibidos que ninguna ruta reconoce: un formato nuevo, un estudio fuera del
|
|
catálogo o un escaneo ilegible. Para incluirlos, agregue o ajuste una ruta en Conectar.
|
|
</p>
|
|
@if (unrecognised.isLoading()) {
|
|
<app-loading what="los documentos no reconocidos" />
|
|
} @else {
|
|
<table class="plain">
|
|
<thead>
|
|
<tr>
|
|
<th>Ruta</th>
|
|
<th>Origen</th>
|
|
<th>Inicio del texto</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@for (row of unrecognised.value() ?? []; track $index) {
|
|
<tr>
|
|
<td>{{ row['route'] }}</td>
|
|
<td class="muted">{{ details(row) }}</td>
|
|
<td>
|
|
<pre class="preview">{{ row['preview'] || '(sin texto legible)' }}</pre>
|
|
</td>
|
|
</tr>
|
|
} @empty {
|
|
<tr>
|
|
<td colspan="3" class="muted">Sin documentos no reconocidos.</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>&ngsp;<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"
|
|
>{{ candidateReason(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">Sin decisiones pendientes.</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 $index) {
|
|
<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">Sin decisiones pendientes.</p>
|
|
}
|
|
}
|
|
</mat-tab>
|
|
</mat-tab-group>
|
|
</section>
|