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 static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import gov.va.med.ars.dao.ewv.IEwvClaimRepository;
import gov.va.med.ars.dao.ewv.IEwvHealthInformationRepository;
import gov.va.med.ars.exceptions.GenericException;
import gov.va.med.domain.ewv.EwvClaims;
import gov.va.med.domain.ewv.EwvHealthInformation;
import gov.va.med.ewv.model.response.HealthCareInfoResponse;
import gov.va.med.ewv.model.response.HealthCareInformationLine;
import gov.va.med.ewv.util.ClaimType;
import gov.va.med.ewv.util.EwvUtils;
import gov.va.med.ewv.util.HealthInfoType;
@RunWith(MockitoJUnitRunner.class)
public class EwvHealthCareInfoServiceImplTest {
@InjectMocks
EwvHealthCareInfoServiceImpl ewvHealthCareInfoService;
@Mock
IEwvHealthInformationRepository ewvHealthInformationRepository;
@Mock
IEwvClaimRepository ewvClaimRepository;
String pdi = "201736500000002";
EwvClaims ewvClaim;
ClaimType claimType = ClaimType.INSTITUTIONAL;
Set<EwvHealthInformation> ewvHealthInfoSet = new HashSet<>();
// creating the EwvHealthInformation
EwvHealthInformation ewvHealthInformation = new EwvHealthInformation();
HealthCareInfoResponse healthCareInfoResponse = new HealthCareInfoResponse();
List<HealthCareInformationLine> healthCareInfoList = new ArrayList<HealthCareInformationLine>();
@Before
public void init() throws Exception {
String ediClaimKey = "681A4FD0-CE88-7F6C-E053-4A10BF0A3038";
//ClaimType claimType = ClaimType.DENTAL;
String memberId = "666666661";
String medicareCrossover = "Y";
String pos = "21";
// Patient info
String patientName = "RODGERS-CROMARTIE, DOMINIQUE";
String patientIdNumber = "1234567890";
String patientDob = "01/01/1935";
String patientGender = "M";
String patientAddressLine1 = "1122 Maple Street";
String patientAddressLine2 = "Apt. B";
String patientCity = "NEW YORK";
String patientState = "NY";
String patientPostalCode = "12345";
String patientCountry = "USA";
// Vendor info
String serviceVendorName = "GENERAL DIAGNOSTIC HOSPITAL";
String serviceVendorTaxIdNum = "1234567890";
String serviceVendorNpi = "1234567890";;
String serviceVendorAddressLine1 = "2000 SOUTH US HIGHWAY 1";
String serviceVendorAddressLine2 = "SUITE 100";
String serviceVendorCity = "NEW YORK";
String serviceVendorState = "NY";
String serviceVendorPostalCode = "12345";
String billingVendorName = "GENERAL MEMORIAL HOSPITAL";
String billingVendorTaxIdNum = "1234567890";
String billingVendorNpi = "1234567890";;
String billingVendorAddressLine1 = "1212 SOUTH US HIGHWAY 1";;
String billingVendorAddressLine2 = null;
String billingVendorCity = "NEW YORK";;
String billingVendorState = "NY";
String billingVendorPostalCode = "12345";
// Billing info
String invoicePatientAccountNum= "1721590-2";
String invoiceTypeOfBill= "21";
String invoiceFrequency= "1";
String invoiceStatementFromDate= "01/01/2017";
String invoiceStatementToDate= "02/01/2017";
String invoicePreviousPdi= "1234567890123";
String invoicePatientPaidAmt= "999.99";
String invoicePatientSignature= "B";
String invoicePatientStatus= "UNK";
String invoicePriorAuthorization1= "12345678901234567890";
String invoicePriorAuthorization2= "";
String invoiceAdmissionType= "UNK";
String invoiceAdmissionSource= "UNK";
String invoiceAccidentDate= "01/01/2017";
String invoiceAccidentIndicator= "123456";
String invoiceProvAcceptsAssignmt= "A"; //which field?
String invoiceAssignmentOfBenefits= "Y";
String invoiceDischargeDateHour= "02/01/2017 15:00";
String invoiceAdmissionDateHour = "01/01/2017 15:00";
String svcLineTotalClaimCharges = "999.99";
String pcn = invoicePatientAccountNum;
EwvUtils.shorten(pcn, 20);
String hccodesPoaNotes = "123456789012345678901234567890";
String hccodesAdmittingDiagnosis = "998";
String hccodesReasonForVists = "998";
String hccodesECode = "998";
String poaNotesPlain = hccodesPoaNotes;
String poaNotesLong = EwvUtils.addLineBreaks(poaNotesPlain);
String poaNotesShort = EwvUtils.shorten(poaNotesLong, 15);
if (poaNotesShort.endsWith("...")) {
}
EwvUtils.shorten(invoicePriorAuthorization1, 20);
BigDecimal ewvClaim_guid = new BigDecimal(1);
ewvClaim = new EwvClaims();
ewvClaim.setBillingVendorName(billingVendorName);
ewvClaim.setBillingVendorNpi(billingVendorNpi);
ewvClaim.setBillingVendorAddressLine1(billingVendorAddressLine1);
ewvClaim.setBillingVendorAddressLine2(billingVendorAddressLine2);
ewvClaim.setBillingVendorCity(billingVendorCity);
ewvClaim.setBillingVendorState(billingVendorState);
ewvClaim.setBillingVendorPostalCode(billingVendorPostalCode);
ewvClaim.setBillingVendorTaxIdNum(billingVendorTaxIdNum);
ewvClaim.setClaimType(claimType.getValueOf());
ewvClaim.setEdiClaimKey(ediClaimKey);
ewvClaim.setGuid(ewvClaim_guid);
ewvClaim.setInvoiceAccidentDate(invoiceAccidentDate);
ewvClaim.setInvoiceAccidentIndicator(invoiceAccidentIndicator);
ewvClaim.setInvoiceAdmissionDateHour(invoiceAdmissionDateHour);
ewvClaim.setInvoiceAdmissionSource(invoiceAdmissionSource);
ewvClaim.setInvoiceAdmissionType(invoiceAdmissionType);
ewvClaim.setInvoiceAssignmentOfBenefits(invoiceAssignmentOfBenefits);
ewvClaim.setInvoiceDischargeDateHour(invoiceDischargeDateHour);
ewvClaim.setInvoiceFrequency(invoiceFrequency);
ewvClaim.setInvoicePatientAccountNum(invoicePatientAccountNum);
ewvClaim.setInvoicePatientPaidAmt(invoicePatientPaidAmt);
ewvClaim.setInvoicePatientSignature(invoicePatientSignature);
ewvClaim.setInvoicePatientStatus(invoicePatientStatus);
ewvClaim.setInvoicePreviousPdi(invoicePreviousPdi);
ewvClaim.setInvoicePriorAuthorization1(invoicePriorAuthorization1);
ewvClaim.setInvoicePriorAuthorization2(invoicePriorAuthorization2);
ewvClaim.setInvoiceProvAcceptsAssignmt(invoiceProvAcceptsAssignmt);
ewvClaim.setInvoiceStatementFromDate(invoiceStatementFromDate);
ewvClaim.setInvoiceStatementToDate(invoiceStatementToDate);
ewvClaim.setInvoiceTypeOfBill(invoiceTypeOfBill);
ewvClaim.setMedicareCrossover(medicareCrossover);
ewvClaim.setMemberId(memberId);
ewvClaim.setPcn(pcn);
ewvClaim.setPdi(pdi);
ewvClaim.setPos(pos);
ewvClaim.setPatientAddressLine1(patientAddressLine1);
ewvClaim.setPatientAddressLine2(patientAddressLine2);
ewvClaim.setPatientCity(patientCity);
ewvClaim.setPatientCountry(patientCountry);
ewvClaim.setPatientDob(patientDob);
ewvClaim.setPatientGender(patientGender);
ewvClaim.setPatientIdNumber(patientIdNumber);
ewvClaim.setPatientName(patientName);
ewvClaim.setPatientState(patientState);
ewvClaim.setPatientPostalCode(patientPostalCode);
ewvClaim.setPatientState(patientState);
ewvClaim.setServiceVendorName(serviceVendorName);
ewvClaim.setServiceVendorNpi(serviceVendorNpi);
ewvClaim.setServiceVendorAddressLine1(serviceVendorAddressLine1);
ewvClaim.setServiceVendorAddressLine2(serviceVendorAddressLine2);
ewvClaim.setServiceVendorCity(serviceVendorCity);
ewvClaim.setServiceVendorState(serviceVendorState);
ewvClaim.setServiceVendorPostalCode(serviceVendorPostalCode);
ewvClaim.setServiceVendorTaxIdNum(serviceVendorTaxIdNum);
ewvClaim.setSvcLineTotalClaimCharges(svcLineTotalClaimCharges);
ewvClaim.setHccodesAdmittingDiagnosis(hccodesAdmittingDiagnosis);
ewvClaim.setHccodesReasonForVists(hccodesReasonForVists);
ewvClaim.setHccodesECode(hccodesECode);
ewvClaim.setHccodesPoaNotes(hccodesPoaNotes);
ewvHealthInformation.setGuid(new BigDecimal(1));
ewvHealthInformation.setEwvClaims(ewvClaim);
ewvHealthInformation.setHealthCareType("CONDITION");
ewvHealthInformation.setQualifier("BG");
ewvHealthInformation.setAmount("1.00");
ewvHealthInformation.setClaimDate("10/10/2019");
ewvHealthInformation.setCode("C5");
ewvHealthInformation.setFormat("F");
ewvHealthInformation.setHiSeq(new BigDecimal(1));
ewvHealthInfoSet.add(ewvHealthInformation);
healthCareInfoList.add(new HealthCareInformationLine(1L, HealthInfoType.CONDITION, "BG", "Description", "C5", "10/10/2012","F", "10.00"));
healthCareInfoResponse.setHealthCareConditionInformationBeanList(healthCareInfoList);
}
@Test
public void populateHealthCareInfoLine_success() throws GenericException {
when(ewvHealthInformationRepository.getHealthInformationoByClaimGuid(new BigDecimal(1))).thenReturn(ewvHealthInfoSet);
List<HealthCareInformationLine> healthCareInfoLine = ewvHealthCareInfoService.populateHealthCareInfoLine(HealthInfoType.CONDITION,ewvClaim);
assertEquals("BG",healthCareInfoLine.get(0).getQualifier());
assertEquals("C5",healthCareInfoLine.get(0).getCode());
assertEquals(HealthInfoType.CONDITION,healthCareInfoLine.get(0).getType());
}
@Test
public void createHealthCareInformationList_success() throws GenericException {
HealthCareInformationLine healthCareInformationLine = ewvHealthCareInfoService.createHealthCareInformationList(ewvHealthInformation, HealthInfoType.CONDITION);
assertEquals("BG",healthCareInformationLine.getQualifier());
assertEquals("C5",healthCareInformationLine.getCode());
assertEquals(HealthInfoType.CONDITION,healthCareInformationLine.getType());
}
@Test
public void populateHealthCareInfoResponse_success() throws GenericException {
when(ewvHealthInformationRepository.getHealthInformationoByClaimGuid(new BigDecimal(1))).thenReturn(ewvHealthInfoSet);
HealthCareInfoResponse healthCareInfoResponse = ewvHealthCareInfoService.populateHealthCareInfoResponse(ewvClaim);
assertEquals(HealthInfoType.CONDITION,healthCareInfoResponse.getHealthCareConditionInformationBeanList().get(0).getType());
}
@Test
public void populateHealthCareInfoResponseByPdi_success() throws GenericException {
when(ewvClaimRepository.getEwvClaimByPdiNumber("1")).thenReturn(ewvClaim);
when(ewvHealthInformationRepository.getHealthInformationoByClaimGuid(new BigDecimal(1))).thenReturn(ewvHealthInfoSet);
HealthCareInfoResponse healthCareInfoResponse = ewvHealthCareInfoService.populateHealthCareInfoResponse("1");
assertEquals(HealthInfoType.CONDITION,healthCareInfoResponse.getHealthCareConditionInformationBeanList().get(0).getType());
}
}