Kit exit: TEA over FHIR, dashboard-test presentation merged in #9

Merged
roberto merged 73 commits from feature/kit-exit-integration into dev 2026-11-16 21:09:08 -06:00
Owner

WebApp side of ISSSTELEON/WorkingNarrative#179 (kit exit, converging the team's branches onto dev): the TEA WebApp rebuilt over the FHIR services, and Angel's dashboard-test presentation merged over those same FHIR services (its kit-based WebApi/kit backend was not merged).

Opened per the owner's request; merging into dev is left to a person in the Gitea UI.

🤖 Generated with Claude Code

WebApp side of ISSSTELEON/WorkingNarrative#179 (kit exit, converging the team's branches onto dev): the TEA WebApp rebuilt over the FHIR services, and Angel's dashboard-test presentation merged over those same FHIR services (its kit-based WebApi/kit backend was not merged). Opened per the owner's request; merging into dev is left to a person in the Gitea UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
roberto added 73 commits 2026-11-16 01:20:45 -06:00
- Pestaña Seguimiento de TEA: tabla de pacientes con filtro de alteraciones EEG
  y fila desplegable con ADOS-2 por reactivo, calidad del EEG y mapa topográfico
  (GET /tea/seguimiento/<id>).
- Indicadores destacados: M21 y M22 (pacientes con TEA con y sin EEG).
- Con un solo periodo elegido, TEA muestra un párrafo de resumen en lugar de
  las tarjetas.
- El filtro general admite un único periodo (Elegir periodo); agregar otro lo reemplaza.
- Buscar indicadores pasa a ser una lista desplegable con casillas; solo los
  indicadores marcados se muestran en Indicadores gráficos, con Mostrar todos.
- Filtro general: «Intervalo de análisis» (Semestral/Mensual) en lugar de
  «Modalidad»; al cambiar de intervalo se elige el periodo más reciente.
- Resumen de TEA: evaluaciones con o sin diagnóstico y diagnóstico positivo
  de TEA explícito.
- Seguimiento: panel «Alteraciones del EEG» (exponente aperiódico, husos del
  sueño, entropía multiescala) con posibles efectos asociados. Datos de
  ejemplo, pendientes de validación médica.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Se quita el botón flotante de navegación por indicadores.
- Cada opción de «Buscar indicadores» tiene un enlace «Ir» que lleva a su
  tarjeta (y la muestra si estaba oculta por la selección).
- Resumen del paciente en Seguimiento más compacto; «Puntajes por reactivo»
  plegado por defecto, con un triángulo para desplegarlo.
Figura fig_c1_donas para indicadores C1 de un semestre: el anillo interior
divide la población entre con y sin el evento, y el exterior cada parte por
grupo de edad, con el mismo dibujo que la distribución de resultados
citológicos de cáncer cervicouterino. Se construye con los datos
estratificados por grupo de edad.
- M21 (fig_c1_dona_edad): solo el anillo por grupo de edad, con el porcentaje
  total con EEG al centro.
- M22 (fig_c1_barras_edad): una barra por grupo de edad con el porcentaje de
  pacientes sin EEG.
- M24 conserva la dona de dos anillos.
Los pacientes con número impar abren su propia ventana, como la ficha de
cáncer cervicouterino (con «Regresar» y un resumen arriba); los pares
conservan el resumen desplegable en la fila. El encabezado de la ficha ya
nombra el dominio en lugar de decir siempre cáncer cervicouterino.
- La ficha propia del paciente reparte los paneles en tres columnas
  (dos o una en pantallas más estrechas), con los puntajes por reactivo
  abiertos y un mapa más grande.
- La dona de M21 muestra solo a los pacientes con EEG por grupo de edad;
  el centro conserva el porcentaje total con EEG.
- Leyenda con botones, como la distribución de resultados citológicos de
  cáncer cervicouterino: el grupo o la categoría elegida conserva su color,
  el resto se atenúa, «Volver» retrocede y un clic en la figura equivale al
  botón (indicadores-highlight.ts).
- M21, M22 y M24 con botones por grupo de edad; el centro de las donas
  muestra la selección.
- En TEA, la dona C2 de un periodo (M23) se dibuja con ambos anillos y
  botones, y sus barras también los tienen.
- Pestaña Evolución (solo TEA), entre Resumen y Seguimiento: una figura por
  indicador con todos los periodos publicados, mensual o semestral. Barras
  apiladas para C2, línea con intervalo de confianza para C1 y mediana con
  cuartiles para C3r. Los periodos suprimidos se sombrean, no se dibujan
  como cero.
- Paleta: verde #A8C243 y rojo ladrillo #B8433A, comprobados para
  daltonismo. Las líneas usan un verde más oscuro sobre fondo claro.
