Commit Graph

89 Commits

Author SHA1 Message Date
alberto 3d4032f5d6 Merge parity/F1c
# Conflicts:
#	src/app/indicadores/tea-indicators.spec.ts
2026-12-01 11:51:57 -06:00
alberto 728d89f62e Merge parity/F1b 2026-12-01 11:51:43 -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 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 8237e9f483 T15/T16: one page case per page and tab: sign-in, Conectar, Revisión, CaCu, CaMa, TEA tabs, record, risk, Gobernanza
Shared helpers (admin sign-in fixture, watch, downloaded) live in e2e/support.ts.
Conectar checks the EDF reader among the node kinds; CaCu and CaMa show their
four tabs over a platform without their data; the training-inputs 404 of a
domain without training files is the one allowed response.
2026-12-01 05:06:43 -06:00
alberto 2ea5106d32 T8: the record page test goes back through the frame's Regresar link 2026-12-01 04:17:02 -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
alberto 3655b9857c TEA studies upload their EDFs as one upload set (the merged upload takes several files) 2026-12-01 00:09:12 -06:00
alberto 3e213c4fc0 OpenAPI document and client regenerated from the merged API 2026-11-30 23:57:49 -06:00
alberto bd897baa2d Merge origin/rebuild into parity/T1-merge (WebApp)
rebuild's shell, auth and non-TEA pages; tea/parity's TEA pages on tea/parity's API.
- Routes: rebuild's signed-in tree; the TEA risk page joins it (domainAllowed reads the
  route's data domain when the path has no :domain).
- Indicadores: rebuild's header and its generic Resumen/Trazabilidad/Definiciones tabs
  (TEA as the reference page, fed by tea/parity's measures); TEA Seguimiento and Análisis
  de riesgo render tea/parity's tea-list inside rebuild's tab-seguimiento/tab-riesgos,
  which keep rebuild's CaCu/CaMa lists and patient search. rebuild's tab-riesgos-tea read
  rebuild's TEA Patient extensions, which are gone with its backend; tea-list already
  shows that list from tea/parity's FHIR search, so it is deleted rather than ported
  (its look is the base for T8/T9).
- Paciente: rebuild's record for CaCu/CaMa; TEA delegates to tea/parity's TeaRecord.
  rebuild's inline TEA sections read its EEG detail endpoint and are removed.
- Gobernanza: tea/parity's page (execution, models with checks/lineage, bundles, training,
  studies, preview) until T13; model headings use rebuild's model titles. figures.ts:
  rebuild's scenarios (drawn in the record) plus tea/parity's association forest.
