Mostrar confirmación con intervalo en barra y ajustar etiquetas de la ficha

This commit is contained in:
2026-12-02 23:43:18 -06:00
parent a3a100450b
commit 5d660b7043
9 changed files with 65 additions and 18 deletions
+12 -3
View File
@@ -4,7 +4,7 @@ import { MatCardModule } from '@angular/material/card';
import type { Measure } from 'fhir/r4';
import { Mode } from './bars';
import { scenarioBars } from './figures';
import { detail, donut, formatScore, name, Reading, scoring } from './measures';
import { detail, donut, formatScore, intervalBar, name, Reading, scoring } from './measures';
import type { ReadingsCard, Section } from './pages';
import { Readings } from './readings';
@@ -28,7 +28,8 @@ type Shown = Extract<Section, { kind: 'readings' | 'columns' | 'choice' }>;
<app-readings
[title]="s.title"
[camaStyle]="hasCamaHeading(s)"
[headline]="headlineOf(s)"
[headline]="s.footnote ? '' : headlineOf(s)"
[foot]="footOf(s)"
[note]="s.note ?? ''"
[modes]="s.modes"
[view]="view()"
@@ -58,7 +59,8 @@ type Shown = Extract<Section, { kind: 'readings' | 'columns' | 'choice' }>;
[title]="c.section.title"
[hideTitle]="true"
[camaStyle]="true"
[headline]="headlineOf(c.section)"
[headline]="c.section.footnote ? '' : headlineOf(c.section)"
[foot]="footOf(c.section)"
[note]="c.section.note ?? ''"
[modes]="c.section.modes"
[loading]="of().loading"
@@ -162,11 +164,18 @@ export class ReadingsSection {
const words = detail(measure, r, s.unit);
return scoring(measure) === 'cohort' ? words : `${formatScore(measure, r)} · ${words}`;
}
/** The headline of a card that says it under its figure, as one line separated by commas. */
protected footOf(s: ReadingsCard): string {
return s.footnote
? this.headlineOf(s).replace(' · ', ', ').replace('. IC 95 %', ', IC 95 %')
: '';
}
protected readonly draw = computed(() => (mode: Mode) => {
if (mode.kind !== 'figure') return undefined;
const r = this.of().reading(mode.measure);
const measure = this.of().measure(mode.measure);
if (!measure || !r?.populations['initial-population']) return undefined;
if (mode.figure === 'interval') return intervalBar(r, mode.colors?.['numerator']);
if (mode.figure === 'donut') return donut(measure, r, 'category', mode.colors);
const categories = (mode.catalog ?? []).map((c) => ({ ...c, group: '' }));
return scenarioBars(