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,
OnInit,
Input,
OnDestroy,
SimpleChanges,
OnChanges
} from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { EwvViewerService } from '../../ewv-viewer/ewv-viewer.service';
import { OhiInfoService } from './ohi-info.service';
@Component({
selector: 'app-ohi-info',
templateUrl: './ohi-info.component.html',
styleUrls: [
'../../ewv-viewer/ewv-viewer.component.scss',
'./ohi-info.component.scss'
]
})
export class OhiInfoComponent implements OnInit, OnChanges, OnDestroy {
@Input() data;
@Input() compareData;
// @ViewChild('otherHealthInfoInput') inputElement: ElementRef;
@Input() tabbable = true;
@Input() isRightSide: boolean;
@Input() isSplitView;
// @Output() oneAccordionClicked = new EventEmitter();
collapseState = true;
collapseStateSubscription: Subscription = new Subscription();
isSplitSubscription = new Subscription();
claimLevelAdjustmentsRows = [];
compareClaimLevelAdjustmentsRows = [];
claimLevelAdjustmentsRowsList = [];
quickviewServiceLineOhiOutputRowsList = [];
ohiInfo;
compareOhiInfo;
ohiInfoMsg = 'No OHI Information Found';
@Input() accordionId;
constructor(private ewvViewerService: EwvViewerService, private ohiInfoService: OhiInfoService) {}
ngOnInit() {
this.collapseStateSubscription = this.ewvViewerService
.getCollapseState()
.subscribe(state => {
this.collapseState = state;
});
// this.isSplitSubscription = this.ewvViewerService.isSplitView.subscribe(
// data => (this.isSplitView = data)
// );
this.populateData();
}
ngOnChanges(changes: SimpleChanges): void {
if (changes.data && changes.data.currentValue) {
this.data = changes.data.currentValue; // Wrong! already done!
this.populateData();
if (this.isRightSide) {
this.populateCompareData();
// the following code is for highlighting purposes.
try { // provide default array, if needed
this.ohiInfo.quickviewServiceLineOhiOutputRows = this.ohiInfo.quickviewServiceLineOhiOutputRows || [];
} catch (error) { }
try { // provide default array, if needed
this.compareOhiInfo.quickviewServiceLineOhiOutputRows = this.compareOhiInfo.quickviewServiceLineOhiOutputRows || [];
} catch (error) { }
try { // *ngFor needs the longer array
this.claimLevelAdjustmentsRowsList =
this.claimLevelAdjustmentsRows.length > this.compareClaimLevelAdjustmentsRows.length
? this.claimLevelAdjustmentsRows : this.compareClaimLevelAdjustmentsRows;
} catch (error) { }
try { // *ngFor needs the longer array
this.quickviewServiceLineOhiOutputRowsList =
this.ohiInfo.quickviewServiceLineOhiOutputRows.length > this.compareOhiInfo.quickviewServiceLineOhiOutputRows.length
? this.ohiInfo.quickviewServiceLineOhiOutputRows : this.compareOhiInfo.quickviewServiceLineOhiOutputRows;
} catch (error) { }
}
}
}
get tabbableIdx() {
return this.tabbable ? '0' : '-1';
}
populateData() {
this.ohiInfo = this.data;
this.populateClaimLevelAdjustmentsData();
}
populateCompareData() {
this.compareOhiInfo = this.compareData;
this.populateCompareClaimLevelAdjustmentsData();
}
populateClaimLevelAdjustmentsData() {
// Leave the below to avoid duplicates!
this.claimLevelAdjustmentsRows = [];
let primaryOhiClaimLevelAdjustments = [];
if (
this.ohiInfo &&
this.ohiInfo.primaryOhi &&
this.ohiInfo.primaryOhi.claimOhiAdjustments
) {
primaryOhiClaimLevelAdjustments = this.ohiInfo.primaryOhi
.claimOhiAdjustments;
}
let secondaryOhiClaimLevelAdjustments = [];
if (
this.ohiInfo &&
this.ohiInfo.secondaryOhi &&
this.ohiInfo.secondaryOhi.claimOhiAdjustments
) {
secondaryOhiClaimLevelAdjustments = this.ohiInfo.secondaryOhi
.claimOhiAdjustments;
}
let tertiaryOhiClaimLevelAdjustments = [];
if (
this.ohiInfo &&
this.ohiInfo.tertiaryOhi &&
this.ohiInfo.tertiaryOhi.claimOhiAdjustments
) {
tertiaryOhiClaimLevelAdjustments = this.ohiInfo.tertiaryOhi
.claimOhiAdjustments;
}
const numberOfClaimLevelAdjustmentsRow = Math.max(
primaryOhiClaimLevelAdjustments.length,
secondaryOhiClaimLevelAdjustments.length,
tertiaryOhiClaimLevelAdjustments.length
);
let primaryOhiPayerPaidAmountValue = '';
if (
this.ohiInfo &&
this.ohiInfo.primaryOhi &&
this.ohiInfo.primaryOhi.payerPaidAmount
) {
primaryOhiPayerPaidAmountValue = this.ohiInfo.primaryOhi.payerPaidAmount;
}
let secondaryOhiPayerPaidAmountValue = '';
if (
this.ohiInfo &&
this.ohiInfo.secondaryOhi &&
this.ohiInfo.secondaryOhi.payerPaidAmount
) {
secondaryOhiPayerPaidAmountValue = this.ohiInfo.secondaryOhi
.payerPaidAmount;
}
let tertiaryOhiPayerPaidAmountValue = '';
if (
this.ohiInfo &&
this.ohiInfo.tertiaryOhi &&
this.ohiInfo.tertiaryOhi.payerPaidAmount
) {
tertiaryOhiPayerPaidAmountValue = this.ohiInfo.tertiaryOhi
.payerPaidAmount;
}
for (let i = 0; i < numberOfClaimLevelAdjustmentsRow; i++) {
let claimLevelAdjustment : {
primaryOhiInfo: {
payerPaidAmount: string,
adjustmentCode: string,
adjCodeGroupDescription: string,
adjustmentAmount: string,
descriptionLong: string
},
secondaryOhiInfo: {
payerPaidAmount: string,
adjustmentCode: string,
adjCodeGroupDescription: string,
adjustmentAmount: string,
descriptionLong: string
},
tertiaryOhiInfo: {
payerPaidAmount: string,
adjustmentCode: string,
adjCodeGroupDescription: string,
adjustmentAmount: string,
descriptionLong: string
},
};
if (i == 0) {
claimLevelAdjustment = {
primaryOhiInfo: {
payerPaidAmount: primaryOhiPayerPaidAmountValue,
adjustmentCode: '',
adjCodeGroupDescription: '',
adjustmentAmount: '',
descriptionLong: ''
},
secondaryOhiInfo: {
payerPaidAmount: secondaryOhiPayerPaidAmountValue,
adjustmentCode: '',
adjCodeGroupDescription: '',
adjustmentAmount: '',
descriptionLong: ''
},
tertiaryOhiInfo: {
payerPaidAmount: tertiaryOhiPayerPaidAmountValue,
adjustmentCode: '',
adjCodeGroupDescription: '',
adjustmentAmount: '',
descriptionLong: ''
}
};
} else {
claimLevelAdjustment = {
primaryOhiInfo: {
payerPaidAmount: '',
adjustmentCode: '',
adjCodeGroupDescription: '',
adjustmentAmount: '',
descriptionLong: ''
},
secondaryOhiInfo: {
payerPaidAmount: '',
adjustmentCode: '',
adjCodeGroupDescription: '',
adjustmentAmount: '',
descriptionLong: ''
},
tertiaryOhiInfo: {
payerPaidAmount: '',
adjustmentCode: '',
adjCodeGroupDescription: '',
adjustmentAmount: '',
descriptionLong: ''
}
};
}
if (primaryOhiClaimLevelAdjustments[i]) {
if (primaryOhiClaimLevelAdjustments[i].adjustmentCode) {
claimLevelAdjustment.primaryOhiInfo.adjustmentCode =
primaryOhiClaimLevelAdjustments[i].adjustmentCode;
}
if(primaryOhiClaimLevelAdjustments[i].adjCodeGroupDescription) {
claimLevelAdjustment.primaryOhiInfo.adjCodeGroupDescription =
primaryOhiClaimLevelAdjustments[i].adjCodeGroupDescription;
}
if (primaryOhiClaimLevelAdjustments[i].adjustmentAmount) {
claimLevelAdjustment.primaryOhiInfo.adjustmentAmount =
primaryOhiClaimLevelAdjustments[i].adjustmentAmount;
}
if (primaryOhiClaimLevelAdjustments[i].descriptionLong) {
claimLevelAdjustment.primaryOhiInfo.descriptionLong =
primaryOhiClaimLevelAdjustments[i].descriptionLong;
}
}
if (secondaryOhiClaimLevelAdjustments[i]) {
if (secondaryOhiClaimLevelAdjustments[i].adjustmentCode) {
claimLevelAdjustment.secondaryOhiInfo.adjustmentCode =
secondaryOhiClaimLevelAdjustments[i].adjustmentCode;
}
if(secondaryOhiClaimLevelAdjustments[i].adjCodeGroupDescription) {
claimLevelAdjustment.secondaryOhiInfo.adjCodeGroupDescription =
secondaryOhiClaimLevelAdjustments[i].adjCodeGroupDescription;
}
if (secondaryOhiClaimLevelAdjustments[i].adjustmentAmount) {
claimLevelAdjustment.secondaryOhiInfo.adjustmentAmount =
secondaryOhiClaimLevelAdjustments[i].adjustmentAmount;
}
if (secondaryOhiClaimLevelAdjustments[i].descriptionLong) {
claimLevelAdjustment.secondaryOhiInfo.descriptionLong =
secondaryOhiClaimLevelAdjustments[i].descriptionLong;
}
}
if (tertiaryOhiClaimLevelAdjustments[i]) {
if (tertiaryOhiClaimLevelAdjustments[i].adjustmentCode) {
claimLevelAdjustment.tertiaryOhiInfo.adjustmentCode =
tertiaryOhiClaimLevelAdjustments[i].adjustmentCode;
}
if(tertiaryOhiClaimLevelAdjustments[i].adjCodeGroupDescription) {
claimLevelAdjustment.tertiaryOhiInfo.adjCodeGroupDescription =
tertiaryOhiClaimLevelAdjustments[i].adjCodeGroupDescription;
}
if (tertiaryOhiClaimLevelAdjustments[i].adjustmentAmount) {
claimLevelAdjustment.tertiaryOhiInfo.adjustmentAmount =
tertiaryOhiClaimLevelAdjustments[i].adjustmentAmount;
}
if (tertiaryOhiClaimLevelAdjustments[i].descriptionLong) {
claimLevelAdjustment.tertiaryOhiInfo.descriptionLong =
tertiaryOhiClaimLevelAdjustments[i].descriptionLong;
}
}
this.claimLevelAdjustmentsRows.push(claimLevelAdjustment);
}
}
populateCompareClaimLevelAdjustmentsData() {
this.compareClaimLevelAdjustmentsRows = [];
let primaryOhiClaimLevelAdjustments = [];
if (
this.compareOhiInfo &&
this.compareOhiInfo.primaryOhi &&
this.compareOhiInfo.primaryOhi.claimOhiAdjustments
) {
primaryOhiClaimLevelAdjustments = this.compareOhiInfo.primaryOhi
.claimOhiAdjustments;
}
let secondaryOhiClaimLevelAdjustments = [];
if (
this.compareOhiInfo &&
this.compareOhiInfo.secondaryOhi &&
this.compareOhiInfo.secondaryOhi.claimOhiAdjustments
) {
secondaryOhiClaimLevelAdjustments = this.compareOhiInfo.secondaryOhi
.claimOhiAdjustments;
}
let tertiaryOhiClaimLevelAdjustments = [];
if (
this.compareOhiInfo &&
this.compareOhiInfo.tertiaryOhi &&
this.compareOhiInfo.tertiaryOhi.claimOhiAdjustments
) {
tertiaryOhiClaimLevelAdjustments = this.compareOhiInfo.tertiaryOhi
.claimOhiAdjustments;
}
const numberOfClaimLevelAdjustmentsRow = Math.max(
primaryOhiClaimLevelAdjustments.length,
secondaryOhiClaimLevelAdjustments.length,
tertiaryOhiClaimLevelAdjustments.length
);
let primaryOhiPayerPaidAmountValue = '';
if (
this.compareOhiInfo &&
this.compareOhiInfo.primaryOhi &&
this.compareOhiInfo.primaryOhi.payerPaidAmount
) {
primaryOhiPayerPaidAmountValue = this.compareOhiInfo.primaryOhi.payerPaidAmount;
}
let secondaryOhiPayerPaidAmountValue = '';
if (
this.compareOhiInfo &&
this.compareOhiInfo.secondaryOhi &&
this.compareOhiInfo.secondaryOhi.payerPaidAmount
) {
secondaryOhiPayerPaidAmountValue = this.compareOhiInfo.secondaryOhi
.payerPaidAmount;
}
let tertiaryOhiPayerPaidAmountValue = '';
if (
this.compareOhiInfo &&
this.compareOhiInfo.tertiaryOhi &&
this.compareOhiInfo.tertiaryOhi.payerPaidAmount
) {
tertiaryOhiPayerPaidAmountValue = this.compareOhiInfo.tertiaryOhi
.payerPaidAmount;
}
for (let i = 0; i < numberOfClaimLevelAdjustmentsRow; i++) {
const claimLevelAdjustment = {
primaryOhiInfo: {
payerPaidAmount: primaryOhiPayerPaidAmountValue,
adjustmentCode: '',
adjustmentAmount: '',
descriptionLong: ''
},
secondaryOhiInfo: {
payerPaidAmount: secondaryOhiPayerPaidAmountValue,
adjustmentCode: '',
adjustmentAmount: '',
descriptionLong: ''
},
tertiaryOhiInfo: {
payerPaidAmount: tertiaryOhiPayerPaidAmountValue,
adjustmentCode: '',
adjustmentAmount: '',
descriptionLong: ''
}
};
if (primaryOhiClaimLevelAdjustments[i]) {
if (primaryOhiClaimLevelAdjustments[i].adjustmentCode) {
claimLevelAdjustment.primaryOhiInfo.adjustmentCode =
primaryOhiClaimLevelAdjustments[i].adjustmentCode;
}
if (primaryOhiClaimLevelAdjustments[i].adjustmentAmount) {
claimLevelAdjustment.primaryOhiInfo.adjustmentAmount =
primaryOhiClaimLevelAdjustments[i].adjustmentAmount;
}
if (primaryOhiClaimLevelAdjustments[i].descriptionLong) {
claimLevelAdjustment.primaryOhiInfo.descriptionLong =
primaryOhiClaimLevelAdjustments[i].descriptionLong;
}
}
if (secondaryOhiClaimLevelAdjustments[i]) {
if (secondaryOhiClaimLevelAdjustments[i].adjustmentCode) {
claimLevelAdjustment.secondaryOhiInfo.adjustmentCode =
secondaryOhiClaimLevelAdjustments[i].adjustmentCode;
}
if (secondaryOhiClaimLevelAdjustments[i].adjustmentAmount) {
claimLevelAdjustment.secondaryOhiInfo.adjustmentAmount =
secondaryOhiClaimLevelAdjustments[i].adjustmentAmount;
}
if (secondaryOhiClaimLevelAdjustments[i].descriptionLong) {
claimLevelAdjustment.secondaryOhiInfo.descriptionLong =
secondaryOhiClaimLevelAdjustments[i].descriptionLong;
}
}
if (tertiaryOhiClaimLevelAdjustments[i]) {
if (tertiaryOhiClaimLevelAdjustments[i].adjustmentCode) {
claimLevelAdjustment.tertiaryOhiInfo.adjustmentCode =
tertiaryOhiClaimLevelAdjustments[i].adjustmentCode;
}
if (tertiaryOhiClaimLevelAdjustments[i].adjustmentAmount) {
claimLevelAdjustment.tertiaryOhiInfo.adjustmentAmount =
tertiaryOhiClaimLevelAdjustments[i].adjustmentAmount;
}
if (tertiaryOhiClaimLevelAdjustments[i].descriptionLong) {
claimLevelAdjustment.tertiaryOhiInfo.descriptionLong =
tertiaryOhiClaimLevelAdjustments[i].descriptionLong;
}
}
this.compareClaimLevelAdjustmentsRows.push(claimLevelAdjustment);
}
}
getDollarSignString(dollarAmount): void {
if (dollarAmount) {
dollarAmount = dollarAmount.trim();
}
if (dollarAmount) {
dollarAmount = '$' + dollarAmount;
} else {
dollarAmount = '';
}
return dollarAmount;
}
getPayerIdString(payerId) {
let aPayerIdValue = '';
if (payerId) {
payerId = payerId.trim();
}
if (payerId) {
aPayerIdValue = '(' + payerId + ')';
}
return aPayerIdValue;
}
// ensureBothClaimsCollapse() {
// // console.dir(this.inputElement);
// // // this.inputElement.nativeElement.checked = this.collapseState;
// // this.oneAccordionClicked.emit(true);
// }
ngOnDestroy() {
this.collapseStateSubscription.unsubscribe();
this.isSplitSubscription.unsubscribe();
}
}