Skip to content

Commit 401d650

Browse files
committed
Fixe some inconsistencies and corrected EpipulseExportFacade method name
1 parent c012379 commit 401d650

4 files changed

Lines changed: 13 additions & 29 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/epipulse/EpipulseExportFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ public interface EpipulseExportFacade extends DeletableFacade {
4040

4141
void deleteEpipulseExport(String uuid);
4242

43-
boolean configured();
43+
boolean isConfigured();
4444
}

sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/labmessage/AbstractLabMessageProcessingFlow.java

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ && samplesContainPositiveTest(externalMessageDto.getSampleReports(), PathogenTes
205205
caseClassification = CaseClassification.CONFIRMED;
206206
}
207207

208-
if (caseClassification != CaseClassification.NO_CASE && samplesContainOnlyNegativeTests(externalMessageDto.getSampleReports(), PathogenTestType.IGRA)) {
208+
// latent tuberculosis will contain only IGRA tests so check if all are negative which would indicate a NO_CASE
209+
if (caseClassification != CaseClassification.NO_CASE
210+
&& samplesContainOnlyNegativeTests(externalMessageDto.getSampleReports(), PathogenTestType.IGRA)) {
209211
caseClassification = CaseClassification.NO_CASE;
210212

211213
}
@@ -285,6 +287,11 @@ protected boolean isLatentTuberculosisMessage(ExternalMessageDto externalMessage
285287
return false;
286288
}
287289

290+
final Collection<SampleReportDto> sampleReports = externalMessageDto.getSampleReports();
291+
if (sampleReports == null || sampleReports.isEmpty()) {
292+
return false;
293+
}
294+
288295
// Latent Tubeculosis message should contain only IGRA tests othewise it is Tuberculosis
289296
final List<TestReportDto> testReports = externalMessageDto.getSampleReports()
290297
.stream()
@@ -357,9 +364,7 @@ protected boolean containsPositiveTest(Collection<TestReportDto> testReports) {
357364
return false;
358365
}
359366

360-
return testReports.stream()
361-
.filter(Objects::nonNull)
362-
.anyMatch(t -> t.getTestResult() == PathogenTestResultType.POSITIVE);
367+
return testReports.stream().filter(Objects::nonNull).anyMatch(t -> t.getTestResult() == PathogenTestResultType.POSITIVE);
363368
}
364369

365370
protected boolean containsOnlyNegativeTests(Collection<TestReportDto> testReports) {
@@ -370,9 +375,7 @@ protected boolean containsOnlyNegativeTests(Collection<TestReportDto> testReport
370375
return false;
371376
}
372377

373-
return testReports.stream()
374-
.filter(Objects::nonNull)
375-
.anyMatch(t -> t.getTestResult() == PathogenTestResultType.NEGATIVE);
378+
return testReports.stream().filter(Objects::nonNull).allMatch(t -> t.getTestResult() == PathogenTestResultType.NEGATIVE);
376379
}
377380

378381
protected boolean containsPositiveTest(Collection<TestReportDto> testReports, PathogenTestType testType) {
@@ -434,23 +437,4 @@ protected boolean hasIgraPositiveTest(Collection<TestReportDto> testReports) {
434437
return containsPositiveTest(testReports, PathogenTestType.IGRA);
435438
}
436439

437-
/**
438-
* Checks if there are only IGRA negative tests in the test reports.
439-
*
440-
* @param testReports
441-
* @return true if all the IGRA tests in the testReports are negative, false otherwise
442-
*/
443-
protected boolean hasOnlyIgraNegativeTest(List<TestReportDto> testReports) {
444-
if (testReports == null) {
445-
return false;
446-
}
447-
if (testReports.isEmpty()) {
448-
return false;
449-
}
450-
return testReports.stream()
451-
.filter(Objects::nonNull)
452-
.filter(t -> t.getTestType() == PathogenTestType.IGRA)
453-
.allMatch(t -> t.getTestResult() == PathogenTestResultType.NEGATIVE);
454-
}
455-
456440
}

sormas-backend/src/main/java/de/symeda/sormas/backend/epipulse/EpipulseExportFacadeEjb.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ private void validate(EpipulseExportDto epipulseExportDto) throws ValidationRunt
338338
}
339339

340340
@Override
341-
public boolean configured() {
341+
public boolean isConfigured() {
342342
return epipulseExportService.configured();
343343
}
344344

sormas-ui/src/main/java/de/symeda/sormas/ui/epipulse/EpiPulseExportController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public EpiPulseExportController() {
5050

5151
public void create(Runnable callback) {
5252

53-
boolean configured = FacadeProvider.getEpipulseExportFacade().configured();
53+
boolean configured = FacadeProvider.getEpipulseExportFacade().isConfigured();
5454
if (configured) {
5555
EpipulseEditForm createForm = new EpipulseEditForm(true);
5656
createForm.setValue(EpipulseExportDto.build(UserProvider.getCurrent().getUserReference()));

0 commit comments

Comments
 (0)