Skip to content

Commit

Permalink
#13159 Automatically (Soft-)Delete Samples & Pathogen Tests with Nega…
Browse files Browse the repository at this point in the history
…tive Test Results for COVID-19 - rename config property
  • Loading branch information
Levente Gal committed Oct 29, 2024
1 parent 536f9c8 commit b74ceb5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ public interface ConfigFacade {

boolean isAnyCaseClassificationCalculationEnabled();

Integer getNegaiveCovidSamplesMaxAgeDays();
Integer getNegaiveCovidTestsMaxAgeDays();
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public class ConfigFacadeEjb implements ConfigFacade {
public static final int DEFAULT_DOCUMENT_UPLOAD_SIZE_LIMIT_MB = 20;
public static final String IMPORT_FILE_SIZE_LIMIT_MB = "importFileSizeLimitMb";
public static final int DEFAULT_IMPOR_FILE_SIZE_LIMIT_MB = 20;
public static final String NEGAIVE_COVID_SAMPLES_MAX_AGE_DAYS = "negaiveCovidSamplesMaxAgeDays";
public static final String NEGATIVE_COVID_TESTS_MAX_AGE_DAYS = "negativeCovidTestsMaxAgeDays";

private final Logger logger = LoggerFactory.getLogger(getClass());

Expand Down Expand Up @@ -840,8 +840,8 @@ public void resetRequestContext() {
}

@Override
public Integer getNegaiveCovidSamplesMaxAgeDays() {
return parseProperty(NEGAIVE_COVID_SAMPLES_MAX_AGE_DAYS, null, Integer::parseInt);
public Integer getNegaiveCovidTestsMaxAgeDays() {
return parseProperty(NEGATIVE_COVID_TESTS_MAX_AGE_DAYS, null, Integer::parseInt);
}

@LocalBean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ public List<DiseaseVariant> getAssociatedDiseaseVariants(String sampleUuid) {
}

public void cleanupOldCovidSamples() {
final Integer maxAgeDays = configFacade.getNegaiveCovidSamplesMaxAgeDays();
final Integer maxAgeDays = configFacade.getNegaiveCovidTestsMaxAgeDays();
if (maxAgeDays == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void init() {
user = creator.createUser(rdcf).toReference();
caze = creator.createCase(user, creator.createPerson().toReference(), rdcf);

MockProducer.getProperties().setProperty(ConfigFacadeEjb.NEGAIVE_COVID_SAMPLES_MAX_AGE_DAYS, String.valueOf(negativeCovidTestMaxAge));
MockProducer.getProperties().setProperty(ConfigFacadeEjb.NEGATIVE_COVID_TESTS_MAX_AGE_DAYS, String.valueOf(negativeCovidTestMaxAge));
}

@Test
Expand Down Expand Up @@ -242,7 +242,7 @@ public void testDeletionReferenceDate() {

@Test
public void testNotConfigured() {
MockProducer.getProperties().remove(ConfigFacadeEjb.NEGAIVE_COVID_SAMPLES_MAX_AGE_DAYS);
MockProducer.getProperties().remove(ConfigFacadeEjb.NEGATIVE_COVID_TESTS_MAX_AGE_DAYS);

SampleDto sample = creator.createSample(caze.toReference(), user, rdcf.facility, s -> {
s.setPathogenTestResult(PathogenTestResultType.NEGATIVE);
Expand Down
2 changes: 1 addition & 1 deletion sormas-base/setup/sormas.properties
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ app.url=
# Number of days after which negative CORONAVIRUS pathogen tests and their samples are soft deleted
# default: not set, meaning no delete
# possible values: any integer representing the number of days
# negativeCovidSamplesMaxAgeDays
# negativeCovidTestsMaxAgeDays

# The similarity threshold after which two names are identified as similar enough to consider them for duplicate detection.
# The default value should work for most servers. If you need to change it, please change it carefully as slightly higher or lower values already lead to significant differences.
Expand Down

0 comments on commit b74ceb5

Please sign in to comment.