- plot.ts: rebuild's layout helpers on tea/parity's partial Plotly bundle.
- Conectar: rebuild's KINDS/HELP with an entry for tea/parity's edf node.
- Dead code removed: measures boxes/sankey (tea/parity's old TEA tab), eeg-labels
  headMap/byDeviation/LEVEL_NAMES/METRIC_NAMES (rebuild's TEA record), e2e/layout.ts.
- e2e: tea/parity's TEA cases, signed in; rebuild's CaCu/CaMa/site cases need their
  hospitals loaded and come back with the page suite (T16).
- openapi.json and src/app/api: regenerated in the next commit.
2026-11-30 23:56:25 -06:00
alberto b291885b97 Gobernanza preview saved as PDF; Playwright TEA page tests
- The EEG preview dialog gets "Guardar como PDF": previewPdfContent is a
  pure function (verdict, checks, metrics with scores per electrode and
  zone, ADOS-2 classification/CSS and items by their Core titles,
  warnings), downloadPreviewPdf a thin wrapper over export/pdf; the file
  is tea-gobernanza-<day>.pdf. Unit-tested without mocks.
- e2e/pages.spec.ts now holds only the TEA page tests (the CaCu/CaMa
  cases needed fixtures P7 removed): every indicator tab, the follow-up
  xlsx export, the patient record and risk page with their PDFs, and
  every Gobernanza section in sync mode including the preview PDF. Each
  download is checked for a file and a name without a record number.
- Fixes the page tests found: the TEA xlsx name ('seguimiento-tea') failed
  validateName, so the export always threw; it is now tea-<page>-<day>.
  ng serve crashed on every Plotly page (has-hover reads 'global'): the
  build defines global as globalThis. Record numbers repeated once per
  source identifier; they are deduplicated. A refused bundle export showed
  '{}': the blob error body is now read for the API's detail.
2026-11-30 19:17:46 -06:00
alberto b847e04697 ADOS-2 items shown by the child's module, grouped by domain and subdomain
The patient record ADOS-2 table and the Seguimiento ADOS-2 card list only
the module's items, in the order of core.tea.ados2_items as the FHIR
aggregate Observation carries them: each module item component has the
module's item code and exact title as a second coding (and code.text), and
ados2-domain / ados2-subdomain extensions. Components without those
(items outside the module) are not listed. Association titles and the
concordance look the item up by catalog field instead of by row index, so
they do not depend on which items the module has. ADOS2_ITEMS moves to a
shared src/app/ados2.ts.
2026-11-30 16:56:26 -06:00
alberto e5556ebf41 Merge P6 cleanup into P5-combined 2026-11-30 16:34:17 -06:00
alberto 08a1bf910e Merge P5.3-tea-patient into P5-combined 2026-11-30 14:20:07 -06:00
alberto 7e21ebbc7b Merge P5.2-tea-indicators into P5-combined 2026-11-30 14:20:07 -06:00
alberto fde3ec08e1 Merge P5.4-gobernanza into P5-combined 2026-11-30 14:20:07 -06:00
alberto 3f6fa28590 TEA patient pages: the record and the risk analysis page
Keep the TEA record branch inside Paciente and lazy-load the risk route.
Separate FHIR adaptation, figures, shared section rendering, and PDF
content under paciente. Use the existing section cards, tables, and
buttons, with flexible summary fields and scrollable detail tables.

Read the Patient by _id with Observation, DiagnosticReport, and
RiskAssessment reverse includes. Group neurology observations by
encounter, use aggregate ADOS-2 evaluations, and use the lab-record
observation for EEG dates without reports. Order the timeline and exams
newest first and use the RiskAssessment headline flag for pair order.
Render absent fields and empty tables with an em dash.

Use a normalized 10–20 layout and a 41-by-41 inverse-distance weighted
contour clipped to the head outline, with symmetric z colors and
electrode labels. Keep the head outline and markers when no site has a
score. Request each aggregate champion's version once per record load,
draw the median and p5–p95 band with banded(), and place the observed
value at the EEG's age. Omit unavailable bands and count-rate bands.

Use the RiskAssessment's EEG for z and pair status, falling back to the
newest EEG with z scores for the bars when needed. Use site outside flags
for the forest filter, aggregate scores for global and posterior-rhythm
pairs, and show the unit-OR line and available CI bounds. Select the
headline pair by default. The current RiskAssessment carries no logistic
coefficients, so the view shows patient and reference points at the
served z and at zero. Keep the optional logistic figure input independent
of the FHIR mapping. Link to Seguimiento with the agreed query parameter.

Share section data with the PDF and include snapshots of the rendered
figures. Use the existing safe seguimiento and riesgos filename tokens
with the UTC date. Format values for es-MX and size categorical charts
to their row count.

Add Vitest coverage for the head map, norm and point, forest filtering,
z band, probability fallback, ADOS-2 rows, PDF content, included data,
and the domain branch. Static TypeScript and Angular template checks
passed with a temporary PDF type shim. The Angular build, Vitest runtime
and Playwright run on the test machines.
2026-11-30 14:19:03 -06:00
alberto adff5bac5c Indicadores TEA: Resumen, Trazabilidad, Seguimiento, Análisis de riesgo, periodicities 2026-11-30 14:19:03 -06:00
alberto e2d1c9f277 Gobernanza: execution, models (training, run monitor, checks, lineage, bundles, interpretability), EEG studies
Share one execution selection across training and analysis. Use the first
configured scheduler for a remote default and let the API validate typed
addresses. Suspend health polling when the document is hidden. Poll each
run serially, retry status reads on transient errors, and compute ETA from
completed items and elapsed seconds.

Reuse the Conectar Formly types with nullable fields and inlined references.
Omit the optional cohort when its name is blank, and offer the declared
input sets in a datalist with filename validation before upload. Identify
the versions created by a training run from its version log lines, then
check each exact version before promotion. Use native dialogs for checks,
lineage, bulk confirmation and preview. Recheck promotion eligibility before
submitting changes, and list results per version.

Verify bundle hashes using SubtleCrypto before upload. Use blob downloads
for bundles and reports. Read age centiles from the curve endpoint and keep
the count-rate reference line from the report. Join study metrics by code
and regional values by feature, skipping absent ages and values. Use one
Plotly trace per association pair and scale the forest plot height by row
count.

Preflight the TEA pipeline before staging EDFs, then start the pipeline once
for the batch. Refresh studies, their overlays and summary on completed
runs. Page through analyze history to compare its end times against the
latest tea_eeg result. The branch base lacks export/pdf.ts, so the preview
uses the specified TODO and omits the PDF action.

Added Vitest coverage for execution and run polling, ETA and cancellation,
training schema, version actions, bundle digest verification, study overlays
and the association forest. Ruff check, Ruff format --check, Prettier,
strict Angular and TypeScript diagnostics for Gobernanza and git diff --check
passed. npm ci, ng build and vitest run are assigned to the test machines.
2026-11-30 14:19:03 -06:00
alberto 0760721144 Cleanup of the TEA parity work: no prose in code, no hacks, everything in its place
1. No prose in code
- Remove the parity-added comment above the canvas palette mapping.

2. No hacks, no glued code
- Keep the existing palette entries and saved-pipeline behavior.

3. Everything in its place
- Keep canvas code in conectar. Generated API bindings and OpenAPI
  are excluded from the cleanup.
2026-11-30 13:41:49 -06:00
alberto 56d1ef2e8a WebApp shared: Plotly partial bundle, card actions, print report, export module
Plotly partial bundle (bar, scatter, box, pie, sankey, contour) replacing the cartesian dist; card-actions (published Measure definitions, settings, Volver); Descargar reporte with a print stylesheet; export module: xlsx with frozen header, autofilter, Parámetros sheet and 5,000-row cap, pdfmake documents with header/footer, allRows following next links, file names without patient identifiers; lazy-loaded export libraries.

Checks on milkpc (node:22): npm ci, ng build (initial 567 kB / 134 kB transfer), ng test 7 files passed.
2026-11-30 13:36:35 -06:00
Roberto Treviño 053679c817 Connecting a database no longer freezes the page: the columns field keeps one empty list 2026-11-30 05:17:14 -06:00
Roberto Treviño ffa732df12 The page test follows the pages as they are 2026-11-30 02:14:16 -06:00
Roberto Treviño 786b199203 The generated API client matches the API 2026-11-29 21:15:12 -06:00
alberto 5d03f333f7 Client: eeg_studies_summary and the FHIR eeg_summary as distinct operations 2026-11-29 19:47:01 -06:00
alberto f7cc141625 Merge P4.3 into P4.1 for one combined gate 2026-11-29 19:46:01 -06:00
alberto 84dcebda55 Regenerate the governance REST API client 2026-11-29 19:45:50 -06:00
alberto 12b056343b TEA follow-up: Patient search with TEA filters and $eeg-summary
Regenerate the OpenAPI document and Angular client with the existing generator configuration. Repeated generation produced identical files.
2026-11-29 19:42:17 -06:00
Roberto Treviño ca887c29ab Wording: formal, precise, no narrative; the missing reports of a promotion in Spanish 2026-11-29 15:24:25 -06:00
Roberto Treviño bb506c3926 Conectar: Configuración and Avanzado tabs, rows instead of JSON, field titles as keys, captions that fit their nodes 2026-11-29 15:24:24 -06:00
Roberto Treviño b48c025400 Page test: no overlapping, clipped or wrapped labels at 1440 and 820 px 2026-11-29 12:39:07 -06:00
Roberto Treviño a93cd71126 Cosmetic pass: legends above plots, readable hovers and ticks, KPI qualifiers, a header that never wraps 2026-11-29 12:39:07 -06:00
Roberto Treviño 979b7cf34d Gobernanza: the header's domain switcher, model titles, confirmations, a stop button, an upload button 2026-11-29 12:39:07 -06:00
Roberto Treviño cde9b1cfb1 Revisión: documents no route recognises; reasons and fields in Spanish 2026-11-29 12:39:07 -06:00
Roberto Treviño edc32af67e CaMa record as the old card: summary, mammography, histopathology, prognosis, risk of death and its scenarios' risk factors 2026-11-29 12:39:07 -06:00
Roberto Treviño 2216186d26 Patient lists have a search box; TEA alterations by their Spanish names 2026-11-29 12:39:07 -06:00
Roberto Treviño 55c4e0b173 OpenAPI client: model titles, run termination, Patient name and identifier 2026-11-29 12:39:07 -06:00