diff --git a/worker/src/main/java/gov/cms/ab2d/worker/processor/ContractProcessorImpl.java b/worker/src/main/java/gov/cms/ab2d/worker/processor/ContractProcessorImpl.java index 1991f070d..24770f219 100644 --- a/worker/src/main/java/gov/cms/ab2d/worker/processor/ContractProcessorImpl.java +++ b/worker/src/main/java/gov/cms/ab2d/worker/processor/ContractProcessorImpl.java @@ -241,7 +241,9 @@ private void loadEobRequests(ContractData contractData) throws InterruptedExcept if (contractData.getJob().hasJobBeenCancelled()) { return; } - + if (contractData.getJob().getUntil() != null) { + return; + } // Verify that the number of benes requested matches the number expected from the database and fail // immediately if the two do not match ProgressTracker progressTracker = jobProgressService.getStatus(jobUuid); diff --git a/worker/src/main/java/gov/cms/ab2d/worker/processor/JobProcessorImpl.java b/worker/src/main/java/gov/cms/ab2d/worker/processor/JobProcessorImpl.java index 9853297e0..47f85b022 100644 --- a/worker/src/main/java/gov/cms/ab2d/worker/processor/JobProcessorImpl.java +++ b/worker/src/main/java/gov/cms/ab2d/worker/processor/JobProcessorImpl.java @@ -164,7 +164,9 @@ void verifyTrackedJobProgress(Job job) { if (ignoredContracts.contains(job.getContractNumber())) { return; } - + if (job.getUntil() != null) { + return; + } // Number in database int expectedPatients = progressTracker.getPatientsExpected(); diff --git a/worker/src/main/java/gov/cms/ab2d/worker/processor/coverage/CoverageDriverImpl.java b/worker/src/main/java/gov/cms/ab2d/worker/processor/coverage/CoverageDriverImpl.java index 78810ac47..53dbc258a 100644 --- a/worker/src/main/java/gov/cms/ab2d/worker/processor/coverage/CoverageDriverImpl.java +++ b/worker/src/main/java/gov/cms/ab2d/worker/processor/coverage/CoverageDriverImpl.java @@ -519,13 +519,7 @@ public boolean isCoverageAvailable(Job job, ContractDTO contract) throws Interru @Override public int numberOfBeneficiariesToProcess(Job job, ContractDTO contract) { - // ZonedDateTime time; -// //Centene and Humana support -// if (job.getContractNumber().equals("S4802") || job.getContractNumber().equals("Z1001")) -// time = job.getSince().atZoneSameInstant(AB2D_ZONE).plusMonths(1); -// else if (job.getContractNumber().equals("S5884")) -// time = job.getSince().atZoneSameInstant(AB2D_ZONE).plusMonths(2); - ZonedDateTime time = getEndDateTime(); + ZonedDateTime endTime = (job.getUntil() != null) ? job.getUntil().atZoneSameInstant(AB2D_ZONE).plusMonths(1) : getEndDateTime(); if (contract == null) { throw new CoverageDriverException("cannot retrieve metadata for job missing contract"); @@ -534,7 +528,7 @@ public int numberOfBeneficiariesToProcess(Job job, ContractDTO contract) { ZonedDateTime startDateTime = getStartDateTime(contract); List periodsToReport = new ArrayList<>(); - while (startDateTime.isBefore(time)) { + while (startDateTime.isBefore(endTime)) { CoveragePeriod periodToReport = coverageService.getCoveragePeriod(mapping.map(contract), startDateTime.getMonthValue(), startDateTime.getYear()); periodsToReport.add(periodToReport); @@ -555,7 +549,7 @@ public int numberOfBeneficiariesToProcess(Job job, ContractDTO contract) { @Trace(metricName = "EnrollmentLoadFromDB", dispatcher = true) @Override public CoveragePagingResult pageCoverage(Job job, ContractDTO contract) { - ZonedDateTime now = getEndDateTime(); + ZonedDateTime endTime = (job.getUntil() != null) ? job.getUntil().atZoneSameInstant(AB2D_ZONE).plusMonths(1) : getEndDateTime(); if (contract == null) { throw new CoverageDriverException("cannot retrieve metadata for job missing contract"); @@ -565,7 +559,7 @@ public CoveragePagingResult pageCoverage(Job job, ContractDTO contract) { try { // Check that all coverage periods necessary are present before beginning to page - while (startDateTime.isBefore(now)) { + while (startDateTime.isBefore(endTime)) { // Will throw exception if it doesn't exist coverageService.getCoveragePeriod(mapping.map(contract), startDateTime.getMonthValue(), startDateTime.getYear()); startDateTime = startDateTime.plusMonths(1);