- «Sin EEG» conserva su color en M21 y M22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Evolución pasa a llamarse Histórico y añade «Periodos a mostrar»: los
  últimos 5, 10, 15... meses o semestres, según el intervalo elegido.
- M21 y M22 usan un color por grupo de edad, sin verde ni rojo, también en
  sus líneas de Histórico.
- Se quita el selector «Representación gráfica».
- Todas las filas de Seguimiento de TEA se despliegan en su lugar; se quita
  la ventana propia de los pacientes impares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Filtros por grupo de edad, rango de riesgo M-CHAT-R/F y nivel de CSS ADOS-2.
  Se envían a la API como grupo_edad, mchat_min/max y css_min/max.
- Se quita «Ordenar por prioridad», también de CaCu, donde estaba deshabilitado.
- El grupo de edad menor pasa a 16-23 meses, igual que en los indicadores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M23 ya no cuenta los diagnósticos descartados: el párrafo dice ahora «evaluados
por psicología [...] diagnóstico confirmado o en proceso».

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sin grupos de categorías (M23), la dona de TEA se dibuja como la de M21: un
anillo con rótulos, el total al centro y un botón por categoría.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ritmo posterior, husos de sueño N2 y N3, picos paroxísticos y gradiente
anteroposterior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- La calificación general es una palabra (Bueno, Aceptable o Malo), como en
  Automagic, y es la peor de sus criterios.
- Los criterios son lo que busca PREP, con números: canales afectados de 19 y
  ruido de línea en dB.
- Se quitan impedancia, artefactos, canales rechazados, segmentos útiles y el
  puntaje de 100.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resumen
- Estado del caso (completo, en proceso, fuera del protocolo) al cierre del
  periodo, en una figura y en el párrafo, separado de diagnóstico confirmado.
- Tiempos por paso: M-CHAT a ADOS-2, ADOS-2 a diagnóstico y total.
- Un solo formato: barras. M24 son barras apiladas por grupo de edad.
- «Descargar reporte» abre la impresión con el periodo y los indicadores
  seleccionados.

Histórico
- Porcentaje de casos en proceso, tiempos por paso en la misma escala y
  calidad de los EEG (indicador solo de esta pestaña, con `vistas`).
- Ejes con unidades y fechas como «mar 2025».

Seguimiento
- Columna y filtro de estado del caso, con lo que falta.
- Filtro por tipo de alteración y resumen de EEG que sigue los filtros.
- Módulo de ADOS-2 junto al puntaje.
- Tarjetas de alteraciones: al elegir una se apartan y aparece su mapa, sin
  caja, con leyenda de colores. Referencia por grupo de edad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Al desplegar un paciente se abre su primera alteración, o la primera métrica
si no tiene alteraciones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
«Personalizado…» en «Periodos a mostrar» abre un diálogo con los periodos del
intervalo elegido, por año. Las figuras muestran solo los elegidos, sin volver
a consultar, y cada intervalo recuerda su propia selección.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cards: patients with BI-RADS 4, 5 and 6, histopathological detection rate, screening to result and result to diagnosis times. The detection rate and the result-to-diagnosis time are not published by the catalog yet, so they are drawn as explicit pending cards and are queried once the catalog lists them. cama_eu38a is added to the CaMa KPIs.
CaMa reads «cáncer de mama» everywhere on the indicators page and uses the compact filter: interval, one period and Aplicar on one row, without the mode selector, the multiple selection or the editing summaries. The opportunity strip is the four cards only, and the biopsy distribution card is no longer drawn in the summary (it stays in Datos y definiciones). Other domains keep their filter and strip.

(cherry picked from commit 7c9dcf634e5870fec35ab96347b0863b2e3bb86e)
CaMa's graphic section reads «Indicadores clínicos» and counts the indicators it draws. The search box, pins, floating navigation, representation selector and figure count are not drawn for CaMa; CaCu and TEA keep them.

(cherry picked from commit e54ee5a55aa3722f6895300fa7e8cefb28f12ebb)
One card draws the exams by category as a donut and, per BI-RADS family, the patients next to the exams. Patients come from cama_birads_456_paciente (each patient once per period, in the category of the most severe exam), so its exclusive categories are added within that indicator only, for the verified version 0.2.0; other versions, suppressed or missing cells leave the figure unknown. No exams-per-patient ratio is computed and patients are never derived from exams. The patients' indicator has no card of its own while the exams' one is published.

(cherry picked from commit b7bafd178896cb2715049d5c8293185f31391c92)
A Histórico tab between Resumen and Seguimiento, for CaMa only: monthly or semestral interval, how many periods to show, and a custom period dialog. Counts are stacked, rates draw their confidence band and medians their quartile band; suppressed periods are shaded and listed, and a rate over no denominator or a median over no observations is no value. Five charts use published indicators; the three whose indicator the catalog does not publish are drawn as pending panels.

