Clarify CaCu and CaMa chart labels
This commit is contained in:
+7
-7
@@ -30,7 +30,7 @@ test('indicadores cacu: its sections in order, each card read one mode at a time
|
||||
.evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim()));
|
||||
expect(headings.slice(headings.indexOf('Indicadores de oportunidad'))).toEqual([
|
||||
'Indicadores de oportunidad',
|
||||
'Días de la ruta del tamizaje',
|
||||
'Tiempos de tamizaje',
|
||||
'Indicadores clínicos',
|
||||
'Resultados de citología, VPH y biopsia',
|
||||
'Distribución de resultados citológicos',
|
||||
@@ -40,7 +40,7 @@ test('indicadores cacu: its sections in order, each card read one mode at a time
|
||||
'Tasa de confirmación histopatológica de referencia a colposcopía',
|
||||
]);
|
||||
const route = tab.locator('app-readings').first();
|
||||
for (const mode of ['Por pasos', 'Primer diagnóstico', 'Diagnóstico tras biopsia', 'Acumulado desde la toma']) {
|
||||
for (const mode of ['Por ventana de tiempo', 'Primer diagnóstico', 'Diagnóstico tras biopsia', 'Acumulado desde la toma']) {
|
||||
await route.getByRole('radio', { name: mode }).click();
|
||||
await expect(
|
||||
route.getByRole('table', { name: mode }).or(route.getByText('Sin datos en el periodo.')),
|
||||
@@ -112,7 +112,7 @@ test('indicadores cacu: its sections in order, each card read one mode at a time
|
||||
|
||||
test('riesgos cacu: ages filter the whole list and a row opens its stages', async ({ page }) => {
|
||||
await page.goto('/indicadores/cacu');
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
await page.getByRole('tab', { name: 'Análisis de Riesgo' }).click();
|
||||
const list = page.locator('table.worklist tbody tr');
|
||||
await expect(list.first().locator('app-stages li')).toHaveCount(5);
|
||||
await list.first().getByRole('button', { name: 'Detalle' }).click();
|
||||
@@ -187,7 +187,7 @@ async function withRounds(page: Page, how: Simulation) {
|
||||
}
|
||||
/** The first group of independent bars of a card (the cytology and genotype breakdowns). */
|
||||
const plotOf = (readings: Locator) => readings.locator('.group').first();
|
||||
/** The groups of a card as the page draws them: "label<br>n = N", the width of the first bar and the colour of
|
||||
/** The groups of a card as the page draws them: "label<br>unit: N", the width of the first bar and the colour of
|
||||
* each category (the first group's rows), in hex. */
|
||||
const traces = (readings: Locator) =>
|
||||
readings.evaluate((el) => {
|
||||
@@ -202,7 +202,7 @@ const traces = (readings: Locator) =>
|
||||
return {
|
||||
y: groups.map(
|
||||
(g) =>
|
||||
`${g.querySelector('h4')!.childNodes[0].textContent!.trim()}<br>n = ${g.querySelector('.n')!.textContent!.replace('n = ', '').trim()}`,
|
||||
`${g.querySelector('h4')!.childNodes[0].textContent!.trim()}<br>${g.querySelector('.n')!.textContent!.trim()}`,
|
||||
),
|
||||
x: groups.map((g) => parseFloat((g.querySelector('.fill') as HTMLElement).style.width)),
|
||||
colours: Object.fromEntries(
|
||||
@@ -277,7 +277,7 @@ for (const card of ['cytology', 'genotype'] as const) {
|
||||
const { card: of, view } = await withRounds(page, 'no-initial');
|
||||
await view(ROUND.name);
|
||||
const found = await traces(of(TITLES[card]));
|
||||
expect(found.y[0]).toBe('Detección inicial<br>n = 0');
|
||||
expect(found.y[0]).toBe('Detección inicial<br>Pacientes: 0');
|
||||
expect(found.x[0]).toBe(0);
|
||||
});
|
||||
|
||||
@@ -307,7 +307,7 @@ test('rondas (simulado): the genotype card never shows the incomplete positives,
|
||||
'VPH 16',
|
||||
'VPH 18',
|
||||
'VPH 16 y 18',
|
||||
'Positivo',
|
||||
'Positivo sin genotipo',
|
||||
]);
|
||||
for (const name of VIEWS.slice(1)) {
|
||||
await view(name);
|
||||
|
||||
@@ -25,7 +25,7 @@ const isXlsx = (b: Buffer) => b.subarray(0, 2).toString() === 'PK'; // a zip con
|
||||
|
||||
async function followUp(page: Page, domain: 'cama' | 'cacu') {
|
||||
await page.goto(`/indicadores/${domain}`);
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
await page.getByRole('tab', { name: 'Análisis de Riesgo' }).click();
|
||||
await page.locator('table.worklist tbody tr').first().waitFor({ timeout: 120_000 });
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ test.beforeEach(async ({ page }) => {
|
||||
/** The record of the first patient of the risk list, as an address. */
|
||||
async function firstRecord(page: Page): Promise<{ url: string; sample: string }> {
|
||||
await page.goto('/indicadores/cacu');
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
await page.getByRole('tab', { name: 'Análisis de Riesgo' }).click();
|
||||
const link = page.locator('table.worklist tbody tr a').first();
|
||||
await link.waitFor({ timeout: 120_000 });
|
||||
const url = (await link.getAttribute('href'))!;
|
||||
@@ -1587,7 +1587,7 @@ test('elegibilidad (simulado): a new patient never inherits the previous risk ex
|
||||
await open(page, firstUrl);
|
||||
await expect(reason).toBeVisible();
|
||||
await page.getByRole('link', { name: 'Regresar' }).click();
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
await page.getByRole('tab', { name: 'Análisis de Riesgo' }).click();
|
||||
await page.locator(`a[href*="/pacientes/${secondId}?"]`).first().click();
|
||||
await expect(historial(page)).toBeVisible({ timeout: 120_000 });
|
||||
await expect(riskBox(page).locator('app-risk-scales')).toBeVisible();
|
||||
|
||||
+8
-8
@@ -58,14 +58,14 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie
|
||||
);
|
||||
await expect(page.locator('app-tab-indicadores app-plot').first()).toBeVisible();
|
||||
|
||||
await page.getByRole('tab', { name: 'Histórico' }).click();
|
||||
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
||||
await expect(page.locator('app-tab-trazabilidad section.panel')).toHaveCount(9);
|
||||
|
||||
await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
|
||||
await expect(page.locator('app-tab-definiciones details')).toHaveCount(21);
|
||||
|
||||
const list = page.waitForResponse((r) => r.url().includes('/fhir/Patient?'));
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
await page.getByRole('tab', { name: 'Análisis de Riesgo' }).click();
|
||||
const bundle = await (await list).json();
|
||||
const patient = bundle.entry.find((e: any) => e.search.mode === 'match').resource;
|
||||
const first = patient.name?.[0]?.text ?? patient.id.slice(0, 10);
|
||||
@@ -84,14 +84,14 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie
|
||||
).not.toContainText('Sin estudios');
|
||||
|
||||
await page.goto('/indicadores/cama');
|
||||
await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible();
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible();
|
||||
await page.getByRole('tab', { name: 'Análisis de Riesgo' }).click();
|
||||
await page.locator('mat-form-field', { hasText: 'Ventana' }).click();
|
||||
await page.getByRole('option', { name: '12 meses' }).click();
|
||||
const camaRows = page.locator('table.worklist tbody tr');
|
||||
await expect(camaRows.first()).toContainText('BI-RADS');
|
||||
await page.goto('/indicadores/tea');
|
||||
await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible();
|
||||
await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible();
|
||||
expect(problems).toEqual([]);
|
||||
});
|
||||
|
||||
@@ -208,8 +208,8 @@ const kindOf = (types: string[]) => [...new Set(types)].sort().join('+');
|
||||
for (const domain of ['cacu', 'cama', 'tea']) {
|
||||
test(`pestañas de indicadores ${domain} tienen nombres únicos`, async ({ page }) => {
|
||||
await page.goto(`/indicadores/${domain}`);
|
||||
await expect(page.getByRole('tab', { name: 'Seguimiento', exact: true })).toHaveCount(1);
|
||||
await expect(page.getByRole('tab', { name: 'Histórico', exact: true })).toHaveCount(1);
|
||||
await expect(page.getByRole('tab', { name: 'Análisis de Riesgo', exact: true })).toHaveCount(1);
|
||||
await expect(page.getByRole('tab', { name: 'Trazabilidad', exact: true })).toHaveCount(1);
|
||||
const labels = await page.getByRole('tab').allTextContents();
|
||||
expect(new Set(labels.map((s) => s.trim())).size).toBe(labels.length);
|
||||
});
|
||||
@@ -278,7 +278,7 @@ for (const domain of ['cacu', 'cama', 'tea']) {
|
||||
['h2', 'h3', 'plot'].includes(i.kind),
|
||||
);
|
||||
await page.goto(`/indicadores/${domain}`);
|
||||
await page.getByRole('tab', { name: 'Histórico' }).click();
|
||||
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
||||
const tab = page.locator('app-tab-trazabilidad');
|
||||
await expect(tab.getByRole('heading', { name: 'Filtros' })).toBeVisible();
|
||||
await expect(tab.locator('app-loading')).toHaveCount(0, { timeout: 5 * 60_000 });
|
||||
|
||||
@@ -157,15 +157,15 @@ describe('bars', () => {
|
||||
);
|
||||
const y = (f.data[0] as any).y;
|
||||
expect(y).toEqual([
|
||||
'Detección inicial<br>n = 0',
|
||||
'Detección subsecuente<br>n = 8',
|
||||
'Sin dato<br>n = 2',
|
||||
'Detección inicial<br>Pacientes: 0',
|
||||
'Detección subsecuente<br>Pacientes: 8',
|
||||
'Sin dato<br>Pacientes: 2',
|
||||
]);
|
||||
expect((f.data[0] as any).x).toEqual([0, 75, 100]);
|
||||
});
|
||||
it('leaves out a group that does not reconcile', () => {
|
||||
const f = draw(reading({ 'subsequent|NILM': 6 }, 10));
|
||||
expect((f.data[0] as any).y).toEqual(['Detección subsecuente<br>n = 6']);
|
||||
expect((f.data[0] as any).y).toEqual(['Detección subsecuente<br>Pacientes: 6']);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -173,7 +173,7 @@ describe('bars', () => {
|
||||
describe('shared views of cytology and HPV by genotype', () => {
|
||||
const HPV = [
|
||||
{ code: 'negative', label: 'Negativo', color: '#42A77E', group: '' },
|
||||
{ code: 'positive_other', label: 'Positivo', color: '#A8C243', group: '' },
|
||||
{ code: 'positive_other', label: 'Positivo sin genotipo', color: '#A8C243', group: '' },
|
||||
];
|
||||
const reading = (cells: Record<string, number>): Reading => ({
|
||||
populations: { 'initial-population': Object.values(cells).reduce((a, b) => a + b, 0) },
|
||||
@@ -198,7 +198,7 @@ describe('shared views of cytology and HPV by genotype', () => {
|
||||
|
||||
it('does not list a hidden category but keeps it in the total and the percentages', () => {
|
||||
const t = bars(counts, () => reading({}))!;
|
||||
expect(t.rows.map((x) => x.label)).toEqual(['Negativo', 'Positivo']);
|
||||
expect(t.rows.map((x) => x.label)).toEqual(['Negativo', 'Positivo sin genotipo']);
|
||||
expect(t.rows.map((x) => x.cells)).toEqual([
|
||||
['5', '50.0 %'],
|
||||
['2', '20.0 %'],
|
||||
@@ -247,7 +247,7 @@ describe('shared views of cytology and HPV by genotype', () => {
|
||||
});
|
||||
expect((own.data[0] as any).x).toEqual([80]); // 4 of the 5 the catalog draws
|
||||
expect((all.data[0] as any).x).toEqual([40]); // 4 of the group's 10 reports
|
||||
expect((all.data[0] as any).y).toEqual(['25-34<br>n = 10']);
|
||||
expect((all.data[0] as any).y).toEqual(['25-34<br>Reportes: 10']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+41
-10
@@ -16,6 +16,10 @@ export type Mode = {
|
||||
kind: 'counts';
|
||||
measure: string;
|
||||
catalog: Category[];
|
||||
/** The records counted in the category distribution. */
|
||||
unit?: string;
|
||||
/** What the share in the second column is a share of. */
|
||||
percentLabel?: string;
|
||||
hidden?: Hidden;
|
||||
/** every bar on a fixed scale of 0 to 100 %, so its length is the share shown */
|
||||
percent?: boolean;
|
||||
@@ -27,6 +31,7 @@ export type Mode = {
|
||||
order: string[];
|
||||
complete?: boolean;
|
||||
colors?: Colors;
|
||||
percentLabel?: string;
|
||||
}
|
||||
| {
|
||||
kind: 'positives';
|
||||
@@ -35,8 +40,15 @@ export type Mode = {
|
||||
order: string[];
|
||||
complete?: boolean;
|
||||
colors?: Colors;
|
||||
percentLabel?: string;
|
||||
}
|
||||
| {
|
||||
kind: 'signs';
|
||||
measure: string;
|
||||
strata: string[];
|
||||
colors?: Colors;
|
||||
percentLabel?: string;
|
||||
}
|
||||
| { kind: 'signs'; measure: string; strata: string[]; colors?: Colors }
|
||||
| {
|
||||
kind: 'grouped';
|
||||
measure: string;
|
||||
@@ -47,6 +59,8 @@ export type Mode = {
|
||||
order: string[];
|
||||
/** what the records are called ("pacientes", "reportes") */
|
||||
unit: string;
|
||||
/** The denominator of the percentage shown with each grouped result. */
|
||||
percentLabel?: string;
|
||||
/** draw an empty group of `order` when the counts reconcile (see `reconciles`) */
|
||||
complete?: boolean;
|
||||
/** each group's denominator is all its records, not only those of the catalog's categories */
|
||||
@@ -55,10 +69,18 @@ export type Mode = {
|
||||
}
|
||||
| { kind: 'days'; steps: { label: string; measure: string }[]; tint?: Tint }
|
||||
/** A proportion as one bar of 0 to 100 %, its 95 % interval as the two marks on it */
|
||||
| { kind: 'ratio'; measure: string; colors?: Colors }
|
||||
| { kind: 'ratio'; measure: string; colors?: Colors; percentLabel?: string }
|
||||
| { kind: 'days-by'; measure: string; stratum: string; tint?: Tint }
|
||||
/** A proportion as its two parts (what counted and what did not), in units, with the shares */
|
||||
| { kind: 'split'; measure: string; yes: string; no: string; colors?: [string, string] }
|
||||
| {
|
||||
kind: 'split';
|
||||
measure: string;
|
||||
yes: string;
|
||||
no: string;
|
||||
colors?: [string, string];
|
||||
unit?: string;
|
||||
percentLabel?: string;
|
||||
}
|
||||
/** Each row's units by result (a bar in segments), and the share of the row's units with a
|
||||
* result that are `malignant`; a row with units and no result is not a row with none */
|
||||
| {
|
||||
@@ -213,7 +235,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
if (r?.score === undefined || !total) return undefined;
|
||||
const ends = r.low !== undefined && r.high !== undefined ? [r.low, r.high] : [];
|
||||
return {
|
||||
head: ['n/N', '%', 'IC 95 %'],
|
||||
head: ['n/N', mode.percentLabel ?? 'Porcentaje', 'IC 95 %'],
|
||||
rows: [
|
||||
{
|
||||
label: 'Total',
|
||||
@@ -239,7 +261,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
];
|
||||
const most = mode.percent ? total : Math.max(...Object.values(cells).map(size));
|
||||
return {
|
||||
head: ['n', '%'],
|
||||
head: [mode.unit ?? 'n', mode.percentLabel ?? 'Porcentaje'],
|
||||
rows: all.map(({ code, label, color }) => {
|
||||
const n = size(cells[code]);
|
||||
const cols = [`${n}`, pct(n, total)];
|
||||
@@ -261,6 +283,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
cells[c]['denominator'] ?? 0,
|
||||
mode.colors?.[c],
|
||||
]),
|
||||
mode.percentLabel,
|
||||
);
|
||||
if (!patients(r) || !Object.keys(cells).length) return undefined;
|
||||
const sound = (c: string) =>
|
||||
@@ -277,6 +300,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
ok,
|
||||
(c) => (sound(c) ? [cells[c]['numerator'], cells[c]['denominator']] : undefined),
|
||||
mode.colors,
|
||||
mode.percentLabel,
|
||||
);
|
||||
}
|
||||
case 'positives': {
|
||||
@@ -291,6 +315,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
const positive = size(cells[`${c}|positive`]);
|
||||
return [name(c), positive, positive + size(cells[`${c}|negative`]), mode.colors?.[c]];
|
||||
}),
|
||||
mode.percentLabel,
|
||||
);
|
||||
if (!patients(r) || !found.size) return undefined;
|
||||
const ok = reconciles(
|
||||
@@ -306,6 +331,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
return [positive, positive + size(cells[`${c}|negative`])];
|
||||
},
|
||||
mode.colors,
|
||||
mode.percentLabel,
|
||||
);
|
||||
}
|
||||
case 'signs': {
|
||||
@@ -317,6 +343,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
const positive = size(strata[s]['positive']);
|
||||
return [name(s), positive, positive + size(strata[s]['negative']), mode.colors?.[s]];
|
||||
}),
|
||||
mode.percentLabel,
|
||||
);
|
||||
}
|
||||
case 'days':
|
||||
@@ -349,7 +376,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined):
|
||||
[mode.no, denominator - numerator],
|
||||
];
|
||||
return {
|
||||
head: ['n', '%'],
|
||||
head: [mode.unit ?? 'n', mode.percentLabel ?? 'Porcentaje'],
|
||||
rows: parts.map(([label, n], i) => ({
|
||||
label,
|
||||
color: mode.colors?.[i],
|
||||
@@ -480,6 +507,7 @@ function complete(
|
||||
reconciled: boolean,
|
||||
counts: (code: string) => [number, number] | undefined,
|
||||
colors: Colors = {},
|
||||
percentLabel = 'Porcentaje',
|
||||
): Bars {
|
||||
const extra = listed.filter((c) => !order.includes(c));
|
||||
const rows: Bar[] = [...order, ...extra].map((code) => {
|
||||
@@ -507,7 +535,7 @@ function complete(
|
||||
const none = empty.length === classified.length;
|
||||
const unclassified = counts('no_data')?.[1] ?? 0;
|
||||
return {
|
||||
head: ['n/N', '%'],
|
||||
head: ['n/N', percentLabel],
|
||||
rows,
|
||||
note: !reconciled
|
||||
? 'Los conteos del informe no concilian con el total de pacientes: los grupos ausentes no se muestran como cero.'
|
||||
@@ -520,10 +548,13 @@ function complete(
|
||||
};
|
||||
}
|
||||
|
||||
function ratios(rows: [string, number, number, string?][]): Bars | undefined {
|
||||
function ratios(
|
||||
rows: [string, number, number, string?][],
|
||||
percentLabel = 'Porcentaje',
|
||||
): Bars | undefined {
|
||||
if (!rows.length) return undefined;
|
||||
return {
|
||||
head: ['n/N', '%'],
|
||||
head: ['n/N', percentLabel],
|
||||
rows: rows.map(([label, n, total, color]) => ({
|
||||
label,
|
||||
color,
|
||||
@@ -543,7 +574,7 @@ function medians(
|
||||
const top = Math.max(...rows.flatMap((r) => [r.score?.score ?? 0, r.score?.high ?? 0])) || 1;
|
||||
const at = (v: number) => (100 * v) / top;
|
||||
return {
|
||||
head: ['Mediana', 'n', 'Q1–Q3'],
|
||||
head: ['Mediana', 'Observaciones', 'Q1–Q3'],
|
||||
markColor: tint?.mark,
|
||||
rows: rows.map(({ label, n, score: s }) => {
|
||||
if (s?.score === undefined) return { label, width: 0, marks: [], cells: ['—', `${n}`, '—'] };
|
||||
|
||||
@@ -125,7 +125,7 @@ export function scenarioBars(
|
||||
: catalog.categories.reduce((t, c) => t + n(s, c.code), 0),
|
||||
);
|
||||
const y = order
|
||||
? scenarios.map((s, i) => `${label(s)}<br>n = ${totals[i]}`)
|
||||
? scenarios.map((s, i) => `${label(s)}<br>${options.ofAll ? 'Reportes' : 'Pacientes'}: ${totals[i]}`)
|
||||
: scenarios.map(label);
|
||||
return {
|
||||
data: catalog.categories.map((c) => ({
|
||||
@@ -304,9 +304,11 @@ export function shareDonut(r: Reading, catalog: Catalog, center: string): Figure
|
||||
line: { color: '#FFFFFF', width: 2 },
|
||||
},
|
||||
// an empty slice says nothing (its label would sit on its neighbours')
|
||||
texttemplate: values.map((v) => (v ? '%{label}<br>%{percent}' : '')),
|
||||
texttemplate: values.map((v) =>
|
||||
v ? `%{label}<br>%{percent} del total de ${center}` : '',
|
||||
),
|
||||
textposition: 'outside',
|
||||
hovertemplate: '%{label}<br>%{value} (%{percent})<extra></extra>',
|
||||
hovertemplate: `%{label}<br>%{value} (%{percent} del total de ${center})<extra></extra>`,
|
||||
} as Partial<Plotly.Data>,
|
||||
],
|
||||
layout: {
|
||||
|
||||
@@ -36,28 +36,28 @@ import { Loading } from '../loading';
|
||||
<p class="muted empty">Este dominio todavía no tiene indicadores publicados.</p>
|
||||
} @else {
|
||||
<mat-tab-group mat-stretch-tabs="false" mat-align-tabs="center" animationDuration="0ms">
|
||||
<mat-tab label="Resumen">
|
||||
<mat-tab label="Indicadores">
|
||||
<app-tab-indicadores [domain]="domain()" [measures]="measures.value()!" />
|
||||
</mat-tab>
|
||||
<mat-tab label="Histórico">
|
||||
<mat-tab label="Trazabilidad">
|
||||
<ng-template matTabContent>
|
||||
<app-tab-trazabilidad [domain]="domain()" [measures]="measures.value()!" />
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
@if (domain() === 'cacu') {
|
||||
<mat-tab label="Seguimiento">
|
||||
<mat-tab label="Análisis de Riesgo">
|
||||
<ng-template matTabContent>
|
||||
<app-tab-riesgos [domain]="domain()" />
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
} @else if (domain() === 'tea') {
|
||||
<mat-tab label="Seguimiento">
|
||||
<mat-tab label="Análisis de Riesgo">
|
||||
<ng-template matTabContent>
|
||||
<app-tab-riesgos-tea [domain]="domain()" />
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
} @else if (domain() === 'cama') {
|
||||
<mat-tab label="Seguimiento">
|
||||
<mat-tab label="Análisis de Riesgo">
|
||||
<ng-template matTabContent>
|
||||
<app-tab-seguimiento [domain]="domain()" />
|
||||
</ng-template>
|
||||
|
||||
@@ -106,6 +106,7 @@ export const LABELS: Record<string, string> = {
|
||||
normal: 'Normal',
|
||||
carcinoma: 'Carcinoma',
|
||||
no_data: 'Sin dato',
|
||||
'<25': '<25 años (sin límite inferior)',
|
||||
no_biopsy: 'Sin biopsia',
|
||||
pre_colposcopy: 'Pre colposcopia',
|
||||
post_colposcopy: 'Post colposcopia',
|
||||
|
||||
@@ -59,7 +59,7 @@ const HPV = [
|
||||
{ code: 'positive_16', label: 'VPH 16', color: HPV_COLORS['positive_16'] },
|
||||
{ code: 'positive_18', label: 'VPH 18', color: HPV_COLORS['positive_18'] },
|
||||
{ code: 'positive_16_18', label: 'VPH 16 y 18', color: HPV_COLORS['positive_16_18'] },
|
||||
{ code: 'positive_other', label: 'Positivo', color: HPV_COLORS['positive_other'] },
|
||||
{ code: 'positive_other', label: 'Positivo sin genotipo', color: HPV_COLORS['positive_other'] },
|
||||
];
|
||||
const REQUESTS = [
|
||||
{ code: 'high_grade', label: 'LIEAG o más', color: REQUEST_COLORS['high_grade'] },
|
||||
@@ -107,19 +107,28 @@ const groupViews = (
|
||||
measure,
|
||||
catalog,
|
||||
unit,
|
||||
caption: more.ofAll
|
||||
? 'Porcentaje de reportes de VPH del grupo por genotipo.'
|
||||
: 'Porcentaje de pacientes del grupo por resultado citológico.',
|
||||
...v,
|
||||
...more,
|
||||
}));
|
||||
|
||||
/** A PPV's card: the whole, and by each of its stratifiers. */
|
||||
const ppv = (measure: string, title: string, note: string, ...more: Mode[]): ReadingsCard => ({
|
||||
const ppv = (
|
||||
measure: string,
|
||||
title: string,
|
||||
note: string,
|
||||
percentLabel: string,
|
||||
...more: Mode[]
|
||||
): ReadingsCard => ({
|
||||
kind: 'readings',
|
||||
title,
|
||||
headline: measure,
|
||||
footnote: true,
|
||||
note: `${note} Confirma la histología LIEBG o mayor.`,
|
||||
modes: [
|
||||
{ kind: 'ratio', label: 'Total', measure, colors: PPV_DONUT },
|
||||
{ kind: 'ratio', label: 'Total', measure, colors: PPV_DONUT, percentLabel },
|
||||
{
|
||||
kind: 'shares',
|
||||
label: 'Citología previa',
|
||||
@@ -128,6 +137,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea
|
||||
stratum: 'cytology',
|
||||
colors: PPV_CYTOLOGY_COLORS,
|
||||
order: ['ascus_plus', 'lsil_plus', 'hsil_plus', 'no_data'],
|
||||
percentLabel: 'Porcentaje de pacientes con esta citología previa',
|
||||
},
|
||||
{
|
||||
kind: 'shares',
|
||||
@@ -137,6 +147,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea
|
||||
stratum: 'hpv',
|
||||
colors: HPV_COLORS,
|
||||
order: ['negative', 'positive', 'hpv_16', 'hpv_18', 'no_data'],
|
||||
percentLabel: 'Porcentaje de pacientes de cada grupo de VPH previo',
|
||||
},
|
||||
{
|
||||
kind: 'shares',
|
||||
@@ -145,6 +156,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea
|
||||
stratum: 'level',
|
||||
colors: PPV_LEVEL_COLORS,
|
||||
order: ['cin1_plus', 'cin2_plus', 'carcinoma'],
|
||||
percentLabel: 'Porcentaje de pacientes de cada nivel de histología',
|
||||
},
|
||||
{
|
||||
kind: 'shares',
|
||||
@@ -155,6 +167,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea
|
||||
colors: ROUND_COLORS,
|
||||
order: ROUNDS,
|
||||
complete: true,
|
||||
percentLabel: 'Porcentaje de pacientes de cada ronda',
|
||||
},
|
||||
...more,
|
||||
],
|
||||
@@ -197,7 +210,7 @@ export const CACU: Page = {
|
||||
opportunity: [
|
||||
{
|
||||
kind: 'readings',
|
||||
title: 'Días de la ruta del tamizaje',
|
||||
title: 'Tiempos de tamizaje',
|
||||
note: 'Mediana en días; las marcas son el primer y el tercer cuartil.',
|
||||
modes: [
|
||||
{
|
||||
@@ -217,7 +230,7 @@ export const CACU: Page = {
|
||||
{
|
||||
kind: 'days',
|
||||
tint: TINT,
|
||||
label: 'Por pasos',
|
||||
label: 'Por ventana de tiempo',
|
||||
caption: 'Cada paso mide a sus propias pacientes: las medianas no se suman.',
|
||||
steps: [
|
||||
{
|
||||
@@ -262,7 +275,14 @@ export const CACU: Page = {
|
||||
title: 'Distribución de resultados citológicos',
|
||||
note: 'Pacientes, por su última muestra válida del periodo.',
|
||||
modes: [
|
||||
{ kind: 'counts', label: GENERAL, measure: 'CACU_EU7', catalog: CYTOLOGY.categories },
|
||||
{
|
||||
kind: 'counts',
|
||||
label: GENERAL,
|
||||
measure: 'CACU_EU7',
|
||||
catalog: CYTOLOGY.categories,
|
||||
unit: 'Pacientes',
|
||||
percentLabel: 'Porcentaje de pacientes',
|
||||
},
|
||||
...groupViews('CACU_EU7', CYTOLOGY.categories, 'pacientes'),
|
||||
],
|
||||
},
|
||||
@@ -277,6 +297,8 @@ export const CACU: Page = {
|
||||
label: GENERAL,
|
||||
measure: 'CACU_VPH_GENOTIPO',
|
||||
catalog: HPV,
|
||||
unit: 'Reportes',
|
||||
percentLabel: 'Porcentaje de reportes de VPH',
|
||||
hidden: HPV_HIDDEN,
|
||||
},
|
||||
...groupViews('CACU_VPH_GENOTIPO', HPV, 'reportes', {
|
||||
@@ -295,6 +317,8 @@ export const CACU: Page = {
|
||||
label: 'General',
|
||||
measure: 'CACU_BIOPSIA_RESULTADOS',
|
||||
catalog: BIOPSY.categories,
|
||||
unit: 'Reportes',
|
||||
percentLabel: 'Porcentaje de reportes de biopsia',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -310,6 +334,7 @@ export const CACU: Page = {
|
||||
'CACU_VPP_COLPOSCOPIA',
|
||||
'Tasa de confirmación histopatológica de referencia a colposcopía',
|
||||
'Pacientes con colposcopía en el periodo; biopsia solicitada en los 60 días siguientes.',
|
||||
'Porcentaje de pacientes',
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -318,12 +343,15 @@ export const CACU: Page = {
|
||||
'CACU_VPP_BIOPSIA',
|
||||
'Tasa de confirmación histopatológica de referencia a biopsia',
|
||||
'Pacientes con biopsia reportada, por fecha de solicitud.',
|
||||
'Porcentaje de biopsias reportadas',
|
||||
{
|
||||
kind: 'counts',
|
||||
label: 'Solicitudes',
|
||||
caption: 'Solicitudes de biopsia registradas, según su resultado.',
|
||||
measure: 'CACU_BIOPSIA_SOLICITUD_CONFIRMACION',
|
||||
catalog: REQUESTS,
|
||||
unit: 'Solicitudes',
|
||||
percentLabel: 'Porcentaje de solicitudes',
|
||||
},
|
||||
),
|
||||
},
|
||||
|
||||
@@ -342,6 +342,7 @@ export const PAGES: Record<string, Page> = {
|
||||
measure: 'CAMA_HISTOPATOLOGIA_BIRADS',
|
||||
catalog: [...BIOPSY_GRADES, ...NO_RESULT],
|
||||
percent: true,
|
||||
percentLabel: 'Porcentaje de pacientes',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -366,6 +367,7 @@ export const PAGES: Record<string, Page> = {
|
||||
measure: 'CAMA_BIOPSIAS',
|
||||
catalog: [...BIOPSY_GRADES, NO_RESULT[1]],
|
||||
percent: true,
|
||||
percentLabel: 'Porcentaje de reportes de biopsia',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -386,6 +388,8 @@ export const PAGES: Record<string, Page> = {
|
||||
yes: 'Con reporte de biopsia',
|
||||
no: 'Sin reporte de biopsia',
|
||||
colors: [INSTITUTIONAL, NEUTRAL],
|
||||
unit: 'Mastografías',
|
||||
percentLabel: 'Porcentaje de mastografías',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -54,7 +54,7 @@ import { Reading } from './measures';
|
||||
@for (group of g.groups; track group.code) {
|
||||
<section class="group" [attr.data-group]="group.code" [attr.aria-label]="group.label">
|
||||
<h4>
|
||||
{{ group.label }} <span class="n">n = {{ group.total }}</span>
|
||||
{{ group.label }} <span class="n">{{ countUnit() }}: {{ group.total }}</span>
|
||||
@if (group.hint) {
|
||||
<span class="hint">{{ group.hint }}</span>
|
||||
}
|
||||
@@ -364,6 +364,11 @@ export class Readings {
|
||||
readonly draw = input.required<(mode: Mode) => Figure | undefined>();
|
||||
|
||||
protected readonly chosen = signal('');
|
||||
protected readonly countUnit = computed(() => {
|
||||
const mode = this.mode();
|
||||
const unit = mode.kind === 'grouped' ? mode.unit : 'pacientes';
|
||||
return unit[0].toUpperCase() + unit.slice(1);
|
||||
});
|
||||
protected readonly mode = computed(
|
||||
() => this.modes().find((m) => m.label === (this.view() || this.chosen())) ?? this.modes()[0],
|
||||
);
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
</td>
|
||||
<td>
|
||||
{{ row.age ?? 'No disponible' }}
|
||||
<small>Grupo: {{ row.ageGroup }}</small>
|
||||
<small>Grupo: {{ name(row.ageGroup) }}</small>
|
||||
</td>
|
||||
<td>{{ name(row.status) }}</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user