-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI Navigation Patients : Enable to use Patient Management services in…
… external archive #4195
- Loading branch information
1 parent
d1b6774
commit fa7e136
Showing
8 changed files
with
306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
dcm4chee-arc-ui2/src/app/widgets/issuer-picker/issuer-picker.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.issuerpicker{ | ||
max-height: 350px; | ||
overflow: auto; | ||
position: absolute; | ||
z-index: 98; | ||
background: white; | ||
-webkit-box-shadow: 3px 4px 8px 6px #cccccc; | ||
-moz-box-shadow: 3px 4px 8px 6px #cccccc; | ||
box-shadow: 3px 4px 8px 6px #cccccc; | ||
padding:20px 30px; | ||
} | ||
.issuerpicker .msg{ | ||
float: left; | ||
margin: 20px 0 0px 0; | ||
width: 100%; | ||
font-size:12px; | ||
} | ||
.issuerpicker .close{ | ||
position: absolute; | ||
right: 10px; | ||
top: 10px; | ||
font-size: 13px; | ||
} | ||
.issuerpicker .btn_content{ | ||
width: 100%; | ||
} | ||
|
||
.issuer-picker-element { | ||
margin-left: 5px; | ||
} |
29 changes: 29 additions & 0 deletions
29
dcm4chee-arc-ui2/src/app/widgets/issuer-picker/issuer-picker.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="issuerpicker" (keyup)="onModelChange($event)"> | ||
<div class="close issuer-picker-element" (click)="close()"><span class="glyphicon glyphicon-remove issuer-picker-element"></span></div> | ||
<h6 *ngIf="mode === 'dcmIssuer'" i18n="@@add_issuer">Add Issuer</h6> | ||
<div class="form-group" *ngIf="mode === 'dcmIssuer'"> | ||
<label class="control-label text-right col-md-5" for="hour" i18n="@@local_namespace_id">Local Namespace Entity ID:</label> | ||
<div class="col-md-7"> | ||
<input type="string" class="col-md-12" id="hour" [(ngModel)]="localNamespaceEntityID"> | ||
</div> | ||
</div> | ||
<div class="form-group" *ngIf="mode === 'dcmIssuer'"> | ||
<label class="control-label text-right col-md-5" for="minute" i18n="@@universal_entity_id">Universal Entity ID:</label> | ||
<div class="col-md-7"> | ||
<input type="string" class="col-md-12" id="minute" [(ngModel)]="universalEntityID"> | ||
</div> | ||
</div> | ||
<div class="form-group" *ngIf="mode === 'dcmIssuer'"> | ||
<label class="control-label text-right col-md-5" for="sec" i18n="@@universal_entity_id_type">Universal Entity ID Type:</label> | ||
<div class="col-md-7"> | ||
<input type="string" class="col-md-12" id="sec" [(ngModel)]="universalEntityIDType"> | ||
</div> | ||
</div> | ||
<p class="msg"> | ||
{{message}} | ||
</p> | ||
<div class="btn_content"> | ||
<button class="btn issuer-picker-element" (click)="addIssuer()" i18n="@@Set">Set</button> | ||
<button class="btn issuer-picker-element" (click)="clear()" i18n="@@Clear">Clear</button> | ||
</div> | ||
</div> |
163 changes: 163 additions & 0 deletions
163
dcm4chee-arc-ui2/src/app/widgets/issuer-picker/issuer-picker.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
import {Component, OnInit, EventEmitter, Output, Input} from '@angular/core'; | ||
import * as _ from 'lodash-es'; | ||
|
||
const WEEK = { | ||
plural:$localize `:@@week_plural:weeks`, | ||
singular:$localize `:@@week_singular:week` | ||
}; | ||
const YEAR = { | ||
plural:$localize `:@@year_plural:years`, | ||
singular:$localize `:@@year_singular:year` | ||
}; | ||
const DAY = { | ||
plural:$localize `:@@day_plural:days`, | ||
singular:$localize `:@@day_singular:day` | ||
}; | ||
const HOUR = { | ||
plural:$localize `:@@hour_plural:hours`, | ||
singular:$localize `:@@hour_singular:hour` | ||
}; | ||
const MINUTE = { | ||
plural:$localize `:@@minute_plural:minutes`, | ||
singular:$localize `:@@minute_singular:minute` | ||
}; | ||
const SECOND = { | ||
plural:$localize `:@@second_plural:seconds`, | ||
singular:$localize `:@@second_singular:second` | ||
}; | ||
const MONTH = { | ||
plural:$localize `:@@month_plural:months`, | ||
singular:$localize `:@@month_singular:month` | ||
}; | ||
|
||
@Component({ | ||
selector: 'duration-picker', | ||
templateUrl: './issuer-picker.component.html', | ||
styleUrls: ['./issuer-picker.component.css'] | ||
}) | ||
export class IssuerPickerComponent implements OnInit { | ||
|
||
|
||
@Output() onValueSet = new EventEmitter(); | ||
@Input() mode; | ||
@Input() value; | ||
constructor() { } | ||
y; //yeaar | ||
d; //day | ||
month; | ||
h; //hour | ||
m; //minute | ||
s; //second | ||
week; | ||
localNamespaceEntityID; | ||
universalEntityID; | ||
universalEntityIDType; | ||
message; | ||
|
||
ngOnInit() { | ||
this.extractIssuerFromValue(); | ||
this.onModelChange(null); | ||
} | ||
|
||
extractIssuerFromValue(){ | ||
let match; | ||
let ptrn = /(\d)(\w)/g; | ||
try { | ||
while ((match = ptrn.exec(this.value)) != null) { | ||
if(this.mode === "dcmDuration"){ | ||
switch(match[2]) { | ||
case 'D': | ||
this.d = parseInt(match[1]); | ||
break; | ||
case 'H': | ||
this.h = parseInt(match[1]); | ||
break; | ||
case 'M': | ||
this.m = parseInt(match[1]); | ||
break; | ||
case 'S': | ||
this.s = parseInt(match[1]); | ||
break; | ||
} | ||
}else{ | ||
if(this.mode === "datePicker"){ | ||
switch(match[2]) { | ||
case 'D': | ||
this.d = parseInt(match[1]); | ||
break; | ||
case 'H': | ||
this.h = parseInt(match[1]); | ||
break; | ||
case 'M': | ||
this.m = parseInt(match[1]); | ||
break; | ||
} | ||
}else{ | ||
switch(match[2]) { | ||
case 'Y': | ||
this.y = parseInt(match[1]); | ||
break; | ||
case 'W': | ||
this.week = parseInt(match[1]); | ||
break; | ||
case 'M': | ||
this.month = parseInt(match[1]); | ||
break; | ||
case 'D': | ||
this.d = parseInt(match[1]); | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
}catch (e){ | ||
console.error("error parsing data!",e); | ||
} | ||
} | ||
addIssuer(){ | ||
this.onValueSet.emit(this.generateIssuer()); | ||
} | ||
clear(){ | ||
this.onValueSet.emit('empty'); | ||
} | ||
generateIssuer(){ | ||
let issuer = ''; | ||
if (this._isset(this.localNamespaceEntityID)) { | ||
issuer = this.localNamespaceEntityID; | ||
if (this._isset(this.universalEntityID) && this._isset(this.universalEntityIDType)) | ||
issuer += `&${this.universalEntityID}&${this.universalEntityIDType}`; | ||
} else if (this._isset(this.universalEntityID) && this._isset(this.universalEntityIDType)) { | ||
issuer = `&${this.universalEntityID}&${this.universalEntityIDType}`; | ||
} | ||
|
||
return issuer; | ||
} | ||
|
||
close(){ | ||
this.onValueSet.emit(""); | ||
} | ||
|
||
onModelChange(e){ | ||
this.message = $localize `:@@this_period_will_last_week:The issuer configured will be `; | ||
if (this._isset(this.localNamespaceEntityID)) { | ||
this.message += `${this.localNamespaceEntityID}`; | ||
if (this._isset(this.universalEntityID) && this._isset(this.universalEntityIDType)) | ||
this.message += `&${this.universalEntityID}&${this.universalEntityIDType}`; | ||
} else if (this._isset(this.universalEntityID) && this._isset(this.universalEntityIDType)) | ||
this.message += `&${this.universalEntityID}&${this.universalEntityIDType}`; | ||
|
||
if ((this._isset(this.universalEntityID) && !this._isset(this.universalEntityIDType)) | ||
|| (!this._isset(this.universalEntityID) && this._isset(this.universalEntityIDType))) | ||
this.message = $localize `:@@invalid_universal_issuer:Invalid universal issuer: ` + `&${this.universalEntityID}&${this.universalEntityIDType}`; | ||
} | ||
|
||
_isset(v){ | ||
return v && v != "" && v != null; | ||
} | ||
|
||
_clearFromEmptyValue(array, objectKey){ | ||
return _.remove(array,(m)=>{ | ||
return this._isset(m[objectKey]); | ||
}) | ||
} | ||
} |