Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public class TestReportDto extends EntityDto {
private String serotypeText;

private PathogenTestCategory pathogenTestCategory;
private boolean fourFoldIncreaseAntibodyTiter;

public SampleReportReferenceDto getSampleReport() {
return sampleReport;
Expand Down Expand Up @@ -922,4 +923,13 @@ public PathogenTestCategory getPathogenTestCategory() {
public void setPathogenTestCategory(PathogenTestCategory pathogenTestCategory) {
this.pathogenTestCategory = pathogenTestCategory;
}

public boolean getFourFoldIncreaseAntibodyTiter() {
return fourFoldIncreaseAntibodyTiter;
}

public void setFourFoldIncreaseAntibodyTiter(boolean fourFoldIncreaseAntibodyTiter) {
this.fourFoldIncreaseAntibodyTiter = fourFoldIncreaseAntibodyTiter;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,15 @@ public List<String[]> mapToPathogenTest(TestReportDto sourceTestReport, Pathogen
pathogenTest.getDrugSusceptibility().getErythromycinSusceptibility(),
sourceTestReport.getErythromycinSusceptibility(),
PathogenTestDto.DRUG_SUSCEPTIBILITY,
DrugSusceptibilityDto.ERYTHROMYCIN_SUSCEPTIBILITY))));
DrugSusceptibilityDto.ERYTHROMYCIN_SUSCEPTIBILITY),

Mapping.of(
pathogenTest::setFourFoldIncreaseAntibodyTiter,
pathogenTest.isFourFoldIncreaseAntibodyTiter(),
sourceTestReport.getFourFoldIncreaseAntibodyTiter(),
PathogenTestDto.FOUR_FOLD_INCREASE_ANTIBODY_TITER))

));
}

