Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
import {
Component,
AfterViewInit,
Input,
SimpleChanges,
OnChanges,
OnDestroy
} from '@angular/core';
import {
TableColumnModel,
TableSettings,
PaginationSettings
} from '../../../shared/table';
import { EwvViewerService } from '../../ewv-viewer/ewv-viewer.service';
import { Subscription } from 'rxjs/Subscription';
@Component({
selector: 'app-hi-health-care-value-info',
templateUrl: './hi-health-care-value-info.component.html',
styleUrls: ['./../../ewv-viewer/ewv-viewer.component.scss']
})
export class HiHealthCareValueInfoComponent
implements AfterViewInit, OnChanges, OnDestroy, OnChanges {
@Input() data;
@Input() accordionId;
isSplitView: boolean; // This
isSplitSubscription = new Subscription(); // This
loading = true;
collapseStateSubscription: Subscription = new Subscription();
collapseState = true;
noDataMsg = 'No Health Care Value Info Data Found';
tableSettings: TableSettings = new TableSettings();
paginationSettings: PaginationSettings = new PaginationSettings();
healthCareValue;
HiHealthCareValueInfoTableColumns: TableColumnModel[] = [
new TableColumnModel('Qualifier', 'qualifier'),
// new TableColumnModel('Description', 'descriptionShort'), // Removed per client
new TableColumnModel('Code', 'code'),
new TableColumnModel('Code Description', 'description'),
new TableColumnModel('Amount', 'amount')
// new TableColumnModel(' ', ' ')
];
constructor(private ewvViewerService: EwvViewerService) {}
ngAfterViewInit() {
this.tableSettings.pagination = false;
if (this.data) {
this.populateData();
}
}
ngOnChanges(changes: SimpleChanges): void {
this.data = changes.data.currentValue;
if (this.data) {
this.populateData();
}
}
populateData() {
this.collapseStateSubscription = this.ewvViewerService
.getCollapseState()
.subscribe(state => {
this.collapseState = state;
});
if (this.data.healthCareInfo) {
this.healthCareValue = this.data.healthCareInfo.healthCareValueInformationBeanList;
if (this.healthCareValue) {
this.healthCareValue.forEach(element => {
const reg = /^\${1}[0-9].*/;
if (reg.test(element.amount) === false) {
element.amount = '$' + element.amount;
}
});
}
this.loading = false;
} else {
this.healthCareValue = [];
this.loading = false;
}
this.isSplitSubscription = this.ewvViewerService.isSplitView.subscribe(
// This
data => (this.isSplitView = data)
);
}
ngOnDestroy() {
this.collapseStateSubscription.unsubscribe();
this.isSplitSubscription.unsubscribe(); // This
}
}