From 54ffec1027355e91e47999ee2a5441e3121236e0 Mon Sep 17 00:00:00 2001 From: evans-g-crsj Date: Fri, 10 Jan 2025 14:13:07 -0500 Subject: [PATCH] :pencil: Change property name for upset response (elems to sets) --- src/endpoints/upset.test.ts | 8 ++++---- src/endpoints/upset.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/endpoints/upset.test.ts b/src/endpoints/upset.test.ts index e39eebe..1c103e0 100644 --- a/src/endpoints/upset.test.ts +++ b/src/endpoints/upset.test.ts @@ -266,10 +266,10 @@ describe('Upset', () => { const result = await computeUpset(sqon); expect(result).toEqual({ data: [ - { name: 'Abnormality of the eye (HP:0000478)', elems: ['pt-223twf8ytr', 'pt-2282xh6dem'] }, - { name: 'Seizure (HP:0001250)', elems: ['pt-223twf8ytr'] }, - { name: 'Ventricular septal defect (HP:0001629)', elems: ['pt-2282xh6dem'] }, - { name: 'Abnormality of the dentition (HP:0000164)', elems: ['pt-2282xh6dem'] }, + { name: 'Abnormality of the eye (HP:0000478)', sets: ['pt-223twf8ytr', 'pt-2282xh6dem'] }, + { name: 'Seizure (HP:0001250)', sets: ['pt-223twf8ytr'] }, + { name: 'Ventricular septal defect (HP:0001629)', sets: ['pt-2282xh6dem'] }, + { name: 'Abnormality of the dentition (HP:0000164)', sets: ['pt-2282xh6dem'] }, ], participantsCount: 2, }); diff --git a/src/endpoints/upset.ts b/src/endpoints/upset.ts index 88dd910..5b89508 100644 --- a/src/endpoints/upset.ts +++ b/src/endpoints/upset.ts @@ -5,7 +5,7 @@ import EsInstance from '../ElasticSearchClientInstance'; export type UpsetData = { name: string; - elems: string[]; + sets: string[]; }[]; export const countIt = (xs: string[]): Map => { @@ -114,7 +114,7 @@ export const computeUpset = async ( const pts = ps.reduce((ys, y) => (y.ph.includes(x) ? [...ys, y.patient] : ys), []); return { name: x, - elems: pts, + sets: pts, }; });