Search in sources :

Example 1 with CoverageSummary

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());
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 2 with CoverageSummary

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);
    }
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) ParseException(java.text.ParseException) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 3 with CoverageSummary

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);
    }
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) ParseException(java.text.ParseException) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 4 with CoverageSummary

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);
    }
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) ParseException(java.text.ParseException) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 5 with CoverageSummary

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);
    }
}
Also used : CoverageSummary(gov.cms.ab2d.coverage.model.CoverageSummary) IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle) ParseException(java.text.ParseException) ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

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