diff --git a/src/app.test.ts b/src/app.test.ts index 344705a..9be1e6e 100644 --- a/src/app.test.ts +++ b/src/app.test.ts @@ -103,13 +103,19 @@ describe('Express app (without Arranger)', () => { T21: 7266, D21: 1430, }, - ethnicity: { - 'Not Hispanic or Latino': 6710, - 'Hispanic or Latino': 850, - Unknown: 579, - 'asked but unknown': 494, - NoInformation: 30, - unknown: 10, + race: { + White: 7029, + 'Black or African American': 618, + Unknown: 408, + Asian: 269, + NoInformation: 131, + other: 66, + 'asked but unknown': 58, + 'More than one race': 37, + unknown: 35, + 'American Indian or Alaska Native': 34, + 'Native Hawaiian or Other Pacific Islander': 8, + 'not available': 3, }, diagnosis: [ { diff --git a/src/endpoints/statistics/index.ts b/src/endpoints/statistics/index.ts index 05a7ea2..b091791 100644 --- a/src/endpoints/statistics/index.ts +++ b/src/endpoints/statistics/index.ts @@ -35,7 +35,7 @@ export type Statistics = { transcriptomes: number; sex: Record; downSyndromeStatus: Record; - ethnicity: Record; + race: Record; diagnosis: Diagnosis[]; }; @@ -236,7 +236,7 @@ export const fetchDemographicsStats = async (client: Client): Promise { + const race = response.body.responses[2].aggregations.race.buckets.reduce((acc, curr) => { acc[curr.key] = curr.doc_count; return acc; }, {}); - return [sex, downSyndromeStatus, ethnicity]; + return [sex, downSyndromeStatus, race]; }; export const fetchTopDiagnosis = async (client: Client): Promise => { @@ -318,7 +318,7 @@ export const getStatistics = async (): Promise => { transcriptomes: results[8], sex: results[9][0], downSyndromeStatus: results[9][1], - ethnicity: results[9][2], + race: results[9][2], diagnosis, }; };