From f3f3eea84e7b1975c3dfeddab29892e4475d393a Mon Sep 17 00:00:00 2001 From: shefki Date: Thu, 2 Apr 2020 19:42:08 +0200 Subject: [PATCH] UI Navigation page -> MWL tab : SOPClassesInStudy sent as query filter in MWL requests #2456 --- .../src/app/study/study/study.component.ts | 2 +- .../src/app/study/study/study.service.ts | 60 ++++++++++++++++++- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/dcm4chee-arc-ui2/src/app/study/study/study.component.ts b/dcm4chee-arc-ui2/src/app/study/study/study.component.ts index b4ff0aa020..5b73c34075 100644 --- a/dcm4chee-arc-ui2/src/app/study/study/study.component.ts +++ b/dcm4chee-arc-ui2/src/app/study/study/study.component.ts @@ -258,7 +258,7 @@ export class StudyComponent implements OnInit, OnDestroy, AfterContentChecked{ this.route.params.subscribe(params => { this.patients = []; this.internal = !this.internal; - console.log("this.selectedElements",this.selectedElements); + this.service.clearFilterObject(params.tab, this.filter); this.studyConfig.tab = undefined; setTimeout(()=>{ this.internal = !this.internal; diff --git a/dcm4chee-arc-ui2/src/app/study/study/study.service.ts b/dcm4chee-arc-ui2/src/app/study/study/study.service.ts index b11545ad99..698439fc85 100644 --- a/dcm4chee-arc-ui2/src/app/study/study/study.service.ts +++ b/dcm4chee-arc-ui2/src/app/study/study/study.service.ts @@ -5,8 +5,8 @@ import { DicomLevel, DicomMode, DicomResponseType, DiffAttributeSet, - FilterSchema, - SelectDropdown, SelectedDetailObject, SelectionAction, + FilterSchema, FilterSchemaElement, + SelectDropdown, SelectedDetailObject, SelectionAction, StudyFilterConfig, UniqueSelectIdObject } from "../../interfaces"; import {Globalvar} from "../../constants/globalvar"; @@ -236,6 +236,62 @@ export class StudyService { return dropdown; }; + clearFilterObject(tab: DicomMode, filterObject:StudyFilterConfig){ + const keys = this.getFilterKeysFromTab(tab); + Object.keys(filterObject.filterModel).forEach(filterKey=>{ + if(keys.indexOf(filterKey) === -1){ + delete filterObject.filterModel[filterKey]; + } + }); + } + + getFilterKeysFromTab(tab:DicomMode){ + if(tab){ + return (()=>{ + switch (tab) { + case "patient": + return [ + ...Globalvar.PATIENT_FILTER_SCHEMA([], false), + ...Globalvar.PATIENT_FILTER_SCHEMA([], true) + ].filter(filter => { + return filter.filterKey != "aet"; + }); + break; + case "mwl": + return [ + ...Globalvar.MWL_FILTER_SCHEMA(false), + ...Globalvar.MWL_FILTER_SCHEMA(true) + ]; + break; + case "uwl": + return [ + ...Globalvar.UWL_FILTER_SCHEMA(false), + ...Globalvar.UWL_FILTER_SCHEMA(true) + ]; + break; + case "diff": + return [ + ...Globalvar.DIFF_FILTER_SCHEMA([],[],false), + ...Globalvar.DIFF_FILTER_SCHEMA([],[],true) + ].filter(filter => { + return filter.filterKey != "aet"; + }); + break; + default: + return [ + ...Globalvar.STUDY_FILTER_SCHEMA([],false), + ...Globalvar.STUDY_FILTER_SCHEMA([],true) + ].filter(filter => { + return filter.filterKey != "aet"; + }); + } + })().map((filterSchemaElement:FilterSchemaElement)=>{ + return filterSchemaElement.filterKey; + }) + } + return []; + } + getFilterSchema(tab: DicomMode, aets: Aet[], quantityText: { count: string, size: string }, filterMode: ('main' | 'expand'), webApps?: DcmWebApp[], attributeSet?:SelectDropdown[],showCount?:boolean) { let schema: FilterSchema; let lineLength: number = 3;