Skip to content

Commit

Permalink
AB2D-5892 (Sprint 3)Centene customer support to provide 2 year data (#…
Browse files Browse the repository at this point in the history
…1302)

* AB2D-5892 (Sprint 3)Centene customer support to provide 2 year data

* 2.0.14-snapshot

* Bump bfd version to 15

* fix checkstyle

* Remove S3147
  • Loading branch information
smirnovaae authored Jan 17, 2024
1 parent f4b9a06 commit e3e26d0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pipeline {
stage('Package without tests - Create SBOM') {
steps {
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
sh 'mvn package -s settings.xml -DskipTests -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL}'
sh 'mvn -U package -s settings.xml -DskipTests -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL}'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<!-- AB2D lib versions -->
<events-client.version>1.11.8</events-client.version>
<bfd-lib.version>2.0.10</bfd-lib.version>
<bfd-lib.version>2.0.16</bfd-lib.version>
<fhir-lib.version>1.1.11</fhir-lib.version>
<aggregator-lib.version>1.2.12</aggregator-lib.version>
<filters-lib.version>1.8.7</filters-lib.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import gov.cms.ab2d.worker.processor.coverage.CoverageDriver;
import gov.cms.ab2d.worker.service.ContractWorkerClient;
import gov.cms.ab2d.worker.service.JobChannelService;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -34,6 +35,7 @@
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down Expand Up @@ -242,7 +244,10 @@ private void loadEobRequests(ContractData contractData) throws InterruptedExcept
if (contractData.getJob().hasJobBeenCancelled()) {
return;
}

//Ignore for S4802 during Centene support
if (contractData.getContract().getContractNumber().equals("S4802") || contractData.getContract().getContractNumber().equals("Z1001")) {
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);
Expand All @@ -253,6 +258,7 @@ private void loadEobRequests(ContractData contractData) throws InterruptedExcept
throw new ContractProcessingException("expected " + totalExpected +
" patients from database but retrieved " + totalQueued);
}

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import gov.cms.ab2d.fhir.BundleUtils;
import gov.cms.ab2d.fhir.FhirVersion;
import gov.cms.ab2d.worker.config.SearchConfig;

import java.io.File;
import java.io.IOException;
import java.text.ParseException;
Expand All @@ -24,6 +25,7 @@
import java.util.Date;
import java.util.List;
import java.util.concurrent.Future;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
Expand Down Expand Up @@ -187,7 +189,9 @@ private List<IBaseResource> getEobBundleResources(PatientClaimsRequest request,
eobBundle = bfdClient.requestEOBFromServer(request.getVersion(), patient.getIdentifiers().getBeneficiaryId(), sinceTime, request.getContractNum());
collector.filterAndAddEntries(eobBundle, patient);

while (BundleUtils.getNextLink(eobBundle) != null) {
// Only for S4802 Contract (Centene support)

while (BundleUtils.getNextLink(eobBundle) != null && isContinue(eobBundle, request)) {
eobBundle = bfdClient.requestNextBundleFromServer(request.getVersion(), eobBundle, request.getContractNum());
collector.filterAndAddEntries(eobBundle, patient);
}
Expand All @@ -214,11 +218,27 @@ private List<IBaseResource> getEobBundleResources(PatientClaimsRequest request,
}
}

//Centene Support
boolean isContinue(IBaseResource resource, PatientClaimsRequest request) {
OffsetDateTime sinceTime = request.getSinceTime();
if (sinceTime == null) {
return true;
}
Date lastUpdated = resource.getMeta().getLastUpdated();
if (lastUpdated == null) {
return false;
}
if (request.getContractNum().equals("S4802") || request.getContractNum().equals("Z1001")) {
return lastUpdated.getTime() < sinceTime.plusMonths(1).toInstant().toEpochMilli();
}
return true;
}

/**
* Determine what since date to use if any.
*
* <p>
* If since provided by user is null and attestation time is before the earliest date that we can use since for then return null.
*
* <p>
* If since provided is not null, check that since date is not before attestation time and that since date is not
* before AB2D epoch.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,11 @@ public boolean isCoverageAvailable(Job job, ContractDTO contract) throws Interru
@Override
public int numberOfBeneficiariesToProcess(Job job, ContractDTO contract) {

ZonedDateTime now = getEndDateTime();
ZonedDateTime time;
//Centene support
if (job.getContractNumber().equals("S4802") || job.getContractNumber().equals("Z1001"))
time = job.getSince().atZoneSameInstant(AB2D_ZONE).plusMonths(1);
else time = getEndDateTime();

if (contract == null) {
throw new CoverageDriverException("cannot retrieve metadata for job missing contract");
Expand All @@ -528,7 +532,7 @@ public int numberOfBeneficiariesToProcess(Job job, ContractDTO contract) {
ZonedDateTime startDateTime = getStartDateTime(contract);

List<CoveragePeriod> periodsToReport = new ArrayList<>();
while (startDateTime.isBefore(now)) {
while (startDateTime.isBefore(time)) {
CoveragePeriod periodToReport =
coverageService.getCoveragePeriod(mapping.map(contract), startDateTime.getMonthValue(), startDateTime.getYear());
periodsToReport.add(periodToReport);
Expand Down

0 comments on commit e3e26d0

Please sign in to comment.