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 java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import gov.va.med.ars.dao.ewv.IEwvClaimRepository;
import gov.va.med.ars.dao.ewv.ILuClaimAdjustReasonCodeRepository;
import gov.va.med.ars.exceptions.GenericException;
import gov.va.med.domain.ewv.EwvAmbulanceInfo5010;
import gov.va.med.domain.ewv.EwvClaimLevelAdjustments;
import gov.va.med.domain.ewv.EwvClaimOhis;
import gov.va.med.domain.ewv.EwvClaims;
import gov.va.med.domain.ewv.EwvDiagnosisCodes;
import gov.va.med.domain.ewv.EwvECodes5010;
import gov.va.med.domain.ewv.EwvHealthInformation;
import gov.va.med.domain.ewv.EwvProcedureCodes;
import gov.va.med.domain.ewv.EwvServiceLineOhiAdjtmts;
import gov.va.med.domain.ewv.EwvServiceLineOhis;
import gov.va.med.domain.ewv.EwvServiceLines;
import gov.va.med.domain.ewv.EwvServiceLinesDrugs;
import gov.va.med.domain.ewv.EwvSlProvider;
import gov.va.med.domain.ewv.EwvSvcLineDme;
import gov.va.med.domain.ewv.EwvSvcLineTeeth;
import gov.va.med.ewv.model.response.OhiInfoContainer;
import gov.va.med.ewv.service.IEwvOhiService;
@RunWith(MockitoJUnitRunner.class)
public class EwvOhiServiceImplTest {
@InjectMocks
EwvOhiServiceImpl ewvOhiService;
@Mock
IEwvClaimRepository ewvClaimRepository;
@Mock
ILuClaimAdjustReasonCodeRepository luClaimAdjustReasonCodeRepository;
@Test
public void EwvOhiServiceImpl_Success() throws GenericException {
// Creating the EwvECodes5010
EwvECodes5010 ewvECodes5010 = new EwvECodes5010(new BigDecimal(1), new EwvClaims(), "CD",new BigDecimal(1),"POA1");
// Creating the EwvClaimLevelAdjustments
EwvClaimLevelAdjustments ewvClaimLevelAdjustments = new EwvClaimLevelAdjustments(new BigDecimal(1), new EwvClaimOhis(), "ADR1",
"DESC", "1", "1.00", "1.00", "1.00", "1.00", "1.00");
Set<EwvClaimLevelAdjustments> ewvClaimLevelAdjustmentsSet = new HashSet<>();
ewvClaimLevelAdjustmentsSet.add(ewvClaimLevelAdjustments);
// Creating the EwvClaimOhis
EwvClaimOhis ewvClaimOhis = new EwvClaimOhis(new BigDecimal(1),new EwvClaims(), "1", "P2E", "GEN HOSP","1", "GEN HOSP", "IND1","IND1", "TYPE1", "10/10/2018",
"1.00", "1.00", "1.00", "1.00",
"1.00", "1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"CD1", "DESC1", "CD2",
"DESC2", "CD3", "DESC3",
"CD4", "DESC4", "CD5",
"DESC5", "1.00", "1.00",
"1.00", "1.00", "CD1",
"DESC1", "DESC2", "DESC3",
"CODE3", "DESC3", "CODE4",
"DESC4", "CODE5", "DESC5",ewvClaimLevelAdjustmentsSet
);
Set<EwvClaimOhis> ewvClaimOhisSet = new HashSet<EwvClaimOhis>();
ewvClaimOhisSet.add(ewvClaimOhis);
// Creating the EwvAmbulanceInfo5010
EwvAmbulanceInfo5010 ewvAmbulanceInfo5010 = new EwvAmbulanceInfo5010(new BigDecimal(1),new EwvClaims(), new EwvServiceLines(),
"2238", "Sarno Road", "MO", "FL",
"FL", "2238", "WICKHAM", "ML",
"TN", "32901", "TR1", "DR1",
"FIRST", "STR2", "COND2", "COND11",
"COND12", "COND13", "COND14", "COND15",
"CERT1", "COND21", "COND22", "COND23",
"COND24", "COND25", "CERT3", "COND31",
"COND32", "COND33", "COND34", "COND35");
// Creating the EwvSvcLineDme
EwvSvcLineDme ewvSvcLineDme = new EwvSvcLineDme(new BigDecimal(1), new EwvServiceLines(), "1","1","1.00","1.00");
Set<EwvSvcLineDme> ewvSvcLinedmeSet = new HashSet<EwvSvcLineDme>();
ewvSvcLinedmeSet.add(ewvSvcLineDme);
EwvSlProvider ewvSlProvider = new EwvSlProvider(new BigDecimal(1),new EwvServiceLines(),"P", "1","LAST", "MIKE", "8009", "32901","GEN HOSP", "CD2");
Set<EwvSlProvider> ewvSlProviderSet = new HashSet<EwvSlProvider>();
ewvSlProviderSet.add(ewvSlProvider);
EwvServiceLineOhiAdjtmts ewvServiceLineOhiAdjmts = new EwvServiceLineOhiAdjtmts(new BigDecimal(1), new EwvServiceLineOhis(),"123456","R1", "DES1", "Q1", "1.00", "1.00", "1.00", "1.00", "1.00");
Set<EwvServiceLineOhiAdjtmts> ewvServiceLineOhiAdjtmtses = new HashSet<>();
ewvServiceLineOhiAdjtmtses.add(ewvServiceLineOhiAdjmts);
EwvServiceLineOhis ewvServiceLineOhis = new EwvServiceLineOhis(new BigDecimal(1), new EwvServiceLines(),"1",
"10/10/2018", "Y", "REV", "PROC1","MOD1",
"MOD2", "MOD3", "MOD5","MOD6", "2.00", "201300", ewvServiceLineOhiAdjtmtses);
Set<EwvServiceLineOhis> ewvServiceLineOhisSet = new HashSet<EwvServiceLineOhis>();
ewvServiceLineOhisSet.add(ewvServiceLineOhis);
// Creating the EwvProcedureCodes
EwvProcedureCodes ewvProcedureCodes = new EwvProcedureCodes(new BigDecimal(1), new EwvClaims(), "CD1", "10/20/2018",new BigDecimal(2));
Set<EwvProcedureCodes> ewvProcedureCodesSet = new HashSet<>();
ewvProcedureCodesSet.add(ewvProcedureCodes);
EwvSvcLineTeeth ewvSvcLineTeeth = new EwvSvcLineTeeth(new BigDecimal(1), new EwvServiceLines(), "100", "SF1","SF2","SF3","SF4","SF5");
Set<EwvSvcLineTeeth> ewvSvcLineTeethSet = new HashSet<>();
ewvSvcLineTeethSet.add(ewvSvcLineTeeth);
Set<EwvAmbulanceInfo5010> ewvAmbulanceInfo5010Set = new HashSet<>();
ewvAmbulanceInfo5010Set.add(ewvAmbulanceInfo5010);
EwvServiceLinesDrugs ewvServiceLineDrugs = new EwvServiceLinesDrugs(new BigDecimal(1), new EwvServiceLines(),"RX1","RXN",
"RXQ", "RXT", "RXC", "RXC5010");
Set<EwvServiceLinesDrugs> ewvServiceLinesDrugsSet = new HashSet<>();
ewvServiceLinesDrugsSet.add(ewvServiceLineDrugs);
// Creating the EwvServiceLines
EwvServiceLines ewvServiceLines = new EwvServiceLines(new BigDecimal(1), new EwvClaims(), 10L, "10/10/2017",
"10/12/2018", "REV1", "PROC", "MOD1", "MOD2",
"MOD3", "MOD4", "QTY", "NDC", "TYPE1", "22.00",
"11.00", "11.00", "1", "DX1", "DX2", "DX3", "DX4",
"2.00", "", "", ewvSvcLinedmeSet, ewvSlProviderSet,
ewvServiceLineOhisSet,
ewvSvcLineTeethSet,
ewvAmbulanceInfo5010Set,
ewvServiceLinesDrugsSet);
Set<EwvServiceLines> ewvServiceLineses = new HashSet<>();
ewvServiceLineses.add(ewvServiceLines);
// Creating the EwvHealthInformation
EwvHealthInformation ewvHealthInformation = new EwvHealthInformation(new BigDecimal(1),new EwvClaims(),"HC", "QL","DESC", "CODE", "10/20/2018", "PDF", "22.00", new BigDecimal(1));
Set<EwvHealthInformation> ewvHealthInfoSet = new HashSet<>();
ewvHealthInfoSet.add(ewvHealthInformation);
// Creating the EwvDiagnosisCodes
EwvDiagnosisCodes ewvDiagnosisCodes = new EwvDiagnosisCodes(new BigDecimal(1), new EwvClaims(), "DX1", new BigDecimal(1),"POA5010");
Set<EwvDiagnosisCodes> ewvDiagnosisCodeses = new HashSet<>();
ewvDiagnosisCodeses.add(ewvDiagnosisCodes);
EwvClaims ewvClaims = new EwvClaims(new BigDecimal(1), "1", "1", "MICHAEL", "1",
"10/10/1999", "M", "CHARLOTTE", "NORTH CAROLIAN",
"CHARLOTTE", "NC", "27278", "USA",
"HOSP", "2222", "555",
"CHICAGO", "CK", "CHICAGO",
"NC", "28278", "CHICA HOSP",
"666", "745", "CYBERONICS",
"HOUSTON", "HOUSTON","TX",
"77058", "142563", "PROF",
"21", "10/20/1996", "13/05/1997",
"456", "22.00", "SIGN1",
"FIRST","AUTH1", "AUTH2",
"AD1", "ADMISSION1", "10/10/2018",
"10/10/2018", "ACI", "A",
"RT","10/11/2017", "10",
"HCCODE1", "HCDDX", "HCRSNVST",
"HCDR", "PROC1", "PROCDT",
"SVCLINETOTAL", "005010X222", "2235698", "125364", "FEE",
"MEL", null, null, null, null, null, null, null, null, null, null, null, null, null, ewvClaimOhisSet, ewvAmbulanceInfo5010Set, ewvProcedureCodesSet,
ewvServiceLineses, ewvHealthInfoSet, ewvDiagnosisCodeses);
OhiInfoContainer ohiInfoResult = ewvOhiService.getOhiData(ewvClaims);
assertNotEquals(null, ohiInfoResult);
assertEquals("1", ohiInfoResult.getClaimOhiList().get(0).getClaimOhiHeaderBean().getOhiPayerID());
assertEquals("GEN HOSP", ohiInfoResult.getClaimOhiList().get(0).getClaimOhiHeaderBean().getOhiGroupName());
assertEquals("1", ohiInfoResult.getClaimOhiList().get(0).getClaimOhiAdjustmentsBean().getOhiPayerId());
assertNotEquals(null, ohiInfoResult.getClaimOhiList().get(0).getCobAmountsBean().getCobMedicareATrustFund());
/* MedicareInPatientAdjudicationBean should be null if MedicareOutPatientAdjudicationBean is not null*/
assertEquals(null, ohiInfoResult.getClaimOhiList().get(0).getMedicareInPatientAdjudicationBean());
assertNotEquals(null, ohiInfoResult.getClaimOhiList().get(0).getMedicareOutPatientAdjudicationBean().getOhiPayerId());
}
@Test
public void EwvOhiServiceImpl_Success_Inst() throws GenericException {
// Creating the EwvECodes5010
EwvECodes5010 ewvECodes5010 = new EwvECodes5010(new BigDecimal(1), new EwvClaims(), "CD",new BigDecimal(1),"POA1");
// Creating the EwvClaimLevelAdjustments
EwvClaimLevelAdjustments ewvClaimLevelAdjustments = new EwvClaimLevelAdjustments(new BigDecimal(1), new EwvClaimOhis(), "ADR1",
"DESC", "1", "1.00", "1.00", "1.00", "1.00", "1.00");
Set<EwvClaimLevelAdjustments> ewvClaimLevelAdjustmentsSet = new HashSet<>();
ewvClaimLevelAdjustmentsSet.add(ewvClaimLevelAdjustments);
// Creating the EwvClaimOhis
EwvClaimOhis ewvClaimOhis = new EwvClaimOhis(new BigDecimal(1),new EwvClaims(), "1", "P2E", "GEN HOSP","1", "GEN HOSP", "IND1","IND1", "TYPE1", "10/10/2018",
"1.00", "1.00", "1.00", "1.00",
"1.00", "1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"1.00", "1.00", "1.00",
"CD1", "DESC1", "CD2",
"DESC2", "CD3", "DESC3",
"CD4", "DESC4", "CD5",
"DESC5", "1.00", "1.00",
"1.00", "1.00", "CD1",
"DESC1", "DESC2", "DESC3",
"CODE3", "DESC3", "CODE4",
"DESC4", "CODE5", "DESC5",ewvClaimLevelAdjustmentsSet
);
Set<EwvClaimOhis> ewvClaimOhisSet = new HashSet<EwvClaimOhis>();
ewvClaimOhisSet.add(ewvClaimOhis);
// Creating the EwvAmbulanceInfo5010
EwvAmbulanceInfo5010 ewvAmbulanceInfo5010 = new EwvAmbulanceInfo5010(new BigDecimal(1),new EwvClaims(), new EwvServiceLines(),
"2238", "Sarno Road", "MO", "FL",
"FL", "2238", "WICKHAM", "ML",
"TN", "32901", "TR1", "DR1",
"FIRST", "STR2", "COND2", "COND11",
"COND12", "COND13", "COND14", "COND15",
"CERT1", "COND21", "COND22", "COND23",
"COND24", "COND25", "CERT3", "COND31",
"COND32", "COND33", "COND34", "COND35");
// Creating the EwvSvcLineDme
EwvSvcLineDme ewvSvcLineDme = new EwvSvcLineDme(new BigDecimal(1), new EwvServiceLines(), "1","1","1.00","1.00");
Set<EwvSvcLineDme> ewvSvcLinedmeSet = new HashSet<EwvSvcLineDme>();
ewvSvcLinedmeSet.add(ewvSvcLineDme);
EwvSlProvider ewvSlProvider = new EwvSlProvider(new BigDecimal(1),new EwvServiceLines(),"P", "1","LAST", "MIKE", "8009", "32901","GEN HOSP", "CD2");
Set<EwvSlProvider> ewvSlProviderSet = new HashSet<EwvSlProvider>();
ewvSlProviderSet.add(ewvSlProvider);
EwvServiceLineOhiAdjtmts ewvServiceLineOhiAdjmts = new EwvServiceLineOhiAdjtmts(new BigDecimal(1), new EwvServiceLineOhis(),"123456","R1", "DES1", "Q1", "1.00", "1.00", "1.00", "1.00", "1.00");
Set<EwvServiceLineOhiAdjtmts> ewvServiceLineOhiAdjtmtses = new HashSet<>();
ewvServiceLineOhiAdjtmtses.add(ewvServiceLineOhiAdjmts);
EwvServiceLineOhis ewvServiceLineOhis = new EwvServiceLineOhis(new BigDecimal(1), new EwvServiceLines(),"1",
"10/10/2018", "Y", "REV", "PROC1","MOD1",
"MOD2", "MOD3", "MOD5","MOD6", "2.00", "201300", ewvServiceLineOhiAdjtmtses);
Set<EwvServiceLineOhis> ewvServiceLineOhisSet = new HashSet<EwvServiceLineOhis>();
ewvServiceLineOhisSet.add(ewvServiceLineOhis);
// Creating the EwvProcedureCodes
EwvProcedureCodes ewvProcedureCodes = new EwvProcedureCodes(new BigDecimal(1), new EwvClaims(), "CD1", "10/20/2018",new BigDecimal(2));
Set<EwvProcedureCodes> ewvProcedureCodesSet = new HashSet<>();
ewvProcedureCodesSet.add(ewvProcedureCodes);
EwvSvcLineTeeth ewvSvcLineTeeth = new EwvSvcLineTeeth(new BigDecimal(1), new EwvServiceLines(), "100", "SF1","SF2","SF3","SF4","SF5");
Set<EwvSvcLineTeeth> ewvSvcLineTeethSet = new HashSet<>();
ewvSvcLineTeethSet.add(ewvSvcLineTeeth);
Set<EwvAmbulanceInfo5010> ewvAmbulanceInfo5010Set = new HashSet<>();
ewvAmbulanceInfo5010Set.add(ewvAmbulanceInfo5010);
EwvServiceLinesDrugs ewvServiceLineDrugs = new EwvServiceLinesDrugs(new BigDecimal(1), new EwvServiceLines(),"RX1","RXN",
"RXQ", "RXT", "RXC", "RXC5010");
Set<EwvServiceLinesDrugs> ewvServiceLinesDrugsSet = new HashSet<>();
ewvServiceLinesDrugsSet.add(ewvServiceLineDrugs);
// Creating the EwvServiceLines
EwvServiceLines ewvServiceLines = new EwvServiceLines(new BigDecimal(1), new EwvClaims(), 10L, "10/10/2017",
"10/12/2018", "REV1", "PROC", "MOD1", "MOD2",
"MOD3", "MOD4", "QTY", "NDC", "TYPE1", "22.00",
"11.00", "11.00", "1", "DX1", "DX2", "DX3", "DX4",
"2.00", "", "", ewvSvcLinedmeSet, ewvSlProviderSet,
ewvServiceLineOhisSet,
ewvSvcLineTeethSet,
ewvAmbulanceInfo5010Set,
ewvServiceLinesDrugsSet);
Set<EwvServiceLines> ewvServiceLineses = new HashSet<>();
ewvServiceLineses.add(ewvServiceLines);
// Creating the EwvHealthInformation
EwvHealthInformation ewvHealthInformation = new EwvHealthInformation(new BigDecimal(1),new EwvClaims(),"HC", "QL","DESC", "CODE", "10/20/2018", "PDF", "22.00", new BigDecimal(1));
Set<EwvHealthInformation> ewvHealthInfoSet = new HashSet<>();
ewvHealthInfoSet.add(ewvHealthInformation);
// Creating the EwvDiagnosisCodes
EwvDiagnosisCodes ewvDiagnosisCodes = new EwvDiagnosisCodes(new BigDecimal(1), new EwvClaims(), "DX1", new BigDecimal(1),"POA5010");
Set<EwvDiagnosisCodes> ewvDiagnosisCodeses = new HashSet<>();
ewvDiagnosisCodeses.add(ewvDiagnosisCodes);
EwvClaims ewvClaims = new EwvClaims(new BigDecimal(1), "1", "1", "MICHAEL", "1",
"10/10/1999", "M", "CHARLOTTE", "NORTH CAROLIAN",
"CHARLOTTE", "NC", "27278", "USA",
"HOSP", "2222", "555",
"CHICAGO", "CK", "CHICAGO",
"NC", "28278", "CHICA HOSP",
"666", "745", "CYBERONICS",
"HOUSTON", "HOUSTON","TX",
"77058", "142563", "INST",
"21", "10/20/1996", "13/05/1997",
"456", "22.00", "SIGN1",
"FIRST","AUTH1", "AUTH2",
"AD1", "ADMISSION1", "10/10/2018",
"10/10/2018", "ACI", "A",
"RT","10/11/2017", "10",
"HCCODE1", "HCDDX", "HCRSNVST",
"HCDR", "PROC1", "PROCDT",
"SVCLINETOTAL", "005010X223", "2235698", "125364", "FEE",
"MEL", null, null, null, null, null, null, null, null, null, null, null, null, null, ewvClaimOhisSet, ewvAmbulanceInfo5010Set, ewvProcedureCodesSet,
ewvServiceLineses, ewvHealthInfoSet, ewvDiagnosisCodeses);
OhiInfoContainer ohiInfoResult = ewvOhiService.getOhiData(ewvClaims);
assertNotEquals(null, ohiInfoResult);
assertEquals("1", ohiInfoResult.getClaimOhiList().get(0).getClaimOhiHeaderBean().getOhiPayerID());
assertEquals("GEN HOSP", ohiInfoResult.getClaimOhiList().get(0).getClaimOhiHeaderBean().getOhiGroupName());
assertEquals("1", ohiInfoResult.getClaimOhiList().get(0).getClaimOhiAdjustmentsBean().getOhiPayerId());
assertNotEquals(null, ohiInfoResult.getClaimOhiList().get(0).getCobAmountsBean().getCobMedicareATrustFund());
assertNotEquals(null, ohiInfoResult.getClaimOhiList().get(0).getMedicareInPatientAdjudicationBean().getOhiPayerId());
/* MedicareOutPatientAdjudicationBean should be null if MedicareInPatientAdjudicationBean is not null*/
assertEquals(null, ohiInfoResult.getClaimOhiList().get(0).getMedicareOutPatientAdjudicationBean());
}
}