TEA Indicadores as the old page: the period summary in words, the three timeliness boxes, counts and age-group figures; tab named Resumen
This commit is contained in:
@@ -10,7 +10,10 @@ import { Fhir, resources } from '../fhir';
|
||||
import { Figure, Plot } from '../plot';
|
||||
import { LAYOUTS } from './layout';
|
||||
import {
|
||||
ageShare,
|
||||
ageStack,
|
||||
boxFigure,
|
||||
countBars,
|
||||
fill,
|
||||
nestedDonut,
|
||||
rateDots,
|
||||
@@ -215,6 +218,40 @@ export class TabIndicadores {
|
||||
const r = measure ? this.rd(measure) : undefined;
|
||||
return r && r.score !== undefined ? boxFigure(r, this.applied() ?? '') : undefined;
|
||||
}
|
||||
/** TEA's summary of the period: its numbers from the measures (none: no summary). */
|
||||
protected readonly teaSummary = computed(() => {
|
||||
const rd = (c: string) => this.reports.value()?.get(c);
|
||||
const status = rd('M28_CASOS_POR_ESTADO');
|
||||
if (!status) return undefined;
|
||||
const n = (r: Reading | undefined, pop: string) => r?.populations[pop] ?? 0;
|
||||
const cat = (r: Reading | undefined, c: string) =>
|
||||
r?.strata['category']?.[c]?.['initial-population'] ?? 0;
|
||||
const days = (c: string) => {
|
||||
const v = rd(c)?.score;
|
||||
return v === undefined
|
||||
? '—'
|
||||
: `${v.toLocaleString('es-MX', { maximumFractionDigits: 1 })} días`;
|
||||
};
|
||||
const confirmed = rd('M24_CONFIRMACION_DIAGNOSTICO')?.score;
|
||||
const withEeg = rd('M21_DIAGNOSTICADOS_CON_EEG');
|
||||
return {
|
||||
evaluated: n(status, 'initial-population'),
|
||||
mchatOnly: cat(status, 'mchat_only'),
|
||||
psychology: cat(status, 'psychology'),
|
||||
neuropediatrics: cat(status, 'neuropediatrics') + cat(status, 'eeg'),
|
||||
confirmed:
|
||||
confirmed === undefined
|
||||
? '—'
|
||||
: `${(confirmed * 100).toLocaleString('es-MX', { maximumFractionDigits: 1 })}%`,
|
||||
toAdos: days('M26_DIAS_MCHAT_ADOS2'),
|
||||
toDiagnosis: days('M27_DIAS_ADOS2_DIAGNOSTICO'),
|
||||
whole: days('M25_DIAS_MCHAT_DIAGNOSTICO'),
|
||||
diagnosed: n(withEeg, 'denominator'),
|
||||
eeg: n(withEeg, 'numerator'),
|
||||
missing: n(rd('M22_DIAGNOSTICADOS_SIN_EEG'), 'numerator'),
|
||||
unusable: cat(rd('M29_CALIDAD_EEG'), 'bad'),
|
||||
};
|
||||
});
|
||||
protected measureTitle(code: string | undefined): string {
|
||||
return (code && this.byName().get(code)?.title) || '';
|
||||
}
|
||||
@@ -232,6 +269,12 @@ export class TabIndicadores {
|
||||
return nestedDonut(r, spec.catalog, spec.center);
|
||||
case 'share-donut':
|
||||
return shareDonut(r, spec.catalog, spec.center);
|
||||
case 'counts':
|
||||
return countBars(r, spec.catalog, spec.axis, this.applied() ?? '');
|
||||
case 'age-stack':
|
||||
return ageStack(r, spec.names);
|
||||
case 'age-share':
|
||||
return ageShare(r, spec.names[0]);
|
||||
case 'scenario-bars':
|
||||
return scenarioBars(r, spec.catalog, spec.stratum, name);
|
||||
case 'rates':
|
||||
|
||||
Reference in New Issue
Block a user