Search in sources :

Example 6 with CoverageSummary

use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.

the class PatientClaimsCollectorTest method whenSkipBillablePeriod.

@DisplayName("Skip billable period check changes whether eobs are filtered or not")
@Test
void whenSkipBillablePeriod() {
    CoverageSummary coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(PATIENT_ID), null, List.of());
    PatientClaimsRequest request = new PatientClaimsRequest(List.of(coverageSummary), LATER_ATT_DATE, null, "client", "job", "contractNum", Contract.ContractType.CLASSIC_TEST, noOpToken, STU3, null);
    PatientClaimsCollector collector = new PatientClaimsCollector(request, EPOCH);
    collector.filterAndAddEntries(BUNDLE, coverageSummary);
    assertEquals(1, collector.getEobs().size());
    request = new PatientClaimsRequest(List.of(coverageSummary), LATER_ATT_DATE, null, "client", "job", "contractNum", Contract.ContractType.SYNTHEA, noOpToken, STU3, null);
    collector = new PatientClaimsCollector(request, EPOCH);
    collector.filterAndAddEntries(BUNDLE, coverageSummary);
    assertTrue(collector.getEobs().isEmpty());
    request = new PatientClaimsRequest(List.of(coverageSummary), LATER_ATT_DATE, null, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, null);
    collector = new PatientClaimsCollector(request, EPOCH);
    collector.filterAndAddEntries(BUNDLE, coverageSummary);
    assertTrue(collector.getEobs().isEmpty());
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 7 with CoverageSummary

use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.

the class PatientClaimsProcessorUnitTest method process_whenPatientHasSinglePageOfClaimsDataEarlySinceDate.

@Test
void process_whenPatientHasSinglePageOfClaimsDataEarlySinceDate() throws ExecutionException, InterruptedException {
    // Override default behavior of setup
    coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(patientId), null, List.of(TestUtil.getOpenRange()));
    request = new PatientClaimsRequest(List.of(coverageSummary), EARLY_ATT_DATE, EARLY_SINCE_DATE, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, tmpEfsMountDir.getAbsolutePath());
    org.hl7.fhir.dstu3.model.Bundle bundle1 = EobTestDataUtil.createBundle(eob.copy());
    when(mockBfdClient.requestEOBFromServer(STU3, patientId, null)).thenReturn(bundle1);
    cut.process(request).get();
    verify(mockBfdClient).requestEOBFromServer(STU3, patientId, null);
    verify(mockBfdClient, never()).requestNextBundleFromServer(STU3, bundle1);
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) Test(org.junit.jupiter.api.Test)

Example 8 with CoverageSummary

use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.

the class PatientClaimsProcessorUnitTest method setUp.

@BeforeEach
void setUp() throws Exception {
    searchConfig = new SearchConfig(tmpEfsMountDir.getAbsolutePath(), "streamingDir", "finishedDir", 0, 0, 1, 2);
    cut = new PatientClaimsProcessorImpl(mockBfdClient, eventLogger, searchConfig);
    ReflectionTestUtils.setField(cut, "earliestDataDate", "01/01/1900");
    eob = (ExplanationOfBenefit) EobTestDataUtil.createEOB();
    createOutputFiles();
    List<CoverageSummary> coverageSummaries = new ArrayList<>();
    coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(patientId), null, List.of(TestUtil.getOpenRange()));
    coverageSummaries.add(coverageSummary);
    CoverageSummary fileSummary = new CoverageSummary(createIdentifierWithoutMbi(-199900000022040L), null, List.of(TestUtil.getOpenRange()));
    coverageSummaries.add(fileSummary);
    request = new PatientClaimsRequest(List.of(coverageSummary), LATER_ATT_DATE, null, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, tmpEfsMountDir.getAbsolutePath());
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) ArrayList(java.util.ArrayList) SearchConfig(gov.cms.ab2d.worker.config.SearchConfig) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 9 with CoverageSummary

use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.

the class PatientClaimsProcessorUnitTest method process_whenPatientHasSinglePageOfClaimsDataSince.

@Test
void process_whenPatientHasSinglePageOfClaimsDataSince() throws ExecutionException, InterruptedException {
    // Override default behavior of setup
    coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(patientId), null, List.of(TestUtil.getOpenRange()));
    OffsetDateTime sinceDate = EARLY_ATT_DATE.plusDays(1);
    request = new PatientClaimsRequest(List.of(coverageSummary), LATER_ATT_DATE, sinceDate, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, tmpEfsMountDir.getAbsolutePath());
    org.hl7.fhir.dstu3.model.Bundle bundle1 = EobTestDataUtil.createBundle(eob.copy());
    when(mockBfdClient.requestEOBFromServer(STU3, patientId, LATER_ATT_DATE)).thenReturn(bundle1);
    cut.process(request).get();
    verify(mockBfdClient).requestEOBFromServer(STU3, patientId, LATER_ATT_DATE);
    verify(mockBfdClient, never()).requestNextBundleFromServer(STU3, bundle1);
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) OffsetDateTime(java.time.OffsetDateTime) Test(org.junit.jupiter.api.Test)

Example 10 with CoverageSummary

use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.

the class CoverageDriverStub method pageCoverage.

@Override
public CoveragePagingResult pageCoverage(CoveragePagingRequest request) {
    CoveragePagingRequest nextRequest = getNextRequest(request, null, request.getContract());
    List<CoverageSummary> results = getSummaries(request);
    return new CoveragePagingResult(results, nextRequest);
}
Also used : CoveragePagingRequest(gov.cms.ab2d.coverage.model.CoveragePagingRequest) CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) CoveragePagingResult(gov.cms.ab2d.coverage.model.CoveragePagingResult)

Aggregations

CoverageSummary (gov.cms.ab2d.coverage.model.CoverageSummary)35 Test (org.junit.jupiter.api.Test)27 DisplayName (org.junit.jupiter.api.DisplayName)23 FilterOutByDate (gov.cms.ab2d.filter.FilterOutByDate)14 CoveragePagingRequest (gov.cms.ab2d.coverage.model.CoveragePagingRequest)13 CoveragePagingResult (gov.cms.ab2d.coverage.model.CoveragePagingResult)13 Identifiers (gov.cms.ab2d.coverage.model.Identifiers)11 OffsetDateTime (java.time.OffsetDateTime)10 LinkedHashSet (java.util.LinkedHashSet)10 ContractForCoverageDTO (gov.cms.ab2d.coverage.model.ContractForCoverageDTO)9 CoverageSearchEvent (gov.cms.ab2d.coverage.model.CoverageSearchEvent)9 AB2D_EPOCH (gov.cms.ab2d.common.util.DateUtil.AB2D_EPOCH)8 CoverageCount (gov.cms.ab2d.coverage.model.CoverageCount)8 CoverageJobStatus (gov.cms.ab2d.coverage.model.CoverageJobStatus)8 CoveragePeriod (gov.cms.ab2d.coverage.model.CoveragePeriod)8 List (java.util.List)8 Map (java.util.Map)8 Optional (java.util.Optional)8 CoverageDelta (gov.cms.ab2d.coverage.model.CoverageDelta)7 CoverageMapping (gov.cms.ab2d.coverage.model.CoverageMapping)7