Skip to content

Commit

Permalink
adding aet model, starting to add study components end services, UI: …
Browse files Browse the repository at this point in the history
…Renewing Study page #1802
  • Loading branch information
shral committed Jan 24, 2019
1 parent d8234a4 commit d2e4a59
Show file tree
Hide file tree
Showing 16 changed files with 395 additions and 3 deletions.
7 changes: 7 additions & 0 deletions dcm4chee-arc-ui2/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ import { StorageVerificationComponent } from './monitoring/storage-verification/
import {StorageVerificationService} from "./monitoring/storage-verification/storage-verification.service";
import { ConfigTabComponent } from './configuration/config-tab.component';
import {DevicesService} from './configuration/devices/devices.service';
import {StudyTabComponent} from "./study/study-tab.component";
import { StudyComponent } from './study/study/study.component';
import {StudyService} from "./study/study/study.service";

@NgModule({
declarations: [
Expand Down Expand Up @@ -149,6 +152,8 @@ import {DevicesService} from './configuration/devices/devices.service';
TableGeneratorComponent,
StorageVerificationComponent,
ConfigTabComponent,
StudyTabComponent,
StudyComponent,
],
imports: [
BrowserModule,
Expand Down Expand Up @@ -184,6 +189,7 @@ import {DevicesService} from './configuration/devices/devices.service';
canActivate: [AuthGuard]
},
{ path: 'studies', component: StudiesComponent , canActivate: [AuthGuard]},
{ path: 'study/:tab', component: StudyComponent , canActivate: [AuthGuard]},
{ path: 'permission-denied', component: PermissionDeniedComponent},
{ path: 'monitoring/control', component: ControlComponent, canActivate: [AuthGuard] },
{ path: 'monitoring/export', component: ExportComponent, canActivate: [AuthGuard] },
Expand Down Expand Up @@ -237,6 +243,7 @@ import {DevicesService} from './configuration/devices/devices.service';
DiffMonitorService,
RangePickerService,
StorageVerificationService,
StudyService,
{provide: LOCALE_ID, useValue: 'en-US' }
],
bootstrap: [AppComponent]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export class AeListService {
getAes(){
return this.$http.get(
'../aes'
).map(res => {let resjson; try{ let pattern = new RegExp("[^:]*:\/\/[^\/]*\/auth\/"); if(pattern.exec(res.url)){ WindowRefService.nativeWindow.location = "/dcm4chee-arc/ui2/";} resjson = res.json(); }catch (e){ resjson = [];} return resjson;})
).map(res => j4care.redirectOnAuthResponse(res));
}
getAets(){
return this.$http.get(
'../aets'
).map(res => {let resjson; try{ let pattern = new RegExp("[^:]*:\/\/[^\/]*\/auth\/"); if(pattern.exec(res.url)){ WindowRefService.nativeWindow.location = "/dcm4chee-arc/ui2/";} resjson = res.json(); }catch (e){ resjson = [];} return resjson;})
).map(res => j4care.redirectOnAuthResponse(res));

}
getDevices(){
Expand Down
4 changes: 3 additions & 1 deletion dcm4chee-arc-ui2/src/app/constants/globalvar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {FilterSchema} from "../interfaces";

export class Globalvar {
public static get MODALITIES(): any {
return {
Expand Down Expand Up @@ -648,7 +650,7 @@ export class Globalvar {
return actionObject;
}
}
static STUDY_FILTER_SCHEMA(aets,hidden?){
static STUDY_FILTER_SCHEMA(aets,hidden?):FilterSchema{
if(hidden){
return [
{
Expand Down
85 changes: 85 additions & 0 deletions dcm4chee-arc-ui2/src/app/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
export interface J4careDateTime {
FullYear:string;
Month:string;
Date:string;
Hours:string;
Minutes:string;
Seconds:string;
dateObject?:Date;
}
export type J4careDateTimeMode = "range" | "leftOpen" | "rightOpen" | "single";

export interface RangeObject {
firstDateTime:J4careDateTime;
secondDateTime:J4careDateTime;
mode:J4careDateTimeMode;
}

export type StatisticsPage = "simple"|"detailed"

export type FilterTag = "input"|"checkbox"|"select"|"modality"|"range-picker-limit"|"range-picker-time"|"range-picker"|"multi-select";

export type RangeUnit = "hour" | "day" | "week" | "month" | "year";

export class SelectDropdown {
private _value:string;
private _text:string;
private _label:string;
private _title?:string;
constructor(value:any,text:string, title?:string){
this._value = value;
this._text = text;
this._label = text;
this._title = title;
}

get value(): string {
return this._value;
}

set value(value: string) {
this._value = value;
}

get text(): string {
return this._text;
}

set text(value: string) {
this._text = value;
}

get label(): string {
return this._label;
}

set label(value:string) {
this._label = value;
}

get title(): string {
return this._title;
}

set title(value: string) {
this._title = value;
}
}
export type Quantity = "count"|"size"|string;
export type StudyDateMode = "StudyReceiveDateTime"|"StudyDate"|string;
export type FilterSchema = FilterSchemaElement[];

export interface FilterSchemaElement {
tag:FilterTag;
filterKey:string;
type?:"text"|"number";
text?:string;
description?:string;
placeholder?:string;
showStar?:boolean;
maxSelectedLabels?:number;
options?:SelectDropdown[]
}

export type StudyTab = "study" | "patient" | "mwl" | "diff";
export type AccessLocation = "internal" | "external";
102 changes: 102 additions & 0 deletions dcm4chee-arc-ui2/src/app/models/aet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import * as _ from "lodash";

export class Aet {
private _dicomAETitle:string;
private _dicomDescription:string;
private _dcmAcceptedUserRole:string[];
private _dcmAllowDeletePatient:string;
private _dcmAllowDeleteStudyPermanently:string;
private _dicomApplicationCluster:string[];
private _dicomAssociationAcceptor:boolean;
private _dicomAssociationInitiator:boolean;
private _dicomNetworkConnection:any

constructor(aetObject){
[
"dicomAETitle",
"dicomDescription",
"dcmAcceptedUserRole",
"dcmAllowDeletePatient",
"dcmAllowDeleteStudyPermanently",
"dicomApplicationCluster",
"dicomAssociationAcceptor",
"dicomAssociationInitiator",
"dicomNetworkConnection"
].forEach(attr=>{
if(_.hasIn(aetObject,attr))
this[attr] = aetObject[attr];
});
}

get dcmAcceptedUserRole(): string[] {
return this._dcmAcceptedUserRole;
}

set dcmAcceptedUserRole(value: string[]) {
this._dcmAcceptedUserRole = value;
}

get dcmAllowDeletePatient(): string {
return this._dcmAllowDeletePatient;
}

set dcmAllowDeletePatient(value: string) {
this._dcmAllowDeletePatient = value;
}

get dcmAllowDeleteStudyPermanently(): string {
return this._dcmAllowDeleteStudyPermanently;
}

set dcmAllowDeleteStudyPermanently(value: string) {
this._dcmAllowDeleteStudyPermanently = value;
}

get dicomAETitle(): string {
return this._dicomAETitle;
}

set dicomAETitle(value: string) {
this._dicomAETitle = value;
}

get dicomDescription(): string {
return this._dicomDescription;
}

set dicomDescription(value: string) {
this._dicomDescription = value;
}

get dicomApplicationCluster(): string[] {
return this._dicomApplicationCluster;
}

set dicomApplicationCluster(value: string[]) {
this._dicomApplicationCluster = value;
}

get dicomAssociationAcceptor(): boolean {
return this._dicomAssociationAcceptor;
}

set dicomAssociationAcceptor(value: boolean) {
this._dicomAssociationAcceptor = value;
}

get dicomAssociationInitiator(): boolean {
return this._dicomAssociationInitiator;
}

set dicomAssociationInitiator(value: boolean) {
this._dicomAssociationInitiator = value;
}

get dicomNetworkConnection(): any {
return this._dicomNetworkConnection;
}

set dicomNetworkConnection(value: any) {
this._dicomNetworkConnection = value;
}
}
2 changes: 2 additions & 0 deletions dcm4chee-arc-ui2/src/app/models/instance-dicom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export class InstanceDicom {
}
3 changes: 3 additions & 0 deletions dcm4chee-arc-ui2/src/app/models/patient-dicom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export class PatientDicom {

}
2 changes: 2 additions & 0 deletions dcm4chee-arc-ui2/src/app/models/series-dicom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export class SeriesDicom {
}
2 changes: 2 additions & 0 deletions dcm4chee-arc-ui2/src/app/models/study-dicom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export class StudyDicom {
}
17 changes: 17 additions & 0 deletions dcm4chee-arc-ui2/src/app/study/study-tab.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'study-tab',
template:`
<ul class="nav nav-tabs" role="tablist">
<li [permission]="{id:'tab-study-study',param:'visible'}" role="presentation" routerLinkActive="active"><a role="tab" routerLink="/study/study" routerLinkActive="active">Study</a></li>
<li [permission]="{id:'tab-study-patient',param:'visible'}" role="presentation" routerLinkActive="active"><a role="tab" routerLink="/study/patient" routerLinkActive="active">Patient</a></li>
<li [permission]="{id:'tab-study-mwl',param:'visible'}" role="presentation" routerLinkActive="active"><a role="tab" routerLink="/study/mwl" routerLinkActive="active">MWL</a></li>
<li [permission]="{id:'tab-study-diff',param:'visible'}" role="presentation" routerLinkActive="active"><a role="tab" routerLink="/study/diff" routerLinkActive="active">DIFF</a></li>
</ul>
`
})
export class StudyTabComponent{

constructor() { }
}
6 changes: 6 additions & 0 deletions dcm4chee-arc-ui2/src/app/study/study/study.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="main_content white_design">
<study-tab></study-tab>
<div class="tab-content">
<h2>Studies {{tab}}</h2>
</div>
</div>
Empty file.
41 changes: 41 additions & 0 deletions dcm4chee-arc-ui2/src/app/study/study/study.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { StudyComponent } from './study.component';
import {StudyTabComponent} from "../study-tab.component";
import {PermissionDirective} from "../../helpers/permissions/permission.directive";
import {ActivatedRoute} from "@angular/router";
import {AeListService} from "../../configuration/ae-list/ae-list.service";
import {StudyService} from "./study.service";
import {PermissionService} from "../../helpers/permissions/permission.service";
import {AppService} from "../../app.service";
import {HttpModule} from "@angular/http";
import {RouterTestingModule} from "@angular/router/testing";

describe('StudyComponent', () => {
let component: StudyComponent;
let fixture: ComponentFixture<StudyComponent>;

/* beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StudyComponent, StudyTabComponent, PermissionDirective],
providers:[
{provide:ActivatedRoute, useClass:StudyComponentDependenc},
{provide:StudyService, useClass:StudyComponentDependenc},
{provide:AppService, useClass:StudyComponentDependenc},
{provide:PermissionService, useClass:StudyComponentDependenc}
],
imports:[RouterTestingModule]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(StudyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});*/
});
Loading

0 comments on commit d2e4a59

Please sign in to comment.