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.
Reuse the existing male blue and female magenta, in that order. Read the published sex-by-result and age-by-sex cells and omit unknown sex. Keep the report age labels and sort by the starting month. Use zero for absent count cells and omit rates without denominators.
Keep M24 count heights and percentage labels. Stack the two outcomes within each sex using Plotly offset groups. Use the previous prevalence alpha of 0.25 for both transparent outcomes. For M31, use the published outcome counts and keep the sex focus control by outlining the selected bars while preserving both fill colors. Use the standard chart card height and identify changed figures by measure in the page checks.
Prettier, targeted figure type checking, and the 23 indicator logic tests passed. Full application type checking requires the unavailable pdfmake dependencies in this checkout. Angular and Playwright runs are reserved for the test machines.
The training form flattens the discriminated source union generically: the discriminator becomes a select labelled by each variant's title, a variant's fields hide unless it is chosen, and the payload keeps only the chosen variant's fields. No variant names, option labels or Hz labels live in the WebApp. The Sankey places the three 'Se quedó en' nodes in the leftmost column, every node at its own position.
The checked-in document listed routes the API no longer has; the inputs route now types its response, so the training form reads allowed by index and the schema type drops the JSON schema's own $defs.
Use the existing Plotly card and registered Sankey trace. Build transition totals from the remaining stages and omit zero-flow links. Build the prevalence donut from the report counts, with a grey slice for missing sex and controls to highlight each recorded sex. Use grouped bars for M23 and separate age and sex stacks for M24. Use the existing stacked history style for M31 and put the M30 figure behind one page flag. Cover the builders and the existing TEA page case.
Keep preview visibility in the domain page and reset it on domain changes. Build the source controls from the folder schema, keep folder edits while hidden, and send only the discriminator for site training. Place the existing upload controls in the next card and use the server-declared file types. Keep shared ingestion endpoints used by Conectar and remove the EEG-page upload flow.
Docker socket access was denied and the local environment lacks fastapi-users. Generate the changed OpenAPI route and schemas from the real models router with the production app settings, verify its other routes and schemas against the checked-in document, and run ng-openapi-gen directly from the cached dependencies.
Render the worklist stepper from the Patient stage and read M-CHAT, CSS
and alteration count from its FHIR extensions. Keep the compact stepper
private to Seguimiento and share the dated screening logic with the
patient record. Use the first dated event for each step, require prior
steps, and use the later date when an event predates its prerequisite.
Only a good-quality EEG completes that stage.
Use horizontal Plotly bars on the destination rows for elapsed spans,
diamonds for completed steps, and labels for pending steps. Keep the
screening order on the axis and show 30 days on either side when all
completed steps share one date. Reuse the registered bar and scatter
traces and the rebuild palette.
Use completed months at the applied cutoff and show the marked headline
association with the reference formatting. Resolve item labels from
the model's ADOS-2 observation and fall back to the item code. Move the
existing detail and risk actions into the patient-name cell to keep the
requested ten columns. Keep raw association numbers and separate CI
bounds in Excel and keep the screening dates in the follow-up export.
Update the two logic specs and the follow-up, risk and record page
assertions. All 34 targeted Vitest cases passed with Plotly rendering
stubbed. The local TypeScript check reached the existing PDF export
code and reported missing pdfmake typings. Angular and page runs are
reserved for the test machines.
Removed the legacy indicator layout, unused chart helpers, styles and
exports, the card-actions component, fetch-all and explanatory comments;
one pager shared by the four worklists, shared filter-row styles, one
FHIR name and CURP reader, downloads through export/, the concept-map
editor on Material controls.