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:
@@ -0,0 +1,64 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
import type { Measure } from 'fhir/r4';
|
||||
import { code, label } from '../fhir';
|
||||
import { periodTypes, STRATA } from './measures';
|
||||
|
||||
const SCORING: Record<string, string> = {
|
||||
proportion: 'Proporción',
|
||||
'continuous-variable': 'Variable continua (mediana)',
|
||||
cohort: 'Composición (conteo)',
|
||||
};
|
||||
const IMPROVEMENT: Record<string, string> = {
|
||||
increase: 'Mejor si sube',
|
||||
decrease: 'Mejor si baja',
|
||||
};
|
||||
const PERIODS: Record<string, string> = { semester: 'Semestral', month: 'Mensual' };
|
||||
|
||||
/** What each measure is: how it scores, which way is better, its periods and strata. */
|
||||
@Component({
|
||||
selector: 'app-tab-definiciones',
|
||||
template: `
|
||||
<table class="plain card">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Indicador</th>
|
||||
<th>Clave</th>
|
||||
<th>Cálculo</th>
|
||||
<th>Mejora</th>
|
||||
<th>Periodos</th>
|
||||
<th>Estratos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (m of measures(); track m.id) {
|
||||
<tr>
|
||||
<td>{{ m.title }}</td>
|
||||
<td>
|
||||
<code>{{ m.name }}</code> v{{ m.version }}
|
||||
</td>
|
||||
<td>{{ scoring[code(m.scoring) ?? ''] }}</td>
|
||||
<td>{{ improvement[code(m.improvementNotation) ?? ''] ?? '—' }}</td>
|
||||
<td>{{ types(m) }}</td>
|
||||
<td>{{ strata(m) }}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
`,
|
||||
styles: ':host { display: block; padding-top: 16px; overflow-x: auto; }',
|
||||
})
|
||||
export class TabDefiniciones {
|
||||
readonly measures = input.required<Measure[]>();
|
||||
protected readonly scoring = SCORING;
|
||||
protected readonly improvement = IMPROVEMENT;
|
||||
protected readonly code = code;
|
||||
protected types(m: Measure): string {
|
||||
return periodTypes(m)
|
||||
.map((p) => PERIODS[p] ?? p)
|
||||
.join(', ');
|
||||
}
|
||||
protected strata(m: Measure): string {
|
||||
const names = (m.group?.[0]?.stratifier ?? []).map((s) => code(s.code) ?? label(s.code));
|
||||
return names.map((n) => STRATA[n] ?? n).join(', ') || '—';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user