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());
}
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);
}
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());
}
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);
}
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);
}
Aggregations