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 { Subscription } from 'rxjs/Subscription';
import { EwvViewerService } from '../../ewv-viewer/ewv-viewer.service';

@Component({
selector: 'app-hi-health-care-occurrence-info',
templateUrl: './hi-health-care-occurrence-info.component.html',
styleUrls: ['../../ewv-viewer/ewv-viewer.component.scss']
})
export class HiHealthCareOccurrenceInfoComponent
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 Info Data Found';
tableSettings: TableSettings = new TableSettings();
paginationSettings: PaginationSettings = new PaginationSettings();
healthCareOccurrance;

HiHealthCareValueInfoTableColumns: TableColumnModel[] = [
new TableColumnModel('Qualifier', 'qualifier'),
new TableColumnModel('Code', 'code'),
new TableColumnModel('Code Description', 'description'),
new TableColumnModel('Date', 'date')
];

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.healthCareOccurrance = this.data.healthCareInfo.healthCareOccurranceInformationBeanList;
this.loading = false;
} else {
this.healthCareOccurrance = [];
this.loading = false;
}
this.isSplitSubscription = this.ewvViewerService.isSplitView.subscribe(
// This
data => (this.isSplitView = data)
);
}

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