Algorithm scores 0, 1, 2, 3 -> 0, 1, 2, 2 and 7, 8, 9 -> 0, with the Toddler
B-1 exception (1 -> 2). The algorithm column comes from completed months and
item A-1 (new catalog field language_level): Toddler 12-20 months few words,
21-30 by A-1; Module 1 by A-1; Module 2 under five or not. The total adds only
the column's items. Classification from the manual's total cuts; Toddler CSS
from Esler 2015 table 3; Modules 1-2 CSS from the manual's comparison tables
(test transcription, in code for now). Module 3 is not scored (no items in
the ADOS-2 list). Labels non_tea / autism_spectrum / autism and little_or_no /
mild_to_moderate / moderate_to_severe concern. A-1 travels to FHIR, follow-up
(ados2_language_level), association input, synthetic hospital, pipelines and
the Gobernanza preview. Ported from the tea library 0.4.0 (patches 0001/0002).
- Cause: the percent axis range of 0-110 was only reached by the three percent bar builders (ageStack, ageShare, teaAlterations); every other bar chart with outside labels (count bars, sex bars) ran on autorange, where Plotly reserves no room for outside text, and the labels were only kept visible by cliponaxis false, so they spilled over the plot edge into the legend area. The headroom lived in each builder instead of in the shared plot code.
- Headroom is now computed once in the shared plot builder (plot-headroom.ts, used by layoutOf): for bar traces with outside labels, the value axis (y for vertical, x for horizontal bars) gets a range of 15 % over the maximum (and under the minimum if negative) unless the figure sets its own range. Percent axes keep their explicit 0-110 range with ticks every 20, ending at 100.
- cliponaxis false for bars is removed: with the headroom the labels are inside the plot area.
- Indicadores clinicos: route chart 300, grid figures 320, figure-row figures 360 again; the clinicalHeight constant is gone.
- Logic spec on the produced axis ranges: plot-headroom.spec.ts.
- tea-data: evaluable(metric) is the single rule (a metric with no
outside result is not evaluable)
- tea-sections: the Alteraciones block takes its head map and age norm
from metricCharts, which yields none for a not evaluable metric; the
block keeps title, z and Resultado with the reason
- paciente: loadNorms skips not evaluable metrics instead of fetching
their curves
- tea-patient.spec: a not evaluable metric yields no charts and no
chart entries in the PDF content
The risk page needs no change: zBars already drops rows without z, so
a not evaluable metric adds no empty plot.
- Prevalencia registrada (M31): the sex selector, its signal and the bar outline highlight are gone; the headline always shows the total rate and the bars keep one bar per sex
- Indicadores de oportunidad: the box charts show Q3, Mediana and Q1 in the hover, formatted with the shared one-decimal hover format, instead of annotations
- Porcentaje de confirmacion diagnostica (M24): the stacked bars, axis title, ticks, bar text and hover are in percent of the patients of each sex and age group
- Porcentaje de pacientes con / sin EEG (M21, M22): bar text shows the percentage only
- Headroom: the shared percent axis now ends at 110 with ticks every 20, and the shared plot builder never clips bar labels (cliponaxis false for every bar trace), so a 100 % bar keeps its label; the per-trace cliponaxis on the bar builders was removed
- Indicadores clinicos: route, grid and figure-row charts all use one height (430 px, was 300/320/360)
Choices: percent axis headroom lives in percentAxis, with rate dots keeping their own 0-100 range; the clinical height is a single component constant.
Added a "Periodos a mostrar" selector to the Trazabilidad filters, as in the
reference history tab.
- period-selection.ts: pure functions for the initial window, the periods
shown for a choice, the select options, the year grouping and the labels.
- periods-dialog.ts: Material dialog with the periods of the interval by year,
checkboxes, choose all and clear all, and a count of what is chosen.
- tab-trazabilidad.ts: the select offers the latest periods in steps of five,
all, and a custom choice that opens the dialog; the choice is kept per
interval. Every panel draws the same chosen periods.
Choices: the periods offered are those with data in any panel. The default is
the domain's declared window (the last 5 months for CaCu, months only) when
there are more periods than it, otherwise all. Cancelling the dialog leaves the
selection untouched. period-selection.spec.ts covers the selection functions.
The definitions tab renders a TEA section from indicadores/tea-definitions.ts, shown only
for the TEA domain through definitionGroups(domain). Five groups: EEG alterations and the
16-36 month range, how to read z, the head map colors and the norm bands (P25-P75 = 50 %,
P5-P95 = 90 %), the "No evaluable" reasons, the risk analysis (odds ratio reading and what the
probability means), and the indicators (prevalence per 10,000 and the data it needs, medians
that do not add up, M23 groups).
Choices left open by the spec:
- The text is plain data (group id, title, term/text entries) rendered as definition lists,
above the indicator catalog.
- The "No evaluable" reasons cover every code in eeg-labels.ts, merging sin N2 / sin N3,
sin edad / edad fuera de la curva, with the spec's seven reasons all present.
- The range text says 16 to 36 months for every alteration, spikes included.
- The only test covers the domain filter and the shape of the data, not the text.
eeg-labels.ts maps each reason code to its Spanish label: the metric
reasons, the study reasons and one label per window reason. The metric
shows "No evaluable · <label>" in Resultado where it showed a dash, and
only when it has no result; a metric with a result keeps it. The
study's reasons show as a Motivos row in the EEG quality summary.
Unknown codes show as the code. The patient spec covers the mapping and
the reading of both extensions from FHIR.
Changed:
- Summary: the time sentences say "La mediana de..." and the footnote is gone (nothing else used it); "se evaluaron" is now "se registraron en el tamizaje".
- boxFigure: the median, Q3 and Q1 are text annotations to the right of the box; the hover is off so nothing else is labelled.
- M23 is titled "Pacientes en tamizaje por resultado diagnostico" on the page and in Trazabilidad.
- M21/M22 ageShare: the bar text is "p % (n/N)" from numerator and denominator of strata.age_sex, and the hover reuses it.
- M28 Sankey: every node label ends with its count ("M-CHAT · 18"), the "Se quedo en..." nodes included; link labels stay without it.
- M31: the bars plot the rate per 10,000 for the selected period, one bar per sex, with the rate as bar text and confirmed of total children in the hover. The card shows a headline number that follows the sex toggle (total when both sexes). Trazabilidad plots the rate as a line per sex plus the total (new 'rate' panel kind replaces the stacked counts).
- reading() carries the per-stratum measureScore as Reading.rates; the group measureScore is the total rate.
Choices the spec left open:
- Q3, median and Q1 sit at a fixed 56 px right of the box, anchored top/middle/bottom so they do not overlap when the three values are equal.
- Headline detail line: "por 10 000 niños · n confirmados de N niños".
- The selected-sex outline on the M31 bars is black, since the bars are one trace now.
- e2e pages.spec.ts:23 already expects no toggle on the M23 card, which is what the page renders, so it stays; it now also asserts the new M23 heading.
Add a label above each completed timeline diamond and a baseline tick at
each completed step date, retaining the dotted line and day annotations.
Group each study and metric into one alterations block with its fields,
head map and age norm. Name the centile bands, shorten the norm title,
explain the head-map z scale and use Puntas paroxísticas consistently in
the shared biomarker labels. Update the logic and page expectations.
Choices left open by the spec:
- Use label annotations shifted upward by 26 pixels and a 40-pixel top
margin; retain the existing categorical axis and pending annotations.
Use the completed dates as explicit date-axis ticks.
- Add an optional charts array for the grouped row while retaining chart
for standalone plots. Put the map first and norm second, omit absent
figures, and keep a block even when neither figure is available.
- Use two equal grid columns with the existing space-4 gap, stacking at
800 pixels. Separate adjacent blocks with the existing border color,
space-6 margin and space-4 padding.
- Keep grouped figures in the PDF export's existing sequential image
order, consuming one image for each figure.
- Make bandFill's final name parameter optional and show its legend only
when a name is supplied, preserving unnamed governance bands.
- Keep the existing lighter outer/darker inner band drawing order.
- Keep tea-data.ts unchanged: its spike title already matches the required
Puntas paroxísticas. Preserve the existing spike exclusion in loadNorms.
Verification: git diff --check passed. Prettier skipped because this
worktree has no WebApp/node_modules/.bin/prettier. Angular tests/build and
browser page tests were not run on the saturated lab server, as specified.
No API signatures, schemas or endpoints changed.
Replace the risk introduction with the reviewed text, name severe ADOS-2
probabilities in the risk section and record table, and place the TEA
clarification below the risk probability table through section content.
Use one shared decimal log-axis builder in the patient forest and both
governance OR charts. Add builder and patient logic coverage and update
the page case for the section, column headers and clarification.
Choices left open by the spec:
- Name the builder logAxis and mirror valueAxis's iterable input signature;
put its logic spec in indicadores/figures.spec.ts beside the builder.
- Generate the 1-2-3-5-7 sequence from the floor of the minimum log10 to
the ceiling of the maximum log10, including only 1 in the last decade.
Whole-decade bounds retain labels for narrow and single-value ranges.
- Ignore missing, nonfinite and nonpositive input; return empty tick
arrays when no positive finite data remain. Discard generated zero or
nonfinite ticks at floating-point limits.
- Construct tick values from decimal exponent strings to avoid binary
multiplication artifacts; use explicit array ticks and SHORT hovers.
- Let the existing private decimal formatter accept optional Intl options,
retaining its existing defaults. For log labels use its es-MX locale,
one significant digit and no grouping, preserving small decimals and
avoiding scientific notation and trailing zeros.
- Include estimates and confidence bounds in each chart's input, plus 1
in the two charts that draw the reference line.
- Represent the risk table note as a following text block so the existing
page and PDF renderers both place it below the table.
- Cover decimal sequences, whole-decade bounds, singleton and iterable
input, invalid input, small and large labels, patient confidence bounds,
probability labels and the clarification's PDF inclusion in logic tests.
Add page assertions for the probability headers and clarification.
Validation: ruff check . passed; ruff format --check . passed (144 files);
git diff --check passed. A Node smoke check of the source logAxis function
passed nine assertions. Prettier was skipped because this worktree has no
WebApp/node_modules/.bin/prettier. Angular tests/build and Playwright page
tests were not run here, as the spec reserves them for milkpc/the VM.
Python imports and the API did not change; lint-imports and API generation
were not needed.
The module-level axis defaults were shared by every chart, and Plotly writes its detected axis type, range and autorange back into the layout it is given, so one chart's category axis and range leaked into the others (count axes typed as categories, percent ranges ignored). Each layout now gets its own axis objects.
The EEG quality chart's count axis was typed as a category axis, which put 0 on the right; every count and value axis now takes its type and tick format from valueAxis: linear, whole numbers for counts (one step when the range is narrow), one decimal otherwise, with Plotly choosing the number of ticks.
Remove 125 JavaScript, TypeScript, and stylesheet comments and nine configuration comments. The submodule had zero tracked Markdown files. Remove the Markdown-only EditorConfig section.
Keep the generated client headers and tool directives. Delete other comments in place without regenerating the client or changing OpenAPI data.
Root cause of the crossing bands and overlap: with explicit node x/y Plotly keeps the nodes where they are set but orders the links leaving a node on its own, so a stopped band could leave the top of a node while its target sat at the bottom (bands crossed), zero-flow nodes stayed in the figure and tiny nodes landed on one another, and long one-line labels ran into the next column's labels. Now the stopped nodes are plain sinks that Plotly justifies to the right column, ordered neuropediátrica, psicológica, M-CHAT from top to bottom so bands never cross; nodes without flow are dropped; labels break in two lines; the padding keeps two-line labels apart. The card spans the whole row. Checked by screenshots of the live page across monthly and semester periods.
Keep preview state in Modelos and reset the toggle on domain changes. Hide the form while collapsed so the current selections, run monitor and result dialog survive toggling. Keep the existing evaluation and PDF handlers.
Use one wrapping button-row class with space-3 gaps and block margins. Inside table cells use the existing cell padding between rows. Apply the same class to the indicators export and keep the existing domain navigation bottom margin.
Delete the training upload UI and hand-edit the client and OpenAPI. Preserve the generator format and update the Modelos component spec and Gobernanza page case to cover both toggle states.
Share the integer tick rule between Trazabilidad and TEA record figures.
Use the plotted extent, including stacked totals or interval bounds, to
target four divisions. Round spacing up to a 1/2/5 step with a minimum of
one, anchor ticks at zero, ignore nonfinite values, and include integer
bounds when a fractional extent contains no integer.
Point the existing patient link at the TEA risk route and remove the
details accordion and separate risk action. Exercise the link from the
risk list in the existing patient page case. Connect completed diamonds
in step order on the existing marker trace, using its color for the
dotted line and retaining the duration bars and annotations.
The scalp figure used the ear electrodes as markers outside the circle,
omitted the ears, and masked sample centers without clipping Plotly's
rendered contour cells at the scalp boundary. Its interpolation also
colored distant areas with no adjacent sample. Use the reference's 19
scalp positions, nose and ear paths, and reverse-wound mask painted in
the card's white surface color beneath the outline. Derive the mask and
the existing 41-point grid in headMapGeometry. Use the reference's 0.45
interpolation reach with inverse squared distance, taking a coincident
sample directly and preserving the existing zone inputs and z color
scale. Test mirror positions, scalp bounds, and plotted contour values.
Prettier, Ruff check, Ruff format check, and git diff --check passed.
Angular and Playwright execution are reserved for the test machines.