Skip to content

Commit

Permalink
feat(catalogue): model update to 5.2 (#4345)
Browse files Browse the repository at this point in the history
* add internal identifiers table
* add Internal identifiers ontology file and adapt ext identifiers
* add Resources.exclusion criteria and .other exclusion criteria
* add Subpopulations.exclusion criteria .other exclusion criteria
* rename Inclusion Exclusion Criteria table
* edit NetworksStaging profile
  • Loading branch information
BrendaHijmans authored Oct 20, 2024
1 parent 15ad576 commit 9b22e28
Show file tree
Hide file tree
Showing 24 changed files with 1,432 additions and 225 deletions.
6 changes: 5 additions & 1 deletion apps/nuxt3-ssr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@ Runtime config options can be set via query param to test/debug options:
- logo: ```logo=[logo-file-name-without-extension]```
- feature flag cohorts only: ```cohort-only=true``` // defaults to false

for example ```.../catalogue-demo/ssr-catalogue?cohort-only=true&theme=umcg&logo=UMCGkort.woordbeeld```
for example ```.../catalogue-demo/ssr-catalogue?cohort-only=true&theme=umcg&logo=UMCGkort.woordbeeld```

### generate types

gradle generateTypes --args='catalogue apps/nuxt3-ssr/interfaces/catalogue.ts'
33 changes: 32 additions & 1 deletion apps/nuxt3-ssr/components/SubpopulationDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,40 @@ if (subpopulation?.countries) {
}
if (subpopulation?.inclusionCriteria) {
items.push({
label: "Inclusion criteria",
content: renderList(
subpopulation.inclusionCriteria.sort(
(a, b) => (b.order ?? 0) - (a.order ?? 0)
),
toName
),
});
}
if (subpopulation?.otherInclusionCriteria) {
items.push({
label: "Other inclusion criteria",
content: subpopulation.inclusionCriteria,
content: subpopulation.otherInclusionCriteria,
});
}
if (subpopulation?.exclusionCriteria) {
items.push({
label: "Exclusion criteria",
content: renderList(
subpopulation.exclusionCriteria.sort(
(a, b) => (b.order ?? 0) - (a.order ?? 0)
),
toName
),
});
}
if (subpopulation?.otherExclusionCriteria) {
items.push({
label: "Other exclusion criteria",
content: subpopulation.otherExclusionCriteria,
});
}
Expand Down
11 changes: 10 additions & 1 deletion apps/nuxt3-ssr/gql/subpopulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ export default gql`
name
order
}
inclusionCriteria
inclusionCriteria {
name
order
}
otherInclusionCriteria
exclusionCriteria {
name
order
}
otherExclusionCriteria
comorbidity {
name
code
Expand Down
31 changes: 27 additions & 4 deletions apps/nuxt3-ssr/interfaces/catalogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,16 @@ export interface IICDOTopologies {
children?: IICDOTopologies[];
}

export interface IInclusionCriteria {
export interface IInclusionExclusionCriteria {
order?: number;
name: string;
label?: string;
parent?: IInclusionCriteria;
parent?: IInclusionExclusionCriteria;
codesystem?: string;
code?: string;
ontologyTermURI?: string;
definition?: string;
children?: IInclusionCriteria[];
children?: IInclusionExclusionCriteria[];
}

export interface IInformedConsentRequired {
Expand All @@ -418,6 +418,25 @@ export interface IInformedConsentTypes {
children?: IInformedConsentTypes[];
}

export interface IInternalIdentifierTypes {
order?: number;
name: string;
label?: string;
parent?: IInternalIdentifierTypes;
codesystem?: string;
code?: string;
ontologyTermURI?: string;
definition?: string;
children?: IInternalIdentifierTypes[];
}

export interface IInternalIdentifiers {
resource: IResources;
identifier: string;
internalIdentifierType?: IOntologyNode;
internalIdentifierTypeOther?: string;
}

export interface IKeywords {
order?: number;
name: string;
Expand Down Expand Up @@ -667,7 +686,8 @@ export interface IResources {
networkType?: IOntologyNode[];
website?: string;
description?: string;
keywords?: string;
keywords?: string[];
internalIdentifiers?: IInternalIdentifiers[];
externalIdentifiers?: IExternalIdentifiers[];
startYear?: number;
endYear?: number;
Expand Down Expand Up @@ -698,6 +718,8 @@ export interface IResources {
populationAgeGroups?: IOntologyNode[];
inclusionCriteria?: IOntologyNode[];
otherInclusionCriteria?: string;
exclusionCriteria?: IOntologyNode[];
otherExclusionCriteria?: string;
populationEntry?: IOntologyNode[];
populationEntryOther?: string;
populationExit?: IOntologyNode[];
Expand Down Expand Up @@ -948,6 +970,7 @@ export interface ISubpopulations {
countries?: IOntologyNode[];
regions?: IOntologyNode[];
inclusionCriteria?: string;
exclusionCriteria?: string;
}

export interface ITitles {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const query = gql`
populationOncologyMorphology ${moduleToString(ontologyFragment)}
inclusionCriteria ${moduleToString(ontologyFragment)}
otherInclusionCriteria
exclusionCriteria ${moduleToString(ontologyFragment)}
otherExclusionCriteria
publications(orderby: {title:ASC}) {
doi
title
Expand Down Expand Up @@ -403,6 +405,15 @@ const population: IDefinitionListItem[] = [
label: "Other inclusion criteria",
content: resource.value.otherInclusionCriteria,
},
{
label: "Exclusion criteria",
type: "ONTOLOGY",
content: resource.value.exclusionCriteria,
},
{
label: "Other exclusion criteria",
content: resource.value.otherExclusionCriteria,
},
];
if (mainMedicalConditions.value && mainMedicalConditions.value.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,40 @@ if (subpopulation?.countries) {
}
if (subpopulation?.inclusionCriteria) {
items.push({
label: "Inclusion criteria",
content: renderList(
subpopulation.inclusionCriteria.sort(
(a, b) => (b.order ?? 0) - (a.order ?? 0)
),
toName
),
});
}
if (subpopulation?.otherInclusionCriteria) {
items.push({
label: "Other inclusion criteria",
content: subpopulation.inclusionCriteria,
content: subpopulation.otherInclusionCriteria,
});
}
if (subpopulation?.exclusionCriteria) {
items.push({
label: "Exclusion criteria",
content: renderList(
subpopulation.exclusionCriteria.sort(
(a, b) => (b.order ?? 0) - (a.order ?? 0)
),
toName
),
});
}
if (subpopulation?.otherExclusionCriteria) {
items.push({
label: "Other exclusion criteria",
content: subpopulation.otherExclusionCriteria,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,21 @@ public ImportProfileTask(Schema schema, String configLocation, boolean includeDe
@Override
public void run() {
this.start();
Task commitTask = new Task();
try {
schema.tx(
db -> {
Schema s = db.getSchema(schema.getName());
load(s);
this.addSubTask(commitTask);
commitTask.setDescription("Committing");
});
} catch (Exception e) {
commitTask.completeWithError("Commit failed: " + e.getMessage());
this.completeWithError(e.getMessage());
throw (e);
}
commitTask.complete();
this.complete();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public void test01FAIRDataHubLoader() {
void test06DataCatalogueLoader() {
Schema dataCatalogue = database.createSchema(DATA_CATALOGUE);
DataModels.Profile.DATA_CATALOGUE.getImportTask(dataCatalogue, true).run();
assertEquals(22, dataCatalogue.getTableNames().size());
assertEquals(23, dataCatalogue.getTableNames().size());
}

@Test
public void test07DataCatalogueCohortStagingLoader() {
Schema cohortStaging = database.createSchema(COHORT_STAGING);
DataModels.Profile.DATA_CATALOGUE_COHORT_STAGING.getImportTask(cohortStaging, true).run();
assertEquals(17, cohortStaging.getTableNames().size());
assertEquals(18, cohortStaging.getTableNames().size());
}

@Disabled
Expand Down
1 change: 1 addition & 0 deletions backend/molgenis-emx2-typescript/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ dependencies {
task generateTypes(type: JavaExec) {
group = 'application'
classpath = sourceSets.main.runtimeClasspath
workingDir = rootProject.projectDir
main = 'org.molgenis.emx2.typescript.AToolToGenerateTypeScriptTypes'
}
Loading

0 comments on commit 9b22e28

Please sign in to comment.