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:
Roberto Treviño
2026-11-28 10:26:24 -06:00
parent 3e096dd03f
commit aeb2d4ec84
7 changed files with 349 additions and 9 deletions
+113 -1
View File
@@ -20,7 +20,18 @@ export interface Kpi {
export type Section =
| { kind: 'route'; title: string; steps: { label: string; measure: string }[] }
| { kind: 'figures'; title?: string; figures: FigureSpec[] }
| { kind: 'boxes'; title: string; cards: { measure?: string; title: string }[] }
| {
kind: 'boxes';
/** none: the boxes stand alone (TEA) */
title?: string;
cards: { measure?: string; title: string }[];
/** the measure's own title under each card's (CaMa) */
subtitles?: boolean;
}
/** Each figure in its own card, titled, two to a row (TEA). */
| { kind: 'grid'; figures: FigureSpec[] }
/** TEA's period summary in words, its numbers from the measures. */
| { kind: 'tea-summary' }
| ({ kind: 'card' } & Kpi);
/** Figure titles may carry `{p}`, the applied period. */
export type FigureSpec =
@@ -32,6 +43,14 @@ export type FigureSpec =
center: string;
}
| { kind: 'scenario-bars'; title: string; measure: string; catalog: Catalog; stratum: string }
| { kind: 'counts'; title: string; measure: string; catalog: Catalog; axis: string }
| {
kind: 'age-stack' | 'age-share';
title: string;
measure: string;
/** the numerator's and the rest's names (stack), or the axis (share) */
names: [string, string];
}
| {
kind: 'rates';
title: string;
@@ -128,6 +147,98 @@ const BREAST_BIOPSY: Catalog = {
};
export const PAGES: Record<string, Page> = {
tea: {
anchor: 'M23_PACIENTES_EVALUADOS',
kpis: [],
opportunity: [
{ kind: 'tea-summary' },
{
kind: 'boxes',
cards: [
{ measure: 'M26_DIAS_MCHAT_ADOS2', title: 'Días de M-CHAT a ADOS-2' },
{ measure: 'M27_DIAS_ADOS2_DIAGNOSTICO', title: 'Días de ADOS-2 a diagnóstico' },
{ measure: 'M25_DIAS_MCHAT_DIAGNOSTICO', title: 'Días de M-CHAT a diagnóstico positivo' },
],
},
],
clinical: [
{
kind: 'grid',
figures: [
{
kind: 'counts',
title: 'Pacientes evaluados por resultado diagnóstico',
measure: 'M23_PACIENTES_EVALUADOS',
axis: 'Conteo (paciente)',
catalog: {
groups: [],
categories: [
{ code: 'confirmed', label: 'Diagnóstico confirmado', color: OLIVE, group: '' },
{ code: 'in_process', label: 'En proceso', color: '#B8433A', group: '' },
],
},
},
{
kind: 'age-stack',
title: 'Porcentaje de confirmación diagnóstica',
measure: 'M24_CONFIRMACION_DIAGNOSTICO',
names: ['Diagnóstico confirmado', 'En proceso'],
},
{
kind: 'age-share',
title: 'Porcentaje de pacientes con diagnóstico de TEA con EEG',
measure: 'M21_DIAGNOSTICADOS_CON_EEG',
names: ['% de pacientes con EEG', ''],
},
{
kind: 'age-share',
title: 'Porcentaje de pacientes con diagnóstico de TEA sin EEG',
measure: 'M22_DIAGNOSTICADOS_SIN_EEG',
names: ['% de pacientes sin EEG', ''],
},
{
kind: 'counts',
title: 'Casos por estatus',
measure: 'M28_CASOS_POR_ESTADO',
axis: 'Conteo (paciente)',
catalog: {
groups: [],
categories: [
{ code: 'mchat_only', label: 'Solo M-CHAT', color: '#B8433A', group: '' },
{
code: 'psychology',
label: 'Hasta evaluación psicológica',
color: '#42C29C',
group: '',
},
{
code: 'neuropediatrics',
label: 'Hasta evaluación neuropediátrica',
color: '#7184A2',
group: '',
},
{ code: 'eeg', label: 'Con EEG', color: OLIVE, group: '' },
],
},
},
{
kind: 'counts',
title: 'Calidad del EEG',
measure: 'M29_CALIDAD_EEG',
axis: 'Conteo (examen)',
catalog: {
groups: [],
categories: [
{ code: 'good', label: 'Bueno', color: OLIVE, group: '' },
{ code: 'bad', label: 'No aceptable', color: '#B8433A', group: '' },
{ code: 'not_analyzed', label: 'Sin analizar', color: '#C9CDD2', group: '' },
],
},
},
],
},
],
},
cama: {
anchor: 'CAMA_BIRADS456_PACIENTE',
kpis: [
@@ -163,6 +274,7 @@ export const PAGES: Record<string, Page> = {
{
kind: 'boxes',
title: 'Tiempo de tamizaje a diagnóstico',
subtitles: true,
cards: [
{
measure: 'CAMA_EU38A',