-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f327ce
commit adfb1c2
Showing
12 changed files
with
107 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
spring.profiles.active=mock-beans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...src/main/java/gov/cms/ab2d/worker/processor/coverage/check/CoverageStableCheckHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package gov.cms.ab2d.worker.processor.coverage.check; | ||
|
||
import gov.cms.ab2d.coverage.model.CoverageCount; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
import java.time.LocalDate; | ||
|
||
/** | ||
* Check to make sure that month to month enrollment changes are within acceptable bounds. If enrollment goes from | ||
* 1K to 1 million then there may be problem. | ||
*/ | ||
@Slf4j | ||
public class CoverageStableCheckHelper { | ||
private static final int CHANGE_THRESHOLD = 1000; | ||
|
||
//Moved the skip check conditions to a method to make sonar happy | ||
public static boolean skipCheck(CoverageCount previousMonth, CoverageCount nextMonth, int change) { | ||
|
||
// Don't check December to January because changes can be 200% or more | ||
LocalDate now = LocalDate.now(); | ||
boolean skip = previousMonth.getMonth() == 12; | ||
|
||
// Ignores coverage checks from previous years | ||
if (nextMonth.getYear() < now.getYear() && previousMonth.getYear() < now.getYear()) { | ||
skip = true; | ||
} | ||
|
||
// January to February changes can also be significant. | ||
// Stop sending this notification once February ends. | ||
if (now.getMonthValue() > 2 && previousMonth.getMonth() == 1) { | ||
skip = true; | ||
} | ||
|
||
// Change could be anomaly for smaller contracts, ignore | ||
if (change < CHANGE_THRESHOLD) { | ||
skip = true; | ||
} | ||
return skip; | ||
} | ||
} |
Oops, something went wrong.