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-occurrence-span-info',
templateUrl: './hi-health-care-occurrence-span-info.component.html',
styleUrls: ['./../../ewv-viewer/ewv-viewer.component.scss']
})
export class HiHealthCareOccurrenceSpanInfoComponent
implements AfterViewInit, OnChanges, OnDestroy, OnChanges {
@Input() data;
@Input() accordionId;

isSplitView: boolean;
isSplitSubscription = new Subscription();
loading = true;
collapseStateSubscription: Subscription = new Subscription();
collapseState = true;
noDataMsg = 'No Health Care Occurrence Span Info Data Found';
tableSettings: TableSettings = new TableSettings();
paginationSettings: PaginationSettings = new PaginationSettings();
healthCareOccurranceSpan;
HiHealthCareValueInfoTableColumns: TableColumnModel[] = [
new TableColumnModel('Qualifier', 'qualifier'),
// new TableColumnModel('Description', 'descriptionShort'), // Removed per client
new TableColumnModel('Code', 'code'),
new TableColumnModel('Code Description', 'description'),
new TableColumnModel('Date', 'date')
// new TableColumnModel('Format', 'format') // Removed per client
];

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.healthCareOccurranceSpan = this.data.healthCareInfo.healthCareOccurranceSpanInformationBeanList;
this.loading = false;
} else {
this.healthCareOccurranceSpan = [];
this.loading = false;
}

this.isSplitSubscription = this.ewvViewerService.isSplitView.subscribe(
// This
data => (this.isSplitView = data)
);
}

ngOnDestroy() {
this.collapseStateSubscription.unsubscribe();
this.isSplitSubscription.unsubscribe(); // This
}
}