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.
This commit is contained in:
@@ -0,0 +1,100 @@
|
|||||||
|
import type { Observation, ObservationComponent } from 'fhir/r4';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { ados2Component, ados2Groups } from './ados2';
|
||||||
|
import { EXT } from './fhir';
|
||||||
|
|
||||||
|
function item(
|
||||||
|
field: string,
|
||||||
|
domain: string,
|
||||||
|
subdomain: string,
|
||||||
|
code: string,
|
||||||
|
title: string,
|
||||||
|
value?: number,
|
||||||
|
): ObservationComponent {
|
||||||
|
return {
|
||||||
|
code: {
|
||||||
|
coding: [{ code: `ados2.${field}` }, { code, display: title }],
|
||||||
|
text: title,
|
||||||
|
},
|
||||||
|
extension: [
|
||||||
|
{ url: EXT + 'ados2-domain', valueCoding: { code: domain[0], display: domain } },
|
||||||
|
{ url: EXT + 'ados2-subdomain', valueCoding: { code: subdomain, display: subdomain } },
|
||||||
|
],
|
||||||
|
valueQuantity: value == null ? undefined : { value },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const AS = 'Afectación social (AS)';
|
||||||
|
const CRR = 'Comportamiento restringido y repetitivo (CRR)';
|
||||||
|
|
||||||
|
const observation: Observation = {
|
||||||
|
resourceType: 'Observation',
|
||||||
|
status: 'final',
|
||||||
|
code: { coding: [{ code: 'ados2' }] },
|
||||||
|
component: [
|
||||||
|
{ code: { coding: [{ code: 'ados2.module' }] }, valueCodeableConcept: { text: 'Módulo 1' } },
|
||||||
|
item('pointing', AS, 'Comunicación', 'A-7', 'Señalar', 2),
|
||||||
|
item('gestures', AS, 'Comunicación', 'A-8', 'Gestos', 1),
|
||||||
|
item(
|
||||||
|
'unusual_eye_contact',
|
||||||
|
AS,
|
||||||
|
'Interacción social recíproca',
|
||||||
|
'B-1',
|
||||||
|
'Contacto visual inusual',
|
||||||
|
),
|
||||||
|
item(
|
||||||
|
'intonation',
|
||||||
|
CRR,
|
||||||
|
'Comportamientos restringidos y repetitivos',
|
||||||
|
'A-3',
|
||||||
|
'Entonación de las vocalizaciones o verbalizaciones',
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
{ code: { coding: [{ code: 'ados2.response_to_name' }] } },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('Ítems del ADOS-2', () => {
|
||||||
|
it('agrupa los ítems del módulo por dominio y subdominio en su orden', () => {
|
||||||
|
expect(ados2Groups(observation)).toEqual([
|
||||||
|
{
|
||||||
|
domain: AS,
|
||||||
|
subdomains: [
|
||||||
|
{
|
||||||
|
subdomain: 'Comunicación',
|
||||||
|
items: [
|
||||||
|
{ code: 'A-7', title: 'Señalar', score: 2 },
|
||||||
|
{ code: 'A-8', title: 'Gestos', score: 1 },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
subdomain: 'Interacción social recíproca',
|
||||||
|
items: [{ code: 'B-1', title: 'Contacto visual inusual', score: undefined }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
domain: CRR,
|
||||||
|
subdomains: [
|
||||||
|
{
|
||||||
|
subdomain: 'Comportamientos restringidos y repetitivos',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
code: 'A-3',
|
||||||
|
title: 'Entonación de las vocalizaciones o verbalizaciones',
|
||||||
|
score: 3,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
expect(ados2Groups(undefined)).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('encuentra el ítem de una asociación por su número', () => {
|
||||||
|
expect(ados2Component(observation, 2)?.code.text).toBe('Señalar');
|
||||||
|
expect(ados2Component(observation, 8)?.code.coding?.[0].code).toBe('ados2.response_to_name');
|
||||||
|
expect(ados2Component(observation, 0)).toBeUndefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import type { Observation, ObservationComponent } from 'fhir/r4';
|
||||||
|
import { code, ext } from './fhir';
|
||||||
|
|
||||||
|
export const ADOS2_ITEMS = [
|
||||||
|
'vocalization_directed',
|
||||||
|
'pointing',
|
||||||
|
'gestures',
|
||||||
|
'unusual_eye_contact',
|
||||||
|
'facial_expressions',
|
||||||
|
'gaze_integration',
|
||||||
|
'shared_enjoyment',
|
||||||
|
'response_to_name',
|
||||||
|
'ignoring',
|
||||||
|
'requesting',
|
||||||
|
'showing',
|
||||||
|
'joint_attention_initiation',
|
||||||
|
'joint_attention_response',
|
||||||
|
'social_overtures_quality',
|
||||||
|
'social_overtures_caregiver',
|
||||||
|
'reciprocal_communication',
|
||||||
|
'rapport_quality',
|
||||||
|
'intonation',
|
||||||
|
'stereotyped_language',
|
||||||
|
'unusual_sensory_interest',
|
||||||
|
'hand_finger_mannerisms',
|
||||||
|
'repetitive_interests',
|
||||||
|
];
|
||||||
|
|
||||||
|
export interface Ados2Item {
|
||||||
|
code: string;
|
||||||
|
title: string;
|
||||||
|
score?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Ados2Subdomain {
|
||||||
|
subdomain: string;
|
||||||
|
items: Ados2Item[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Ados2Domain {
|
||||||
|
domain: string;
|
||||||
|
subdomains: Ados2Subdomain[];
|
||||||
|
}
|
||||||
|
|
||||||
|
function coded(component: ObservationComponent, name: string): string {
|
||||||
|
const coding = ext(component, name)?.valueCoding;
|
||||||
|
return coding?.display ?? coding?.code ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ados2Groups(observation: Observation | undefined): Ados2Domain[] {
|
||||||
|
const groups: Ados2Domain[] = [];
|
||||||
|
for (const component of observation?.component ?? []) {
|
||||||
|
const item = component.code.coding?.[1];
|
||||||
|
if (!ext(component, 'ados2-domain') || !item?.code) continue;
|
||||||
|
const domain = coded(component, 'ados2-domain');
|
||||||
|
const subdomain = coded(component, 'ados2-subdomain');
|
||||||
|
let group = groups.at(-1);
|
||||||
|
if (!group || group.domain !== domain) {
|
||||||
|
group = { domain, subdomains: [] };
|
||||||
|
groups.push(group);
|
||||||
|
}
|
||||||
|
let sub = group.subdomains.at(-1);
|
||||||
|
if (!sub || sub.subdomain !== subdomain) {
|
||||||
|
sub = { subdomain, items: [] };
|
||||||
|
group.subdomains.push(sub);
|
||||||
|
}
|
||||||
|
sub.items.push({
|
||||||
|
code: item.code,
|
||||||
|
title: component.code.text ?? item.display ?? item.code,
|
||||||
|
score: component.valueQuantity?.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ados2Component(
|
||||||
|
observation: Observation | undefined,
|
||||||
|
number: number,
|
||||||
|
): ObservationComponent | undefined {
|
||||||
|
const field = ADOS2_ITEMS[number - 1];
|
||||||
|
return observation?.component?.find((c) => field && code(c.code) === `ados2.${field}`);
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { Bundle, DiagnosticReport, Observation, Patient, RiskAssessment } from 'fhir/r4';
|
import type { Bundle, DiagnosticReport, Observation, Patient, RiskAssessment } from 'fhir/r4';
|
||||||
|
import { ados2Component, ados2Groups } from '../ados2';
|
||||||
import { code, ext, label, resources } from '../fhir';
|
import { code, ext, label, resources } from '../fhir';
|
||||||
|
|
||||||
/** One row of the follow-up list: what the list shows of a patient at the cut-off. */
|
/** One row of the follow-up list: what the list shows of a patient at the cut-off. */
|
||||||
@@ -212,31 +213,6 @@ export const TEA_STEPS = [
|
|||||||
{ code: 'eeg', label: 'EEG' },
|
{ code: 'eeg', label: 'EEG' },
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
const ADOS2_ITEMS = [
|
|
||||||
'vocalization_directed',
|
|
||||||
'pointing',
|
|
||||||
'gestures',
|
|
||||||
'unusual_eye_contact',
|
|
||||||
'facial_expressions',
|
|
||||||
'gaze_integration',
|
|
||||||
'shared_enjoyment',
|
|
||||||
'response_to_name',
|
|
||||||
'ignoring',
|
|
||||||
'requesting',
|
|
||||||
'showing',
|
|
||||||
'joint_attention_initiation',
|
|
||||||
'joint_attention_response',
|
|
||||||
'social_overtures_quality',
|
|
||||||
'social_overtures_caregiver',
|
|
||||||
'reciprocal_communication',
|
|
||||||
'rapport_quality',
|
|
||||||
'intonation',
|
|
||||||
'stereotyped_language',
|
|
||||||
'unusual_sensory_interest',
|
|
||||||
'hand_finger_mannerisms',
|
|
||||||
'repetitive_interests',
|
|
||||||
];
|
|
||||||
|
|
||||||
type Prediction = NonNullable<RiskAssessment['prediction']>[number];
|
type Prediction = NonNullable<RiskAssessment['prediction']>[number];
|
||||||
|
|
||||||
function associationPair(p: Prediction) {
|
function associationPair(p: Prediction) {
|
||||||
@@ -257,11 +233,9 @@ function associationPair(p: Prediction) {
|
|||||||
function concordance(headline?: ReturnType<typeof associationPair>, ados?: Observation): string {
|
function concordance(headline?: ReturnType<typeof associationPair>, ados?: Observation): string {
|
||||||
if (!headline || !ados || headline.probability == null || headline.reference == null) return '—';
|
if (!headline || !ados || headline.probability == null || headline.reference == null) return '—';
|
||||||
const outcome = headline.pair?.split('|')[2];
|
const outcome = headline.pair?.split('|')[2];
|
||||||
const item = ADOS2_ITEMS[Number(outcome?.match(/^ados2_item_(\d{2})$/)?.[1]) - 1];
|
const item = Number(outcome?.match(/^ados2_item_(\d{2})$/)?.[1]);
|
||||||
const score =
|
const score =
|
||||||
outcome === 'CSS'
|
outcome === 'CSS' ? ados.valueInteger : ados2Component(ados, item)?.valueQuantity?.value;
|
||||||
? ados.valueInteger
|
|
||||||
: ados.component?.find((c) => item && code(c.code) === `ados2.${item}`)?.valueQuantity?.value;
|
|
||||||
if (score == null) return '—';
|
if (score == null) return '—';
|
||||||
const event = score >= (outcome === 'CSS' ? 8 : 1);
|
const event = score >= (outcome === 'CSS' ? 8 : 1);
|
||||||
const predicted = headline.probability >= headline.reference;
|
const predicted = headline.probability >= headline.reference;
|
||||||
@@ -348,6 +322,7 @@ export function teaRows(page: Bundle) {
|
|||||||
evaluation.component?.find((c) => code(c.code) === 'ados2.module')?.valueCodeableConcept,
|
evaluation.component?.find((c) => code(c.code) === 'ados2.module')?.valueCodeableConcept,
|
||||||
),
|
),
|
||||||
classification: label(evaluation.interpretation?.[0]),
|
classification: label(evaluation.interpretation?.[0]),
|
||||||
|
groups: ados2Groups(evaluation),
|
||||||
},
|
},
|
||||||
eegs: eegs.map((e) => ({
|
eegs: eegs.map((e) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
|
|||||||
@@ -33,7 +33,17 @@ function fixture(): Bundle {
|
|||||||
effectiveDateTime: '2026-03-02',
|
effectiveDateTime: '2026-03-02',
|
||||||
valueInteger: 8,
|
valueInteger: 8,
|
||||||
component: [
|
component: [
|
||||||
{ code: { coding: [{ code: 'ados2.vocalization_directed' }] }, valueQuantity: { value: 1 } },
|
{
|
||||||
|
code: {
|
||||||
|
coding: [{ code: 'ados2.vocalization_directed' }, { code: 'A-2' }],
|
||||||
|
text: 'Frecuencia de la vocalización espontánea dirigida a otros',
|
||||||
|
},
|
||||||
|
extension: [
|
||||||
|
{ url: EXT + 'ados2-domain', valueCoding: { display: 'Afectación social (AS)' } },
|
||||||
|
{ url: EXT + 'ados2-subdomain', valueCoding: { display: 'Comunicación' } },
|
||||||
|
],
|
||||||
|
valueQuantity: { value: 1 },
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
const risk: RiskAssessment = {
|
const risk: RiskAssessment = {
|
||||||
@@ -178,7 +188,26 @@ describe('TEA indicators', () => {
|
|||||||
name: 'Ana',
|
name: 'Ana',
|
||||||
recordNumbers: ['123'],
|
recordNumbers: ['123'],
|
||||||
mchatScore: 9,
|
mchatScore: 9,
|
||||||
ados: { css: 8 },
|
ados: {
|
||||||
|
css: 8,
|
||||||
|
groups: [
|
||||||
|
{
|
||||||
|
domain: 'Afectación social (AS)',
|
||||||
|
subdomains: [
|
||||||
|
{
|
||||||
|
subdomain: 'Comunicación',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
code: 'A-2',
|
||||||
|
title: 'Frecuencia de la vocalización espontánea dirigida a otros',
|
||||||
|
score: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
eegs: [{ quality: 'Bueno', channels: 19 }],
|
eegs: [{ quality: 'Bueno', channels: 19 }],
|
||||||
headline: { pair: cssPair, or: 2, q: 0.01 },
|
headline: { pair: cssPair, or: 2, q: 0.01 },
|
||||||
concordance: 'Concordante',
|
concordance: 'Concordante',
|
||||||
|
|||||||
@@ -227,6 +227,36 @@
|
|||||||
<dt>Clasificación</dt>
|
<dt>Clasificación</dt>
|
||||||
<dd>{{ ados.classification || '—' }}</dd>
|
<dd>{{ ados.classification || '—' }}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@if (ados.groups.length) {
|
||||||
|
<table class="plain">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Código</th>
|
||||||
|
<th>Ítem</th>
|
||||||
|
<th>Puntaje</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
@for (group of ados.groups; track group.domain) {
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th colspan="3">{{ group.domain }}</th>
|
||||||
|
</tr>
|
||||||
|
@for (sub of group.subdomains; track sub.subdomain) {
|
||||||
|
<tr>
|
||||||
|
<th colspan="3">{{ sub.subdomain }}</th>
|
||||||
|
</tr>
|
||||||
|
@for (item of sub.items; track item.code) {
|
||||||
|
<tr>
|
||||||
|
<td>{{ item.code }}</td>
|
||||||
|
<td>{{ item.title }}</td>
|
||||||
|
<td>{{ item.score ?? '—' }}</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
}
|
||||||
|
</table>
|
||||||
|
}
|
||||||
} @else {
|
} @else {
|
||||||
<p>—</p>
|
<p>—</p>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import type {
|
|||||||
Patient,
|
Patient,
|
||||||
RiskAssessment,
|
RiskAssessment,
|
||||||
} from 'fhir/r4';
|
} from 'fhir/r4';
|
||||||
|
import { ados2Component, ados2Groups } from '../ados2';
|
||||||
import { code, ext, Fhir, label, resources } from '../fhir';
|
import { code, ext, Fhir, label, resources } from '../fhir';
|
||||||
|
|
||||||
const steps: Record<string, string> = {
|
const steps: Record<string, string> = {
|
||||||
@@ -42,14 +43,6 @@ const biomarkers: Record<string, string> = {
|
|||||||
gradient: 'anteroposterior_gradient',
|
gradient: 'anteroposterior_gradient',
|
||||||
};
|
};
|
||||||
|
|
||||||
const repetitive = new Set([
|
|
||||||
'ados2.intonation',
|
|
||||||
'ados2.stereotyped_language',
|
|
||||||
'ados2.unusual_sensory_interest',
|
|
||||||
'ados2.hand_finger_mannerisms',
|
|
||||||
'ados2.repetitive_interests',
|
|
||||||
]);
|
|
||||||
|
|
||||||
const classifications: Record<string, string> = {
|
const classifications: Record<string, string> = {
|
||||||
non_spectrum: 'Fuera del espectro',
|
non_spectrum: 'Fuera del espectro',
|
||||||
autism_spectrum: 'Espectro autista',
|
autism_spectrum: 'Espectro autista',
|
||||||
@@ -103,13 +96,17 @@ export function identity(patient: Patient): string[][] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function adosItems(observation: Observation): string[][] {
|
export function adosItems(observation: Observation): string[][] {
|
||||||
return (observation.component ?? [])
|
return ados2Groups(observation).flatMap((group) =>
|
||||||
.filter((item) => code(item.code) !== 'ados2.module')
|
group.subdomains.flatMap((sub) =>
|
||||||
.map((item) => [
|
sub.items.map((item) => [
|
||||||
shown(label(item.code)),
|
group.domain,
|
||||||
repetitive.has(code(item.code) ?? '') ? 'RRB' : 'SA',
|
sub.subdomain,
|
||||||
observationValue(item),
|
item.code,
|
||||||
]);
|
item.title,
|
||||||
|
shown(item.score),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function adosSummary(observation: Observation): string[][] {
|
export function adosSummary(observation: Observation): string[][] {
|
||||||
@@ -258,7 +255,6 @@ function associations(
|
|||||||
eeg: Study | undefined,
|
eeg: Study | undefined,
|
||||||
ados: Observation[],
|
ados: Observation[],
|
||||||
) {
|
) {
|
||||||
const items = ados[0] ? adosItems(ados[0]) : [];
|
|
||||||
return (risk?.prediction ?? [])
|
return (risk?.prediction ?? [])
|
||||||
.map((p): Pair => {
|
.map((p): Pair => {
|
||||||
const key = code(p.outcome) ?? '';
|
const key = code(p.outcome) ?? '';
|
||||||
@@ -274,7 +270,7 @@ function associations(
|
|||||||
title: [
|
title: [
|
||||||
metric?.title ?? metrics[biomarkers[biomarker]] ?? biomarker,
|
metric?.title ?? metrics[biomarkers[biomarker]] ?? biomarker,
|
||||||
zoneLabel(zone),
|
zoneLabel(zone),
|
||||||
item ? (items[Number(item[1]) - 1]?.[0] ?? outcome) : outcome,
|
item ? label(ados2Component(ados[0], Number(item[1]))?.code) || outcome : outcome,
|
||||||
].join(' · '),
|
].join(' · '),
|
||||||
headline: ext(p, 'association-headline')?.valueBoolean === true,
|
headline: ext(p, 'association-headline')?.valueBoolean === true,
|
||||||
altered: site?.outside != null && site.outside !== 0,
|
altered: site?.outside != null && site.outside !== 0,
|
||||||
|
|||||||
@@ -47,14 +47,32 @@ const ados: Observation = {
|
|||||||
valueInteger: 0,
|
valueInteger: 0,
|
||||||
component: [
|
component: [
|
||||||
{ code: { coding: [{ code: 'ados2.module' }] }, valueCodeableConcept: { text: 'Módulo 1' } },
|
{ code: { coding: [{ code: 'ados2.module' }] }, valueCodeableConcept: { text: 'Módulo 1' } },
|
||||||
...Array.from({ length: 21 }, (_, i) => ({
|
|
||||||
code: { coding: [{ code: `ados2.item${i}` }], text: `Ítem ${i + 1}` },
|
|
||||||
valueQuantity: i === 0 ? { value: 0 } : undefined,
|
|
||||||
})),
|
|
||||||
{
|
{
|
||||||
code: { coding: [{ code: 'ados2.intonation' }], text: 'Entonación' },
|
code: { coding: [{ code: 'ados2.pointing' }, { code: 'A-7' }], text: 'Señalar' },
|
||||||
|
extension: [
|
||||||
|
{ url: EXT + 'ados2-domain', valueCoding: { display: 'Afectación social (AS)' } },
|
||||||
|
{ url: EXT + 'ados2-subdomain', valueCoding: { display: 'Comunicación' } },
|
||||||
|
],
|
||||||
|
valueQuantity: { value: 0 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: {
|
||||||
|
coding: [{ code: 'ados2.intonation' }, { code: 'A-3' }],
|
||||||
|
text: 'Entonación de las vocalizaciones o verbalizaciones',
|
||||||
|
},
|
||||||
|
extension: [
|
||||||
|
{
|
||||||
|
url: EXT + 'ados2-domain',
|
||||||
|
valueCoding: { display: 'Comportamiento restringido y repetitivo (CRR)' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: EXT + 'ados2-subdomain',
|
||||||
|
valueCoding: { display: 'Comportamientos restringidos y repetitivos' },
|
||||||
|
},
|
||||||
|
],
|
||||||
valueQuantity: { value: 2 },
|
valueQuantity: { value: 2 },
|
||||||
},
|
},
|
||||||
|
{ code: { coding: [{ code: 'ados2.response_to_name' }], text: 'Respuesta al nombre' } },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -134,7 +152,7 @@ describe('Figuras del paciente TEA', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Expediente TEA', () => {
|
describe('Expediente TEA', () => {
|
||||||
it('muestra los 22 ítems del ADOS-2 y sus dominios sin incluir el módulo', async () => {
|
it('muestra solo los ítems del módulo con dominio, subdominio, código y título', async () => {
|
||||||
const fixture = TestBed.createComponent(TeaSection);
|
const fixture = TestBed.createComponent(TeaSection);
|
||||||
fixture.componentRef.setInput(
|
fixture.componentRef.setInput(
|
||||||
'section',
|
'section',
|
||||||
@@ -142,10 +160,10 @@ describe('Expediente TEA', () => {
|
|||||||
);
|
);
|
||||||
await fixture.whenStable();
|
await fixture.whenStable();
|
||||||
const rows = fixture.nativeElement.querySelectorAll('tbody tr');
|
const rows = fixture.nativeElement.querySelectorAll('tbody tr');
|
||||||
expect(rows).toHaveLength(22);
|
expect(rows).toHaveLength(2);
|
||||||
expect(rows[0].textContent).toContain('SA');
|
const cells = Array.from(rows[0].cells, (c: HTMLTableCellElement) => c.textContent?.trim());
|
||||||
expect(rows[0].cells[2].textContent.trim()).toBe('0');
|
expect(cells).toEqual(['Afectación social (AS)', 'Comunicación', 'A-7', 'Señalar', '0']);
|
||||||
expect(rows[21].textContent).toContain('RRB');
|
expect(rows[1].cells[2].textContent.trim()).toBe('A-3');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exporta las secciones, tablas y figuras con un nombre sin identificador', async () => {
|
it('exporta las secciones, tablas y figuras con un nombre sin identificador', async () => {
|
||||||
@@ -166,7 +184,15 @@ describe('Expediente TEA', () => {
|
|||||||
expect.objectContaining({ text: 'Relación con el ADOS-2' }),
|
expect.objectContaining({ text: 'Relación con el ADOS-2' }),
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
table: expect.objectContaining({
|
table: expect.objectContaining({
|
||||||
body: expect.arrayContaining([['Entonación', 'RRB', '2']]),
|
body: expect.arrayContaining([
|
||||||
|
[
|
||||||
|
'Comportamiento restringido y repetitivo (CRR)',
|
||||||
|
'Comportamientos restringidos y repetitivos',
|
||||||
|
'A-3',
|
||||||
|
'Entonación de las vocalizaciones o verbalizaciones',
|
||||||
|
'2',
|
||||||
|
],
|
||||||
|
]),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
expect.objectContaining({ image: 'data:image/png;base64,YQ==' }),
|
expect.objectContaining({ image: 'data:image/png;base64,YQ==' }),
|
||||||
|
|||||||
@@ -63,7 +63,10 @@ export function recordSections(patient: TeaPatient, norms: ReadonlyMap<string, C
|
|||||||
blocks: patient.ados.map((o) => ({
|
blocks: patient.ados.map((o) => ({
|
||||||
title: shown(o.effectiveDateTime),
|
title: shown(o.effectiveDateTime),
|
||||||
fields: adosSummary(o),
|
fields: adosSummary(o),
|
||||||
table: { headers: ['Ítem', 'Dominio', 'Puntaje'], rows: adosItems(o) },
|
table: {
|
||||||
|
headers: ['Dominio', 'Subdominio', 'Código', 'Ítem', 'Puntaje'],
|
||||||
|
rows: adosItems(o),
|
||||||
|
},
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user