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:
2026-11-30 16:56:26 -06:00
parent e5556ebf41
commit b847e04697
8 changed files with 301 additions and 60 deletions
+37 -11
View File
@@ -47,14 +47,32 @@ const ados: Observation = {
valueInteger: 0,
component: [
{ 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 },
},
{ code: { coding: [{ code: 'ados2.response_to_name' }], text: 'Respuesta al nombre' } },
],
};
@@ -134,7 +152,7 @@ describe('Figuras del paciente 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);
fixture.componentRef.setInput(
'section',
@@ -142,10 +160,10 @@ describe('Expediente TEA', () => {
);
await fixture.whenStable();
const rows = fixture.nativeElement.querySelectorAll('tbody tr');
expect(rows).toHaveLength(22);
expect(rows[0].textContent).toContain('SA');
expect(rows[0].cells[2].textContent.trim()).toBe('0');
expect(rows[21].textContent).toContain('RRB');
expect(rows).toHaveLength(2);
const cells = Array.from(rows[0].cells, (c: HTMLTableCellElement) => c.textContent?.trim());
expect(cells).toEqual(['Afectación social (AS)', 'Comunicación', 'A-7', 'Señalar', '0']);
expect(rows[1].cells[2].textContent.trim()).toBe('A-3');
});
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({
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==' }),