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.
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.
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.
- 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.
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.
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.
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.
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.