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

package gov.va.med.ewv.service.impl;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;

import gov.va.med.domain.ewv.EwvClaims;
import gov.va.med.ewv.model.response.PatientHeaderInfo;
import gov.va.med.ewv.model.response.PatientInfo;
import gov.va.med.ewv.model.response.VendorInfo;
import gov.va.med.ewv.service.IEwvPatientAndVendorInfoService;
import gov.va.med.ewv.util.ClaimFormat;
import gov.va.med.ewv.util.ClaimType;
import gov.va.med.ewv.util.EwvUtils;

@Service
public class EwvPatientAndVendorInfoServiceImpl implements IEwvPatientAndVendorInfoService {

public static final Logger logger = LogManager.getLogger(EwvPatientAndVendorInfoServiceImpl.class);

@Override
public PatientHeaderInfo populatePatientHeaderInfo(EwvClaims claim) {
logger.info(" Invoked populatePatientHeaderInfo() for claim guid "+ claim.getGuid());
String medicareCrossOver = claim.getMedicareCrossover();
String[] patientNames = claim.getPatientName().split(",");
// String patientFullName = patientNames[0] + ", " + patientNames[1];
String patientFullName = patientNames[0] + ", ";
if (patientNames.length > 1) {
patientFullName += patientNames[1];
}
String billingNPI = claim.getBillingVendorNpi();
String memberID = claim.getMemberId();
String tin = claim.getBillingVendorTaxIdNum();
String pdi = claim.getPdi();
String pcn = claim.getInvoicePatientAccountNum();
String pcnShort = EwvUtils.shorten(pcn, 20);
boolean usePcnModalPanel = pcnShort.endsWith("...");

ClaimFormat claimFormat = EwvUtils.determineClaimFormat(claim);
ClaimType claimType = EwvUtils.determineClaimType(claim);

String format = claimType.getAltValue() + " ("+ claimFormat.getValueOf() + ")";
logger.info(" Exiting populatePatientHeaderInfo() with PatientHeaderInfo");
return new PatientHeaderInfo(format,
claimType,
medicareCrossOver,
patientFullName,
billingNPI,
memberID,
tin,
pdi,
pcn,
pcnShort,
usePcnModalPanel);
}

@Override
public PatientInfo populatePatientInfo(EwvClaims claim) {
logger.info(" Invoked populatePatientInfo() for claim guid : "+ claim.getGuid());
String[] patientName = claim.getPatientName().split(",");
logger.info(" Exiting populatePatientInfo() ");
return new PatientInfo(claim.getPatientName(),
claim.getPatientIdNumber(),
claim.getPatientDob(),
claim.getPatientDateOfDeath5010(),
claim.getPatientGender(),
claim.getPatientAddressLine1(),
claim.getPatientAddressLine2(),
claim.getPatientCity(),
claim.getPatientState(),
claim.getPatientPostalCode(),
claim.getPatientCountry(),
(patientName.length > 1 ? patientName[1] : ""),
patientName[0]);
}

@Override
public VendorInfo populateBillingProviderInfo(EwvClaims claim) {
// TODO Auto-generated method stub
logger.info(" Invoked populateBillingProviderInfo() for claim guid : "+claim.getGuid());
return new VendorInfo(claim.getBillingVendorName(),
claim.getBillingVendorTaxIdNum(),
claim.getBillingVendorNpi(),
claim.getBillingVendorTaxonomyCode(),
claim.getBillingVendorAddressLine1(),
claim.getBillingVendorAddressLine2(),
claim.getBillingVendorCity(),
claim.getBillingVendorState(),
claim.getBillingVendorPostalCode(),
claim.getBillingVendorCountry()
);
}

@Override
public VendorInfo populateServiceLocationInfo(EwvClaims claim) {
logger.info(" Invoked populateServiceLocationInfo() for claim guid : "+claim.getGuid());
// TODO Auto-generated method stub
return new VendorInfo(claim.getServiceVendorName(),
claim.getServiceVendorTaxIdNum(),
claim.getServiceVendorNpi(),
claim.getBillingVendorTaxonomyCode(),
claim.getServiceVendorAddressLine1(),
claim.getServiceVendorAddressLine2(),
claim.getServiceVendorCity(),
claim.getServiceVendorState(),
claim.getServiceVendorPostalCode(),
claim.getServiceVendorCountry()
);
}
}