use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.
the class PatientClaimsCollectorTest method whenBundleNull_thenFailQuietly.
@DisplayName("Fail quietly on null bundle")
@Test
void whenBundleNull_thenFailQuietly() {
CoverageSummary coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(PATIENT_ID), null, List.of(TestUtil.getOpenRange()));
PatientClaimsRequest request = new PatientClaimsRequest(List.of(coverageSummary), OffsetDateTime.now(), null, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, null);
PatientClaimsCollector collector = new PatientClaimsCollector(request, EPOCH);
collector.filterAndAddEntries(null, coverageSummary);
assertTrue(collector.getEobs().isEmpty());
}
use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.
the class PatientClaimsCollectorTest method whenEarlyAttestation_blockEarlyEobs.
@DisplayName("Early attestation still blocks old billable periods")
@Test
void whenEarlyAttestation_blockEarlyEobs() {
try {
CoverageSummary coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(PATIENT_ID), null, List.of(TestUtil.getOpenRange()));
// Old billable period date and older attestation date should return nothing
ExplanationOfBenefit eob = (ExplanationOfBenefit) EobTestDataUtil.createEOB();
eob.getBillablePeriod().setStart(SDF.parse("12/29/2019"));
eob.getBillablePeriod().setEnd(SDF.parse("12/30/2019"));
IBaseBundle oldBundle = EobTestDataUtil.createBundle(eob);
PatientClaimsRequest request = new PatientClaimsRequest(List.of(coverageSummary), OffsetDateTime.now().minusYears(100), null, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, null);
PatientClaimsCollector collector = new PatientClaimsCollector(request, EPOCH);
collector.filterAndAddEntries(oldBundle, coverageSummary);
assertTrue(collector.getEobs().isEmpty());
} catch (ParseException pe) {
fail("could not build dates", pe);
}
}
use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.
the class PatientClaimsCollectorTest method whenEarlyAttestation_allowEarlyEobs.
@DisplayName("Early attestation still allows valid billable periods")
@Test
void whenEarlyAttestation_allowEarlyEobs() {
try {
CoverageSummary coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(PATIENT_ID), null, List.of(TestUtil.getOpenRange()));
// Valid billable period and old attestation date
ExplanationOfBenefit eob = (ExplanationOfBenefit) EobTestDataUtil.createEOB();
eob.getBillablePeriod().setStart(SDF.parse("01/02/2020"));
eob.getBillablePeriod().setEnd(SDF.parse("01/03/2020"));
IBaseBundle oldBundle = EobTestDataUtil.createBundle(eob);
PatientClaimsRequest request = new PatientClaimsRequest(List.of(coverageSummary), OffsetDateTime.now().minusYears(100), null, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, null);
PatientClaimsCollector collector = new PatientClaimsCollector(request, EPOCH);
collector.filterAndAddEntries(oldBundle, coverageSummary);
assertEquals(1, collector.getEobs().size());
} catch (ParseException pe) {
fail("could not build dates", pe);
}
}
use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.
the class PatientClaimsCollectorTest method whenAttestationToday_blockEobs.
@DisplayName("Attestation today valid billable periods should be blocked")
@Test
void whenAttestationToday_blockEobs() {
try {
CoverageSummary coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(PATIENT_ID), null, List.of(TestUtil.getOpenRange()));
// Valid billable period and attestation day of today
ExplanationOfBenefit eob = (ExplanationOfBenefit) EobTestDataUtil.createEOB();
eob.getBillablePeriod().setStart(SDF.parse("01/02/2020"));
eob.getBillablePeriod().setEnd(SDF.parse("01/03/2020"));
IBaseBundle oldBundle = EobTestDataUtil.createBundle(eob);
PatientClaimsRequest request = new PatientClaimsRequest(List.of(coverageSummary), OffsetDateTime.now(), null, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, null);
PatientClaimsCollector collector = new PatientClaimsCollector(request, EPOCH);
collector.filterAndAddEntries(oldBundle, coverageSummary);
assertTrue(collector.getEobs().isEmpty());
} catch (ParseException pe) {
fail("could not build dates", pe);
}
}
use of gov.cms.ab2d.coverage.model.CoverageSummary in project ab2d by CMSgov.
the class PatientClaimsCollectorTest method oldSinceOldAttestation_thenFilterOut.
@DisplayName("Old since and attestation doesn't work if before ab2d epoch")
@Test
void oldSinceOldAttestation_thenFilterOut() {
try {
CoverageSummary coverageSummary = new CoverageSummary(createIdentifierWithoutMbi(PATIENT_ID), null, List.of(TestUtil.getOpenRange()));
// Old billable period date and older attestation date should return nothing
ExplanationOfBenefit eob = (ExplanationOfBenefit) EobTestDataUtil.createEOB();
eob.getBillablePeriod().setStart(SDF.parse("10/13/1970"));
eob.getBillablePeriod().setEnd(SDF.parse("10/13/1970"));
IBaseBundle oldBundle = EobTestDataUtil.createBundle(eob);
PatientClaimsRequest request = new PatientClaimsRequest(List.of(coverageSummary), OffsetDateTime.now().minusYears(100), null, "client", "job", "contractNum", Contract.ContractType.NORMAL, noOpToken, STU3, null);
PatientClaimsCollector collector = new PatientClaimsCollector(request, EPOCH);
collector.filterAndAddEntries(oldBundle, coverageSummary);
assertTrue(collector.getEobs().isEmpty());
} catch (ParseException pe) {
fail("could not build dates", pe);
}
}
Aggregations