(cherry picked from commit 268d7443e0a89da8d6bc67ecb2b5db2715236f93)
On /indicadores/<dominio> the header shows «Plataforma de Indicadores» and a menu button with the current domain (TEA, CaCu, Cáncer de mama) that links to the other two through the router. Institutional routes keep their breadcrumb header.

(cherry picked from commit 79a18fd7a8ed1a3a58201e7cc24c9692b53dbc47)
The in-page domain buttons are removed, since the header selector replaces them. Also fixes a computed that, after a visit to CaMa, never became true again, so CaCu and TEA lost their search box when switched to from CaMa.

(cherry picked from commit 3678c3653b33fcb98ba2334ca8f03f838dc86440)
The menu and its overlay were in the initial bundle of every route (+183 kB); they now load in their own chunk, with a same-size placeholder. On phones the title moves to a second row instead of being squeezed beside the selector.

(cherry picked from commit 2ccddf80dbbe41a328281fcdc1c95ebe421f4191)
Tokens are set on body when the indicators header is present, so menus, selects and dialogs share them; the other routes keep Rajdhani and their shapes.

(cherry picked from commit f5103b483d9d7188b4feffe91beda38d997004d4)
Fields and Aplicar at 40 px, tighter padding and a small description. Only the CaMa block changes; CaCu and TEA keep their filters.
Confirmation, screening-to-diagnosis and exam-to-result cards leave the summary (they stay in Histórico and Datos y definiciones). The histopathological result by BI-RADS keeps its place and structure as a pending card, with no figure or number, until the catalog publishes its indicator. The patients KPI uses the reference's wording.
The kit's notes are no longer appended to CaMa's opportunity cards (they stay in the figure footers, Histórico and Datos y definiciones). The four cards measure 308 x 220 px at 1366 px, like the reference. TEA keeps its notes and CaCu already hid them.
GET /<dominio>/seguimiento with the window, page, size, cut-off date and the filters the list announces. Filters and columns come with the answer; only demonstration answers (simulado: true) are accepted and anything outside the contract is rejected before it reaches a view. The fixture is the synthetic answer of the reference prototype and is used by tests only.
The tab asks GET /cama/seguimiento when it is first opened and draws the form,
the table, the details and the pagination from what the answer announces, so a
later change of source behind the endpoint needs no change here. It shows the
demonstration notice when the answer is simulated, a clear pending state while
the endpoint is not published (404 on the first page), and error, empty and
retry states. Stale requests are cancelled.

The sections, CaCu and initial-integration specs now expect the CaMa request
when the tab opens.
The card for cama_histopatologia_birads now shows rates with their Wilson
interval per BI-RADS category and a two-ring donut of the biopsy result, with
group and category selection, period navigation and the published values table.
A pure adapter turns the stratified C2 response into rows and figures; the view
only asks for the data and draws what the adapter returns.

BI-RADS 4 is a row of its own. The denominator is benign, B3, in situ and
invasive; no biopsy and no data are reported apart. A published zero is a zero,
a suppressed cell is suppressed, and a cell or stratum the response does not
carry is unavailable, never zero: no rate or donut total is drawn over an
incomplete matrix. The card keeps its place first in the summary and stays
pending while the catalog does not publish the indicator.

The `birads` stratum is added to the accepted dimensions of the data request.
The CaCu cytology confirmation view is not touched.
CAM-01 and CAM-02 already had their KPI cards and history panels waiting for the
catalog; they are now covered with the answers WebApi gives for the synthetic
base, both visible (lowered suppression threshold) and suppressed (normal
threshold). Once published they draw only their KPI card in the summary, as the
mockup does, instead of an extra generic figure card; their evolution stays in
the history.

The stacked history figure now keeps a category the catalog announces even when
no row carries it, so a missing category is named under the figure instead of
silently disappearing. The integration specs also cover the summary and the
history with CAM-01, CAM-02 and CAM-03 published.
The rates figure lets the category labels size their own margin, shortens the
axis title, keeps few ticks and wraps «BI-RADS 4 sin subtipo» when the window is
600 px wide or less, and is redrawn when the window crosses that width. Values
and states are unchanged. The reading text keeps the capitals of a category
code inside a sentence («lesión de riesgo (B3)»).
CaMa header reads "Sistema TNM de clasificación tumoral" without the top subtitle.
The general filters block is titled "Filtros generales" and drops the scope
description and the applied-filter summary. In the Histórico the suppressed-data
text becomes a collapsed footnote (details/summary) with the same full text.
CaCu and TEA headers and filters are unchanged.
The follow-up list of breast cancer can now be opened on a selection that the analysis names: the
whole cohort (window 0, offered only while the selection is active), the cut-off the analysis was
computed at, the group's filter, and the cohort with its revision, which the server requires and
repeats.

