Skip to content

Commit

Permalink
fix: SKFP-1281 update family count to use data from studies (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
aperron-ferlab authored Sep 24, 2024
1 parent 4a5a5e3 commit 65bec93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/endpoints/statistics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import filesize from 'filesize';

import EsInstance from '../../ElasticSearchClientInstance';
import { esBiospecimenIndex, esFileIndex, esParticipantIndex, esStudyIndex, esVariantIndex } from '../../esUtils';
import { biospecimenIdKey, familyIdKey, fileIdKey, participantIdKey, studyIdKey } from '../../fieldsKeys';
import { biospecimenIdKey, familyCountKey, fileIdKey, participantIdKey, studyIdKey } from '../../fieldsKeys';
import { isInclude } from '../../projectUtils';

export type Diagnosis = {
Expand Down Expand Up @@ -74,9 +74,9 @@ const fetchParticipantStats = async (client: Client): Promise<number> => {

const fetchFamilyStats = async (client: Client): Promise<number> => {
const { body } = await client.search({
index: esParticipantIndex,
index: esStudyIndex,
body: {
aggs: { types_count: { value_count: { field: familyIdKey } } },
aggs: { types_count: { value_count: { field: familyCountKey } } },
},
size: 0,
});
Expand Down
2 changes: 1 addition & 1 deletion src/fieldsKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const fileIdKey = 'file_id';
export const studyIdKey = 'study_id';
export const participantIdKey = 'participant_id';
export const biospecimenIdKey = 'sample_id';
export const familyIdKey = 'family.family_id';
export const familyCountKey = 'family_count';
export const participantKey = 'fhir_id';
export const participantFileKey = 'files.fhir_id';
export const participantBiospecimenKey = 'files.biospecimens.fhir_id';

0 comments on commit 65bec93

Please sign in to comment.