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.
This commit is contained in:
@@ -19,7 +19,7 @@ export const forestTitle = 'Razones de momios por par';
|
||||
export const probabilityTitle = 'Probabilidad según z';
|
||||
|
||||
const calculation =
|
||||
'El modelo estima, para cada par de métrica o zona del EEG y resultado del ADOS-2, la probabilidad de un puntaje elevado de severidad calibrada (CSS) o de un ítem alterado. La razón de momios corresponde al cambio asociado con una unidad de z. La probabilidad de referencia corresponde a z = 0, la edad media y el módulo más frecuente de la cohorte.';
|
||||
'Para cada alteración del EEG y región cerebral, el modelo da la probabilidad de que un ítem, un área o el puntaje total (CSS) del ADOS-2 salga severo, comparado con un niño en la referencia (z = 0).';
|
||||
const limitations =
|
||||
'Las estimaciones dependen de la cohorte de referencia, de la calidad del EEG y de la disponibilidad de mediciones y pares. Las asociaciones no establecen causalidad. Las probabilidades no sustituyen la evaluación clínica ni establecen un diagnóstico.';
|
||||
|
||||
@@ -87,7 +87,7 @@ export function recordSections(patient: TeaPatient, norms: ReadonlyMap<string, C
|
||||
blocks: [
|
||||
{
|
||||
table: {
|
||||
headers: ['Par', 'OR', 'IC 95 %', 'Probabilidad', 'Referencia'],
|
||||
headers: ['Par', 'OR', 'IC 95 %', 'Prob. ADOS-2 severo', 'Referencia'],
|
||||
rows: associationRows(patient.pairs),
|
||||
},
|
||||
},
|
||||
@@ -133,8 +133,11 @@ export function riskSections(patient: TeaPatient, alteredOnly: boolean, pair?: P
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Probabilidad frente a la referencia',
|
||||
blocks: [{ table: probabilityRows(patient.pairs) }],
|
||||
title: 'Probabilidad de un puntaje ADOS-2 severo',
|
||||
blocks: [
|
||||
{ table: probabilityRows(patient.pairs) },
|
||||
{ text: 'No es la probabilidad de TEA.' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: probabilityTitle,
|
||||
@@ -146,7 +149,7 @@ export function riskSections(patient: TeaPatient, alteredOnly: boolean, pair?: P
|
||||
|
||||
function probabilityRows(pairs: Pair[]): Table {
|
||||
return {
|
||||
headers: ['Par', 'Probabilidad', 'Referencia'],
|
||||
headers: ['Par', 'Prob. ADOS-2 severo', 'Referencia'],
|
||||
rows: pairs.map((p) => [
|
||||
p.headline ? `${p.title} (principal)` : p.title,
|
||||
percent(p.probability),
|
||||
|
||||
Reference in New Issue
Block a user