- A cohort's list quotes `cohorte`, `escenario` and `revision` (not filters) on every page and in the
  export; an answer that loses a filter, changes the window or the cut-off, or is another cohort or
  revision is not drawn and cannot be exported.
- A new selection cancels the previous request; while it loads, and when it fails (403, 409, 503),
  no list of the previous query stays on screen.
- Inside the cohort the form refines the same cohort and says so; "Quitar selección" leaves it.
- "Volver al análisis" and a note when the list holds a different number of patients than the
  analysis counted.
- PDF and XLSX state the selection, the cut-off and "Toda la cohorte"; the file name tells a
  selection apart; an export in progress is cancelled, and a finished one discarded, when the query
  on screen changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A CaMa-only tab between Histórico and Seguimiento shows how many patients of the cohort fall in
each BI-RADS category at a cut-off (GET /cama/analisis/indicadores?corte=), as the cohort API
publishes it. It is a descriptive count, not an incidence or a survival estimate.

- Loading, pending (404), unavailable (503), error and out-of-contract states; the answer is
  validated as an aggregate (no patient rows, nothing published under the threshold).
- A suppressed category is drawn grey and says why; only a published category opens its patients
  in Seguimiento ("Ver pacientes" or a click on its bar).
- The page keeps the selection while the user moves between tabs, clears it on a domain change, and
  "Volver al análisis" returns to the analysis as it was, with the scroll and the focus on the
  control that opened the list, and no new request.
- Tables and figure scroll inside their own region at phone width. CaCu and TEA keep their three
  sections. Curves, the heatmap and the cohort diagnostics of the prototype wait for an API.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contract review against WebApi 1d5f1e0 (webapi/cama_analysis.py, cama_cohort.py, docs/cama-cohort-api.md).

- The cohort's list is rewritten once on arrival so the table, the record and the PDF/XLSX show
  "BI-RADS 5" and "50 a 59 años" (also "Menores de 40 años", "70 años o más", "Sin dato"); the codes
  stay in `<clave>_codigo` and in the filter options, which are what the requests send. Only codes
  whose meaning the API's own code confirms are labelled; biopsy grades are left as they arrive.
- The record calls the biopsy date what the list calls it ("Fecha de reporte"): in the cohort it is
  the date of the biopsy report, which can be known while its result is not.
- With the same cohort revision, cut-off and filter the aggregate and the list are counted from the
  same rows, so a different total breaks the contract: the list shows an alert and its PDF/XLSX
  buttons are disabled.
- When no category is published the analysis says so and keeps "No publicado": the answer cannot
  tell an empty cohort from categories under the threshold.
- Tests: the chosen cut-off reaches the aggregate, the list, the record and every page of the file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The follow-up tab of breast cancer now reads the cohort the analysis publishes: it asks for the
cohort's revision at today's cut-off and lists the whole cohort quoting it. Where the server does
not publish the cohort (404 or 503 on its aggregate) the plain follow-up list is read.

- Another cut-off in the form asks for that cut-off's revision before the list; a revision that
  changes under the list (409) is asked for again once and the same query repeated, and a conflict
  that persists is reported.
- "Quitar selección" returns to the whole cohort instead of another source.
- An empty whole cohort says "Sin pacientes para el corte seleccionado"; filters and windows keep
  the text of the filters.
- Filters, cut-off, page and rows are kept while a record is opened and closed.
- Page specs that open CaMa follow-up answer the aggregate first.
The follow-up list asks for the regular window without quoting a revision; when the answer
names a cohort the next pages and the files quote it. A new cut-off or a revision that changed
under the list is asked for again without the old revision (once, then reported). Leaving the
analysis' selection returns to the regular window. A server that does not answer from the cohort
keeps the plain list.

Histopathology codes are written with the catalog labels (Benigno, Carcinoma in situ, Carcinoma
invasor, Desconocido); other values stay as they arrive.
# Conflicts:
#	src/app/features/indicadores/etiquetas-cohorte.ts
#	src/app/features/indicadores/indicadores-seguimiento-cohorte.spec.ts
Rows name their patient with pac_id (a decimal string) or the legacy
id_seudonimo. pac_id wins; an invalid pac_id is never replaced by the
legacy field, and a page that repeats a patient or mixes both fields is
not drawn or exported. The table, patient record, PDF and spreadsheet
follow the announced identifier column and label. CaCu requests risk
only with a pac_id.
The visually-hidden labels are absolutely positioned and had no positioned ancestor in the view, so they were laid out against the document and, with the table far down the page, gave the document its own vertical scroll next to the one of the page container. The view is now their containing block.
roberto merged commit 2834fac85c into dev 2026-11-16 21:09:08 -06:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ISSSTELEON/WebApp#9