Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pva/bugfixes for cdisc subsets and banner #314

Merged
merged 10 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ dependencies {
implementation 'org.springframework:spring-web:6.1.13' // Updated version
implementation 'org.springframework:spring-webmvc:6.1.13' // Updated version
// fixes netty resolver error for macos
implementation 'io.netty:netty-common:4.1.115.Final'
implementation 'io.netty:netty-resolver-dns-native-macos'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
Expand Down
68 changes: 36 additions & 32 deletions web/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"braces": "^3.0.3",
"chart.js": "^2.9.4",
"cookie": "^0.4.1",
"cross-spawn": "^7.0.6",
"eventsource": "^1.1.1",
"file-saver": "^2.0.5",
"follow-redirects": "^1.14.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div>
<p [innerHTML]="subsetDescription"></p>
</div>
<div *ngIf="subsetLink != null">
<div *ngIf="subsetLink != null && linkNotInDescription()">
Subset Download Link: <a href="{{ subsetLink }}" target="_blank">{{ subsetLink }}</a>
</div>
<div><br /></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ export class SubsetDetailsComponent implements OnInit {
this.subsetCodes = {};
this.subsets.unshift(this.selectedSubset);
this.subsets.forEach((c) => {
synonymMap.push(this.getSynonymSources(c['synonyms']));
if (c.inverseAssociations?.find((assoc) => assoc.type == 'Concept_In_Subset')) {
if (c && c['synonyms'].length > 0) {
synonymMap.push(this.getSynonymSources(c['synonyms']));
}
if (c && c['inverseAssociations'].length > 0 && c['inverseAssociations'].find((assoc) => assoc.type == 'Concept_In_Subset')) {
this.subsetCodes[c.code] = 1;
}
});
Expand Down Expand Up @@ -401,16 +403,25 @@ export class SubsetDetailsComponent implements OnInit {
getCdiscSubmissionValue(concept: Concept): string {
// If a single CDISC/PT, return it
const matchingSynonyms = concept.synonyms.filter((sy) => sy.source === 'CDISC' && sy.termType === 'PT');
if (matchingSynonyms.length==1) {
if (matchingSynonyms.length===1) {
return matchingSynonyms[0].name;
}
// Otherwise, find the one matching the sumissionValueCode
// Otherwise, find the one matching the submissionValueCode
const matchingSynonym = matchingSynonyms.find((sy) => sy.code === this.submissionValueCode);
if (matchingSynonym) {
return matchingSynonym.name;
}
// can't figure it out, just return the first again
return matchingSynonyms[0].name;
if(matchingSynonyms.length > 0)
return matchingSynonyms[0].name;

// if we get all the way here there isn't one
return null;

}

linkNotInDescription() {
const desc = this.selectedSubset.properties.find((item) => item.type === "Term_Browser_Value_Set_Description");
return (this.selectedSubset.subsetLink !== undefined && desc !== undefined && !desc.value.includes(this.selectedSubset.subsetLink));
}
}
20 changes: 12 additions & 8 deletions web/frontend/src/app/component/welcome/welcome.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class WelcomeComponent implements OnInit, OnDestroy, AfterViewInit {
welcomeText: any = null;
boilerPlateWelcomeText: any = 'Loading welcome text for ' + this.configService.getTerminologyName() + ' ...';
allTerminologies: any = null;
selectedMultiTerminologies = new Set();
selectedMultiTerminologies = new Set<String>();
checkboxStates: { [key: string]: boolean } = {}; // track the state of the checkbox based on terminology
private subscription = null;

Expand All @@ -37,23 +37,27 @@ export class WelcomeComponent implements OnInit, OnDestroy, AfterViewInit {
ngOnInit(): void {
this.route.queryParams
.subscribe(params => {
if (Object.keys(params).length > 0 && params.terminology !== 'multi' && !params.terminology.includes(',')) {
this.setWelcomeText(params.terminology != undefined ? params.terminology : 'ncit');
if (Object.keys(params).length > 0 && params.terminology !== 'multi' && params.terminology !== undefined && !params.terminology.includes(',')) {
this.setWelcomeText(params.terminology !== undefined ? params.terminology : 'ncit');
this.configService.setMultiSearch(false);
} else if (Object.keys(params).length > 0) {
if (params.terminology.includes(',')) {
if (params.terminology !== undefined && params.terminology.includes(',')) {
// populating saved terminologies in url
params.terminology.split(',').forEach(term => {
this.selectedMultiTerminologies.add(term);
});

this.configService.setMultiSearch(true);
} else if (params.terminology === "multi") {
this.configService.setMultiSearch(true);
}
else {
this.setWelcomeText(params.terminology !== undefined ? params.terminology : 'ncit');
this.configService.setMultiSearch(false);
}
this.configService.setMultiSearch(true);
}
this.allTerminologies = this.configService.getTerminologies().map((terminology) => {
// initialize checkboxStates for each terminology
const normalizedTerm = terminology.metadata.uiLabel.replace(/\:.*/, '').toLowerCase();
this.checkboxStates[normalizedTerm] = false;
this.checkboxStates[terminology.terminology] = this.selectedMultiTerminologies.has(terminology.terminology);
// set the checkbox state based on the selected terminologies
return {
label: terminology.metadata.uiLabel.replace(/\:.*/, ''),
Expand Down
Loading