Skip to content

Commit

Permalink
UI Navigation : Link instances to MWL does not consider all selected …
Browse files Browse the repository at this point in the history
…entities #2773
  • Loading branch information
shral committed Sep 17, 2020
1 parent ddc15a9 commit ab7bf14
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
17 changes: 14 additions & 3 deletions dcm4chee-arc-ui2/src/app/study/study/study.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class StudyComponent implements OnInit, OnDestroy, AfterContentChecked{
placeholder: $localize `:@@more_functions:More functions`,
options:[
new SelectDropdown("create_patient",$localize `:@@study.create_patient:Create patient`),
new SelectDropdown("upload_dicom",$localize`:@@study.create_patient:Upload DICOM Object`),
new SelectDropdown("upload_dicom",$localize`:@@study.upload_dicom_object:Upload DICOM Object`),
new SelectDropdown("permanent_delete",$localize `:@@study.short_permanent_delete:Permanent delete`, $localize `:@@study.permanent_delete:Delete rejected Instances permanently`),
new SelectDropdown("export_multiple",$localize `:@@study.export_multiple:Export matching studies`),
new SelectDropdown("reject_multiple",$localize `:@@study.reject_multiple:Reject matching studies`),
Expand Down Expand Up @@ -578,9 +578,20 @@ export class StudyComponent implements OnInit, OnDestroy, AfterContentChecked{
break;
case 'link':
this.service.linkStudyToMwl(this.selectedElements, this.studyWebService.selectedWebService, result.reject).subscribe(res=>{
this.appService.showMsg($localize `:@@study.study_and_mwl_linked_successfully:Study and MWL linked successfully!`);
this.clearClipboard();
console.log("res",res);
this.cfpLoadingBar.complete();
const errorCount = res.filter(result=>result.isError).length;
const msg = $localize `:@@study.process_executed_successfully_detailed:${this.service.getTextFromAction(this.selectedElements.action)}:@@action: process executed successfully:<br>\nErrors: ${errorCount}:@@error:<br>\nSuccessful: ${res.length - errorCount}:@@successfull:`;
if(errorCount === res.length){
this.appService.showError(msg);
}else{
if(errorCount > 0){
this.appService.showWarning(msg);
}else{
this.appService.showMsg(msg);
}
}
this.clearClipboard();
},err=>{
this.cfpLoadingBar.complete();
this.httpErrorHandler.handleError(err);
Expand Down
18 changes: 13 additions & 5 deletions dcm4chee-arc-ui2/src/app/study/study/study.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3193,13 +3193,21 @@ export class StudyService {
}
};

linkStudyToMwl(selectedElements:SelectionActionElement,dcmWebApp:DcmWebApp, rejectionCode){
linkStudyToMwl(selectedElements:SelectionActionElement,dcmWebApp:DcmWebApp, rejectionCode):Observable<any>{
try{
let observables = [];
const target:SelectedDetailObject = selectedElements.postActionElements.getAllAsArray()[0];
return this.$http.post(
`${this.getDicomURL("mwl", dcmWebApp)}/${target.object.attrs['0020000D'].Value[0]}/${_.get(target.object.attrs,'[00400100].Value[0][00400009].Value[0]')}/move/${rejectionCode}`,
selectedElements.preActionElements.getAllAsArray()[0].requestReady,
this.jsonHeader)
selectedElements.preActionElements.getAllAsArray().forEach(object=>{
const url = `${this.getDicomURL("mwl", dcmWebApp)}/${target.object.attrs['0020000D'].Value[0]}/${_.get(target.object.attrs,'[00400100].Value[0][00400009].Value[0]')}/move/${rejectionCode}`;
observables.push(this.$http.post(
url,
object.requestReady,
this.jsonHeader
).pipe(
catchError(err => of({isError: true, error: err})),
));
});
return forkJoin(observables);
}catch (e) {
return throwError(e);
}
Expand Down

0 comments on commit ab7bf14

Please sign in to comment.