Commit Graph

113 Commits

Author SHA1 Message Date
alberto c3e9d8a99f Reason label: triaje, as in the quality table 2026-12-03 14:03:29 -06:00
alberto 7fb7302537 TEA definitions name the No evaluable reasons through the shared reason labels 2026-12-03 14:03:23 -06:00
alberto fd3f7f2537 Merge parity/F2d 2026-12-03 14:03:05 -06:00
alberto 0e4bde9c62 TEA section in Datos y definiciones
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.
2026-12-03 14:02:51 -06:00
alberto 06239e726d Box figure spec reading carries its strata 2026-12-03 13:58:25 -06:00
alberto 477c4a07d8 Merge parity/F2b-reason 2026-12-03 13:57:26 -06:00
alberto cc3f6b3e0d F2b: No evaluable carries the reason ported from the tea library
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.
2026-12-03 13:56:48 -06:00
alberto 581eb64457 Merge parity/F2a 2026-12-03 13:55:41 -06:00
alberto 72d5d07d67 F2a: TEA indicators after the 3 Dec review
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.
2026-12-03 13:55:14 -06:00
alberto 4eed732ca4 Merge parity/F2b-web 2026-12-03 13:52:27 -06:00
alberto 2add96e38a F2b: TEA record after the 3 Dec review
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.
2026-12-03 13:51:40 -06:00
alberto d8b9452870 F2c: risk page after the 3 Dec review
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.
2026-12-03 13:50:53 -06:00
alberto 98eda5bc28 Gobernanza: Analizar EEG leads to Estudios EEG, which hosts the single-study evaluation; the timeline is only a dotted line; the probability curve and the age-norm bands are drawn from the model and the centiles 2026-12-01 18:35:42 -06:00
alberto f7eb170e15 One-step ticks only when the axis spans five or less, counted from zero 2026-12-01 17:29:05 -06:00
alberto 8ebf870f41 Plot axes are built fresh for every chart
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.
2026-12-01 17:23:53 -06:00
alberto ef407ce0a7 Every chart uses the shared short number format: axes, hover and bar/value text
Counts print as integers and other values with at most one decimal, in tick labels (valueAxis, percentAxis), hover templates and bar and pie text.
2026-12-01 17:20:28 -06:00
alberto 5cd601651c Count axes are linear with whole-number or one-decimal tick labels from one shared builder
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.
2026-12-01 17:15:35 -06:00
alberto 8ca3b053bd C1a: code only, no comments, no Markdown
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.
2026-12-01 16:55:32 -06:00
alberto 4118b050b8 F1: Sankey laid out by Plotly's own columns, with no hand-set x/y
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.
2026-12-01 14:36:30 -06:00
alberto 2404a3a66b F1: Sankey stopped nodes bottom to top M-CHAT, psicológica, neuropediátrica; full card width; layout test removed 2026-12-01 14:20:58 -06:00
alberto 58fdfd53d7 F1: Sankey stopped nodes in the rightmost column 2026-12-01 14:14:00 -06:00
alberto 5bd7793cf7 Merge parity/F1h 2026-12-01 14:04:28 -06:00
alberto 7d2a861993 F1: record section test expects the dotted line with its markers 2026-12-01 14:04:28 -06:00
alberto 0fd5cc70ec F1: whole-number axis range typed as a pair; explicit ranges win 2026-12-01 13:51:14 -06:00
alberto 71777537e1 F1h: Gobernanza without Vista previa and Subir archivos, button spacing
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.
2026-12-01 13:49:28 -06:00
alberto e14a85261c Merge parity/F1g 2026-12-01 13:45:25 -06:00
alberto 4929def121 F1g: whole-number axes, risk list link, dotted timeline, head map
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.
2026-12-01 13:42:54 -06:00
alberto 789145b93c F1f: TEA indicator chart formats (sex by age group, men blue, women magenta)
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.
2026-12-01 13:36:44 -06:00
alberto 5bf022b36f F1: training form driven by the API schema; Sankey stopped nodes at the left
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.
2026-12-01 13:32:26 -06:00
alberto 8d7464065d F1: openapi.json regenerated from the merged API, client regenerated, training form types
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.
2026-12-01 12:19:18 -06:00
alberto ec60f61704 Merge parity/F1a 2026-12-01 11:52:00 -06:00
alberto 2d0c8565ae tea-indicators.spec: one teaSteps import 2026-12-01 11:52:00 -06:00
alberto 3d4032f5d6 Merge parity/F1c
# Conflicts:
#	src/app/indicadores/tea-indicators.spec.ts
2026-12-01 11:51:57 -06:00
alberto c4920ed7eb F1b: user fixes
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.
2026-12-01 11:33:06 -06:00
alberto 344dafd9fc F1a: user fixes
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.
2026-12-01 11:32:48 -06:00
alberto a2bf98e9da F1c: user fixes
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.
2026-12-01 11:32:17 -06:00
alberto 7c98566579 T17: sweep of the WebApp after the feature-parity work
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.
2026-12-01 06:48:57 -06:00
alberto 32332b0fcf Merge parity/main into parity/T8-tea-lists 2026-12-01 03:55:35 -06:00
alberto fcb3634fa9 T8/T9: TEA Seguimiento and Análisis de riesgo as two components in rebuild's list style
tea-list is replaced by tab-seguimiento-tea and tab-riesgos-tea over one
tea-rows module (params, rows, workbook, export), with Material filters,
cards and pager. The risk list defaults to every child and keeps the
association pairs per row; the focused patient is fetched with the list's
own search. Specs and page cases follow.
2026-12-01 03:55:35 -06:00
alberto 9e50655d51 T13: the execution spec picks the mode through the Material select 2026-12-01 02:25:00 -06:00
alberto a1c079ce43 Merge parity/main into parity/T13-gobernanza 2026-12-01 02:16:45 -06:00
alberto 3a26c63931 T13: Gobernanza as one page with its sections in fixed places
Keep the route, title, subtitle, domain navigation and composition in
gobernanza.{ts,html,scss}. Ejecución keeps mode and health in execution.ts.
Add models.{ts,html,scss} to own the actions, run monitor, status, versions,
reports, figures, clinical validation, and checks and lineage dialogs.