changedFields.addAll(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ public interface Captions {
String EpiData_clusterTypeText = "EpiData.clusterTypeText";
String EpiData_contactWithSourceCaseKnown = "EpiData.contactWithSourceCaseKnown";
String EpiData_country = "EpiData.country";
String EpiData_country_SHIG = "EpiData.country.SHIG";
String EpiData_exposureDetailsKnown = "EpiData.exposureDetailsKnown";
String EpiData_exposureInvestigationFromDate = "EpiData.exposureInvestigationFromDate";
String EpiData_exposureInvestigationToDate = "EpiData.exposureInvestigationToDate";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,15 @@ public enum PathogenTestType {
Q_PCR,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
MULTIPLEX_PCR,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS)
@ResultValueTypeRel({
ResultValueType.QUALITATIVE,
Expand All @@ -221,7 +223,8 @@ public enum PathogenTestType {
LAMP,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
NASBA,
Expand All @@ -242,19 +245,22 @@ public enum PathogenTestType {
TMA,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
CRISPR_DIAGNOSTICS,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS)
@ResultValueTypeRel(ResultValueType.BOOLEAN)
LINE_PROBE_ASSAY,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS)
@ResultValueTypeRel(ResultValueType.TEXT)
SANGER_SEQUENCING,
Expand Down Expand Up @@ -426,7 +432,8 @@ public enum PathogenTestType {

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.SEROLOGICAL_TESTS)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
RAPID_ANTIBODY_TEST,
Expand All @@ -436,7 +443,8 @@ public enum PathogenTestType {
// ----------------------------------------------------------------------------------------------

@Diseases(value = {
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
Disease.DENGUE })
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
RAPID_ANTIGEN_DETECTION,
Expand All @@ -448,13 +456,15 @@ public enum PathogenTestType {
RAPID_TEST,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
LATERAL_FLOW_ASSAY,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
IMMUNOFLUORESCENCE_ASSAY,
Expand All @@ -467,13 +477,15 @@ public enum PathogenTestType {
SLIDE_AGGLUTINATION,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
QUELLUNG_REACTION,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
@ResultValueTypeRel(ResultValueType.TEXT)
HEMAGGLUTINATION_INHIBITION,
Expand Down Expand Up @@ -513,7 +525,8 @@ public enum PathogenTestType {
FUNGAL_CULTURE,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.CULTURE_AND_ISOLATION)
@ResultValueTypeRel(ResultValueType.TEXT)
MALDI_TOF,
Expand Down Expand Up @@ -546,21 +559,24 @@ public enum PathogenTestType {

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING)
@ResultValueTypeRel(ResultValueType.SMEAR_GRADE)
ACID_FAST_STAIN,

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
DARK_FIELD_MICROSCOPY,

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING)
@ResultValueTypeRel({
ResultValueType.QUALITATIVE,
Expand All @@ -584,7 +600,8 @@ public enum PathogenTestType {

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING)
@ResultValueTypeRel({
ResultValueType.QUALITATIVE,
Expand All @@ -593,21 +610,24 @@ public enum PathogenTestType {

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
IMMUNOHISTOCHEMISTRY,

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING)
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
ELECTRON_MICROSCOPY,

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING)
@ResultValueTypeRel({
ResultValueType.QUALITATIVE,
Expand Down Expand Up @@ -650,7 +670,8 @@ public enum PathogenTestType {

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
@PathogenTestCategoryRel(PathogenTestCategory.ANTIMICROBIAL_SUSCEPTIBILITY_TESTING)
@ResultValueTypeRel(ResultValueType.BOOLEAN)
GENOTYPIC_RESISTANCE_TEST,
Expand All @@ -677,7 +698,8 @@ public enum PathogenTestType {
@ResultValueTypeRel(ResultValueType.NUMERIC)
@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE }, hide = true)
FLOW_CYTOMETRY,

// ----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -829,18 +851,19 @@ public static boolean isSelectableForNewTests(PathogenTestType testType) {
* the generic numeric value/unit fields when the Cq input applies. Both call sites must use this method so
* the rule cannot drift.
*
* <p>The Cq input applies for {@code PCR_RT_PCR}, {@code CQ_VALUE_DETECTION}, or {@code Q_PCR} on Malaria
* <p>
* The Cq input applies for {@code PCR_RT_PCR}, {@code CQ_VALUE_DETECTION}, or {@code Q_PCR} on Malaria
* — except for Tuberculosis, which historically does not offer a Cq value.
*
* @param disease the tested disease (may be {@code null})
* @param testType the test method (may be {@code null})
* @param disease
* the tested disease (may be {@code null})
* @param testType
* the test method (may be {@code null})
*/
public static boolean cqInputApplies(Disease disease, PathogenTestType testType) {
if (disease == Disease.TUBERCULOSIS) {
return false;
}
return testType == PCR_RT_PCR
|| testType == CQ_VALUE_DETECTION
|| (disease == Disease.MALARIA && testType == Q_PCR);
return testType == PCR_RT_PCR || testType == CQ_VALUE_DETECTION || (disease == Disease.MALARIA && testType == Q_PCR);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,13 @@ public enum SampleMaterial {

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE}, hide = true)
BONE,

@Diseases(value = {
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE}, hide = true)
BONE_MARROW,

@Diseases(value = {
Expand Down Expand Up @@ -543,7 +545,8 @@ public enum SampleMaterial {

@Diseases(value = {
Disease.SALMONELLOSIS,
Disease.SHIGELLOSIS }, hide = true)
Disease.SHIGELLOSIS,
Disease.DENGUE}, hide = true)
LUNG_TISSUE,

@Diseases(value = {
Expand Down
1 change: 1 addition & 0 deletions sormas-api/src/main/resources/captions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,7 @@ EpiData.infectionSource= Suspected vehicle or source of infection
EpiData.infectionSourceText= Specify source of infection
EpiData.importedCase= Imported Case
EpiData.country= Country of contamination
EpiData.country.SHIG= Place of residence of patient at the time of disease onset
EpiData.otherDetails= General comment
EpiData.airportWorker=Working at an airport
EpiData.healthcareProfessional=Working as a healthcare professional
Expand Down
4 changes: 2 additions & 2 deletions sormas-api/src/main/resources/enum.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3163,8 +3163,8 @@ ExposureSubSetting.HEALTHCARE_SETTINGS=Healthcare settings
ExposureSubSetting.TEMPORARY_SHELTERS=Temporary shelters
ExposureSubSetting.CROWDED_OUTDOOR_LIMITED_AIRFLOW=Crowded outdoor areas with limited airflow
ExposureSubSetting.CLOSE_PHYSICAL_CONTACT=Close physical contact
ExposureSubSetting.HIGH_TOUCH_ENVIRONMENTS=High-touch environments (e.g. childcare centers, healthcare facilities)
ExposureSubSetting.SEXUAL_ACTIVITY=Sexual
ExposureSubSetting.HIGH_TOUCH_ENVIRONMENTS=High-contact environments (e.g. childcare centers, healthcare facilities)
ExposureSubSetting.SEXUAL_ACTIVITY=Sexual contact
ExposureSubSetting.STANDING_WATER_AREAS=Areas with standing water (e.g. ponds, swamps)
ExposureSubSetting.HIGH_MOSQUITO_ACTIVITY_REGIONS=Regions with high mosquito activity, especially in warm climates
ExposureSubSetting.FORESTED_GRASSY_RURAL=Forested, grassy, or rural areas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public class TestReport extends AbstractDomainObject {
private Serotype serotype;
private String serotypeText;
private PathogenTestCategory pathogenTestCategory;
private boolean fourFoldIncreaseAntibodyTiter;

@Column(length = CHARACTER_LIMIT_DEFAULT)
public String getTestLabName() {
Expand Down Expand Up @@ -945,4 +946,13 @@ public PathogenTestCategory getPathogenTestCategory() {
public void setPathogenTestCategory(PathogenTestCategory pathogenTestCategory) {
this.pathogenTestCategory = pathogenTestCategory;
}

public boolean getFourFoldIncreaseAntibodyTiter() {
return fourFoldIncreaseAntibodyTiter;
}

public void setFourFoldIncreaseAntibodyTiter(boolean fourFoldIncreaseAntibodyTiter) {
this.fourFoldIncreaseAntibodyTiter = fourFoldIncreaseAntibodyTiter;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public static TestReportDto toDto(TestReport source) {
}
target.setSerotypeText(source.getSerotypeText());
target.setPathogenTestCategory(source.getPathogenTestCategory());
target.setFourFoldIncreaseAntibodyTiter(source.getFourFoldIncreaseAntibodyTiter());

return target;
}
Expand Down Expand Up @@ -266,6 +267,7 @@ public TestReport fillOrBuildEntity(@NotNull TestReportDto source, @NotNull Samp
}
target.setSerotypeText(source.getSerotypeText());
target.setPathogenTestCategory(source.getPathogenTestCategory());
target.setFourFoldIncreaseAntibodyTiter(source.getFourFoldIncreaseAntibodyTiter());

return target;
}
Expand Down
7 changes: 7 additions & 0 deletions sormas-backend/src/main/resources/sql/sormas_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16407,4 +16407,11 @@ ALTER TABLE symptoms ADD COLUMN IF NOT EXISTS waterydiarrhea varchar(255
ALTER TABLE symptoms_history ADD COLUMN IF NOT EXISTS waterydiarrhea varchar(255);
INSERT INTO schema_version (version_number, comment) VALUES (641, 'Add Salmonellosis watery diarrhoea symptom issue #13918');

-- 18-06-2026 Malaria and Dengue DD and Lab message processing fixes

ALTER TABLE testreport ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
Comment on lines +16412 to +16413

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify current nullability/defaults for the added columns in schema SQL
rg -n -C2 'fourfoldincreaseantibodytiter|ALTER COLUMN .* SET NOT NULL' sormas-backend/src/main/resources/sql/sormas_schema.sql

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 16223


🏁 Script executed:

fd -i testReport.java -type f

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 247


🏁 Script executed:

find . -type f -name "*.java" | xargs grep -l "class TestReport" | head -5

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 602


🏁 Script executed:

rg -l "class TestReport\b" --type java

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 173


🏁 Script executed:

cat -n sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.java | grep -A5 -B5 "fourFoldIncreaseAntibodyTiter"

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 988


Enforce NOT NULL on the new boolean columns to match the Java primitive contract.

TestReport uses primitive boolean for fourFoldIncreaseAntibodyTiter (line 186), but the new DB columns allow NULL. This creates a schema-Java mismatch at the persistence boundary.

The established pattern in the schema file (see epidata.clusterrelated at lines 14651-14656) is to UPDATE existing NULLs before adding the NOT NULL constraint:

Suggested migration adjustment
ALTER TABLE testreport ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
+UPDATE testreport SET fourfoldincreaseantibodytiter = false WHERE fourfoldincreaseantibodytiter IS NULL;
+UPDATE testreport_history SET fourfoldincreaseantibodytiter = false WHERE fourfoldincreaseantibodytiter IS NULL;
+ALTER TABLE testreport ALTER COLUMN fourfoldincreaseantibodytiter SET NOT NULL;
+ALTER TABLE testreport_history ALTER COLUMN fourfoldincreaseantibodytiter SET NOT NULL;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ALTER TABLE testreport ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
ALTER TABLE testreport ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS fourfoldincreaseantibodytiter boolean DEFAULT false;
UPDATE testreport SET fourfoldincreaseantibodytiter = false WHERE fourfoldincreaseantibodytiter IS NULL;
UPDATE testreport_history SET fourfoldincreaseantibodytiter = false WHERE fourfoldincreaseantibodytiter IS NULL;
ALTER TABLE testreport ALTER COLUMN fourfoldincreaseantibodytiter SET NOT NULL;
ALTER TABLE testreport_history ALTER COLUMN fourfoldincreaseantibodytiter SET NOT NULL;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sormas-backend/src/main/resources/sql/sormas_schema.sql` around lines 16412 -
16413, The ALTER TABLE statements for testreport and testreport_history are
adding fourfoldincreaseantibodytiter as nullable boolean columns with DEFAULT
false, but the Java entity uses a primitive boolean type which cannot be null,
creating a schema-Java mismatch. To fix this, follow the established pattern in
the schema: first add an UPDATE statement to set any existing NULL values to
false in both the testreport and testreport_history tables, then modify both
ALTER TABLE statements to include the NOT NULL constraint on the
fourfoldincreaseantibodytiter columns to enforce the non-nullable contract
expected by the Java primitive boolean field.


INSERT INTO schema_version (version_number, comment) VALUES (642, 'Malaria and Dengue DD and Lab message processing fixes');

-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
Loading
Loading