diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/clinicalcourse/HealthConditionsDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/clinicalcourse/HealthConditionsDto.java index 5fa95cff40a..02701952e9a 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/clinicalcourse/HealthConditionsDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/clinicalcourse/HealthConditionsDto.java @@ -60,7 +60,7 @@ public class HealthConditionsDto extends PseudonymizableDto { public static final String VACCINATED_AGAINST_MOSQUITO_BORNE_VIRUSES = "vaccinatedAgainstMosquitoBorneViruses"; public static final String MALARIA = "malaria"; public static final String MALARIA_INFECTED_YEAR = "malariaInfectedYear"; - public static final String UNDER_MEDICATION = "underMedication"; + public static final String ON_MEDICATION = "onMedication"; public static final String MEDICATION_DETAILS = "medicationDetails"; public static final String CHRONIC_DISEASE = "chronicDisease"; public static final String CHRONIC_DISEASE_DETAILS = "chronicDiseaseDetails"; @@ -201,7 +201,7 @@ public class HealthConditionsDto extends PseudonymizableDto { private Integer malariaInfectedYear; @Diseases(value = { Disease.SHIGELLOSIS }) - private YesNoUnknown underMedication; + private YesNoUnknown onMedication; @Diseases(value = { Disease.SHIGELLOSIS }) private String medicationDetails; @@ -506,12 +506,12 @@ public void setMalariaInfectedYear(Integer malariaInfectedYear) { this.malariaInfectedYear = malariaInfectedYear; } - public YesNoUnknown getUnderMedication() { - return underMedication; + public YesNoUnknown getOnMedication() { + return onMedication; } - public void setUnderMedication(YesNoUnknown underMedication) { - this.underMedication = underMedication; + public void setOnMedication(YesNoUnknown onMedication) { + this.onMedication = onMedication; } public String getMedicationDetails() { diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java index 95fee8269b4..49b4ac4a55e 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java @@ -142,6 +142,7 @@ public class ExposureDto extends PseudonymizableDto { public static final String TRAVEL_PURPOSE = "travelPurpose"; public static final String TRAVEL_PURPOSE_DETAILS = "travelPurposeDetails"; public static final String SHOPPING_FOR_FOOD_DETAILS = "shoppingForFoodDetails"; + public static final String SEXUAL_CONTACT = "sexualContact"; @SensitiveData private UserReferenceDto reportingUser; @@ -466,6 +467,11 @@ public class ExposureDto extends PseudonymizableDto { @Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong) private String shoppingForFoodDetails; + @Diseases({ + Disease.SHIGELLOSIS }) + @SensitiveData + private SexualContact sexualContact; + public static ExposureDto build(ExposureType exposureType) { ExposureDto exposure = new ExposureDto(); @@ -1169,6 +1175,14 @@ public void setShoppingForFoodDetails(String shoppingForFoodDetails) { this.shoppingForFoodDetails = shoppingForFoodDetails; } + public SexualContact getSexualContact() { + return sexualContact; + } + + public void setSexualContact(SexualContact sexualContact) { + this.sexualContact = sexualContact; + } + @Override public ExposureDto clone() throws CloneNotSupportedException { ExposureDto clone = (ExposureDto) super.clone(); diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSubSetting.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSubSetting.java index 3b5f9773e96..0f4dfa7413c 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSubSetting.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSubSetting.java @@ -51,6 +51,9 @@ public enum ExposureSubSetting { EATING_AT_HOME(ExposureCategory.FOOD_BORNE, null), EATING_OUTSIDE(ExposureCategory.FOOD_BORNE, null), + @Diseases({ + Disease.SHIGELLOSIS }) + HOUSEHOLD_CONTACT(ExposureCategory.DIRECT_CONTACT, ExposureSetting.PERSON_TO_PERSON), @Diseases({ Disease.SALMONELLOSIS }) SHOPPING_FOR_FOOD(ExposureCategory.FOOD_BORNE, null), diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/SexualContact.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/SexualContact.java new file mode 100644 index 00000000000..5ae11262a5e --- /dev/null +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/SexualContact.java @@ -0,0 +1,35 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2026 SORMAS Foundation gGmbH + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package de.symeda.sormas.api.exposure; + +import de.symeda.sormas.api.i18n.I18nProperties; + +/** + * Enum for sexual contact types. + */ +public enum SexualContact { + + MALE, + FEMALE, + BOTH, + NOT_ANSWERED, + UNKNOWN, + OTHER; + + @Override + public String toString() { + return I18nProperties.getEnumCaption(this); + } +} diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/labmessage/TestReportDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/labmessage/TestReportDto.java index 028220d36c4..5a756b859d8 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/labmessage/TestReportDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/labmessage/TestReportDto.java @@ -15,6 +15,7 @@ import de.symeda.sormas.api.sample.PCRTestSpecification; import de.symeda.sormas.api.sample.PathogenSpecie; import de.symeda.sormas.api.sample.PathogenStrainCallStatus; +import de.symeda.sormas.api.sample.PathogenTestCategory; import de.symeda.sormas.api.sample.PathogenTestResultType; import de.symeda.sormas.api.sample.PathogenTestType; import de.symeda.sormas.api.sample.RsvSubtype; @@ -217,6 +218,8 @@ public class TestReportDto extends EntityDto { @Size(max = FieldConstraints.CHARACTER_LIMIT_SMALL, message = Validations.textTooLong) private String serotypeText; + private PathogenTestCategory pathogenTestCategory; + public SampleReportReferenceDto getSampleReport() { return sampleReport; } @@ -912,4 +915,11 @@ public void setSerotypeText(String serotypeText) { this.serotypeText = serotypeText; } + public PathogenTestCategory getPathogenTestCategory() { + return pathogenTestCategory; + } + + public void setPathogenTestCategory(PathogenTestCategory pathogenTestCategory) { + this.pathogenTestCategory = pathogenTestCategory; + } } diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java index 385b9ae62f0..9595559466f 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java @@ -1968,6 +1968,7 @@ public interface Captions { String Exposure_rawFoodContactText = "Exposure.rawFoodContactText"; String Exposure_riskArea = "Exposure.riskArea"; String Exposure_seatNumber = "Exposure.seatNumber"; + String Exposure_sexualContact = "Exposure.sexualContact"; String Exposure_sexualExposureText = "Exposure.sexualExposureText"; String Exposure_shoppingForFoodDetails = "Exposure.shoppingForFoodDetails"; String Exposure_shortDistance = "Exposure.shortDistance"; @@ -2139,13 +2140,13 @@ public interface Captions { String HealthConditions_malignancyChemotherapy = "HealthConditions.malignancyChemotherapy"; String HealthConditions_medicationDetails = "HealthConditions.medicationDetails"; String HealthConditions_obesity = "HealthConditions.obesity"; + String HealthConditions_onMedication = "HealthConditions.onMedication"; String HealthConditions_otherConditions = "HealthConditions.otherConditions"; String HealthConditions_previousTuberculosisTreatment = "HealthConditions.previousTuberculosisTreatment"; String HealthConditions_recurrentBronchiolitis = "HealthConditions.recurrentBronchiolitis"; String HealthConditions_sickleCellDisease = "HealthConditions.sickleCellDisease"; String HealthConditions_tuberculosis = "HealthConditions.tuberculosis"; String HealthConditions_tuberculosisInfectionYear = "HealthConditions.tuberculosisInfectionYear"; - String HealthConditions_underMedication = "HealthConditions.underMedication"; String HealthConditions_vaccinatedAgainstMosquitoBorneViruses = "HealthConditions.vaccinatedAgainstMosquitoBorneViruses"; String humanSampleViewType = "humanSampleViewType"; String Immunization = "Immunization"; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java b/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java index afcab3c5729..754e0f61007 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java @@ -172,27 +172,37 @@ public enum PathogenSpecie { @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING }) + PathogenTestType.SEROGROUPING, + PathogenTestType.SEROTYPING, + PathogenTestType.BACTERIAL_CULTURE }) BOYDII, @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING }) + PathogenTestType.SEROGROUPING, + PathogenTestType.SEROTYPING, + PathogenTestType.BACTERIAL_CULTURE }) DYSENTERIAE, @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING }) + PathogenTestType.SEROGROUPING, + PathogenTestType.SEROTYPING, + PathogenTestType.BACTERIAL_CULTURE }) FLEXNERI, @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING }) + PathogenTestType.SEROGROUPING, + PathogenTestType.SEROTYPING, + PathogenTestType.BACTERIAL_CULTURE }) SONNEI, @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING }) + PathogenTestType.SEROGROUPING, + PathogenTestType.SEROTYPING, + PathogenTestType.BACTERIAL_CULTURE }) SHIGELLA_SPP, @Diseases({ Disease.MALARIA, @@ -206,7 +216,10 @@ public enum PathogenSpecie { PathogenTestType.Q_PCR, PathogenTestType.LAMP, PathogenTestType.OTHER_MOLECULAR_ASSAY, - PathogenTestType.OTHER_SEROLOGICAL_TEST }) + PathogenTestType.OTHER_SEROLOGICAL_TEST, + PathogenTestType.BACTERIAL_CULTURE, + PathogenTestType.SEROGROUPING, + PathogenTestType.SEROTYPING }) OTHER, @Diseases({ Disease.TUBERCULOSIS, @@ -223,7 +236,10 @@ public enum PathogenSpecie { PathogenTestType.Q_PCR, PathogenTestType.LAMP, PathogenTestType.OTHER_MOLECULAR_ASSAY, - PathogenTestType.OTHER_SEROLOGICAL_TEST }) + PathogenTestType.OTHER_SEROLOGICAL_TEST, + PathogenTestType.BACTERIAL_CULTURE, + PathogenTestType.SEROGROUPING, + PathogenTestType.SEROTYPING }) UNKNOWN, @Diseases({ Disease.TUBERCULOSIS, diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.java b/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.java index 57c8b304c71..fb6fa5b1080 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.java @@ -210,10 +210,14 @@ public enum PathogenTestType { ResultValueType.NUMERIC }) Q_PCR, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS) @ResultValueTypeRel(ResultValueType.QUALITATIVE) MULTIPLEX_PCR, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS) @ResultValueTypeRel({ ResultValueType.QUALITATIVE, @@ -226,6 +230,8 @@ public enum PathogenTestType { @ResultValueTypeRel(ResultValueType.QUALITATIVE) LAMP, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS) @ResultValueTypeRel(ResultValueType.QUALITATIVE) NASBA, @@ -245,14 +251,20 @@ public enum PathogenTestType { @ResultValueTypeRel(ResultValueType.QUALITATIVE) TMA, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS) @ResultValueTypeRel(ResultValueType.QUALITATIVE) CRISPR_DIAGNOSTICS, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS) @ResultValueTypeRel(ResultValueType.BOOLEAN) LINE_PROBE_ASSAY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS) @ResultValueTypeRel(ResultValueType.TEXT) SANGER_SEQUENCING, @@ -319,9 +331,12 @@ public enum PathogenTestType { @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.SALMONELLOSIS }) + Disease.SALMONELLOSIS, + Disease.SHIGELLOSIS }) @PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS) - @RevealsTestTypeText(diseases = Disease.SALMONELLOSIS) + @RevealsTestTypeText(diseases = { + Disease.SALMONELLOSIS, + Disease.SHIGELLOSIS }) @ResultValueTypeRel(ResultValueType.TEXT) SEROTYPING, @@ -374,6 +389,8 @@ public enum PathogenTestType { ResultValueType.NUMERIC }) ENZYME_LINKED_IMMUNOSORBENT_ASSAY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.SEROLOGICAL_TESTS) @ResultValueTypeRel({ ResultValueType.TEXT, @@ -413,6 +430,8 @@ public enum PathogenTestType { @ResultValueTypeRel(ResultValueType.QUALITATIVE) DIRECT_FLUORESCENT_ANTIBODY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.SEROLOGICAL_TESTS) @ResultValueTypeRel(ResultValueType.QUALITATIVE) RAPID_ANTIBODY_TEST, @@ -427,34 +446,45 @@ public enum PathogenTestType { @ResultValueTypeRel(ResultValueType.QUALITATIVE) RAPID_ANTIGEN_DETECTION, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION) @ResultValueTypeRel(ResultValueType.QUALITATIVE) RAPID_TEST, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION) @ResultValueTypeRel(ResultValueType.QUALITATIVE) LATERAL_FLOW_ASSAY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION) @ResultValueTypeRel(ResultValueType.QUALITATIVE) IMMUNOFLUORESCENCE_ASSAY, @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.SHIGELLOSIS }) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }) @PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION) @ResultValueTypeRel(ResultValueType.QUALITATIVE) SLIDE_AGGLUTINATION, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION) @ResultValueTypeRel(ResultValueType.QUALITATIVE) QUELLUNG_REACTION, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION) @ResultValueTypeRel(ResultValueType.TEXT) HEMAGGLUTINATION_INHIBITION, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION) @ResultValueTypeRel(ResultValueType.QUALITATIVE) RDT, @@ -469,14 +499,20 @@ public enum PathogenTestType { ResultValueType.NUMERIC }) BACTERIAL_CULTURE, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.CULTURE_AND_ISOLATION) @ResultValueTypeRel(ResultValueType.QUALITATIVE) VIRAL_ISOLATION, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.CULTURE_AND_ISOLATION) @ResultValueTypeRel(ResultValueType.TEXT) FUNGAL_CULTURE, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.CULTURE_AND_ISOLATION) @ResultValueTypeRel(ResultValueType.TEXT) MALDI_TOF, @@ -499,14 +535,20 @@ public enum PathogenTestType { @ResultValueTypeRel(ResultValueType.TEXT) GRAM_STAIN, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING) @ResultValueTypeRel(ResultValueType.SMEAR_GRADE) ACID_FAST_STAIN, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING) @ResultValueTypeRel(ResultValueType.QUALITATIVE) DARK_FIELD_MICROSCOPY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING) @ResultValueTypeRel({ ResultValueType.QUALITATIVE, @@ -528,20 +570,28 @@ public enum PathogenTestType { @ResultValueTypeRel(ResultValueType.TEXT) HISTOPATHOLOGY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING) @ResultValueTypeRel({ ResultValueType.QUALITATIVE, ResultValueType.TEXT }) FISH, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING) @ResultValueTypeRel(ResultValueType.QUALITATIVE) IMMUNOHISTOCHEMISTRY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING) @ResultValueTypeRel(ResultValueType.QUALITATIVE) ELECTRON_MICROSCOPY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.MICROSCOPY_AND_STAINING) @ResultValueTypeRel({ ResultValueType.QUALITATIVE, @@ -578,6 +628,8 @@ public enum PathogenTestType { @PathogenTestCategoryRel(PathogenTestCategory.ANTIMICROBIAL_SUSCEPTIBILITY_TESTING) ANTIBIOTIC_SUSCEPTIBILITY, + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) @PathogenTestCategoryRel(PathogenTestCategory.ANTIMICROBIAL_SUSCEPTIBILITY_TESTING) @ResultValueTypeRel(ResultValueType.BOOLEAN) GENOTYPIC_RESISTANCE_TEST, @@ -602,6 +654,8 @@ public enum PathogenTestType { @PathogenTestCategoryRel(PathogenTestCategory.FUNCTIONAL_IMMUNE_ASSAYS) @ResultValueTypeRel(ResultValueType.NUMERIC) + @Diseases(value = { + Disease.SHIGELLOSIS }, hide = true) FLOW_CYTOMETRY, // ---------------------------------------------------------------------------------------------- diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java b/sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java index 023edba4858..981609cfeef 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java @@ -29,7 +29,7 @@ public enum SerotypingMethod { Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING }) + PathogenTestType.SEROTYPING }) MULTIPLEX_PCR, @Diseases(value = { Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }) @@ -44,7 +44,7 @@ public enum SerotypingMethod { @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING }) + PathogenTestType.SEROTYPING }) AGGLUTINATION, @Diseases(value = { Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }) @@ -62,22 +62,15 @@ public enum SerotypingMethod { PathogenTestType.SEROGROUPING }) SLIDE_AGGLUTINATION, @Diseases(value = { - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.SHIGELLOSIS }) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }) @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING, PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) DISK_DIFFUSION, + @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { - PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) - MIC_DETERMINATION, - @Diseases(value = { - Disease.SHIGELLOSIS }) - @ApplicableToPathogenTests(value = { - PathogenTestType.SEROGROUPING, - PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) + PathogenTestType.SEROTYPING }) WGS_PREDICTION, // OTHER is mostly applicable for all diseases and pathogen tests, so we don't specify them as applicable to specific diseases or tests @Diseases diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/DrugSusceptibilityDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/DrugSusceptibilityDto.java index faa2f64f945..e21cad981bc 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/DrugSusceptibilityDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/DrugSusceptibilityDto.java @@ -122,14 +122,19 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { public static final String AZITHROMYCIN_MIC = "azithromycinMic"; public static final String AZITHROMYCIN_SUSCEPTIBILITY = "azithromycinSusceptibility"; + public static final String AZITHROMYCIN_METHOD = "azithromycinMethod"; public static final String CEFTAZIDIME_MIC = "ceftazidimeMic"; public static final String CEFTAZIDIME_SUSCEPTIBILITY = "ceftazidimeSusceptibility"; + public static final String CEFTAZIDIME_METHOD = "ceftazidimeMethod"; public static final String CEFOTAXIME_MIC = "cefotaximeMic"; public static final String CEFOTAXIME_SUSCEPTIBILITY = "cefotaximeSusceptibility"; + public static final String CEFOTAXIME_METHOD = "cefotaximeMethod"; public static final String AMPICILLIN_MIC = "ampicillinMic"; public static final String AMPICILLIN_SUSCEPTIBILITY = "ampicillinSusceptibility"; + public static final String AMPICILLIN_METHOD = "ampicillinMethod"; public static final String TRIMETHOPRIM_SULFAMETHOXAZOLE_MIC = "trimethoprimSulfamethoxazoleMic"; public static final String TRIMETHOPRIM_SULFAMETHOXAZOLE_SUSCEPTIBILITY = "trimethoprimSulfamethoxazoleSusceptibility"; + public static final String TRIMETHOPRIM_SULFAMETHOXAZOLE_METHOD = "trimethoprimSulfamethoxazoleMethod"; @Diseases(value = { Disease.TUBERCULOSIS }) @@ -364,7 +369,8 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { private SusceptibilitySurveillanceType capreomycinSurveillance; @Diseases(value = { Disease.TUBERCULOSIS, - Disease.INVASIVE_MENINGOCOCCAL_INFECTION }) + Disease.INVASIVE_MENINGOCOCCAL_INFECTION, + Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) private SusceptibilityMethod ciprofloxacinMethod; @@ -535,7 +541,8 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { private SusceptibilitySurveillanceType streptomycinSurveillance; @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) private SusceptibilityMethod ceftriaxoneMethod; @@ -595,6 +602,11 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { @ApplicableToPathogenTests(value = { PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) private DrugSusceptibilityType azithromycinSusceptibility; + @Diseases(value = { + Disease.SHIGELLOSIS }) + @ApplicableToPathogenTests(value = { + PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) + private SusceptibilityMethod azithromycinMethod; @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { @@ -606,6 +618,12 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) private DrugSusceptibilityType ceftazidimeSusceptibility; + @Diseases(value = { + Disease.SHIGELLOSIS }) + @ApplicableToPathogenTests(value = { + PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) + private SusceptibilityMethod ceftazidimeMethod; + @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { @@ -616,6 +634,11 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { @ApplicableToPathogenTests(value = { PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) private DrugSusceptibilityType cefotaximeSusceptibility; + @Diseases(value = { + Disease.SHIGELLOSIS }) + @ApplicableToPathogenTests(value = { + PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) + private SusceptibilityMethod cefotaximeMethod; @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { @@ -626,6 +649,11 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { @ApplicableToPathogenTests(value = { PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) private DrugSusceptibilityType ampicillinSusceptibility; + @Diseases(value = { + Disease.SHIGELLOSIS }) + @ApplicableToPathogenTests(value = { + PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) + private SusceptibilityMethod ampicillinMethod; @Diseases(value = { Disease.SHIGELLOSIS }) @ApplicableToPathogenTests(value = { @@ -636,6 +664,11 @@ public class DrugSusceptibilityDto extends PseudonymizableDto { @ApplicableToPathogenTests(value = { PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) private DrugSusceptibilityType trimethoprimSulfamethoxazoleSusceptibility; + @Diseases(value = { + Disease.SHIGELLOSIS }) + @ApplicableToPathogenTests(value = { + PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY }) + private SusceptibilityMethod trimethoprimSulfamethoxazoleMethod; public static DrugSusceptibilityDto build() { DrugSusceptibilityDto drugSusceptibility = new DrugSusceptibilityDto(); @@ -1403,4 +1436,43 @@ public void setTrimethoprimSulfamethoxazoleSusceptibility(DrugSusceptibilityType this.trimethoprimSulfamethoxazoleSusceptibility = trimethoprimSulfamethoxazoleSusceptibility; } + public SusceptibilityMethod getAzithromycinMethod() { + return azithromycinMethod; + } + + public void setAzithromycinMethod(SusceptibilityMethod azithromycinMethod) { + this.azithromycinMethod = azithromycinMethod; + } + + public SusceptibilityMethod getCeftazidimeMethod() { + return ceftazidimeMethod; + } + + public void setCeftazidimeMethod(SusceptibilityMethod ceftazidimeMethod) { + this.ceftazidimeMethod = ceftazidimeMethod; + } + + public SusceptibilityMethod getCefotaximeMethod() { + return cefotaximeMethod; + } + + public void setCefotaximeMethod(SusceptibilityMethod cefotaximeMethod) { + this.cefotaximeMethod = cefotaximeMethod; + } + + public SusceptibilityMethod getAmpicillinMethod() { + return ampicillinMethod; + } + + public void setAmpicillinMethod(SusceptibilityMethod ampicillinMethod) { + this.ampicillinMethod = ampicillinMethod; + } + + public SusceptibilityMethod getTrimethoprimSulfamethoxazoleMethod() { + return trimethoprimSulfamethoxazoleMethod; + } + + public void setTrimethoprimSulfamethoxazoleMethod(SusceptibilityMethod trimethoprimSulfamethoxazoleMethod) { + this.trimethoprimSulfamethoxazoleMethod = trimethoprimSulfamethoxazoleMethod; + } } diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index cdeb36c60e3..e676965cd03 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -1640,6 +1640,7 @@ Exposure.prophylaxisAdherenceDetails=Prophylaxis adherence details Exposure.travelPurpose=Reason for travel Exposure.travelPurposeDetails=Reason for travel details Exposure.shoppingForFoodDetails=Shopping for food (location/details) +Exposure.sexualContact=Sexual contact titleExposuresGeneralSection=General information titleExposuresSection=Exposure details titleExposureActivitySection=Activity details @@ -1722,7 +1723,7 @@ HealthConditions.vaccinatedAgainstMosquitoBorneViruses=Vaccinated against mosqui HealthConditions.immunodeficiencyOtherThanHivText=Specify immunodeficiency other than HIV HealthConditions.malaria=Malaria HealthConditions.malariaInfectedYear=Malaria infected year -HealthConditions.underMedication=Under medication +HealthConditions.onMedication=On medication HealthConditions.medicationDetails=Specify medication details HealthConditions.chronicDisease=Chronic disease HealthConditions.chronicDiseaseDetails=Chronic disease details @@ -3072,13 +3073,13 @@ Symptoms.highOrLowBloodPressure=Blood pressure too high or too low (measured) Symptoms.urinaryRetention=Urinary retention Symptoms.asymptomatic=Asymptomatic Symptoms.hemorrhagicRash=Hemorrhagic rash -Symptoms.arthritis=Septic Arthritis +Symptoms.arthritis=Septic arthritis Symptoms.meningitis=Meningitis Symptoms.septicaemia=Septicaemia Symptoms.nocturnalCough= Nocturnal cough -Symptoms.otherClinicalPresentation=Other Symptoms -Symptoms.otherClinicalPresentationText=Specify Other Symptoms -Symptoms.imi.shock=Septic Shock +Symptoms.otherClinicalPresentation=Other symptoms +Symptoms.otherClinicalPresentationText=Specify other symptoms +Symptoms.imi.shock=Septic shock Symptoms.imi.pneumoniaClinicalOrRadiologic=Pneumonia Symptoms.ipi.pneumoniaClinicalOrRadiologic=Bacterial pneumonia Symptoms.diagnosis=Diagnosis @@ -3098,10 +3099,10 @@ Symptoms.timeOffWorkDays=Days off work Symptoms.acuteEncephalitis=Acute encephalitis Symptoms.skinRashOnsetDate=Maculopapular rash onset date Symptoms.skinRash.lu-MEASLES=Any person not recently vaccinated -Symptoms.eggyBurps=Eggy Burps -Symptoms.weightLoss=Weight Loss -Symptoms.weightLossAmount=Weight Loss Amount (kg) -Symptoms.symptomStatus= Symptom Status +Symptoms.eggyBurps=Eggy burps +Symptoms.weightLoss=Weight loss +Symptoms.weightLossAmount=Weight loss amount (kg) +Symptoms.symptomStatus= Symptom status Symptoms.reoccurrence= Reoccurrence Symptoms.overnightStayRequired= Overnight hospitalization required Symptoms.bloating= Bloating diff --git a/sormas-api/src/main/resources/enum.properties b/sormas-api/src/main/resources/enum.properties index ff5cf441a88..69254948dc7 100644 --- a/sormas-api/src/main/resources/enum.properties +++ b/sormas-api/src/main/resources/enum.properties @@ -1553,7 +1553,6 @@ SerotypingMethod.GEL_DIFFUSION=Gel Diffusion SerotypingMethod.PNEUMOTEST=Pneumotest SerotypingMethod.SLIDE_AGGLUTINATION=Slide Agglutination SerotypingMethod.DISK_DIFFUSION=Disk Diffusion -SerotypingMethod.MIC_DETERMINATION=MIC determination (E-test, broth microdilution) SerotypingMethod.WGS_PREDICTION=WGS-based prediction SerotypingMethod.OTHER=Other @@ -3175,6 +3174,7 @@ ExposureSubSetting.SHOPPING_FOR_FOOD=Shopping for food ExposureSubSetting.BLOOD_TRANSFUSION_RECIPIENT=Blood transfusion recepient ExposureSubSetting.BONE_MARROW_TRANSPLANT_RECIPIENT=Bone marrow transplant recipient ExposureSubSetting.TRAVELED_ABROAD=Traveled abroad +ExposureSubSetting.HOUSEHOLD_CONTACT=Household contact ExposureSubSetting.UNKNOWN=Unknown ExposureSubSetting.OTHER=Other @@ -3274,3 +3274,11 @@ DataPatchFailureCause.INVALID_PATH_FORMAT=Invalid path format DataPatchFailureCause.DUPLICATE_FIELD=Duplicate field — key appeared more than once in the input DataPatchFailureCause.INVALID_CUSTOM_CONTEXT=Invalid customizable field context DataPatchFailureCause.TECHNICAL=Technical error + +# SexualContact +SexualContact.MALE=Male +SexualContact.FEMALE=Female +SexualContact.BOTH=Both +SexualContact.NOT_ANSWERED=Not answered +SexualContact.UNKNOWN=Unknown +SexualContact.OTHER=Other diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditions.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditions.java index 1a27ebb4084..f7b9f7a0899 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditions.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditions.java @@ -54,7 +54,7 @@ public class HealthConditions extends AbstractDomainObject { private YesNoUnknown recurrentBronchiolitis; - private YesNoUnknown underMedication; + private YesNoUnknown onMedication; private String medicationDetails; private YesNoUnknown chronicDisease; private String chronicDiseaseDetails; @@ -353,12 +353,12 @@ public void setMalaria(YesNoUnknown malaria) { } @Enumerated(EnumType.STRING) - public YesNoUnknown getUnderMedication() { - return underMedication; + public YesNoUnknown getOnMedication() { + return onMedication; } - public void setUnderMedication(YesNoUnknown underMedication) { - this.underMedication = underMedication; + public void setOnMedication(YesNoUnknown onMedication) { + this.onMedication = onMedication; } public String getMedicationDetails() { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditionsMapper.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditionsMapper.java index 0a195815860..6d705ac0e11 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditionsMapper.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditionsMapper.java @@ -68,7 +68,7 @@ public static HealthConditionsDto toDto(HealthConditions source) { target.setImmunodeficiencyOtherThanHivText(source.getImmunodeficiencyOtherThanHivText()); target.setMalaria(source.getMalaria()); target.setMalariaInfectedYear(source.getMalariaInfectedYear()); - target.setUnderMedication(source.getUnderMedication()); + target.setOnMedication(source.getOnMedication()); target.setMedicationDetails(source.getMedicationDetails()); target.setChronicDisease(source.getChronicDisease()); target.setChronicDiseaseDetails(source.getChronicDiseaseDetails()); @@ -115,7 +115,7 @@ public HealthConditions fillOrBuildEntity(@NotNull HealthConditionsDto source, H target.setImmunodeficiencyOtherThanHivText(source.getImmunodeficiencyOtherThanHivText()); target.setMalaria(source.getMalaria()); target.setMalariaInfectedYear(source.getMalariaInfectedYear()); - target.setUnderMedication(source.getUnderMedication()); + target.setOnMedication(source.getOnMedication()); target.setMedicationDetails(source.getMedicationDetails()); target.setChronicDisease(source.getChronicDisease()); target.setChronicDiseaseDetails(source.getChronicDiseaseDetails()); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java index 8cf6abed80b..dbba6e2e82d 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java @@ -241,6 +241,7 @@ public Exposure fillOrBuildExposureEntity(ExposureDto source, Exposure target, b target.setTravelPurpose(source.getTravelPurpose()); target.setTravelPurposeDetails(source.getTravelPurposeDetails()); target.setShoppingForFoodDetails(source.getShoppingForFoodDetails()); + target.setSexualContact(source.getSexualContact()); return target; } @@ -428,6 +429,7 @@ public static ExposureDto toExposureDto(Exposure source) { target.setTravelPurpose(source.getTravelPurpose()); target.setTravelPurposeDetails(source.getTravelPurposeDetails()); target.setShoppingForFoodDetails(source.getShoppingForFoodDetails()); + target.setSexualContact(source.getSexualContact()); return target; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java index 4fe91410664..8eaf9659998 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java @@ -53,6 +53,7 @@ import de.symeda.sormas.api.exposure.GatheringType; import de.symeda.sormas.api.exposure.HabitationType; import de.symeda.sormas.api.exposure.ProphylaxisAdherence; +import de.symeda.sormas.api.exposure.SexualContact; import de.symeda.sormas.api.exposure.SwimmingLocation; import de.symeda.sormas.api.exposure.TravelAccommodation; import de.symeda.sormas.api.exposure.TravelPurpose; @@ -199,6 +200,7 @@ public class Exposure extends AbstractDomainObject { private Set protectiveMeasures = new HashSet<>(); private String shoppingForFoodDetails; + private SexualContact sexualContact; @ManyToOne @JoinColumn(nullable = false) @@ -997,4 +999,12 @@ public void setProphylaxisAdherenceDetails(String prophylaxisAdherenceDetails) { this.prophylaxisAdherenceDetails = prophylaxisAdherenceDetails; } + @Enumerated(EnumType.STRING) + public SexualContact getSexualContact() { + return sexualContact; + } + + public void setSexualContact(SexualContact sexualContact) { + this.sexualContact = sexualContact; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.java index bf1a75fb631..9b42b8ba519 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.java @@ -40,6 +40,7 @@ import de.symeda.sormas.api.sample.PCRTestSpecification; import de.symeda.sormas.api.sample.PathogenSpecie; import de.symeda.sormas.api.sample.PathogenStrainCallStatus; +import de.symeda.sormas.api.sample.PathogenTestCategory; import de.symeda.sormas.api.sample.PathogenTestResultType; import de.symeda.sormas.api.sample.PathogenTestType; import de.symeda.sormas.api.sample.RsvSubtype; @@ -181,6 +182,7 @@ public class TestReport extends AbstractDomainObject { private String seroTypingMethodText; private Serotype serotype; private String serotypeText; + private PathogenTestCategory pathogenTestCategory; @Column(length = CHARACTER_LIMIT_DEFAULT) public String getTestLabName() { @@ -935,4 +937,12 @@ public void setSerotypeText(String serotypeText) { this.serotypeText = serotypeText; } + @Enumerated(EnumType.STRING) + public PathogenTestCategory getPathogenTestCategory() { + return pathogenTestCategory; + } + + public void setPathogenTestCategory(PathogenTestCategory pathogenTestCategory) { + this.pathogenTestCategory = pathogenTestCategory; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjb.java index 3bc445bfc88..42f7d74b7dc 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjb.java @@ -164,6 +164,7 @@ public static TestReportDto toDto(TestReport source) { target.setSerotype(source.getSerotype()); } target.setSerotypeText(source.getSerotypeText()); + target.setPathogenTestCategory(source.getPathogenTestCategory()); return target; } @@ -264,6 +265,7 @@ public TestReport fillOrBuildEntity(@NotNull TestReportDto source, @NotNull Samp target.setSerotype(source.getSerotype()); } target.setSerotypeText(source.getSerotypeText()); + target.setPathogenTestCategory(source.getPathogenTestCategory()); return target; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibility.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibility.java index cd6c8038914..ba1d0263672 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibility.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibility.java @@ -209,14 +209,23 @@ public class DrugSusceptibility extends AbstractDomainObject { private Float azithromycinMic; private DrugSusceptibilityType azithromycinSusceptibility; + + private SusceptibilityMethod azithromycinMethod; + private Float ceftazidimeMic; private DrugSusceptibilityType ceftazidimeSusceptibility; + private SusceptibilityMethod ceftazidimeMethod; + private Float cefotaximeMic; private DrugSusceptibilityType cefotaximeSusceptibility; + private SusceptibilityMethod cefotaximeMethod; + private Float ampicillinMic; private DrugSusceptibilityType ampicillinSusceptibility; + private SusceptibilityMethod ampicillinMethod; private Float trimethoprimSulfamethoxazoleMic; private DrugSusceptibilityType trimethoprimSulfamethoxazoleSusceptibility; + private SusceptibilityMethod trimethoprimSulfamethoxazoleMethod; public Float getAmikacinMic() { return amikacinMic; @@ -1034,4 +1043,48 @@ public void setTrimethoprimSulfamethoxazoleSusceptibility(DrugSusceptibilityType this.trimethoprimSulfamethoxazoleSusceptibility = trimethoprimSulfamethoxazoleSusceptibility; } + @Enumerated(EnumType.STRING) + public SusceptibilityMethod getAzithromycinMethod() { + return azithromycinMethod; + } + + public void setAzithromycinMethod(SusceptibilityMethod azithromycinMethod) { + this.azithromycinMethod = azithromycinMethod; + } + + @Enumerated(EnumType.STRING) + public SusceptibilityMethod getCeftazidimeMethod() { + return ceftazidimeMethod; + } + + public void setCeftazidimeMethod(SusceptibilityMethod ceftazidimeMethod) { + this.ceftazidimeMethod = ceftazidimeMethod; + } + + @Enumerated(EnumType.STRING) + public SusceptibilityMethod getCefotaximeMethod() { + return cefotaximeMethod; + } + + public void setCefotaximeMethod(SusceptibilityMethod cefotaximeMethod) { + this.cefotaximeMethod = cefotaximeMethod; + } + + @Enumerated(EnumType.STRING) + public SusceptibilityMethod getAmpicillinMethod() { + return ampicillinMethod; + } + + public void setAmpicillinMethod(SusceptibilityMethod ampicillinMethod) { + this.ampicillinMethod = ampicillinMethod; + } + + @Enumerated(EnumType.STRING) + public SusceptibilityMethod getTrimethoprimSulfamethoxazoleMethod() { + return trimethoprimSulfamethoxazoleMethod; + } + + public void setTrimethoprimSulfamethoxazoleMethod(SusceptibilityMethod trimethoprimSulfamethoxazoleMethod) { + this.trimethoprimSulfamethoxazoleMethod = trimethoprimSulfamethoxazoleMethod; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java index 3e26ffabef7..f96548325b9 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java @@ -130,6 +130,11 @@ public static DrugSusceptibilityDto toDto(DrugSusceptibility source) { target.setAmpicillinSusceptibility(source.getAmpicillinSusceptibility()); target.setTrimethoprimSulfamethoxazoleMic(source.getTrimethoprimSulfamethoxazoleMic()); target.setTrimethoprimSulfamethoxazoleSusceptibility(source.getTrimethoprimSulfamethoxazoleSusceptibility()); + target.setAzithromycinMethod(source.getAzithromycinMethod()); + target.setAmpicillinMethod(source.getAmpicillinMethod()); + target.setCeftazidimeMethod(source.getCeftazidimeMethod()); + target.setCefotaximeMethod(source.getCefotaximeMethod()); + target.setTrimethoprimSulfamethoxazoleMethod(source.getTrimethoprimSulfamethoxazoleMethod()); return target; } @@ -236,6 +241,11 @@ public DrugSusceptibility fillOrBuildEntity(@NotNull DrugSusceptibilityDto sourc target.setAmpicillinSusceptibility(source.getAmpicillinSusceptibility()); target.setTrimethoprimSulfamethoxazoleMic(source.getTrimethoprimSulfamethoxazoleMic()); target.setTrimethoprimSulfamethoxazoleSusceptibility(source.getTrimethoprimSulfamethoxazoleSusceptibility()); + target.setAzithromycinMethod(source.getAzithromycinMethod()); + target.setAmpicillinMethod(source.getAmpicillinMethod()); + target.setCeftazidimeMethod(source.getCeftazidimeMethod()); + target.setCefotaximeMethod(source.getCefotaximeMethod()); + target.setTrimethoprimSulfamethoxazoleMethod(source.getTrimethoprimSulfamethoxazoleMethod()); return target; } @@ -333,13 +343,18 @@ public static boolean hasData(DrugSusceptibilityDto dto) { || dto.getErythromycinSusceptibility() != null || dto.getAzithromycinMic() != null || dto.getAzithromycinSusceptibility() != null + || dto.getAzithromycinMethod() != null || dto.getCeftazidimeMic() != null || dto.getCeftazidimeSusceptibility() != null + || dto.getCeftazidimeMethod() != null || dto.getCefotaximeMic() != null || dto.getCefotaximeSusceptibility() != null + || dto.getCefotaximeMethod() != null || dto.getAmpicillinMic() != null || dto.getAmpicillinSusceptibility() != null + || dto.getAmpicillinMethod() != null || dto.getTrimethoprimSulfamethoxazoleMic() != null - || dto.getTrimethoprimSulfamethoxazoleSusceptibility() != null; + || dto.getTrimethoprimSulfamethoxazoleSusceptibility() != null + || dto.getTrimethoprimSulfamethoxazoleMethod() != null; } } diff --git a/sormas-backend/src/main/resources/sql/sormas_schema.sql b/sormas-backend/src/main/resources/sql/sormas_schema.sql index 6bd2c0f453e..72689e4bb3c 100644 --- a/sormas-backend/src/main/resources/sql/sormas_schema.sql +++ b/sormas-backend/src/main/resources/sql/sormas_schema.sql @@ -16306,4 +16306,47 @@ alter table cases_history add column IF NOT EXISTS externalcomments text; INSERT INTO schema_version (version_number, comment) VALUES (638, 'Laboratory results tab: dateOther, dateOtherDetails, externalComments on case #13955'); +-- 04-06-2026 Shigellosis lab message processing. #13965 +ALTER TABLE testreport ADD COLUMN IF NOT EXISTS pathogentestcategory varchar(255); +ALTER TABLE exposures ADD COLUMN IF NOT EXISTS sexualcontact varchar(255); +ALTER TABLE drugsusceptibility ADD COLUMN IF NOT EXISTS trimethoprimSulfamethoxazoleMethod varchar(255); +ALTER TABLE drugsusceptibility ADD COLUMN IF NOT EXISTS azithromycinMethod varchar(255); +ALTER TABLE drugsusceptibility ADD COLUMN IF NOT EXISTS ampicillinMethod varchar(255); +ALTER TABLE drugsusceptibility ADD COLUMN IF NOT EXISTS ceftazidimeMethod varchar(255); +ALTER TABLE drugsusceptibility ADD COLUMN IF NOT EXISTS cefotaximeMethod varchar(255); + +DO $$ +BEGIN + IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions' AND column_name = 'undermedication') + AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions' AND column_name = 'onmedication') THEN + ALTER TABLE healthconditions RENAME COLUMN undermedication TO onmedication; + END IF; + IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions' AND column_name = 'undermedication') + AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions' AND column_name = 'onmedication') THEN + ALTER TABLE healthconditions RENAME COLUMN undermedication TO onmedication; + END IF; +END $$; + +ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS pathogentestcategory varchar(255); +ALTER TABLE exposures_history ADD COLUMN IF NOT EXISTS sexualcontact varchar(255); +ALTER TABLE drugsusceptibility_history ADD COLUMN IF NOT EXISTS trimethoprimSulfamethoxazoleMethod varchar(255); +ALTER TABLE drugsusceptibility_history ADD COLUMN IF NOT EXISTS azithromycinMethod varchar(255); +ALTER TABLE drugsusceptibility_history ADD COLUMN IF NOT EXISTS ampicillinMethod varchar(255); +ALTER TABLE drugsusceptibility_history ADD COLUMN IF NOT EXISTS ceftazidimeMethod varchar(255); +ALTER TABLE drugsusceptibility_history ADD COLUMN IF NOT EXISTS cefotaximeMethod varchar(255); + + +DO $$ +BEGIN + IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions_history' AND column_name = 'undermedication') + AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions_history' AND column_name = 'onmedication') THEN + ALTER TABLE healthconditions_history RENAME COLUMN undermedication TO onmedication; + END IF; + IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions_history' AND column_name = 'undermedication') + AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'healthconditions_history' AND column_name = 'onmedication') THEN + ALTER TABLE healthconditions_history RENAME COLUMN undermedication TO onmedication; + END IF; +END $$; +INSERT INTO schema_version (version_number, comment) VALUES (639, '#13965 - Shigellosis Lab messages'); + -- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. *** diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.java index 7986ded8fe7..3c45e808d99 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.java @@ -30,13 +30,13 @@ import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.MALIGNANCY_CHEMOTHERAPY; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.MEDICATION_DETAILS; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.OBESITY; +import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.ON_MEDICATION; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.OTHER_CONDITIONS; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.PREVIOUS_TUBERCULOSIS_TREATMENT; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.RECURRENT_BRONCHIOLITIS; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.SICKLE_CELL_DISEASE; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.TUBERCULOSIS; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.TUBERCULOSIS_INFECTION_YEAR; -import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.UNDER_MEDICATION; import static de.symeda.sormas.api.clinicalcourse.HealthConditionsDto.VACCINATED_AGAINST_MOSQUITO_BORNE_VIRUSES; import static de.symeda.sormas.ui.utils.CssStyles.H3; import static de.symeda.sormas.ui.utils.LayoutUtil.fluidColumn; @@ -100,7 +100,7 @@ public class HealthConditionsForm extends AbstractEditForm fluidColumn(6, 0, locs( TUBERCULOSIS, PREVIOUS_TUBERCULOSIS_TREATMENT, ASPLENIA, HEPATITIS, DIABETES, IMMUNODEFICIENCY_OTHER_THAN_HIV,"IMMUNODEFICIENCY_INCLUDING_HIV_LAYOUT", HIV, HIV_ART, CONGENITAL_SYPHILIS, DOWN_SYNDROME, - CHRONIC_LIVER_DISEASE, MALIGNANCY_CHEMOTHERAPY, RECURRENT_BRONCHIOLITIS, MALARIA, "MALARIA_INFECTED_YEAR_LAYOUT", UNDER_MEDICATION, MEDICATION_DETAILS)), + CHRONIC_LIVER_DISEASE, MALIGNANCY_CHEMOTHERAPY, RECURRENT_BRONCHIOLITIS, MALARIA, "MALARIA_INFECTED_YEAR_LAYOUT", ON_MEDICATION, MEDICATION_DETAILS)), fluidColumn(6, 0, locs( "TUBERCULOSIS_INFECTION_YEAR_LAYOUT","COMPLIANCE_WITH_TREATMENT_LAYOUT",CHRONIC_HEART_FAILURE, CHRONIC_PULMONARY_DISEASE, CHRONIC_KIDNEY_DISEASE, CHRONIC_NEUROLOGIC_CONDITION, CARDIOVASCULAR_DISEASE_INCLUDING_HYPERTENSION, @@ -136,7 +136,7 @@ public class HealthConditionsForm extends AbstractEditForm VACCINATED_AGAINST_MOSQUITO_BORNE_VIRUSES, RECURRENT_BRONCHIOLITIS, MALARIA, - UNDER_MEDICATION, + ON_MEDICATION, MEDICATION_DETAILS, CHRONIC_DISEASE, CHRONIC_DISEASE_DETAILS); @@ -309,7 +309,7 @@ protected void addFields() { } } - FieldHelper.setVisibleWhen(getFieldGroup(), MEDICATION_DETAILS, UNDER_MEDICATION, Arrays.asList(YesNoUnknown.YES), true); + FieldHelper.setVisibleWhen(getFieldGroup(), MEDICATION_DETAILS, ON_MEDICATION, Arrays.asList(YesNoUnknown.YES), true); FieldHelper.setVisibleWhen(getFieldGroup(), CHRONIC_DISEASE_DETAILS, CHRONIC_DISEASE, Arrays.asList(YesNoUnknown.YES), true); initializeVisibilitiesAndAllowedVisibilities(); diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java index 510178e175f..0bac66027aa 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java @@ -70,6 +70,7 @@ import de.symeda.sormas.api.exposure.ExposureType; import de.symeda.sormas.api.exposure.FomiteTransmissionLocation; import de.symeda.sormas.api.exposure.ProphylaxisAdherence; +import de.symeda.sormas.api.exposure.SexualContact; import de.symeda.sormas.api.exposure.TravelPurpose; import de.symeda.sormas.api.exposure.TypeOfAnimal; import de.symeda.sormas.api.i18n.Captions; @@ -133,6 +134,7 @@ public class ExposureForm extends AbstractEditForm { fluidRow(fluidColumn(4, 0, locs(ExposureDto.PROPHYLAXIS_ADHERENCE_DETAILS))) + fluidRow(fluidColumn(4, 0, locs(ExposureDto.TRAVEL_PURPOSE))) + fluidRow(fluidColumn(4, 0, locs(ExposureDto.TRAVEL_PURPOSE_DETAILS))) + + fluidRow(fluidColumn(4, 0, locs(ExposureDto.SEXUAL_CONTACT))) + fluidRow( fluidColumn(4, 0, locs( ExposureDto.EXPOSURE_SUB_SETTING_DETAILS, @@ -197,6 +199,7 @@ public class ExposureForm extends AbstractEditForm { private ComboBox travelPurposeField; private TextField prophylaxisAdherenceDetailsField; private TextField travelPurposeDetailsField; + private ComboBox sexualContactField; private CustomizableFieldsGroup exposureDetailsPanel; private CustomizableFieldsGroup exposuresGeneralPanel; @@ -377,6 +380,8 @@ private void addBasicFields() { travelPurposeField = addField(exposureDetailsLayout, ExposureDto.TRAVEL_PURPOSE, ComboBox.class); travelPurposeField.setVisible(false); travelPurposeDetailsField = addField(exposureDetailsLayout, ExposureDto.TRAVEL_PURPOSE_DETAILS, TextField.class); + sexualContactField = addField(exposureDetailsLayout, ExposureDto.SEXUAL_CONTACT, ComboBox.class); + sexualContactField.setVisible(false); categoryField.addValueChangeListener(e -> { ExposureCategory selectedCategory = (ExposureCategory) e.getProperty().getValue(); @@ -419,6 +424,8 @@ private void addBasicFields() { subSettingsDetailsField.setVisible(containsOther); boolean isProphylaxis = selectedSubSettings != null && selectedSubSettings.contains(ExposureSubSetting.TRAVELED_ABROAD); setVisibleClear(isProphylaxis, ExposureDto.PROPHYLAXIS_ADHERENCE, ExposureDto.TRAVEL_PURPOSE); + boolean isSexualActivity = selectedSubSettings != null && selectedSubSettings.contains(ExposureSubSetting.SEXUAL_ACTIVITY); + setVisibleClear(isSexualActivity, ExposureDto.SEXUAL_CONTACT); // Salmonellosis: shopping-for-food details follows sub-setting selection. // Disease-gated so non-SAL exposures with FOOD_BORNE category don't see it. @@ -668,6 +675,7 @@ public void setValue(ExposureDto newFieldValue) throws ReadOnlyException, Conver String prophylaxisAdherenceDetails = newFieldValue.getProphylaxisAdherenceDetails(); TravelPurpose travelPurpose = newFieldValue.getTravelPurpose(); String travelPurposeDetails = newFieldValue.getTravelPurposeDetails(); + SexualContact sexualContact = newFieldValue.getSexualContact(); // Update field items (these methods clear the field values) updateSettingFieldItems(category); @@ -722,6 +730,14 @@ public void setValue(ExposureDto newFieldValue) throws ReadOnlyException, Conver travelPurposeDetailsField.setVisible(false); } + boolean isSexualActivity = subSettings != null && subSettings.contains(ExposureSubSetting.SEXUAL_ACTIVITY); + sexualContactField.setVisible(isSexualActivity); + if (isSexualActivity) { + sexualContactField.setValue(sexualContact); + } else { + sexualContactField.setValue(null); + } + // Restore contactFactors field value and visibility if (contactFactors != null && !contactFactors.isEmpty()) { contactFactorsField.setValue(contactFactors); diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/person/PersonEditForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/person/PersonEditForm.java index d019202bb66..3cd87e59578 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/person/PersonEditForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/person/PersonEditForm.java @@ -35,7 +35,6 @@ import java.util.GregorianCalendar; import java.util.HashSet; import java.util.List; -import java.util.Objects; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; @@ -121,18 +120,6 @@ public class PersonEditForm extends AbstractEditForm { public static final String HAS_GUARDIAN = "hasGuardian"; public static final Set PERINATAL_DISEASES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(Disease.CONGENITAL_RUBELLA, Disease.RESPIRATORY_SYNCYTIAL_VIRUS))); - public static final Set ENTRY_DATE_DISEASE = Collections.unmodifiableSet( - new HashSet<>( - Arrays.asList( - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.TUBERCULOSIS, - Disease.MEASLES, - Disease.GIARDIASIS, - Disease.CRYPTOSPORIDIOSIS, - Disease.MALARIA, - Disease.DENGUE, - Disease.SHIGELLOSIS))); //@formatter:off private static final String HTML_LAYOUT = loc(PERSON_INFORMATION_HEADING_LOC) + @@ -434,25 +421,9 @@ protected void addFields() { birthCountryCB.addItems(countries); addField(PersonDto.LIVING_STATUS, ComboBox.class); - DateField entryDateDF = addField(PersonDto.ENTRY_DATE, DateField.class); - entryDateDF.setVisible(false); - // Entry date is only required for foreigners in Luxembourg with the TB+IMI+IPI diseases only. - if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG)) { - boolean isEntryDateAllowedDisease = ENTRY_DATE_DISEASE.contains(disease); - birthCountryCB.addValueChangeListener(e -> { - CountryReferenceDto countryRef = (CountryReferenceDto) e.getProperty().getValue(); - boolean isForeigner = false; - if (countryRef != null) { - isForeigner = FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG) - && Arrays.asList(CountryHelper.COUNTRY_CODE_LUXEMBOURG, "LUX") - .stream() - .filter(Objects::nonNull) - .noneMatch(country -> StringUtils.equalsIgnoreCase(country, countryRef.getIsoCode())); - } - setVisibleClear(isEntryDateAllowedDisease && isForeigner, PersonDto.ENTRY_DATE); - setRequired(isEntryDateAllowedDisease && isForeigner, PersonDto.ENTRY_DATE); - }); - } + // Entry date is not a mandatory field. + addField(PersonDto.ENTRY_DATE, DateField.class); + nationalHealthIdField = addField(PersonDto.NATIONAL_HEALTH_ID, SormasTextField.class); nationalHealthIdField.setNullRepresentation(""); Label nationalHealthIdWarningLabel = new Label(I18nProperties.getString(Strings.messagePersonNationalHealthIdInvalid)); diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/TestMethodComponent.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/TestMethodComponent.java index 61eb577fa52..90f280c23f9 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/TestMethodComponent.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/TestMethodComponent.java @@ -189,6 +189,10 @@ private void wireEvents() { // (updateTestTypeItemsByCategory keeps a still-valid selection). track(testCategoryField.addValueChangeListener(e -> { PathogenTestType selectedType = testTypeField.getValue(); + // If the selected category is null, clear the test type field and update the test type list + if (testCategoryField.getValue() == null) { + testTypeField.clear(); + } if (selectedType != null && e.getValue() != null && PathogenTestType.getCategory(selectedType) != e.getValue()) { testTypeField.clear(); } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/AbstractDiseaseSectionComponent.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/AbstractDiseaseSectionComponent.java index d26228bff41..f413be5a924 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/AbstractDiseaseSectionComponent.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/AbstractDiseaseSectionComponent.java @@ -19,6 +19,8 @@ import java.util.function.Consumer; +import com.vaadin.data.HasValue; +import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; @@ -119,6 +121,23 @@ protected void setDrugSusceptibilityRowVisible(boolean visible) { } } + /** + * Visible clear + * + * @param components + */ + public void setVisibleClear(AbstractComponent... components) { + if (components == null) { + return; + } + for (AbstractComponent component : components) { + component.setVisible(false); + if (component instanceof HasValue) { + ((HasValue) component).clear(); + } + } + } + @Override protected boolean hasVisibleContent() { return drugSusceptibilityField != null && drugSusceptibilityField.isVisible(); diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java index 7c9016f49cc..f145ff2661b 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java @@ -17,6 +17,8 @@ *******************************************************************************/ package de.symeda.sormas.ui.samples.diseasesection; +import java.util.Arrays; + import com.vaadin.ui.ComboBox; import com.vaadin.ui.TextField; @@ -40,16 +42,29 @@ public class ShigellosisSectionComponent extends AbstractDiseaseSectionComponent private DrugSusceptibilityForm drugSusceptibilityField; private ComboBox specie; private TextField specieTextField; - private ComboBox serotypingMethodField; - private TextField serotypingMethodTextField; + private ComboBox serotypingMethodCBF; + private TextField serotypingMethodTF; + private TextField serotypeTF; private PathogenTestType currentTestType; private PathogenTestResultType currentResult; - private TextField serotypeField; @Override protected void buildLayout() { + serotypeTF = createTextField(PathogenTestDto.SEROTYPE); + serotypeTF.setVisible(false); + addRow(serotypeTF); + + serotypingMethodCBF = createComboBox(PathogenTestDto.SEROTYPING_METHOD); + serotypingMethodCBF.setItems(SerotypingMethod.values()); + serotypingMethodCBF.setItemCaptionGenerator(SerotypingMethod::toString); + serotypingMethodCBF.setVisible(false); + + serotypingMethodTF = createTextField(PathogenTestDto.SERO_TYPING_METHOD_TEXT); + serotypingMethodTF.setVisible(false); + addRow(serotypingMethodCBF, serotypingMethodTF); + // Shigellosis species specie = createComboBox(PathogenTestDto.SPECIE); specie.setItemCaptionGenerator(PathogenSpecie::toString); @@ -61,23 +76,11 @@ protected void buildLayout() { addRow(specie, specieTextField); - serotypeField = createTextField(PathogenTestDto.SEROTYPE_TEXT); - serotypeField.setVisible(false); - addRow(serotypeField); - - serotypingMethodField = createComboBox(PathogenTestDto.SEROTYPING_METHOD); - serotypingMethodField.setItems(SerotypingMethod.values()); - serotypingMethodField.setItemCaptionGenerator(SerotypingMethod::toString); - serotypingMethodField.setVisible(false); - - serotypingMethodTextField = createTextField(PathogenTestDto.SERO_TYPING_METHOD_TEXT); - serotypingMethodTextField.setVisible(false); - addRow(serotypingMethodField, serotypingMethodTextField); - binder.forField(specie).bind(PathogenTestDto::getSpecie, PathogenTestDto::setSpecie); - binder.forField(serotypingMethodField).bind(PathogenTestDto::getSeroTypingMethod, PathogenTestDto::setSeroTypingMethod); - binder.forField(serotypingMethodTextField).bind(PathogenTestDto::getSeroTypingMethodText, PathogenTestDto::setSeroTypingMethodText); + binder.forField(serotypingMethodCBF).bind(PathogenTestDto::getSeroTypingMethod, PathogenTestDto::setSeroTypingMethod); + binder.forField(serotypingMethodTF).bind(PathogenTestDto::getSeroTypingMethodText, PathogenTestDto::setSeroTypingMethodText); binder.forField(specieTextField).bind(PathogenTestDto::getSpecieText, PathogenTestDto::setSpecieText); + binder.forField(serotypeTF).bind(PathogenTestDto::getSerotypeText, PathogenTestDto::setSerotypeText); // DrugSusceptibilityForm drugSusceptibilityField = new DrugSusceptibilityForm( @@ -94,11 +97,11 @@ protected void buildLayout() { protected void wireVisibility() { // serotypingMethodText visible only when OTHER - track(serotypingMethodField.addValueChangeListener(e -> { + track(serotypingMethodCBF.addValueChangeListener(e -> { boolean showText = e.getValue() == SerotypingMethod.OTHER; - serotypingMethodTextField.setVisible(showText); + serotypingMethodTF.setVisible(showText); if (!showText) { - serotypingMethodTextField.clear(); + serotypingMethodTF.clear(); } })); @@ -112,13 +115,16 @@ protected void wireVisibility() { })); track(eventBus.on(TestTypeChangedEvent.class, event -> { + // Resetting the current result so that the next time the event is fired, + eventBus.fire(new SetTestResultEvent(null)); currentTestType = event.getTestType(); updateDrugSusceptibility(currentTestType); updateComboBoxByDiseaseAndTestType(specie, PathogenSpecie.class, disease, currentTestType); - updateComboBoxByDiseaseAndTestType(serotypingMethodField, SerotypingMethod.class, disease, currentTestType); + updateComboBoxByDiseaseAndTestType(serotypingMethodCBF, SerotypingMethod.class, disease, currentTestType); if (currentTestType != null && currentTestType == PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY) { eventBus.fire(new SetTestResultEvent(PathogenTestResultType.NOT_APPLICABLE)); - } else if (currentTestType != null && currentTestType == PathogenTestType.SEROGROUPING) { + } else if (currentTestType != null + && Arrays.asList(PathogenTestType.SEROGROUPING, PathogenTestType.SEROTYPING).contains(currentTestType)) { eventBus.fire(new SetTestResultEvent(PathogenTestResultType.POSITIVE)); } else { eventBus.fire(new SetTestResultEvent(null)); @@ -143,27 +149,26 @@ private void updateDrugSusceptibility(PathogenTestType testType) { private void updateFieldVisibility() { boolean isPositive = currentResult == PathogenTestResultType.POSITIVE; // Serogrouping test: only show specie, hide drug susceptibility and serotyping method - boolean isSerogroupingTest = isPositive && currentTestType == PathogenTestType.SEROGROUPING; - specie.setVisible(isSerogroupingTest); - serotypeField.setVisible(isSerogroupingTest); - if (!isSerogroupingTest) { - serotypingMethodField.clear(); - serotypingMethodTextField.setVisible(false); - serotypingMethodTextField.clear(); - specie.clear(); - specieTextField.setVisible(false); - specieTextField.clear(); - serotypeField.clear(); - serotypeField.setVisible(false); - } - + boolean isSerogrouping = isPositive && currentTestType == PathogenTestType.SEROGROUPING; + // SEROGroup : species only + // boolean isCultureTest = isPositive && currentTestType == PathogenTestType.BACTERIAL_CULTURE; + boolean isSerotype = isPositive && currentTestType == PathogenTestType.SEROTYPING; + // SEROtype : test method + species + serotype: boolean showDrugSusceptibilityForm = currentTestType != null && currentTestType == PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY; - if (!showDrugSusceptibilityForm) { - serotypingMethodField.clear(); - serotypingMethodTextField.clear(); - serotypingMethodTextField.setVisible(false); + + if (!isSerogrouping && !isSerotype) { + setVisibleClear(specie, specieTextField); } - serotypingMethodField.setVisible(isSerogroupingTest || showDrugSusceptibilityForm); + if (!isSerotype) { + setVisibleClear(serotypeTF); + } + if (!isSerotype && !showDrugSusceptibilityForm) { + setVisibleClear(serotypingMethodCBF, serotypingMethodTF); + } + + serotypingMethodCBF.setVisible(isSerotype); + specie.setVisible(isSerotype || isSerogrouping); + serotypeTF.setVisible(isSerotype); updateRowAndSelfVisibility(); } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java index cee49e156e5..392ac0e8a6b 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java @@ -93,8 +93,8 @@ public class DrugSusceptibilityForm extends AbstractEditForm> VARIANT_MAP = Collections.unmodifiableMap(new HashMap<>() { @@ -137,7 +139,7 @@ public String determineSideComponentVariant(PathogenTestDto pathogenTest) { Disease.DENGUE, Collections.unmodifiableList( Arrays.asList(PathogenTestType.NAAT, PathogenTestType.NEUTRALIZING_ANTIBODIES, PathogenTestType.PCR_RT_PCR))); - put(Disease.SHIGELLOSIS, Collections.unmodifiableList(Arrays.asList(PathogenTestType.SEROGROUPING))); + put(Disease.SHIGELLOSIS, Collections.unmodifiableList(Arrays.asList(PathogenTestType.SEROGROUPING, PathogenTestType.SEROTYPING))); put(Disease.MEASLES, Collections.unmodifiableList(Arrays.asList(PathogenTestType.GENOTYPING))); put( Disease.INVASIVE_PNEUMOCOCCAL_INFECTION,