Render training.ts after Modelos with the existing source, configuration,
promotion checkbox, input sets and upload. Keep ZIP export and import in
bundles.ts. Keep scope, study list, EDF upload and run progress in
tea/studies.{ts,html}, and render tea/preview.ts separately for TEA with
its EDF and ADOS-2 selection, results and PDF export.

Use a page grid for section spacing and the global card style. Keep
table, action and dialog styles local to Modelos. Use Material fields
for editable values and Material buttons to open native file pickers,
retaining input labels and showing the selected filenames. Keep the
native suggestion lists for scheduler and input set names.

Default the training target to all on domain changes. Both Modelos
training actions focus the Entrenamiento heading and use the same
Formly submit path. Use the existing shared start flag and version
refresh via the Modelos component. Reset the training promotion
checkbox on domain changes and the upload selection with its input
listing. Ignore training submissions that finish in a different domain.

Move gobernanza.spec.ts to models.spec.ts alongside checkActions.
Keep bundles, execution, training, run-monitor, figures and preview PDF
logic specs. Update e2e/pages.spec.ts for Material selections and
the Modelos monitor, and check section order and training focus.

Prettier 3.10.1 and git diff --cached --check passed. The main checkout
has no local Prettier installation, so use the available lockfile
version directly from the requested working directory. Angular builds,
unit tests and Playwright are deferred to the VM per the spec.
2026-12-01 02:15:51 -06:00
alberto 374d58f5a5 Merge parity/main into parity/T10-tea-record 2026-12-01 02:02:56 -06:00
alberto 6df008bf8a T10/T11: the TEA record and the risk page render inside rebuild's patient frame
Paciente renders the TEA record and, on the risk route, the risk page with
the same frame as CaCu and CaMa: back link, title with id, identity block
from the FHIR Patient (name, birth date, sex, one row per identifier
system), sections as one card component, Material controls for the
altered-zones toggle and the pair choice, export button in rebuild's style.
tea-patient.ts, tea-record.html, tea-risk.html and tea-section.html/scss are
deleted; the logic specs follow the new structure.
2026-12-01 02:02:56 -06:00
alberto 52ca5876d0 T7: Trazabilidad of the TEA page shows M30 (altered EEG share with its interval)
The TEA Resumen/Trazabilidad/Definiciones tabs already are rebuild's generic
tabs over tp's measures after T1; Casos por estatus (M28) and the EEG quality
(M29) are in place. M30 is the one figure the reference shows only in
Trazabilidad, as a line with its interval; M31 belongs to the out-of-scope
tea-estatus page.
2026-12-01 01:30:27 -06:00
alberto 48e6c9f390 T3: openapi.json and API client regenerated for the training source 2026-12-01 01:20:29 -06:00
alberto f0dd3ec52f Merge parity/main into parity/T3-training-source 2026-12-01 01:09:45 -06:00
alberto 61aeed35ff T3: training form edits the training source; kind and mains as selects 2026-12-01 00:53:30 -06:00
alberto d8cb6420a4 T2: page specs no longer point at the removed reference captures 2026-12-01 00:46:19 -06:00
alberto d3c04a5fcf The record test's FHIR stub answers searches (the CaCu/CaMa record lists her risks) 2026-12-01 00:23:32 -06:00