Skip to content

Commit

Permalink
feat: CQDG-895 add new study metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulous committed Oct 21, 2024
1 parent 10faf33 commit 35b5194
Show file tree
Hide file tree
Showing 3 changed files with 332 additions and 1 deletion.
290 changes: 290 additions & 0 deletions src/graphql/study/extendedMapping.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AggregationsType, { NumericAggregationsType } from '@ferlab/next/lib/common/types/aggregationsType';

const extendedMapping = [
{
unit: null,
Expand Down Expand Up @@ -558,6 +560,294 @@ const extendedMapping = [
gqlId: 'cqdg::Study::extended::study_version',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'data_collection_methods',
displayName: 'Data Collection Methods',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::data_collection_methods',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'study_designs',
displayName: 'Design',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::study_designs',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'restricted',
displayName: 'Restricted',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::restricted',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'study_designs',
displayName: 'Study Designs',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::study_designs',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'data_collection_methods',
displayName: 'Data Collection Methods',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::data_collection_methods',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'expected_number_participants',
displayName: 'Expected Number Participants',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::expected_number_participants',
primaryKey: false,
},

{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'expected_number_biospecimens',
displayName: 'Expected Number Biospecimens',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::expected_number_biospecimens',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'expected_number_files',
displayName: 'Expected Number Files',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::expected_number_files',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'restricted_number_participants',
displayName: 'Restricted Number Participants',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::restricted_number_participants',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'restricted_number_biospecimens',
displayName: 'Restricted Number Biospecimens',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::restricted_number_biospecimens',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'restricted_number_files',
displayName: 'Restricted Number Files',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::restricted_number_files',
primaryKey: false,
},

{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'principal_investigators',
displayName: 'Principal Investigators',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::principal_investigators',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'contact_names',
displayName: 'Contact Names',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::contact_names',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'contact_extensions',
displayName: 'Contact Extensions',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::contact_extensions',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'contact_institutions',
displayName: 'Contact Institutions',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::contact_institutions',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'contact_emails',
displayName: 'Contact Emails',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::contact_emails',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'telecom',
displayName: 'Telecom',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::telecom',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'website',
displayName: 'Website',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::website',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'funding_sources',
displayName: 'Funding Sources',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::funding_sources',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'citation_statement',
displayName: 'Citation Statement',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::citation_statement',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'selection_criteria',
displayName: 'Selection Criteria',
active: false,
isArray: false,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::selection_criteria',
primaryKey: false,
},
{
unit: null,
displayValues: {},
quickSearchEnabled: false,
field: 'expected_items',
displayName: 'Expected Items',
active: false,
isArray: true,
rangeStep: 1,
type: 'keyword',
gqlId: 'cqdg::Study::extended::expected_items',
primaryKey: false,
},
];

export default extendedMapping;
22 changes: 21 additions & 1 deletion src/graphql/study/types/study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,32 @@ export const StudyType = new GraphQLObjectType({
security: { type: GraphQLString },
status: { type: GraphQLString },
study_version: { type: GraphQLString },
contact: { type: StudyContactType },
access_authority: { type: StudyContactType },
data_access_codes: { type: DataAccessCodesType },
data_categories: { type: DataCategoriesType },
data_types: { type: DataTypesType },
datasets: { type: DataSetsType },
experimental_strategies: { type: ExperimentalStrategiesType },
restricted: { type: GraphQLBoolean },
study_designs: { type: new GraphQLList(GraphQLString) },
data_collection_methods: { type: new GraphQLList(GraphQLString) },
expected_number_participants: { type: GraphQLFloat },
expected_number_biospecimens: { type: GraphQLFloat },
expected_number_files: { type: GraphQLFloat },
restricted_number_participants: { type: GraphQLFloat },
restricted_number_biospecimens: { type: GraphQLFloat },
restricted_number_files: { type: GraphQLFloat },
principal_investigators: { type: new GraphQLList(GraphQLString) },
contact_names: { type: new GraphQLList(GraphQLString) },
contact_extensions: { type: new GraphQLList(GraphQLString) },
contact_institutions: { type: new GraphQLList(GraphQLString) },
contact_emails: { type: new GraphQLList(GraphQLString) },
telecom: { type: GraphQLString },
websites: { type: new GraphQLList(GraphQLString), resolve: (parent) => parent.website },
funding_sources: { type: new GraphQLList(GraphQLString) },
citation_statement: { type: GraphQLString },
selection_criteria: { type: GraphQLString },
expected_items: { type: new GraphQLList(GraphQLString) },
}),
extensions: {
nestedFields: ['data_categories', 'data_types', 'datasets', 'experimental_strategies'],
Expand Down
21 changes: 21 additions & 0 deletions src/graphql/study/types/studyAgg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const StudyAggType = new GraphQLObjectType({
contact__value: { type: AggregationsType },
data_access_codes__access_limitations: { type: AggregationsType },
data_access_codes__access_requirements: { type: AggregationsType },
data_categories__data_category: { type: AggregationsType },
data_categories__participant_count: { type: NumericAggregationsType },
data_category: { type: AggregationsType },
data_types__data_type: { type: AggregationsType },
Expand Down Expand Up @@ -39,6 +40,26 @@ const StudyAggType = new GraphQLObjectType({
study_code: { type: AggregationsType },
study_id: { type: AggregationsType },
study_version: { type: AggregationsType },
restricted: { type: AggregationsType },
study_designs: { type: AggregationsType },
data_collection_methods: { type: AggregationsType },
expected_number_participants: { type: NumericAggregationsType },
expected_number_biospecimens: { type: NumericAggregationsType },
expected_number_files: { type: NumericAggregationsType },
restricted_number_participants: { type: NumericAggregationsType },
restricted_number_biospecimens: { type: NumericAggregationsType },
restricted_number_files: { type: NumericAggregationsType },
principal_investigators: { type: AggregationsType },
contact_names: { type: AggregationsType },
contact_extensions: { type: AggregationsType },
contact_institutions: { type: AggregationsType },
contact_emails: { type: AggregationsType },
telecom: { type: AggregationsType },
website: { type: AggregationsType },
funding_sources: { type: AggregationsType },
citation_statement: { type: AggregationsType },
selection_criteria: { type: AggregationsType },
expected_items: { type: AggregationsType },
},
});

Expand Down

0 comments on commit 35b5194

Please sign in to comment.