diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/Disease.java b/sormas-api/src/main/java/de/symeda/sormas/api/Disease.java index a7576caee6f..19c8809641e 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/Disease.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/Disease.java @@ -88,6 +88,8 @@ public enum Disease FHA(true, false, false, true, false, 0, true, false, false), INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, false, 0, false, false, false), INVASIVE_MENINGOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false), + GIARDIASIS(true, true, true, false, true, 14, false, false, false), + CRYPTOSPORIDIOSIS(true, true, true, false, true, 14, false, false, false), OTHER(true, true, true, false, true, 21, false, false, false), UNDEFINED(true, true, true, false, true, 0, false, false, false); diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java index 660b28b180a..27c75bb0efc 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java @@ -364,7 +364,9 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase { @SensitiveData @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION}, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private HealthConditionsDto healthConditions; private YesNoUnknown pregnant; @Diseases({ @@ -1840,8 +1842,6 @@ public void setOtherDiagnosticCriteria(String otherDiagnosticCriteria) { this.otherDiagnosticCriteria = otherDiagnosticCriteria; } - - @JsonIgnore public String i18nPrefix() { return I18N_PREFIX; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.java index ed2504f8a75..c0416cba670 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.java @@ -21,17 +21,21 @@ import java.util.List; import javax.validation.Valid; +import javax.validation.constraints.Size; import de.symeda.sormas.api.CountryHelper; import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.ImportIgnore; import de.symeda.sormas.api.activityascase.ActivityAsCaseDto; import de.symeda.sormas.api.exposure.ExposureDto; +import de.symeda.sormas.api.exposure.InfectionSource; +import de.symeda.sormas.api.exposure.ModeOfTransmission; import de.symeda.sormas.api.feature.FeatureType; -import de.symeda.sormas.api.location.LocationDto; +import de.symeda.sormas.api.i18n.Validations; import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.api.utils.DependingOnFeatureType; import de.symeda.sormas.api.utils.Diseases; +import de.symeda.sormas.api.utils.FieldConstraints; import de.symeda.sormas.api.utils.HideForCountriesExcept; import de.symeda.sormas.api.utils.YesNoUnknown; import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableDto; @@ -57,6 +61,10 @@ public class EpiDataDto extends PseudonymizableDto { public static final String CLUSTER_TYPE = "clusterType"; public static final String CLUSTER_TYPE_TEXT = "clusterTypeText"; public static final String CLUSTER_RELATED = "clusterRelated"; + public static final String MODE_OF_TRANSMISSION = "modeOfTransmission"; + public static final String MODE_OF_TRANSMISSION_TYPE = "modeOfTransmissionType"; + public static final String INFECTION_SOURCE = "infectionSource"; + public static final String INFECTION_SOURCE_TEXT = "infectionSourceText"; private YesNoUnknown exposureDetailsKnown; private YesNoUnknown activityAsCaseDetailsKnown; @@ -64,22 +72,26 @@ public class EpiDataDto extends PseudonymizableDto { private YesNoUnknown highTransmissionRiskArea; private YesNoUnknown largeOutbreaksArea; @Diseases({ - Disease.MEASLES}) - @HideForCountriesExcept(countries = {CountryHelper.COUNTRY_CODE_LUXEMBOURG}) + Disease.MEASLES, + Disease.GIARDIASIS }) private CaseImportedStatus caseImportedStatus; + + @HideForCountriesExcept(countries = { + CountryHelper.COUNTRY_CODE_LUXEMBOURG }) @Diseases({ - Disease.MEASLES}) - @HideForCountriesExcept(countries = {CountryHelper.COUNTRY_CODE_LUXEMBOURG}) + Disease.MEASLES }) private ClusterType clusterType; + @HideForCountriesExcept(countries = { + CountryHelper.COUNTRY_CODE_LUXEMBOURG }) @Diseases({ - Disease.MEASLES}) - @HideForCountriesExcept(countries = {CountryHelper.COUNTRY_CODE_LUXEMBOURG}) + Disease.MEASLES }) private boolean clusterRelated; - @HideForCountriesExcept(countries = {CountryHelper.COUNTRY_CODE_LUXEMBOURG}) + @HideForCountriesExcept(countries = { + CountryHelper.COUNTRY_CODE_LUXEMBOURG }) @Diseases({ - Disease.MEASLES}) + Disease.MEASLES }) private String clusterTypeText; @Diseases({ @@ -92,6 +104,26 @@ public class EpiDataDto extends PseudonymizableDto { Disease.OTHER }) private YesNoUnknown areaInfectedAnimals; + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private ModeOfTransmission modeOfTransmission; + + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + @Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong) + private String modeOfTransmissionType; + + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private InfectionSource infectionSource; + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private String infectionSourceText; + @Valid private List exposures = new ArrayList<>(); @@ -203,6 +235,38 @@ public void setClusterRelated(boolean clusterRelated) { this.clusterRelated = clusterRelated; } + public InfectionSource getInfectionSource() { + return infectionSource; + } + + public void setInfectionSource(InfectionSource infectionSource) { + this.infectionSource = infectionSource; + } + + public String getInfectionSourceText() { + return infectionSourceText; + } + + public void setInfectionSourceText(String infectionSourceText) { + this.infectionSourceText = infectionSourceText; + } + + public ModeOfTransmission getModeOfTransmission() { + return modeOfTransmission; + } + + public void setModeOfTransmission(ModeOfTransmission modeOfTransmission) { + this.modeOfTransmission = modeOfTransmission; + } + + public String getModeOfTransmissionType() { + return modeOfTransmissionType; + } + + public void setModeOfTransmissionType(String modeOfTransmissionType) { + this.modeOfTransmissionType = modeOfTransmissionType; + } + @Override public EpiDataDto clone() throws CloneNotSupportedException { EpiDataDto clone = (EpiDataDto) super.clone(); diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/AnimalLocation.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/AnimalLocation.java new file mode 100644 index 00000000000..0fde75ad4b9 --- /dev/null +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/AnimalLocation.java @@ -0,0 +1,32 @@ +/* + * 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; + +public enum AnimalLocation { + + ZOO, + FARM, + PARK, + FOREST, + OTHER; + + @Override + public String toString() { + return I18nProperties.getEnumCaption(this); + } + +} 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 515cfbb96a9..00a78b44f3c 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 @@ -32,6 +32,7 @@ import de.symeda.sormas.api.location.LocationDto; import de.symeda.sormas.api.user.UserReferenceDto; import de.symeda.sormas.api.utils.DataHelper; +import de.symeda.sormas.api.utils.DependantOn; import de.symeda.sormas.api.utils.DependingOnFeatureType; import de.symeda.sormas.api.utils.Diseases; import de.symeda.sormas.api.utils.EmbeddedPersonalData; @@ -107,6 +108,17 @@ public class ExposureDto extends PseudonymizableDto { public static final String DECEASED_PERSON_RELATION = "deceasedPersonRelation"; public static final String EXPOSURE_ROLE = "exposureRole"; public static final String LARGE_ATTENDANCE_NUMBER = "largeAttendanceNumber"; + public static final String TRAVEL_ACCOMMODATION = "travelAccommodation"; + public static final String TRAVEL_ACCOMMODATION_TYPE = "travelAccommodationType"; + public static final String SWIMMING_LOCATION = "swimmingLocation"; + public static final String SWIMMING_LOCATION_TYPE = "swimmingLocationType"; + public static final String ANIMAL_LOCATION = "animalLocation"; + public static final String DOMESTIC_SWIMMING = "domesticSwimming"; + public static final String INTERNATIONAL_SWIMMING = "internationalSwimming"; + public static final String SEXUAL_EXPOSURE_TEXT = "sexualExposureText"; + public static final String RAW_FOOD_CONTACT = "rawFoodContact"; + public static final String RAW_FOOD_CONTACT_TEXT = "rawFoodContactText"; + public static final String SYMPTOMATIC_INDIVIDUAL_TEXT = "symptomaticIndividualText"; @SensitiveData private UserReferenceDto reportingUser; @@ -126,6 +138,9 @@ public class ExposureDto extends PseudonymizableDto { @EmbeddedPersonalData @EmbeddedSensitiveData private LocationDto location; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private ExposureRole exposureRole; // Type of Place @@ -147,15 +162,39 @@ public class ExposureDto extends PseudonymizableDto { private WorkEnvironment workEnvironment; // Details + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown indoors; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown outdoors; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown wearingMask; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown wearingPpe; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown otherProtectiveMeasures; @SensitiveData @Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong) + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private String protectiveMeasuresDetails; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown shortDistance; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown longFaceToFaceContact; @Diseases({ Disease.UNDEFINED, @@ -213,12 +252,25 @@ public class ExposureDto extends PseudonymizableDto { Disease.UNDEFINED, Disease.OTHER }) private YesNoUnknown handlingAnimals; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private AnimalCondition animalCondition; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown animalVaccinated; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private AnimalContactType animalContactType; @SensitiveData @Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong) private String animalContactTypeDetails; + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private AnimalLocation animalLocation; @Diseases({ Disease.AFP, Disease.CHOLERA, @@ -245,10 +297,16 @@ public class ExposureDto extends PseudonymizableDto { Disease.OTHER }) @Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong) private String waterSourceDetails; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) @PersonalData private ContactReferenceDto contactToCase; private YesNoUnknown prophylaxis; private Date prophylaxisDate; + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) private YesNoUnknown riskArea; // Exposure sub-types @@ -285,6 +343,58 @@ public class ExposureDto extends PseudonymizableDto { private String deceasedPersonRelation; private YesNoUnknown largeAttendanceNumber; + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + @SensitiveData + private TravelAccommodation travelAccommodation; + + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + @Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong) + private String travelAccommodationType; + + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + @DependantOn(INTERNATIONAL_SWIMMING) + private SwimmingLocation swimmingLocation; + + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + @Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong) + private String swimmingLocationType; + + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private YesNoUnknown domesticSwimming; + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private YesNoUnknown internationalSwimming; + + @Diseases(Disease.GIARDIASIS) + @SensitiveData + @Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong) + private String sexualExposureText; + @Diseases({ + Disease.CRYPTOSPORIDIOSIS }) + @SensitiveData + private YesNoUnknown rawFoodContact; + @Diseases({ + Disease.CRYPTOSPORIDIOSIS }) + @SensitiveData + @Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong) + private String rawFoodContactText; + @Diseases({ + Disease.CRYPTOSPORIDIOSIS }) + @SensitiveData + @Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong) + private String symptomaticIndividualText; + public static ExposureDto build(ExposureType exposureType) { ExposureDto exposure = new ExposureDto(); @@ -735,6 +845,94 @@ public void setLargeAttendanceNumber(YesNoUnknown largeAttendanceNumber) { this.largeAttendanceNumber = largeAttendanceNumber; } + public AnimalLocation getAnimalLocation() { + return animalLocation; + } + + public void setAnimalLocation(AnimalLocation animalLocation) { + this.animalLocation = animalLocation; + } + + public TravelAccommodation getTravelAccommodation() { + return travelAccommodation; + } + + public void setTravelAccommodation(TravelAccommodation travelAccommodation) { + this.travelAccommodation = travelAccommodation; + } + + public String getTravelAccommodationType() { + return travelAccommodationType; + } + + public void setTravelAccommodationType(String travelAccommodationType) { + this.travelAccommodationType = travelAccommodationType; + } + + public SwimmingLocation getSwimmingLocation() { + return swimmingLocation; + } + + public void setSwimmingLocation(SwimmingLocation swimmingLocation) { + this.swimmingLocation = swimmingLocation; + } + + public String getSwimmingLocationType() { + return swimmingLocationType; + } + + public void setSwimmingLocationType(String swimmingLocationType) { + this.swimmingLocationType = swimmingLocationType; + } + + public YesNoUnknown getDomesticSwimming() { + return domesticSwimming; + } + + public void setDomesticSwimming(YesNoUnknown domesticSwimming) { + this.domesticSwimming = domesticSwimming; + } + + public YesNoUnknown getInternationalSwimming() { + return internationalSwimming; + } + + public void setInternationalSwimming(YesNoUnknown internationalSwimming) { + this.internationalSwimming = internationalSwimming; + } + + public String getSexualExposureText() { + return sexualExposureText; + } + + public void setSexualExposureText(String sexualExposureText) { + this.sexualExposureText = sexualExposureText; + } + + public YesNoUnknown getRawFoodContact() { + return rawFoodContact; + } + + public void setRawFoodContact(YesNoUnknown rawFoodContact) { + this.rawFoodContact = rawFoodContact; + } + + public String getRawFoodContactText() { + return rawFoodContactText; + } + + public void setRawFoodContactText(String rawFoodContactText) { + this.rawFoodContactText = rawFoodContactText; + } + + public String getSymptomaticIndividualText() { + return symptomaticIndividualText; + } + + public void setSymptomaticIndividualText(String symptomaticIndividualText) { + this.symptomaticIndividualText = symptomaticIndividualText; + } + @Override public ExposureDto clone() throws CloneNotSupportedException { ExposureDto clone = (ExposureDto) super.clone(); diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureType.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureType.java index 5e42f55ebe3..887100dd48a 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureType.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureType.java @@ -21,22 +21,64 @@ public enum ExposureType { + @Diseases(value = { + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }, hide = true) WORK, + @Diseases({ + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }) TRAVEL, + @Diseases(value = { + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }, hide = true) SPORT, + @Diseases(value = { + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }, hide = true) VISIT, + @Diseases(value = { + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }, hide = true) GATHERING, + @Diseases(value = { + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }, hide = true) HABITATION, + @Diseases(value = { + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }, hide = true) PERSONAL_SERVICES, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS }) CHILDCARE_FACILITY, @Diseases(value = { - Disease.CORONAVIRUS }, hide = true) + Disease.CORONAVIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) BURIAL, @Diseases(value = { Disease.CORONAVIRUS }, hide = true) ANIMAL_CONTACT, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + RECREATIONAL_WATER, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + FOOD, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + SEXUAL_CONTACT, + @Diseases({ + Disease.CRYPTOSPORIDIOSIS }) + SYMPTOMATIC_CONTACT, + @Diseases({ + Disease.CRYPTOSPORIDIOSIS, + Disease.GIARDIASIS }) + FLOOD_EXPOSURE, OTHER, UNKNOWN; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/InfectionSource.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/InfectionSource.java new file mode 100644 index 00000000000..e6799b7547e --- /dev/null +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/InfectionSource.java @@ -0,0 +1,30 @@ +/* + * 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; + +public enum InfectionSource { + + FOOD, + ANIMAL, + NOT_APPLICABLE, + OTHER; + + @Override + public String toString() { + return I18nProperties.getEnumCaption(this); + } +} diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ModeOfTransmission.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ModeOfTransmission.java new file mode 100644 index 00000000000..a5caff1ff38 --- /dev/null +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/ModeOfTransmission.java @@ -0,0 +1,40 @@ +/* + * 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; + +public enum ModeOfTransmission { + + ANIMAL_TO_HUMAN, + FOOD_OR_WATER, + PERSON_TO_PERSON, + RECREATIONAL_WATER, + HEALTHCARE_ASSOCIATED, + INJECTING_DRUG_USERS, + LAB_OCCUPATIONAL_EXPOSURE, + MOTHER_TO_CHILD, + SEXUAL, + TRANSFUSION_RECIPIENT, + ORGAN_RECIPIENT, + UNKNOWN, + OTHER; + + @Override + public String toString() { + return I18nProperties.getEnumCaption(this); + } + +} diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/SwimmingLocation.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/SwimmingLocation.java new file mode 100644 index 00000000000..339498188c7 --- /dev/null +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/SwimmingLocation.java @@ -0,0 +1,34 @@ +/* + * 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; + +public enum SwimmingLocation { + + PUBLIC, + PRIVATE, + LAKE, + RIVER, + OCEAN, + WATER_PARK, + OTHER; + + @Override + public String toString() { + return I18nProperties.getEnumCaption(this); + } + +} diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/TravelAccommodation.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/TravelAccommodation.java new file mode 100644 index 00000000000..80f5407e6fb --- /dev/null +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/TravelAccommodation.java @@ -0,0 +1,29 @@ +/* + * 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; + +public enum TravelAccommodation { + + HOTEL, + CAMPING, + RENTED_APARTMENT_OR_HOUSE, + FRIENDS_OR_FAMILY, + OTHER; + + @Override + public String toString() { + return de.symeda.sormas.api.i18n.I18nProperties.getEnumCaption(this); + } +} diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/TypeOfAnimal.java b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/TypeOfAnimal.java index e4ceaf41758..cffd9c7a6b3 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/exposure/TypeOfAnimal.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/exposure/TypeOfAnimal.java @@ -15,24 +15,72 @@ package de.symeda.sormas.api.exposure; +import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.i18n.I18nProperties; +import de.symeda.sormas.api.utils.Diseases; public enum TypeOfAnimal { + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) BAT, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) POULTRY, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) CAMEL, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) CANIDAE, CAT, CATTLE, DOG, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) PRIMATE, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) SNAKE, SWINE, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) RABBIT, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) RODENT, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) TICK, + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) FLEA, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + BIRDS, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + GOAT, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + HORSE, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + SHEEP, OTHER; @Override diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/hospitalization/HospitalizationDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/hospitalization/HospitalizationDto.java index ce80437ce59..f1d7d1aff13 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/hospitalization/HospitalizationDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/hospitalization/HospitalizationDto.java @@ -61,6 +61,7 @@ public class HospitalizationDto extends EntityDto { public static final String OTHER_HOSPITALIZATION_REASON = "otherHospitalizationReason"; public static final String DESCRIPTION = "description"; public static final String CURRENTLY_HOSPITALIZED = "currentlyHospitalized"; + public static final String DURATION_OF_HOSPITALIZATION = "durationOfHospitalization"; // Fields are declared in the order they should appear in the import template @@ -77,23 +78,33 @@ public class HospitalizationDto extends EntityDto { private List previousHospitalizations = new ArrayList<>(); @Diseases({ - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) private YesNoUnknown intensiveCareUnit; @Diseases({ - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) private Date intensiveCareUnitStart; @Diseases({ - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) private Date intensiveCareUnitEnd; @Diseases({ Disease.RESPIRATORY_SYNCYTIAL_VIRUS }) private YesNoUnknown oxygenPrescribed; @Diseases({ - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) private YesNoUnknown stillHospitalized; @Diseases({ - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) private Integer icuLengthOfStay; private HospitalizationReasonType hospitalizationReason; @@ -103,6 +114,11 @@ public class HospitalizationDto extends EntityDto { private String description; private YesNoUnknown currentlyHospitalized; + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private Integer durationOfHospitalization; + public static HospitalizationDto build() { HospitalizationDto hospitalization = new HospitalizationDto(); hospitalization.setUuid(DataHelper.createUuid()); @@ -254,4 +270,12 @@ public Integer getIcuLengthOfStay() { public void setIcuLengthOfStay(Integer icuLengthOfStay) { this.icuLengthOfStay = icuLengthOfStay; } + + public Integer getDurationOfHospitalization() { + return durationOfHospitalization; + } + + public void setDurationOfHospitalization(Integer durationOfHospitalization) { + this.durationOfHospitalization = durationOfHospitalization; + } } 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 4ef6c884310..f61e6b7f71c 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 @@ -894,6 +894,7 @@ public interface Captions { String CaseHospitalization_admittedToHealthFacility = "CaseHospitalization.admittedToHealthFacility"; String CaseHospitalization_currentlyHospitalized = "CaseHospitalization.currentlyHospitalized"; String CaseHospitalization_dischargeDate = "CaseHospitalization.dischargeDate"; + String CaseHospitalization_durationOfHospitalization = "CaseHospitalization.durationOfHospitalization"; String CaseHospitalization_healthFacility = "CaseHospitalization.healthFacility"; String CaseHospitalization_hospitalizationReason = "CaseHospitalization.hospitalizationReason"; String CaseHospitalization_hospitalizedPreviously = "CaseHospitalization.hospitalizedPreviously"; @@ -1568,7 +1569,11 @@ public interface Captions { String EpiData_exposureDetailsKnown = "EpiData.exposureDetailsKnown"; String EpiData_exposures = "EpiData.exposures"; String EpiData_highTransmissionRiskArea = "EpiData.highTransmissionRiskArea"; + String EpiData_infectionSource = "EpiData.infectionSource"; + String EpiData_infectionSourceText = "EpiData.infectionSourceText"; String EpiData_largeOutbreaksArea = "EpiData.largeOutbreaksArea"; + String EpiData_modeOfTransmission = "EpiData.modeOfTransmission"; + String EpiData_modeOfTransmissionType = "EpiData.modeOfTransmissionType"; String epiDataNoSourceContacts = "epiDataNoSourceContacts"; String epiWeekFrom = "epiWeekFrom"; String epiWeekTo = "epiWeekTo"; @@ -1799,6 +1804,7 @@ public interface Captions { String Exposure_animalCondition = "Exposure.animalCondition"; String Exposure_animalContactType = "Exposure.animalContactType"; String Exposure_animalContactTypeDetails = "Exposure.animalContactTypeDetails"; + String Exposure_animalLocation = "Exposure.animalLocation"; String Exposure_animalMarket = "Exposure.animalMarket"; String Exposure_animalVaccinated = "Exposure.animalVaccinated"; String Exposure_bodyOfWater = "Exposure.bodyOfWater"; @@ -1809,6 +1815,7 @@ public interface Captions { String Exposure_deceasedPersonIll = "Exposure.deceasedPersonIll"; String Exposure_deceasedPersonName = "Exposure.deceasedPersonName"; String Exposure_deceasedPersonRelation = "Exposure.deceasedPersonRelation"; + String Exposure_domesticSwimming = "Exposure.domesticSwimming"; String Exposure_eatingRawAnimalProducts = "Exposure.eatingRawAnimalProducts"; String Exposure_endDate = "Exposure.endDate"; String Exposure_exposureDate = "Exposure.exposureDate"; @@ -1824,6 +1831,7 @@ public interface Captions { String Exposure_imi_longFaceToFaceContact = "Exposure.imi.longFaceToFaceContact"; String Exposure_imi_shortDistance = "Exposure.imi.shortDistance"; String Exposure_indoors = "Exposure.indoors"; + String Exposure_internationalSwimming = "Exposure.internationalSwimming"; String Exposure_largeAttendanceNumber = "Exposure.largeAttendanceNumber"; String Exposure_location = "Exposure.location"; String Exposure_longFaceToFaceContact = "Exposure.longFaceToFaceContact"; @@ -1838,10 +1846,18 @@ public interface Captions { String Exposure_prophylaxis = "Exposure.prophylaxis"; String Exposure_prophylaxisDate = "Exposure.prophylaxisDate"; String Exposure_protectiveMeasuresDetails = "Exposure.protectiveMeasuresDetails"; + String Exposure_rawFoodContact = "Exposure.rawFoodContact"; + String Exposure_rawFoodContactText = "Exposure.rawFoodContactText"; String Exposure_riskArea = "Exposure.riskArea"; String Exposure_seatNumber = "Exposure.seatNumber"; + String Exposure_sexualExposureText = "Exposure.sexualExposureText"; String Exposure_shortDistance = "Exposure.shortDistance"; String Exposure_startDate = "Exposure.startDate"; + String Exposure_swimmingLocation = "Exposure.swimmingLocation"; + String Exposure_swimmingLocationType = "Exposure.swimmingLocationType"; + String Exposure_symptomaticIndividualText = "Exposure.symptomaticIndividualText"; + String Exposure_travelAccommodation = "Exposure.travelAccommodation"; + String Exposure_travelAccommodationType = "Exposure.travelAccommodationType"; String Exposure_typeOfAnimal = "Exposure.typeOfAnimal"; String Exposure_typeOfAnimalDetails = "Exposure.typeOfAnimalDetails"; String Exposure_typeOfChildcareFacility = "Exposure.typeOfChildcareFacility"; @@ -2376,6 +2392,8 @@ public interface Captions { String Person_sex = "Person.sex"; String Person_symptomJournalStatus = "Person.symptomJournalStatus"; String Person_uuid = "Person.uuid"; + String Person_workPlace = "Person.workPlace"; + String Person_workPlaceText = "Person.workPlaceText"; String personAgeAndBirthdate = "personAgeAndBirthdate"; String personCommunityPrompt = "personCommunityPrompt"; String PersonContactDetail = "PersonContactDetail"; @@ -2845,6 +2863,7 @@ public interface Captions { String Symptoms_bilateralCataracts = "Symptoms.bilateralCataracts"; String Symptoms_blackeningDeathOfTissue = "Symptoms.blackeningDeathOfTissue"; String Symptoms_bleedingVagina = "Symptoms.bleedingVagina"; + String Symptoms_bloating = "Symptoms.bloating"; String Symptoms_bloodCirculationProblems = "Symptoms.bloodCirculationProblems"; String Symptoms_bloodInStool = "Symptoms.bloodInStool"; String Symptoms_bloodPressureDiastolic = "Symptoms.bloodPressureDiastolic"; @@ -2887,7 +2906,9 @@ public interface Captions { String Symptoms_difficultyBreathingDuringMeals = "Symptoms.difficultyBreathingDuringMeals"; String Symptoms_digestedBloodVomit = "Symptoms.digestedBloodVomit"; String Symptoms_dizzinessStandingUp = "Symptoms.dizzinessStandingUp"; + String Symptoms_durationOfSymptoms = "Symptoms.durationOfSymptoms"; String Symptoms_dysphagia = "Symptoms.dysphagia"; + String Symptoms_eggyBurps = "Symptoms.eggyBurps"; String Symptoms_erraticBehaviour = "Symptoms.erraticBehaviour"; String Symptoms_excessSalivation = "Symptoms.excessSalivation"; String Symptoms_excitation = "Symptoms.excitation"; @@ -2976,7 +2997,9 @@ public interface Captions { String Symptoms_otherClinicalPresentation = "Symptoms.otherClinicalPresentation"; String Symptoms_otherClinicalPresentationText = "Symptoms.otherClinicalPresentationText"; String Symptoms_otherComplications = "Symptoms.otherComplications"; + String Symptoms_otherComplications_CryptoGiardia = "Symptoms.otherComplications.CryptoGiardia"; String Symptoms_otherComplicationsText = "Symptoms.otherComplicationsText"; + String Symptoms_otherComplicationsText_CryptoGiardia = "Symptoms.otherComplicationsText.CryptoGiardia"; String Symptoms_otherHemorrhagicSymptoms = "Symptoms.otherHemorrhagicSymptoms"; String Symptoms_otherHemorrhagicSymptomsText = "Symptoms.otherHemorrhagicSymptomsText"; String Symptoms_otherMajorSiteDetails = "Symptoms.otherMajorSiteDetails"; @@ -2984,6 +3007,7 @@ public interface Captions { String Symptoms_otherNonHemorrhagicSymptoms = "Symptoms.otherNonHemorrhagicSymptoms"; String Symptoms_otherNonHemorrhagicSymptomsText = "Symptoms.otherNonHemorrhagicSymptomsText"; String Symptoms_otitisMedia = "Symptoms.otitisMedia"; + String Symptoms_overnightStayRequired = "Symptoms.overnightStayRequired"; String Symptoms_oxygenSaturationLower94 = "Symptoms.oxygenSaturationLower94"; String Symptoms_painfulLymphadenitis = "Symptoms.painfulLymphadenitis"; String Symptoms_palpableLiver = "Symptoms.palpableLiver"; @@ -3004,6 +3028,7 @@ public interface Captions { String Symptoms_rapidBreathing = "Symptoms.rapidBreathing"; String Symptoms_redBloodVomit = "Symptoms.redBloodVomit"; String Symptoms_refusalFeedorDrink = "Symptoms.refusalFeedorDrink"; + String Symptoms_reoccurrence = "Symptoms.reoccurrence"; String Symptoms_respiratoryDiseaseVentilation = "Symptoms.respiratoryDiseaseVentilation"; String Symptoms_respiratoryFatigue = "Symptoms.respiratoryFatigue"; String Symptoms_respiratoryRate = "Symptoms.respiratoryRate"; @@ -3025,15 +3050,19 @@ public interface Captions { String Symptoms_sunkenEyesFontanelle = "Symptoms.sunkenEyesFontanelle"; String Symptoms_swollenGlands = "Symptoms.swollenGlands"; String Symptoms_symptomatic = "Symptoms.symptomatic"; + String Symptoms_symptomCurrentStatus = "Symptoms.symptomCurrentStatus"; String Symptoms_symptomOnset = "Symptoms.symptomOnset"; String Symptoms_symptomsComments = "Symptoms.symptomsComments"; String Symptoms_symptomsNotOccurred = "Symptoms.symptomsNotOccurred"; String Symptoms_symptomsOccurred = "Symptoms.symptomsOccurred"; + String Symptoms_symptomStatus = "Symptoms.symptomStatus"; String Symptoms_symptomsUnknownOccurred = "Symptoms.symptomsUnknownOccurred"; String Symptoms_temperature = "Symptoms.temperature"; String Symptoms_temperatureSource = "Symptoms.temperatureSource"; String Symptoms_throbocytopenia = "Symptoms.throbocytopenia"; String Symptoms_timeOffWorkDays = "Symptoms.timeOffWorkDays"; + String Symptoms_timeOffWorkDays_giardiasis = "Symptoms.timeOffWorkDays.giardiasis"; + String Symptoms_timeOffWorkOrSchool = "Symptoms.timeOffWorkOrSchool"; String Symptoms_tremor = "Symptoms.tremor"; String Symptoms_unexplainedBleeding = "Symptoms.unexplainedBleeding"; String Symptoms_unilateralCataracts = "Symptoms.unilateralCataracts"; @@ -3043,6 +3072,8 @@ public interface Captions { String Symptoms_vomiting = "Symptoms.vomiting"; String Symptoms_weakness = "Symptoms.weakness"; String Symptoms_weight = "Symptoms.weight"; + String Symptoms_weightLoss = "Symptoms.weightLoss"; + String Symptoms_weightLossAmount = "Symptoms.weightLossAmount"; String Symptoms_wheezing = "Symptoms.wheezing"; String Symptoms_whoopSound = "Symptoms.whoopSound"; String symptomsLesionsLocations = "symptomsLesionsLocations"; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java index bf934328868..4a44424fe2b 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java @@ -638,7 +638,7 @@ public interface Strings { String headingEnvironmentSamplesNotDeleted = "headingEnvironmentSamplesNotDeleted"; String headingEnvironmentSamplesNotRestored = "headingEnvironmentSamplesNotRestored"; String headingEnvironmentSamplesRestored = "headingEnvironmentSamplesRestored"; - String headingEpiCaseImport = "headingEpiCaseImport"; + String headingEpiConclusion = "headingEpiConclusion"; String headingEpiCurve = "headingEpiCurve"; String headingEpiDataSourceCaseContacts = "headingEpiDataSourceCaseContacts"; String headingErrorReportNotAvailable = "headingErrorReportNotAvailable"; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java index 38c840b9c0b..1689520ca5b 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java @@ -46,6 +46,7 @@ import de.symeda.sormas.api.sormastosormas.S2SIgnoreProperty; import de.symeda.sormas.api.sormastosormas.SormasToSormasConfig; import de.symeda.sormas.api.utils.DataHelper; +import de.symeda.sormas.api.utils.DependantOn; import de.symeda.sormas.api.utils.DependingOnFeatureType; import de.symeda.sormas.api.utils.Diseases; import de.symeda.sormas.api.utils.EmbeddedPersonalData; @@ -136,6 +137,8 @@ public class PersonDto extends PseudonymizableDto implements IsPerson { public static final String IS_INCAPACITATED = "incapacitated"; public static final String ENTRY_DATE = "entryDate"; public static final String LIVING_STATUS = "livingStatus"; + public static final String WORK_PLACE = "workPlace"; + public static final String WORK_PLACE_TEXT = "workPlaceText"; private static final long serialVersionUID = -8558187171374254398L; // Fields are declared in the order they should appear in the import template @@ -410,7 +413,9 @@ public class PersonDto extends PseudonymizableDto implements IsPerson { Disease.TUBERCULOSIS, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.MEASLES}) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) private Date entryDate; @HideForCountriesExcept(countries = { CountryHelper.COUNTRY_CODE_LUXEMBOURG }) @@ -419,8 +424,21 @@ public class PersonDto extends PseudonymizableDto implements IsPerson { Disease.TUBERCULOSIS, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.MEASLES }) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) private LivingStatus livingStatus; + @SensitiveData + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + private WorkPlace workPlace; + @SensitiveData + @Diseases(value = { + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + @DependantOn(WORK_PLACE) + private String workPlaceText; @SuppressWarnings("serial") public static class SeveralNonPrimaryContactDetailsException extends RuntimeException { @@ -1124,6 +1142,22 @@ public void setIncapacitated(boolean incapacitated) { this.incapacitated = incapacitated; } + public WorkPlace getWorkPlace() { + return workPlace; + } + + public void setWorkPlace(WorkPlace workPlace) { + this.workPlace = workPlace; + } + + public String getWorkPlaceText() { + return workPlaceText; + } + + public void setWorkPlaceText(String workPlaceText) { + this.workPlaceText = workPlaceText; + } + @Override public String buildCaption() { return buildCaption(firstName, lastName); diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/person/WorkPlace.java b/sormas-api/src/main/java/de/symeda/sormas/api/person/WorkPlace.java new file mode 100644 index 00000000000..0e4fb18a5cc --- /dev/null +++ b/sormas-api/src/main/java/de/symeda/sormas/api/person/WorkPlace.java @@ -0,0 +1,31 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * 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.person; + +import de.symeda.sormas.api.i18n.I18nProperties; + +public enum WorkPlace { + + SCHOOL, + NURSERY, + UNKNOWN, + OTHER; + + @Override + public String toString() { + return I18nProperties.getEnumCaption(this); + } +} diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/sample/GenoTypeResult.java b/sormas-api/src/main/java/de/symeda/sormas/api/sample/GenoTypeResult.java index fe896316c78..1018a82050d 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/sample/GenoTypeResult.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/sample/GenoTypeResult.java @@ -17,39 +17,98 @@ *******************************************************************************/ package de.symeda.sormas.api.sample; +import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.i18n.I18nProperties; +import de.symeda.sormas.api.utils.Diseases; public enum GenoTypeResult { - GENOTYPE_A, - GENOTYPE_B, - GENOTYPE_B2, - GENOTYPE_B3, - GENOTYPE_C1, - GENOTYPE_C2, - GENOTYPE_D1, - GENOTYPE_D10, - GENOTYPE_D11, - GENOTYPE_D2, - GENOTYPE_D3, - GENOTYPE_D4, - GENOTYPE_D5, - GENOTYPE_D6, - GENOTYPE_D7, - GENOTYPE_D8, - GENOTYPE_D9, - GENOTYPE_E, - GENOTYPE_F, - GENOTYPE_G1, - GENOTYPE_G2, - GENOTYPE_G3, - GENOTYPE_H1, - GENOTYPE_H2, - OTHER, - UNKNOWN; + @Diseases({ + Disease.MEASLES }) + GENOTYPE_A, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_B, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_B2, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_B3, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_C1, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_C2, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D1, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D10, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D11, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D2, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D3, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D4, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D5, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D6, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D7, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D8, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_D9, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_E, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_F, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_G1, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_G2, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_G3, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_H1, + @Diseases({ + Disease.MEASLES }) + GENOTYPE_H2, + @Diseases({ + Disease.CRYPTOSPORIDIOSIS }) + CRYPTOSPORIDIUM_HOMINIS, + @Diseases({ + Disease.CRYPTOSPORIDIOSIS }) + CRYPTOSPORIDIUM_PARVUM, + @Diseases({ + Disease.CRYPTOSPORIDIOSIS }) + CRYPTOSPORIDIUM_SPECIES, + OTHER, + UNKNOWN; - @Override - public String toString() { - return I18nProperties.getEnumCaption(this); - } + @Override + public String toString() { + return I18nProperties.getEnumCaption(this); + } } diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestDto.java index 4676a44cf01..6b9f568d86d 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestDto.java @@ -240,12 +240,15 @@ public class PathogenTestDto extends PseudonymizableDto { @SensitiveData @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) - @Diseases(value = {Disease.MEASLES}) + @Diseases(value = { + Disease.MEASLES, + Disease.CRYPTOSPORIDIOSIS }) private GenoTypeResult genoTypeResult; @SensitiveData @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) - @Diseases(value = {Disease.MEASLES}) + @Diseases(value = { + Disease.MEASLES }) private String genoTypeResultText; @SensitiveData 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 efcc05d7f0e..1319569a5ef 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 @@ -26,7 +26,9 @@ public enum PathogenTestType { @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) ANTIBODY_DETECTION, ANTIGEN_DETECTION, @@ -37,39 +39,51 @@ public enum PathogenTestType { RAPID_TEST, + @Diseases(value = { + Disease.GIARDIASIS }, hide = true) CULTURE, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) HISTOPATHOLOGY, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) ISOLATION, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) IGM_SERUM_ANTIBODY, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) IGG_SERUM_ANTIBODY, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) IGA_SERUM_ANTIBODY, @Diseases(value = { @@ -77,21 +91,25 @@ public enum PathogenTestType { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) INCUBATION_TIME, @Diseases(value = { Disease.CORONAVIRUS, Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.MEASLES }) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.MEASLES }) INDIRECT_FLUORESCENT_ANTIBODY, @Diseases(value = { Disease.CORONAVIRUS, Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.MEASLES }) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.MEASLES }) DIRECT_FLUORESCENT_ANTIBODY, @Diseases(value = { @@ -103,7 +121,9 @@ public enum PathogenTestType { @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) NEUTRALIZING_ANTIBODIES, @Diseases(value = { @@ -115,7 +135,9 @@ public enum PathogenTestType { @Diseases(value = { Disease.CORONAVIRUS, Disease.RESPIRATORY_SYNCYTIAL_VIRUS, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) GRAM_STAIN, @Diseases(value = { @@ -123,33 +145,41 @@ public enum PathogenTestType { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) LATEX_AGGLUTINATION, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) CQ_VALUE_DETECTION, @Diseases(value = { - Disease.RESPIRATORY_SYNCYTIAL_VIRUS, - Disease.MEASLES}) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.MEASLES }) SEQUENCING, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) DNA_MICROARRAY, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) TMA, @Diseases(value = { @@ -200,7 +230,8 @@ public enum PathogenTestType { SEROGROUPING, @Diseases(value = { - Disease.MEASLES }) + Disease.MEASLES, + Disease.CRYPTOSPORIDIOSIS }) GENOTYPING, OTHER; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.java b/sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.java index 15a3f8e01ea..e58bb10dd61 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.java @@ -25,18 +25,24 @@ public enum SampleMaterial { @Diseases(value = { - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }, hide = true) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) BLOOD, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) DRY_BLOOD, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) SERA, @Diseases(value = { @@ -50,25 +56,33 @@ public enum SampleMaterial { @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) THROAT_ASPIRATE, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) NASAL_SWAB, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) THROAT_SWAB, @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) NP_SWAB, @Diseases(value = { @@ -76,12 +90,16 @@ public enum SampleMaterial { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) RECTAL_SWAB, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) CEREBROSPINAL_FLUID, @Diseases(value = { @@ -89,20 +107,26 @@ public enum SampleMaterial { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) CRUST, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) TISSUE, @Diseases(value = { Disease.CORONAVIRUS, Disease.RESPIRATORY_SYNCYTIAL_VIRUS, - Disease.INVASIVE_MENINGOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_MENINGOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) URINE, @Diseases(value = { @@ -110,13 +134,17 @@ public enum SampleMaterial { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) CORNEA_PM, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) SALIVA, @Diseases(value = { @@ -124,7 +152,9 @@ public enum SampleMaterial { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) URINE_PM, @Diseases(value = { @@ -132,26 +162,39 @@ public enum SampleMaterial { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) NUCHAL_SKIN_BIOPSY, + @Diseases({ + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }) + BIOPSY, + @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) SPUTUM, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) ENDOTRACHEAL_ASPIRATE, @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) BRONCHOALVEOLAR_LAVAGE, @Diseases(value = { @@ -159,32 +202,42 @@ public enum SampleMaterial { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) BRAIN_TISSUE, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) ANTERIOR_NARES_SWAB, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) OP_ASPIRATE, @Diseases(value = { Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) NP_ASPIRATE, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) PLEURAL_FLUID, @Diseases(value = { @@ -197,29 +250,47 @@ public enum SampleMaterial { @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, - Disease.INVASIVE_MENINGOCOCCAL_INFECTION }, hide = true) + Disease.INVASIVE_MENINGOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) AMNIOTIC_FLUID, @Diseases(value = { Disease.MEASLES, - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }, hide = true) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) CLINICAL_SAMPLE, @Diseases(value = { Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - Disease.MEASLES }, hide = true) + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) PERITONEAL_FLUID, @Diseases(value = { Disease.MEASLES, - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }, hide = true) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) SYNOVIAL_FLUID, @Diseases(value = { - Disease.RESPIRATORY_SYNCYTIAL_VIRUS }, hide = true) + Disease.RESPIRATORY_SYNCYTIAL_VIRUS, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS }, hide = true) EDTA_WHOLE_BLOOD, + @Diseases(value = { + Disease.CRYPTOSPORIDIOSIS }) + INTESTINAL_FLUID, + + @Diseases(value = { + Disease.GIARDIASIS }) + DUODENUM_FLUID, + OTHER; @Override diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java index a312cfd5b51..b7bb8b3925a 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java @@ -29,6 +29,7 @@ import static de.symeda.sormas.api.Disease.CHOLERA; import static de.symeda.sormas.api.Disease.CONGENITAL_RUBELLA; import static de.symeda.sormas.api.Disease.CORONAVIRUS; +import static de.symeda.sormas.api.Disease.CRYPTOSPORIDIOSIS; import static de.symeda.sormas.api.Disease.CSM; import static de.symeda.sormas.api.Disease.C_PNEUMONIAE; import static de.symeda.sormas.api.Disease.DENGUE; @@ -38,6 +39,7 @@ import static de.symeda.sormas.api.Disease.ENTEROVIRUS; import static de.symeda.sormas.api.Disease.EVD; import static de.symeda.sormas.api.Disease.FHA; +import static de.symeda.sormas.api.Disease.GIARDIASIS; import static de.symeda.sormas.api.Disease.GUINEA_WORM; import static de.symeda.sormas.api.Disease.HIV; import static de.symeda.sormas.api.Disease.H_METAPNEUMOVIRUS; @@ -332,6 +334,16 @@ public class SymptomsDto extends PseudonymizableDto { public static final String DATE_OF_ONSET_KNOWN = "dateOfOnsetKnown"; public static final String CLINICAL_PRESENTATION_STATUS = "clinicalPresentationStatus"; + // Giardiasis & Cryptosporidiosis symptoms + public static final String EGGY_BURPS = "eggyBurps"; + public static final String WEIGHT_LOSS = "weightLoss"; + public static final String WEIGHT_LOSS_AMOUNT = "weightLossAmount"; + public static final String BLOATING = "bloating"; + public static final String REOCCURRENCE = "reoccurrence"; + public static final String OVERNIGHT_STAY_REQUIRED = "overnightStayRequired"; + public static final String SYMPTOM_CURRENT_STATUS = "symptomCurrentStatus"; + public static final String DURATION_OF_SYMPTOMS = "durationOfSymptoms"; + // Fields are declared in the order they should appear in the import template public static SymptomsDto build() { @@ -354,6 +366,8 @@ public static SymptomsDto build() { ANTHRAX, CORONAVIRUS, UNSPECIFIED_VHF, + GIARDIASIS, + CRYPTOSPORIDIOSIS, UNDEFINED, OTHER }) @HideForCountries @@ -371,11 +385,13 @@ public static SymptomsDto build() { YELLOW_FEVER, RESPIRATORY_SYNCYTIAL_VIRUS, UNSPECIFIED_VHF, + GIARDIASIS, + CRYPTOSPORIDIOSIS, UNDEFINED, OTHER }) @Outbreaks @HideForCountries - @SymptomGrouping(SymptomGroup.GASTROINTESTINAL) + @SymptomGrouping(SymptomGroup.GENERAL) private SymptomState anorexiaAppetiteLoss; @Diseases({ @@ -615,10 +631,12 @@ public static SymptomsDto build() { CHOLERA, POLIO, UNSPECIFIED_VHF, + GIARDIASIS, + CRYPTOSPORIDIOSIS, UNDEFINED, OTHER }) @HideForCountries - @SymptomGrouping(SymptomGroup.GASTROINTESTINAL) + @SymptomGrouping(SymptomGroup.GENERAL) private SymptomState dehydration; @Diseases({ @@ -635,6 +653,8 @@ public static SymptomsDto build() { ANTHRAX, CORONAVIRUS, UNSPECIFIED_VHF, + GIARDIASIS, + CRYPTOSPORIDIOSIS, UNDEFINED, OTHER }) @Outbreaks @@ -753,6 +773,8 @@ public static SymptomsDto build() { RESPIRATORY_SYNCYTIAL_VIRUS, UNDEFINED, PERTUSSIS, + GIARDIASIS, + CRYPTOSPORIDIOSIS, OTHER }) @Outbreaks @SymptomGrouping(SymptomGroup.GENERAL) @@ -1212,6 +1234,8 @@ public static SymptomsDto build() { RABIES, ANTHRAX, CORONAVIRUS, + CRYPTOSPORIDIOSIS, + GIARDIASIS, UNDEFINED, OTHER }) @Outbreaks @@ -1332,7 +1356,9 @@ public static SymptomsDto build() { FHA, INVASIVE_MENINGOCOCCAL_INFECTION, INVASIVE_PNEUMOCOCCAL_INFECTION, - PERTUSSIS }) + PERTUSSIS, + GIARDIASIS, + CRYPTOSPORIDIOSIS }) @HideForCountries @Outbreaks private Date onsetDate; @@ -1766,6 +1792,8 @@ public static SymptomsDto build() { UNSPECIFIED_VHF, CONGENITAL_RUBELLA, CORONAVIRUS, + GIARDIASIS, + CRYPTOSPORIDIOSIS, UNDEFINED, OTHER }) @SensitiveData @@ -1957,6 +1985,8 @@ public static SymptomsDto build() { UNDEFINED, POLIO, CORONAVIRUS, + CRYPTOSPORIDIOSIS, + GIARDIASIS, OTHER }) @Outbreaks @HideForCountries @@ -2379,6 +2409,8 @@ public static SymptomsDto build() { PLAGUE, ANTHRAX, CORONAVIRUS, + GIARDIASIS, + CRYPTOSPORIDIOSIS, UNDEFINED, OTHER }) @Complication @@ -2487,9 +2519,12 @@ public static SymptomsDto build() { private SymptomState weakness; @Diseases({ CORONAVIRUS, + GIARDIASIS, + CRYPTOSPORIDIOSIS, UNDEFINED, OTHER }) - @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_SWITZERLAND) + @HideForCountriesExcept(countries = { + CountryHelper.COUNTRY_CODE_SWITZERLAND }) @SymptomGrouping(SymptomGroup.GENERAL) private SymptomState fatigue; @Diseases({ @@ -2572,7 +2607,9 @@ public static SymptomsDto build() { INVASIVE_MENINGOCOCCAL_INFECTION, INVASIVE_PNEUMOCOCCAL_INFECTION, PERTUSSIS, - MEASLES }) + MEASLES, + GIARDIASIS, + CRYPTOSPORIDIOSIS }) private SymptomState asymptomatic; @Diseases({ INVASIVE_MENINGOCOCCAL_INFECTION }) @@ -2593,19 +2630,25 @@ public static SymptomsDto build() { @Diseases({ INVASIVE_PNEUMOCOCCAL_INFECTION, INVASIVE_MENINGOCOCCAL_INFECTION, - MEASLES}) + MEASLES, + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + @SymptomGrouping(SymptomGroup.OTHER) private SymptomState otherClinicalPresentation; @Diseases({ INVASIVE_PNEUMOCOCCAL_INFECTION, INVASIVE_MENINGOCOCCAL_INFECTION, - MEASLES}) + MEASLES, + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + @SymptomGrouping(SymptomGroup.OTHER) private String otherClinicalPresentationText; @Diseases({ - INVASIVE_PNEUMOCOCCAL_INFECTION, - INVASIVE_MENINGOCOCCAL_INFECTION, - MEASLES }) + INVASIVE_PNEUMOCOCCAL_INFECTION, + INVASIVE_MENINGOCOCCAL_INFECTION, + MEASLES }) private SymptomState unknownSymptom; // RSV-specific symptoms @@ -2621,20 +2664,66 @@ public static SymptomsDto build() { @SymptomGrouping(SymptomGroup.RESPIRATORY) private SymptomState respiratoryFatigue; - @Diseases(RESPIRATORY_SYNCYTIAL_VIRUS) + @Diseases({ + RESPIRATORY_SYNCYTIAL_VIRUS, + GIARDIASIS, + CRYPTOSPORIDIOSIS }) private YesNoUnknown parentTimeOffWork; - @Diseases(RESPIRATORY_SYNCYTIAL_VIRUS) + @Diseases({ + RESPIRATORY_SYNCYTIAL_VIRUS, + GIARDIASIS, + CRYPTOSPORIDIOSIS }) @DependantOn("parentTimeOffWork") @Size(max = 50, message = Validations.textTooLong) private String timeOffWorkDays; - @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) - @Diseases({ - MEASLES }) - private SymptomState acuteEncephalitis; + @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) + @Diseases({ + MEASLES }) + private SymptomState acuteEncephalitis; + @Diseases({ + GIARDIASIS }) + @SymptomGrouping(SymptomGroup.GASTROINTESTINAL) + private SymptomState eggyBurps; + + @Diseases({ + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + @SymptomGrouping(SymptomGroup.GENERAL) + private SymptomState weightLoss; + @Diseases({ + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + @DependantOn(WEIGHT_LOSS) + @SymptomGrouping(SymptomGroup.GENERAL) + private Float weightLossAmount; + + @Diseases({ + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + private SymptomState symptomCurrentStatus; + + @Diseases({ + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + @DependantOn(SYMPTOM_CURRENT_STATUS) + private Integer durationOfSymptoms; - private DiagnosisType diagnosis; + @Diseases({ + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + private SymptomState reoccurrence; + @Diseases({ + GIARDIASIS, + CRYPTOSPORIDIOSIS }) + private SymptomState overnightStayRequired; + @Diseases({ + GIARDIASIS }) + @SymptomGrouping(SymptomGroup.GASTROINTESTINAL) + private SymptomState bloating; + + private DiagnosisType diagnosis; private InfectionSite majorSite; private String otherMajorSiteDetails; private InfectionSite minorSite; @@ -4321,6 +4410,7 @@ public void setMeningitis(SymptomState meningitis) { this.meningitis = meningitis; } + @Order(321) public SymptomState getOtherClinicalPresentation() { return otherClinicalPresentation; } @@ -4329,6 +4419,7 @@ public void setOtherClinicalPresentation(SymptomState otherClinicalPresentation) this.otherClinicalPresentation = otherClinicalPresentation; } + @Order(322) public String getOtherClinicalPresentationText() { return otherClinicalPresentationText; } @@ -4472,4 +4563,68 @@ public SymptomState getAcuteEncephalitis() { public void setAcuteEncephalitis(SymptomState acuteEncephalitis) { this.acuteEncephalitis = acuteEncephalitis; } + + public SymptomState getEggyBurps() { + return eggyBurps; + } + + public void setEggyBurps(SymptomState eggyBurps) { + this.eggyBurps = eggyBurps; + } + + public SymptomState getWeightLoss() { + return weightLoss; + } + + public void setWeightLoss(SymptomState weightLoss) { + this.weightLoss = weightLoss; + } + + public Float getWeightLossAmount() { + return weightLossAmount; + } + + public void setWeightLossAmount(Float weightLossAmount) { + this.weightLossAmount = weightLossAmount; + } + + public SymptomState getSymptomCurrentStatus() { + return symptomCurrentStatus; + } + + public void setSymptomCurrentStatus(SymptomState symptomCurrentStatus) { + this.symptomCurrentStatus = symptomCurrentStatus; + } + + public Integer getDurationOfSymptoms() { + return durationOfSymptoms; + } + + public void setDurationOfSymptoms(Integer durationOfSymptoms) { + this.durationOfSymptoms = durationOfSymptoms; + } + + public SymptomState getReoccurrence() { + return reoccurrence; + } + + public void setReoccurrence(SymptomState reoccurrence) { + this.reoccurrence = reoccurrence; + } + + public SymptomState getOvernightStayRequired() { + return overnightStayRequired; + } + + public void setOvernightStayRequired(SymptomState overnightStayRequired) { + this.overnightStayRequired = overnightStayRequired; + } + + public SymptomState getBloating() { + return bloating; + } + + public void setBloating(SymptomState bloating) { + this.bloating = bloating; + } } diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index f32940af39c..0fa52c64251 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -648,6 +648,7 @@ CaseHospitalization.currentlyHospitalized=Currently hospitalized? CaseHospitalization.oxygenPrescribed=Oxygen prescribed CaseHospitalization.stillHospitalized=Still hospitalized CaseHospitalization.icuLengthOfStay=Length of ICU stay (days) +CaseHospitalization.durationOfHospitalization=Duration of hospitalization (days) # CaseImport caseImportErrorDescription=Error description caseImportMergeCase=Override existing case with changes from the imported case? @@ -1148,6 +1149,10 @@ EpiData.caseImportedStatus=Case imported status EpiData.clusterRelated=Cluster Related EpiData.clusterType=Cluster type EpiData.clusterTypeText=Specify cluster type text +EpiData.modeOfTransmission=Mode of transmission +EpiData.modeOfTransmissionType= Specify mode of transmission +EpiData.infectionSource= Suspected vehicle or source of infection +EpiData.infectionSourceText= Specify source of infection #Therapy Therapy.directlyObservedTreatment = Directly observed treatment Therapy.mdrXdrTuberculosis = MDR/XDR tuberculosis @@ -1564,6 +1569,18 @@ Exposure.exposureRole=Role Exposure.largeAttendanceNumber=More than 300 attendees Exposure.imi.shortDistance=1.0 m distance Exposure.imi.longFaceToFaceContact=1 hr face-to-face contact +Exposure.travelAccommodation=Travel Accommodation +Exposure.travelAccommodationType=Specify travel accommodation +Exposure.domesticSwimming=Swimming in Luxembourg +Exposure.internationalSwimming=Swimming abroad +Exposure.swimmingLocation=Swimming Location +Exposure.swimmingLocationType=Specify swimming location +Exposure.animalLocation= Animal Location +Exposure.sexualExposureText= Specify sexual exposure + +Exposure.rawFoodContact= Contact with raw pet food +Exposure.rawFoodContactText= Specify contact with raw pet food +Exposure.symptomaticIndividualText= Specify contact with symptomatic individual # Facility facilityActiveFacilities=Active facilities facilityArchivedFacilities=Archived facilities @@ -1966,6 +1983,8 @@ Person.occupationFacilityDetails=Facility name & description Person.occupationFacilityType=Facility type Person.occupationRegion=Facility region Person.occupationType=Type of occupation +Person.workPlace=Place of work +Person.workPlaceText=Specify place of work Person.armedForcesRelationType=Staff of armed forces Person.phone=Primary phone number Person.phoneOwner=Owner of phone @@ -2849,7 +2868,9 @@ Symptoms.otherHemorrhagicSymptomsText=Specify other symptoms Symptoms.otherNonHemorrhagicSymptoms=Other clinical symptoms Symptoms.otherNonHemorrhagicSymptomsText=Specify other symptoms Symptoms.otherComplications=Other complications +Symptoms.otherComplications.CryptoGiardia=Complications Symptoms.otherComplicationsText=Specify other complications +Symptoms.otherComplicationsText.CryptoGiardia=Specify complications Symptoms.otitisMedia=Middle ear inflammation (otitis media) Symptoms.painfulLymphadenitis=Painful lymphadenitis Symptoms.palpableLiver=Palpable liver @@ -2938,7 +2959,7 @@ Symptoms.arthritis=Septic Arthritis Symptoms.meningitis=Meningitis Symptoms.septicaemia=Septicaemia Symptoms.nocturnalCough= Nocturnal Cough -Symptoms.otherClinicalPresentation=Other Clinical Presentation Symptoms +Symptoms.otherClinicalPresentation=Other Symptoms Symptoms.otherClinicalPresentationText=Specify Other Symptoms Symptoms.imi.shock=Septic Shock Symptoms.imi.pneumoniaClinicalOrRadiologic=Pneumonia @@ -2955,10 +2976,21 @@ Symptoms.difficultyBreathingDuringMeals=Difficulty breathing during meals Symptoms.paradoxicalBreathing=Paradoxical (abdominal) breathing Symptoms.respiratoryFatigue=Respiratory fatigue Symptoms.parentTimeOffWork=Parent's time off work +Symptoms.timeOffWorkOrSchool=Time off work or school required 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.reoccurrence= Reoccurrence +Symptoms.overnightStayRequired= Overnight hospitalization required +Symptoms.bloating= Bloating +Symptoms.symptomCurrentStatus= Symptom still presents +Symptoms.durationOfSymptoms= Duration of symptoms (days) +Symptoms.timeOffWorkDays.giardiasis=Duration of absence from work (days) # Task taskMyTasks=My tasks diff --git a/sormas-api/src/main/resources/enum.properties b/sormas-api/src/main/resources/enum.properties index fe7924836d7..503d9abb70a 100644 --- a/sormas-api/src/main/resources/enum.properties +++ b/sormas-api/src/main/resources/enum.properties @@ -113,6 +113,13 @@ AnimalContactType.SCRATCH=Scratch AnimalContactType.LICK=Lick AnimalContactType.OTHER=Other +# AnimalLocation +AnimalLocation.ZOO = Zoo +AnimalLocation.FARM = Farm +AnimalLocation.PARK = Park +AnimalLocation.FOREST = Forest +AnimalLocation.OTHER = Other + # ApproximateAgeType ApproximateAgeType.DAYS = Days ApproximateAgeType.MONTHS = Months @@ -546,6 +553,8 @@ Disease.INVASIVE_MENINGOCOCCAL_INFECTION = Invasive Meningococcal Infection Disease.POST_IMMUNIZATION_ADVERSE_EVENTS_MILD = Post-immunization adverse events mild Disease.POST_IMMUNIZATION_ADVERSE_EVENTS_SEVERE = Post-immunization adverse events severe Disease.FHA = FHA (Functional Hypothalamic Amenorrhea) +Disease.GIARDIASIS=Giardiasis +Disease.CRYPTOSPORIDIOSIS=Cryptosporidiosis Disease.Short.AFP = AFP Disease.Short.CHOLERA = Cholera Disease.Short.CONGENITAL_RUBELLA = CRS @@ -610,6 +619,8 @@ Disease.Short.POST_IMMUNIZATION_ADVERSE_EVENTS_SEVERE = Post-immunization advers Disease.Short.FHA = FHA Disease.Short.INVASIVE_PNEUMOCOCCAL_INFECTION = IPI Disease.Short.INVASIVE_MENINGOCOCCAL_INFECTION = IMI +Disease.Short.GIARDIASIS=Giardia +Disease.Short.CRYPTOSPORIDIOSIS=Cryptosporidiosis DiseaseTransmissionMode.HUMAN_TO_HUMAN = Primarily via human to human DiseaseTransmissionMode.ANIMAL = Primarily via animal @@ -764,6 +775,11 @@ ExposureType.BURIAL=Burial ExposureType.ANIMAL_CONTACT=Animal Contact ExposureType.OTHER=Other ExposureType.UNKNOWN=Unknown +ExposureType.RECREATIONAL_WATER=Exposure to recreational water +ExposureType.FOOD=Exposure to food +ExposureType.SEXUAL_CONTACT=Sexual exposure +ExposureType.SYMPTOMATIC_CONTACT=Contact with symptomatic individuals +ExposureType.FLOOD_EXPOSURE=Flooded area # FacilityType FacilityType.ASSOCIATION=Association, club @@ -901,6 +917,9 @@ GenoTypeResult.GENOTYPE_G2 = Genotype G2 GenoTypeResult.GENOTYPE_G3 = Genotype G3 GenoTypeResult.GENOTYPE_H1 = Genotype H1 GenoTypeResult.GENOTYPE_H2 = Genotype H2 +GenoTypeResult.CRYPTOSPORIDIUM_HOMINIS = Cryptosporidium hominis +GenoTypeResult.CRYPTOSPORIDIUM_PARVUM = Cryptosporidium parvum +GenoTypeResult.CRYPTOSPORIDIUM_SPECIES = Cryptosporidium species GenoTypeResult.OTHER = Other GenoTypeResult.UNKNOWN = Unknown @@ -930,6 +949,12 @@ ImmunizationDateType.RECOVERY_DATE=Date of recovery ImmunizationDateType.REPORT_DATE=Date of report ImmunizationDateType.VALID_UNTIL=Valid until +# InfectionSource +InfectionSource.ANIMAL=Animal +InfectionSource.NOT_APPLICABLE=Not applicable +InfectionSource.FOOD=Food +InfectionSource.OTHER=Other + # InvestigationStatus InvestigationStatus.DISCARDED=Investigation discarded InvestigationStatus.DONE=Investigation done @@ -1011,6 +1036,22 @@ MessageSubject.EVENT_GROUP_CREATED = Event Group created MessageSubject.EVENT_ADDED_TO_EVENT_GROUP = Event added to Event Group MessageSubject.EVENT_REMOVED_FROM_EVENT_GROUP = Event removed from Event Group +# ModeOfTransmission +ModeOfTransmission.ANIMAL_TO_HUMAN = Animal to human +ModeOfTransmission.FOOD_OR_WATER = Food including drinking water +ModeOfTransmission.PERSON_TO_PERSON = Person-to-person (faecal-oral, excluding mother-to-child and sexual transmission) +ModeOfTransmission.RECREATIONAL_WATER = Recreational water +ModeOfTransmission.HEALTHCARE_ASSOCIATED = Healthcare associated +ModeOfTransmission.INJECTING_DRUG_USERS = Injecting drug users +ModeOfTransmission.LAB_OCCUPATIONAL_EXPOSURE = Transmission in a laboratory due to occupational exposure +ModeOfTransmission.MOTHER_TO_CHILD = Transmission from mother to child during pregnancy or at birth +ModeOfTransmission.SEXUAL = Sexual transmission +ModeOfTransmission.TRANSFUSION_RECIPIENT = Transfusion recipient +ModeOfTransmission.ORGAN_RECIPIENT = Organ recipient +ModeOfTransmission.UNKNOWN = Unknown +ModeOfTransmission.OTHER = Other + + # Month Month.JANUARY = January Month.FEBRUARY = February @@ -1274,6 +1315,9 @@ SampleMaterial.DRY_BLOOD = Dried blood spot SampleMaterial.AMNIOTIC_FLUID = Amniotic fluid SampleMaterial.THROAT_ASPIRATE = Throat aspirate SampleMaterial.EDTA_WHOLE_BLOOD = EDTA Whole Blood +SampleMaterial.INTESTINAL_FLUID = Intestinal Fluid +SampleMaterial.DUODENUM_FLUID = Duodenum fluid +SampleMaterial.BIOPSY = Biopsy # SampleSource SampleSource.ANIMAL=Animal SampleSource.ENVIRONMENT=Environment @@ -1397,11 +1441,24 @@ StatisticsVisualizationType.TABLE = Table SurveillanceEpiCurveMode.CASE_STATUS = Case status SurveillanceEpiCurveMode.ALIVE_OR_DEAD = Alive or dead +# SwimmingLocation +SwimmingLocation.PUBLIC = Public pool +SwimmingLocation.PRIVATE = Private pool +SwimmingLocation.LAKE = Lake +SwimmingLocation.RIVER = River +SwimmingLocation.OCEAN = Ocean +SwimmingLocation.WATER_PARK = Water Park +SwimmingLocation.OTHER = Other + + # SymptomState SymptomState.NO = No SymptomState.UNKNOWN = Unknown SymptomState.YES = Yes + + + # TaskAssignee TaskAssignee.ALL = All tasks TaskAssignee.CURRENT_USER = Tasks assigned to me @@ -1476,6 +1533,13 @@ TracingApp.UNKNOWN = Unknown TravelType.ABROAD = Abroad TravelType.WITHIN_COUNTRY = Within the country +# TravelAccommodation +TravelAccommodation.HOTEL = Hotel +TravelAccommodation.CAMPING = Camping site +TravelAccommodation.RENTED_APARTMENT_OR_HOUSE = Rented apartment/ house +TravelAccommodation.FRIENDS_OR_FAMILY = Friends/Family +TravelAccommodation.OTHER = Other + # TreatmentRoute TreatmentRoute.ORAL = Oral TreatmentRoute.IV = IV @@ -1514,6 +1578,10 @@ TypeOfAnimal.RABBIT=Rabbit TypeOfAnimal.RODENT=Rodent or its excreta TypeOfAnimal.FLEA=Flea TypeOfAnimal.TICK=Tick +TypeOfAnimal.BIRDS=Birds +TypeOfAnimal.GOAT=Goat +TypeOfAnimal.HORSE=Horse +TypeOfAnimal.SHEEP=Sheep TypeOfAnimal.OTHER=Other TypeOfChildcareFacility.NURSERY_CRECHE=Nursery/Creche @@ -2168,6 +2236,12 @@ WorkEnvironment.BUILDING_SECTOR = Building sector WorkEnvironment.LOGISTICS_CENTER = Logistics center WorkEnvironment.OTHER = Other +# WorkPlace +WorkPlace.SCHOOL = School +WorkPlace.NURSERY = Nursery +WorkPlace.UNKNOWN = Unknown +WorkPlace.OTHER = Other + # YesNoUnknown YesNoUnknown.NO = No YesNoUnknown.UNKNOWN = Unknown diff --git a/sormas-api/src/main/resources/strings.properties b/sormas-api/src/main/resources/strings.properties index 4af3c54a590..babd468aa69 100644 --- a/sormas-api/src/main/resources/strings.properties +++ b/sormas-api/src/main/resources/strings.properties @@ -826,7 +826,7 @@ headingExtendFollowUp = Extend follow-up period headingExposureInvestigation = Exposure Investigation headingEpiDataSourceCaseContacts = Contacts with Source Case headingExposureDetails = Exposure Details -headingEpiCaseImport = Imported status +headingEpiConclusion = Conclusion headingClusterType = Cluster Type headingAnimalContactDetails = Animal Contact Details headingBurialDetails = Burial Details diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/classification/CaseClassificationFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/classification/CaseClassificationFacadeEjb.java index 2c3d55eb06b..9ad67ccd603 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/classification/CaseClassificationFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/classification/CaseClassificationFacadeEjb.java @@ -347,12 +347,24 @@ private void buildCriteria() { // Measles suspect = allOf( - symptom(SymptomsDto.FEVER), - symptom(SymptomsDto.SKIN_RASH), - xOf(1, symptom(SymptomsDto.COUGH), symptom(SymptomsDto.RUNNY_NOSE), symptom(SymptomsDto.CONJUNCTIVITIS))); + symptom(SymptomsDto.FEVER), + symptom(SymptomsDto.SKIN_RASH), + xOf(1, symptom(SymptomsDto.COUGH), symptom(SymptomsDto.RUNNY_NOSE), symptom(SymptomsDto.CONJUNCTIVITIS))); if (configFacade.isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG)) { probable = allOf(suspect, epiData(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN)); - confirmed = allOf(suspect, symptom(SymptomsDto.SKIN_RASH, CountryHelper.COUNTRY_CODE_LUXEMBOURG + "-" + Disease.MEASLES.name()), xOf(1, positiveTestResult(Disease.MEASLES, PathogenTestType.CULTURE, PathogenTestType.IGM_SERUM_ANTIBODY, PathogenTestType.IGA_SERUM_ANTIBODY, PathogenTestType.PCR_RT_PCR, PathogenTestType.SEQUENCING, PathogenTestType.GENOTYPING))); + confirmed = allOf( + suspect, + symptom(SymptomsDto.SKIN_RASH, CountryHelper.COUNTRY_CODE_LUXEMBOURG + "-" + Disease.MEASLES.name()), + xOf( + 1, + positiveTestResult( + Disease.MEASLES, + PathogenTestType.CULTURE, + PathogenTestType.IGM_SERUM_ANTIBODY, + PathogenTestType.IGA_SERUM_ANTIBODY, + PathogenTestType.PCR_RT_PCR, + PathogenTestType.SEQUENCING, + PathogenTestType.GENOTYPING))); addCriteria(Disease.MEASLES, DateHelper.getDateZero(2020, 11, 6), suspect, probable, confirmed, null); } else { probable = epiData(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN); @@ -467,68 +479,95 @@ private void buildCriteria() { // Invasive Meningococcal Infection suspect = xOf( - 1, - symptom(SymptomsDto.MENINGEAL_SIGNS), - symptom(SymptomsDto.HEMORRHAGIC_RASH), - symptom(SymptomsDto.SHOCK), - symptom(SymptomsDto.ARTHRITIS)); + 1, + symptom(SymptomsDto.MENINGEAL_SIGNS), + symptom(SymptomsDto.HEMORRHAGIC_RASH), + symptom(SymptomsDto.SHOCK), + symptom(SymptomsDto.ARTHRITIS)); probable = allOf(suspect, caseData(CaseDataDto.EPIDEMIOLOGICAL_CONFIRMATION, YesNoUnknown.YES)); confirmed = allOf( - suspect, - xOf(1,(positiveTestResult( - Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - PathogenTestType.MICROSCOPY, - PathogenTestType.PCR_RT_PCR, - PathogenTestType.ANTIGEN_DETECTION)))); - addCriteria( - Disease.INVASIVE_MENINGOCOCCAL_INFECTION, - DateHelper.getDateZero(2020, 11, 6), - suspect, - probable, - confirmed, - null); + suspect, + xOf( + 1, + (positiveTestResult( + Disease.INVASIVE_MENINGOCOCCAL_INFECTION, + PathogenTestType.MICROSCOPY, + PathogenTestType.PCR_RT_PCR, + PathogenTestType.ANTIGEN_DETECTION)))); + addCriteria(Disease.INVASIVE_MENINGOCOCCAL_INFECTION, DateHelper.getDateZero(2020, 11, 6), suspect, probable, confirmed, null); //Invasive Pneumococcal Infection suspect = null; probable = null; - confirmed = xOf(1, positiveTestResult( - Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - PathogenTestType.CULTURE, - PathogenTestType.PCR_RT_PCR, - PathogenTestType.SEQUENCING)); - addCriteria( + confirmed = xOf( + 1, + positiveTestResult( Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, - DateHelper.getDateZero(2020, 11, 6), - suspect, - probable, - confirmed, - null); + PathogenTestType.CULTURE, + PathogenTestType.PCR_RT_PCR, + PathogenTestType.SEQUENCING)); + addCriteria(Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, DateHelper.getDateZero(2020, 11, 6), suspect, probable, confirmed, null); // Pertusis - suspect = xOf(1,allOfTogether(symptom(SymptomsDto.COUGHING_BOUTS, Disease.PERTUSSIS.name()),xOfSub(1, false, - symptom(SymptomsDto.WHOOP_SOUND), symptom(SymptomsDto.COUGHS_PROVOKE_VOMITING), symptom(SymptomsDto.NOCTURNAL_COUGH))), - symptom(SymptomsDto.APNOEA, Disease.PERTUSSIS.name()), - caseData(CaseDataDto.CLINICAL_CONFIRMATION, Disease.PERTUSSIS.name(), YesNoUnknown.YES)); + suspect = xOf( + 1, + allOfTogether( + symptom(SymptomsDto.COUGHING_BOUTS, Disease.PERTUSSIS.name()), + xOfSub( + 1, + false, + symptom(SymptomsDto.WHOOP_SOUND), + symptom(SymptomsDto.COUGHS_PROVOKE_VOMITING), + symptom(SymptomsDto.NOCTURNAL_COUGH))), + symptom(SymptomsDto.APNOEA, Disease.PERTUSSIS.name()), + caseData(CaseDataDto.CLINICAL_CONFIRMATION, Disease.PERTUSSIS.name(), YesNoUnknown.YES)); probable = allOf(suspect, caseData(CaseDataDto.EPIDEMIOLOGICAL_CONFIRMATION, YesNoUnknown.YES)); confirmed = allOf( - suspect, - xOf(1,(positiveTestResult( - Disease.PERTUSSIS, - PathogenTestType.MICROSCOPY, - PathogenTestType.PCR_RT_PCR, - PathogenTestType.CULTURE)))); - addCriteria( - Disease.PERTUSSIS, - DateHelper.getDateZero(2020, 11, 6), - suspect, - probable, - confirmed, - null); + suspect, + xOf(1, (positiveTestResult(Disease.PERTUSSIS, PathogenTestType.MICROSCOPY, PathogenTestType.PCR_RT_PCR, PathogenTestType.CULTURE)))); + addCriteria(Disease.PERTUSSIS, DateHelper.getDateZero(2020, 11, 6), suspect, probable, confirmed, null); + // Giardiasis + // FIXME: Check the case classification exposure criteria for giardiasis, its is wrong for now + probable = allOf( + xOf( + 1, + symptom(SymptomsDto.DIARRHEA), + symptom(SymptomsDto.BLOATING), + symptom(SymptomsDto.ABDOMINAL_PAIN), + symptom(SymptomsDto.WEIGHT_LOSS)), + xOf( + 1, + oneOfCompact(epiData(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN), exposure(ExposureDto.EXPOSURE_TYPE, ExposureType.ANIMAL_CONTACT)), + oneOfCompact( + epiData(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN), + exposure(ExposureDto.EXPOSURE_TYPE, ExposureType.RECREATIONAL_WATER)), + oneOfCompact(epiData(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN), exposure(ExposureDto.EXPOSURE_TYPE, ExposureType.FOOD)), + oneOfCompact(epiData(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN), exposure(ExposureDto.EXPOSURE_TYPE, ExposureType.FLOOD_EXPOSURE)), + oneOfCompact(epiData(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN), exposure(ExposureDto.EXPOSURE_TYPE, ExposureType.SEXUAL_CONTACT)))); + confirmed = allOf( + xOf(1, (positiveTestResult(Disease.GIARDIASIS, PathogenTestType.MICROSCOPY, PathogenTestType.PCR_RT_PCR, PathogenTestType.CULTURE)))); + addCriteria(Disease.GIARDIASIS, DateHelper.getDateZero(2020, 11, 6), null, probable, confirmed, null); + + // Cryptosporidiosis + // FIXME: Check the case classification exposure criteria for cryptosporidiosis, its is wrong for now + probable = allOf( + caseData(CaseDataDto.EPIDEMIOLOGICAL_CONFIRMATION, YesNoUnknown.YES), + xOf(1, symptom(SymptomsDto.DIARRHEA), symptom(SymptomsDto.ABDOMINAL_PAIN)), + xOf( + 1, + exposure(ExposureDto.RAW_FOOD_CONTACT, ExposureType.FOOD), + exposure(ExposureDto.SYMPTOMATIC_INDIVIDUAL_TEXT, ExposureType.SYMPTOMATIC_CONTACT), + exposure(ExposureDto.SEXUAL_EXPOSURE_TEXT, ExposureType.SEXUAL_CONTACT))); + confirmed = allOf( + xOf( + 1, + (positiveTestResult(Disease.CRYPTOSPORIDIOSIS, PathogenTestType.MICROSCOPY, PathogenTestType.PCR_RT_PCR, PathogenTestType.CULTURE)))); + addCriteria(Disease.CRYPTOSPORIDIOSIS, DateHelper.getDateZero(2020, 11, 6), null, probable, confirmed, null); // CORONAVIRUS suspect = xOf( @@ -667,13 +706,15 @@ private ClassificationNoneOfCriteriaDto noneOf(ClassificationCriteriaDto... crit private ClassificationCaseCriteriaDto caseData(String propertyId, Object... propertyValues) { return new ClassificationCaseCriteriaDto(propertyId, propertyValues); } + private ClassificationCaseCriteriaDto caseData(String propertyId, String addition, Object... propertyValues) { - return new ClassificationCaseCriteriaDto(propertyId,addition, propertyValues); + return new ClassificationCaseCriteriaDto(propertyId, addition, propertyValues); } private ClassificationSymptomsCriteriaDto symptom(String propertyId) { return new ClassificationSymptomsCriteriaDto(propertyId); } + private ClassificationSymptomsCriteriaDto symptom(String propertyId, String addition) { return new ClassificationSymptomsCriteriaDto(propertyId, addition); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java index e394c6d3145..a4649abd0eb 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java @@ -30,6 +30,8 @@ import de.symeda.sormas.api.epidata.CaseImportedStatus; import de.symeda.sormas.api.epidata.ClusterType; +import de.symeda.sormas.api.exposure.InfectionSource; +import de.symeda.sormas.api.exposure.ModeOfTransmission; import de.symeda.sormas.api.utils.YesNoUnknown; import de.symeda.sormas.backend.activityascase.ActivityAsCase; import de.symeda.sormas.backend.common.AbstractDomainObject; @@ -59,6 +61,12 @@ public class EpiData extends AbstractDomainObject { private String clusterTypeText; private boolean clusterRelated; + // Giardiasis & Cryptosporidiosis specific + private InfectionSource infectionSource; + private String infectionSourceText; + private ModeOfTransmission modeOfTransmission; + private String modeOfTransmissionType; + private List exposures = new ArrayList<>(); private List activitiesAsCase = new ArrayList<>(); @NotExposedToApi @@ -181,4 +189,38 @@ public boolean isClusterRelated() { public void setClusterRelated(boolean clusterRelated) { this.clusterRelated = clusterRelated; } + + @Enumerated(EnumType.STRING) + public ModeOfTransmission getModeOfTransmission() { + return modeOfTransmission; + } + + public void setModeOfTransmission(ModeOfTransmission modeOfTransmission) { + this.modeOfTransmission = modeOfTransmission; + } + + public String getModeOfTransmissionType() { + return modeOfTransmissionType; + } + + public void setModeOfTransmissionType(String modeOfTransmissionType) { + this.modeOfTransmissionType = modeOfTransmissionType; + } + + @Enumerated(EnumType.STRING) + public InfectionSource getInfectionSource() { + return infectionSource; + } + + public void setInfectionSource(InfectionSource infectionSource) { + this.infectionSource = infectionSource; + } + + public String getInfectionSourceText() { + return infectionSourceText; + } + + public void setInfectionSourceText(String infectionSourceText) { + this.infectionSourceText = infectionSourceText; + } } 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 aa8ef4ffecb..f32079770cf 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 @@ -104,6 +104,10 @@ public EpiData fillOrBuildEntity(EpiDataDto source, EpiData target, boolean chec target.setCaseImportedStatus(source.getCaseImportedStatus()); target.setClusterTypeText(source.getClusterTypeText()); target.setClusterRelated(source.isClusterRelated()); + target.setModeOfTransmission(source.getModeOfTransmission()); + target.setModeOfTransmissionType(source.getModeOfTransmissionType()); + target.setInfectionSource(source.getInfectionSource()); + target.setInfectionSourceText(source.getInfectionSourceText()); return target; } @@ -175,6 +179,19 @@ public Exposure fillOrBuildExposureEntity(ExposureDto source, Exposure target, b target.setRiskArea(source.getRiskArea()); target.setExposureRole(source.getExposureRole()); target.setLargeAttendanceNumber(source.getLargeAttendanceNumber()); + target.setTravelAccommodation(source.getTravelAccommodation()); + target.setTravelAccommodationType(source.getTravelAccommodationType()); + target.setSwimmingLocation(source.getSwimmingLocation()); + target.setSwimmingLocationType(source.getSwimmingLocationType()); + + target.setAnimalLocation(source.getAnimalLocation()); + target.setDomesticSwimming(source.getDomesticSwimming()); + target.setInternationalSwimming(source.getInternationalSwimming()); + target.setSexualExposureText(source.getSexualExposureText()); + + target.setRawFoodContact(source.getRawFoodContact()); + target.setRawFoodContactText(source.getRawFoodContactText()); + target.setSymptomaticIndividualText(source.getSymptomaticIndividualText()); return target; } @@ -251,6 +268,10 @@ public static EpiDataDto toDto(EpiData epiData) { target.setCaseImportedStatus(source.getCaseImportedStatus()); target.setClusterTypeText(source.getClusterTypeText()); target.setClusterRelated(source.isClusterRelated()); + target.setModeOfTransmission(source.getModeOfTransmission()); + target.setModeOfTransmissionType(source.getModeOfTransmissionType()); + target.setInfectionSource(source.getInfectionSource()); + target.setInfectionSourceText(source.getInfectionSourceText()); return target; } @@ -320,6 +341,17 @@ public static ExposureDto toExposureDto(Exposure source) { target.setRiskArea(source.getRiskArea()); target.setExposureRole(source.getExposureRole()); target.setLargeAttendanceNumber(source.getLargeAttendanceNumber()); + target.setTravelAccommodation(source.getTravelAccommodation()); + target.setTravelAccommodationType(source.getTravelAccommodationType()); + target.setSwimmingLocation(source.getSwimmingLocation()); + target.setSwimmingLocationType(source.getSwimmingLocationType()); + target.setAnimalLocation(source.getAnimalLocation()); + target.setDomesticSwimming(source.getDomesticSwimming()); + target.setInternationalSwimming(source.getInternationalSwimming()); + target.setSexualExposureText(source.getSexualExposureText()); + target.setRawFoodContact(source.getRawFoodContact()); + target.setRawFoodContactText(source.getRawFoodContactText()); + target.setSymptomaticIndividualText(source.getSymptomaticIndividualText()); 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 07f39e85c08..6244a27c2f5 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 @@ -36,10 +36,13 @@ import de.symeda.sormas.api.event.MeansOfTransport; import de.symeda.sormas.api.event.TypeOfPlace; import de.symeda.sormas.api.exposure.AnimalContactType; +import de.symeda.sormas.api.exposure.AnimalLocation; import de.symeda.sormas.api.exposure.ExposureRole; import de.symeda.sormas.api.exposure.ExposureType; import de.symeda.sormas.api.exposure.GatheringType; import de.symeda.sormas.api.exposure.HabitationType; +import de.symeda.sormas.api.exposure.SwimmingLocation; +import de.symeda.sormas.api.exposure.TravelAccommodation; import de.symeda.sormas.api.exposure.TypeOfAnimal; import de.symeda.sormas.api.exposure.TypeOfChildcareFacility; import de.symeda.sormas.api.exposure.WorkEnvironment; @@ -130,6 +133,19 @@ public class Exposure extends AbstractDomainObject { // Fields specific to ExposureType.GATHERING private YesNoUnknown largeAttendanceNumber; + // Fields specific to Giardiasis and Cryptosporidiosis + private TravelAccommodation travelAccommodation; + private String travelAccommodationType; + private SwimmingLocation swimmingLocation; + private String swimmingLocationType; + private AnimalLocation animalLocation; + private YesNoUnknown internationalSwimming; + private YesNoUnknown domesticSwimming; + private String sexualExposureText; + private YesNoUnknown rawFoodContact; + private String rawFoodContactText; + private String symptomaticIndividualText; + @ManyToOne @JoinColumn(nullable = false) public EpiData getEpiData() { @@ -641,4 +657,98 @@ public YesNoUnknown getLargeAttendanceNumber() { public void setLargeAttendanceNumber(YesNoUnknown largeAttendanceNumber) { this.largeAttendanceNumber = largeAttendanceNumber; } + + @Enumerated(EnumType.STRING) + public TravelAccommodation getTravelAccommodation() { + return travelAccommodation; + } + + public void setTravelAccommodation(TravelAccommodation travelAccommodation) { + this.travelAccommodation = travelAccommodation; + } + + public String getTravelAccommodationType() { + return travelAccommodationType; + } + + public void setTravelAccommodationType(String travelAccommodationType) { + this.travelAccommodationType = travelAccommodationType; + } + + @Enumerated(EnumType.STRING) + public SwimmingLocation getSwimmingLocation() { + return swimmingLocation; + } + + public void setSwimmingLocation(SwimmingLocation swimmingLocation) { + this.swimmingLocation = swimmingLocation; + } + + public String getSwimmingLocationType() { + return swimmingLocationType; + } + + public void setSwimmingLocationType(String swimmingLocationType) { + this.swimmingLocationType = swimmingLocationType; + } + + @Enumerated(EnumType.STRING) + public AnimalLocation getAnimalLocation() { + return animalLocation; + } + + public void setAnimalLocation(AnimalLocation animalLocation) { + this.animalLocation = animalLocation; + } + + @Enumerated(EnumType.STRING) + public YesNoUnknown getInternationalSwimming() { + return internationalSwimming; + } + + public void setInternationalSwimming(YesNoUnknown internationalSwimming) { + this.internationalSwimming = internationalSwimming; + } + + @Enumerated(EnumType.STRING) + public YesNoUnknown getDomesticSwimming() { + return domesticSwimming; + } + + public void setDomesticSwimming(YesNoUnknown domesticSwimming) { + this.domesticSwimming = domesticSwimming; + } + + public String getSexualExposureText() { + return sexualExposureText; + } + + public void setSexualExposureText(String sexualExposureText) { + this.sexualExposureText = sexualExposureText; + } + + @Enumerated(EnumType.STRING) + public YesNoUnknown getRawFoodContact() { + return rawFoodContact; + } + + public void setRawFoodContact(YesNoUnknown rawFoodContact) { + this.rawFoodContact = rawFoodContact; + } + + public String getRawFoodContactText() { + return rawFoodContactText; + } + + public void setRawFoodContactText(String rawFoodContactText) { + this.rawFoodContactText = rawFoodContactText; + } + + public String getSymptomaticIndividualText() { + return symptomaticIndividualText; + } + + public void setSymptomaticIndividualText(String symptomaticIndividualText) { + this.symptomaticIndividualText = symptomaticIndividualText; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/Hospitalization.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/Hospitalization.java index 9d6c4eb76c8..497aa8a12b8 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/Hospitalization.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/Hospitalization.java @@ -58,6 +58,7 @@ public class Hospitalization extends AbstractDomainObject { public static final String STILL_HOSPITALIZED = "stillHospitalized"; public static final String ICU_LENGTH_OF_STAY = "icuLengthOfStay"; public static final String DESCRIPTION = "description"; + public static final String DURATION_OF_HOSPITALIZATION = "durationOfHospitalization"; private YesNoUnknown admittedToHealthFacility; private Date admissionDate; @@ -79,6 +80,7 @@ public class Hospitalization extends AbstractDomainObject { private String otherHospitalizationReason; private String description; private YesNoUnknown currentlyHospitalized; + private Integer durationOfHospitalization; @Temporal(TemporalType.TIMESTAMP) public Date getAdmissionDate() { @@ -252,4 +254,12 @@ public Integer getIcuLengthOfStay() { public void setIcuLengthOfStay(Integer icuLengthOfStay) { this.icuLengthOfStay = icuLengthOfStay; } + + public Integer getDurationOfHospitalization() { + return durationOfHospitalization; + } + + public void setDurationOfHospitalization(Integer durationOfHospitalization) { + this.durationOfHospitalization = durationOfHospitalization; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/HospitalizationFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/HospitalizationFacadeEjb.java index 5e67e3c3d13..e84de0ac6fd 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/HospitalizationFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/hospitalization/HospitalizationFacadeEjb.java @@ -92,6 +92,7 @@ public Hospitalization fillOrBuildEntity(HospitalizationDto source, Hospitalizat target.setIcuLengthOfStay(source.getIcuLengthOfStay()); target.setDescription(source.getDescription()); target.setCurrentlyHospitalized(source.getCurrentlyHospitalized()); + target.setDurationOfHospitalization(source.getDurationOfHospitalization()); return target; } @@ -168,6 +169,7 @@ public static HospitalizationDto toDto(Hospitalization hospitalization) { target.setIcuLengthOfStay(source.getIcuLengthOfStay()); target.setDescription(source.getDescription()); target.setCurrentlyHospitalized(source.getCurrentlyHospitalized()); + target.setDurationOfHospitalization(source.getDurationOfHospitalization()); return target; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/Person.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/Person.java index 324b2f6d2f2..21148fca75f 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/Person.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/Person.java @@ -63,6 +63,7 @@ import de.symeda.sormas.api.person.Salutation; import de.symeda.sormas.api.person.Sex; import de.symeda.sormas.api.person.SymptomJournalStatus; +import de.symeda.sormas.api.person.WorkPlace; import de.symeda.sormas.backend.caze.Case; import de.symeda.sormas.backend.common.AbstractDomainObject; import de.symeda.sormas.backend.contact.Contact; @@ -232,6 +233,10 @@ public class Person extends AbstractDomainObject implements IsPerson, HasExterna private LivingStatus livingStatus; + // Cryptosporidiosis & Giardiasis specific + private WorkPlace workPlace; + private String workPlaceText; + private List cases = new ArrayList<>(); private List contacts = new ArrayList<>(); private List eventParticipants = new ArrayList<>(); @@ -892,6 +897,23 @@ public void setLivingStatus(LivingStatus livingStatus) { this.livingStatus = livingStatus; } + @Enumerated(EnumType.STRING) + public WorkPlace getWorkPlace() { + return workPlace; + } + + public void setWorkPlace(WorkPlace workPlace) { + this.workPlace = workPlace; + } + + public String getWorkPlaceText() { + return workPlaceText; + } + + public void setWorkPlaceText(String workPlaceText) { + this.workPlaceText = workPlaceText; + } + @Transient private String getPersonContactInformation(PersonContactDetailType personContactDetailType) { final Optional optionalPersonContactDetail = getPersonContactDetails().stream() diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java index 1d6caf508ca..5fb0565c3ac 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java @@ -1038,6 +1038,8 @@ public static PersonDto toPersonDto(Person source) { target.setEmancipated(source.isEmancipated()); target.setEntryDate(source.getEntryDate()); target.setLivingStatus(source.getLivingStatus()); + target.setWorkPlace(source.getWorkPlace()); + target.setWorkPlaceText(source.getWorkPlaceText()); return target; } @@ -1814,7 +1816,8 @@ public Person fillOrBuildEntity(@NotNull PersonDto source, Person target, boolea target.setEmancipated(source.isEmancipated()); target.setEntryDate(source.getEntryDate()); target.setLivingStatus(source.getLivingStatus()); - + target.setWorkPlace(source.getWorkPlace()); + target.setWorkPlaceText(source.getWorkPlaceText()); return target; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/Symptoms.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/Symptoms.java index 051c9fb4502..e3e407728f7 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/Symptoms.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/Symptoms.java @@ -272,6 +272,16 @@ public class Symptoms extends AbstractDomainObject { private YesNoUnknown parentTimeOffWork; private String timeOffWorkDays; + // Giardia & Cryptosporidiosis-specific symptoms + private SymptomState eggyBurps; + private SymptomState weightLoss; + private Float weightLossAmount; + private SymptomState symptomCurrentStatus; + private Integer durationOfSymptoms; + private SymptomState reoccurrence; + private SymptomState overnightStayRequired; + private SymptomState bloating; + // when adding new fields make sure to extend toHumanString @Temporal(TemporalType.TIMESTAMP) @@ -2107,4 +2117,74 @@ public SymptomState getAcuteEncephalitis() { public void setAcuteEncephalitis(SymptomState acuteEncephalitis) { this.acuteEncephalitis = acuteEncephalitis; } + + @Enumerated(EnumType.STRING) + public SymptomState getEggyBurps() { + return eggyBurps; + } + + public void setEggyBurps(SymptomState eggyBurps) { + this.eggyBurps = eggyBurps; + } + + @Enumerated(EnumType.STRING) + public SymptomState getWeightLoss() { + return weightLoss; + } + + public void setWeightLoss(SymptomState weightLoss) { + this.weightLoss = weightLoss; + } + + public Float getWeightLossAmount() { + return weightLossAmount; + } + + public void setWeightLossAmount(Float weightLossAmount) { + this.weightLossAmount = weightLossAmount; + } + + @Enumerated(EnumType.STRING) + public SymptomState getSymptomCurrentStatus() { + return symptomCurrentStatus; + } + + public void setSymptomCurrentStatus(SymptomState symptomCurrentStatus) { + this.symptomCurrentStatus = symptomCurrentStatus; + } + + public Integer getDurationOfSymptoms() { + return durationOfSymptoms; + } + + public void setDurationOfSymptoms(Integer durationOfSymptoms) { + this.durationOfSymptoms = durationOfSymptoms; + } + + @Enumerated(EnumType.STRING) + public SymptomState getReoccurrence() { + return reoccurrence; + } + + public void setReoccurrence(SymptomState reoccurrence) { + this.reoccurrence = reoccurrence; + } + + @Enumerated(EnumType.STRING) + public SymptomState getOvernightStayRequired() { + return overnightStayRequired; + } + + public void setOvernightStayRequired(SymptomState overnightStayRequired) { + this.overnightStayRequired = overnightStayRequired; + } + + @Enumerated(EnumType.STRING) + public SymptomState getBloating() { + return bloating; + } + + public void setBloating(SymptomState bloating) { + this.bloating = bloating; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.java index 510eca047b7..cf5bc834f47 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.java @@ -230,7 +230,8 @@ public Symptoms fillOrBuildEntity(SymptomsDto source, Symptoms target, boolean c target.setOtherMinorSiteDetails(source.getOtherMinorSiteDetails()); target.setDateOfOnsetKnown(source.getDateOfOnsetKnown()); target.setClinicalPresentationStatus(source.getClinicalPresentationStatus()); - target.setUnknownSymptom(source.getUnknownSymptom()); target.setDifficultyBreathingDuringMeals(source.getDifficultyBreathingDuringMeals()); + target.setUnknownSymptom(source.getUnknownSymptom()); + target.setDifficultyBreathingDuringMeals(source.getDifficultyBreathingDuringMeals()); target.setParadoxicalBreathing(source.getParadoxicalBreathing()); target.setRespiratoryFatigue(source.getRespiratoryFatigue()); target.setParentTimeOffWork(source.getParentTimeOffWork()); @@ -238,6 +239,15 @@ public Symptoms fillOrBuildEntity(SymptomsDto source, Symptoms target, boolean c target.setNocturnalCough(source.getNocturnalCough()); target.setSkinRashOnsetDate(source.getSkinRashOnsetDate()); target.setAcuteEncephalitis(source.getAcuteEncephalitis()); + target.setEggyBurps(source.getEggyBurps()); + target.setSymptomCurrentStatus(source.getSymptomCurrentStatus()); + target.setDurationOfSymptoms(source.getDurationOfSymptoms()); + target.setReoccurrence(source.getReoccurrence()); + target.setWeightLoss(source.getWeightLoss()); + target.setWeightLossAmount(source.getWeightLossAmount()); + target.setBloating(source.getBloating()); + target.setOvernightStayRequired(source.getOvernightStayRequired()); + return target; } @@ -460,6 +470,14 @@ public static SymptomsDto toSymptomsDto(Symptoms symptoms) { target.setNocturnalCough(source.getNocturnalCough()); target.setSkinRashOnsetDate(source.getSkinRashOnsetDate()); target.setAcuteEncephalitis(source.getAcuteEncephalitis()); + target.setEggyBurps(source.getEggyBurps()); + target.setReoccurrence(source.getReoccurrence()); + target.setOvernightStayRequired(source.getOvernightStayRequired()); + target.setBloating(source.getBloating()); + target.setSymptomCurrentStatus(source.getSymptomCurrentStatus()); + target.setDurationOfSymptoms(source.getDurationOfSymptoms()); + target.setWeightLoss(source.getWeightLoss()); + target.setWeightLossAmount(source.getWeightLossAmount()); return target; } diff --git a/sormas-backend/src/main/resources/sql/sormas_schema.sql b/sormas-backend/src/main/resources/sql/sormas_schema.sql index bc7918f655c..f4a3f6f3a89 100644 --- a/sormas-backend/src/main/resources/sql/sormas_schema.sql +++ b/sormas-backend/src/main/resources/sql/sormas_schema.sql @@ -14656,4 +14656,61 @@ update epidata_history set clusterRelated = false where clusterRelated is null; alter table epidata_history alter column clusterRelated set not null; INSERT INTO schema_version (version_number, comment) VALUES (592, 'Added cluster related checkbox for LUX Measles #13365'); +-- 2025-09-19 - Integrated new diseases named Giardiasis and Cryptosporidiosis #13601 #13608 +alter table symptoms add column if not exists eggyBurps varchar(255); +alter table symptoms add column if not exists weightLoss varchar(255); +alter table symptoms add column if not exists weightLossAmount integer; +alter table symptoms add column if not exists reoccurrence varchar(255); +alter table symptoms add column if not exists symptomCurrentStatus varchar(255); +alter table symptoms add column if not exists durationOfSymptoms integer; +alter table symptoms add column if not exists overnightStayRequired varchar(255); +alter table symptoms add column if not exists bloating varchar(255); +alter table exposures add column if not exists travelAccommodation varchar(255); +alter table exposures add column if not exists travelAccommodationType varchar(255); +alter table exposures add column if not exists swimmingLocation varchar(255); +alter table exposures add column if not exists swimmingLocationType varchar(255); +alter table exposures add column if not exists animallocation varchar(255); +alter table exposures add column if not exists domesticswimming varchar(255); +alter table exposures add column if not exists internationalswimming varchar(255); +alter table exposures add column if not exists sexualexposuretext varchar(255); +alter table exposures add column if not exists rawfoodcontact varchar(255); +alter table exposures add column if not exists rawfoodcontacttext varchar(255); +alter table exposures add column if not exists symptomaticindividualtext varchar(255); +ALTER TABLE hospitalization ADD COLUMN IF NOT EXISTS durationOfHospitalization integer; + +alter table epidata add column if not exists modeOfTransmission varchar(255); +alter table epidata add column if not exists modeOfTransmissionType varchar(255); +alter table epidata add column if not exists infectionSource varchar(255); +alter table epidata add column if not exists infectionSourcetext varchar(255); +ALTER TABLE person ADD COLUMN IF NOT EXISTS workplace varchar(255); +ALTER TABLE person ADD COLUMN IF NOT EXISTS workplacetext varchar(255); + +alter table symptoms_history add column if not exists eggyBurps varchar(255); +alter table symptoms_history add column if not exists weightLoss varchar(255); +alter table symptoms_history add column if not exists weightLossAmount integer; +alter table symptoms_history add column if not exists reoccurrence varchar(255); +alter table symptoms_history add column if not exists symptomCurrentStatus varchar(255); +alter table symptoms_history add column if not exists durationOfSymptoms integer; +alter table symptoms_history add column if not exists overnightStayRequired varchar(255); +alter table symptoms_history add column if not exists bloating varchar(255); +alter table exposures_history add column if not exists travelAccommodation varchar(255); +alter table exposures_history add column if not exists travelAccommodationType varchar(255); +alter table exposures_history add column if not exists swimmingLocation varchar(255); +alter table exposures_history add column if not exists swimmingLocationType varchar(255); +alter table exposures_history add column if not exists animallocation varchar(255); +alter table exposures_history add column if not exists domesticswimming varchar(255); +alter table exposures_history add column if not exists internationalswimming varchar(255); +alter table exposures_history add column if not exists sexualexposuretext varchar(255); +alter table epidata_history add column if not exists modeOfTransmission varchar(255); +alter table epidata_history add column if not exists modeOfTransmissionType varchar(255); +alter table epidata_history add column if not exists infectionSource varchar(255); +alter table epidata_history add column if not exists infectionSourcetext varchar(255); +alter table exposures_history add column if not exists rawfoodcontact varchar(255); +alter table exposures_history add column if not exists rawfoodcontacttext varchar(255); +alter table exposures_history add column if not exists symptomaticindividualtext varchar(255); +alter table hospitalization_history add column if not exists durationOfHospitalization integer; +ALTER TABLE person_history ADD COLUMN IF NOT EXISTS workplace varchar(255); +ALTER TABLE person_history ADD COLUMN IF NOT EXISTS workplacetext varchar(255); + +INSERT INTO schema_version (version_number, comment) VALUES (593, 'Integrated new diseases named Giardiasis and Cryptosporidiosis #13601 #13608'); -- *** 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/caze/AbstractCaseView.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/AbstractCaseView.java index e4285cf15ef..11bcd8dec11 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/AbstractCaseView.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/AbstractCaseView.java @@ -27,7 +27,6 @@ import de.symeda.sormas.api.CoreFacade; import de.symeda.sormas.api.CountryHelper; import de.symeda.sormas.api.Disease; -import de.symeda.sormas.api.DiseaseHelper; import de.symeda.sormas.api.FacadeProvider; import de.symeda.sormas.api.caze.CaseDataDto; import de.symeda.sormas.api.caze.CaseOrigin; @@ -164,9 +163,7 @@ public void refreshMenu(SubMenu menu, String params) { I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, CaseDataDto.MATERNAL_HISTORY), params); } - if (UiUtil.enabled(FeatureType.VIEW_TAB_CASES_HOSPITALIZATION) - && !caze.checkIsUnreferredPortHealthCase() - && !UiUtil.isPortHealthUser()) { + if (UiUtil.enabled(FeatureType.VIEW_TAB_CASES_HOSPITALIZATION) && !caze.checkIsUnreferredPortHealthCase() && !UiUtil.isPortHealthUser()) { menu.addView( HospitalizationView.VIEW_NAME, I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, CaseDataDto.HOSPITALIZATION), @@ -188,9 +185,11 @@ public void refreshMenu(SubMenu menu, String params) { } if (UiUtil.permitted(FeatureType.VIEW_TAB_CASES_THERAPY, UserRight.THERAPY_VIEW) && !caze.checkIsUnreferredPortHealthCase() - && UiUtil.enabled(FeatureType.CLINICAL_MANAGEMENT) && - !(FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG) && List.of(Disease.MEASLES).contains(caze.getDisease()))) { - // Therapy view is not available for Luxembourg for Measles cases + && UiUtil.enabled(FeatureType.CLINICAL_MANAGEMENT) + && (!(FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG) + && List.of(Disease.MEASLES).contains(caze.getDisease()))) + && !List.of(Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(caze.getDisease())) { + // Therapy view is not available for Luxembourg for Measles cases and for all Gradiastis & Cryptosporidiosis cases. menu.addView(TherapyView.VIEW_NAME, I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, CaseDataDto.THERAPY), params); } } @@ -203,15 +202,24 @@ public void refreshMenu(SubMenu menu, String params) { if (showExtraMenuEntries) { if (UiUtil.permitted( - EnumSet.of(FeatureType.VIEW_TAB_CASES_FOLLOW_UP, FeatureType.VIEW_TAB_CASES_CLINICAL_COURSE, FeatureType.CLINICAL_MANAGEMENT), - UserRight.CLINICAL_COURSE_VIEW) && !caze.checkIsUnreferredPortHealthCase() && !List.of(Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION).contains(caze.getDisease()) && - !(FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG) && List.of(Disease.MEASLES).contains(caze.getDisease()))) { + EnumSet.of(FeatureType.VIEW_TAB_CASES_FOLLOW_UP, FeatureType.VIEW_TAB_CASES_CLINICAL_COURSE, FeatureType.CLINICAL_MANAGEMENT), + UserRight.CLINICAL_COURSE_VIEW) + && !caze.checkIsUnreferredPortHealthCase() + && !List + .of( + Disease.INVASIVE_MENINGOCOCCAL_INFECTION, + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS) + .contains(caze.getDisease()) + && !(FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG) + && List.of(Disease.MEASLES).contains(caze.getDisease()))) { // clinical course view is not available for Luxembourg for Measles cases, - // and for all other countries IMI & IPI cases. + // and for all other countries GIARDIASIS, Cryptosporidiosis, IMI & IPI cases. menu.addView( - ClinicalCourseView.VIEW_NAME, - I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, CaseDataDto.CLINICAL_COURSE), - params); + ClinicalCourseView.VIEW_NAME, + I18nProperties.getPrefixCaption(CaseDataDto.I18N_PREFIX, CaseDataDto.CLINICAL_COURSE), + params); } } if (FacadeProvider.getDiseaseConfigurationFacade().hasFollowUp(caze.getDisease()) diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataView.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataView.java index 1e969d9db52..d330539ef5a 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataView.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataView.java @@ -14,10 +14,13 @@ */ package de.symeda.sormas.ui.caze; +import java.util.List; + import org.apache.commons.collections4.CollectionUtils; import com.vaadin.ui.VerticalLayout; +import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.EditPermissionType; import de.symeda.sormas.api.FacadeProvider; import de.symeda.sormas.api.caze.CaseDataDto; @@ -135,8 +138,7 @@ protected void initView(String params) { boolean isEditAllowed = isEditAllowed(); if (UiUtil.enabled(FeatureType.SURVEILLANCE_REPORTS)) { - CaseNotifierSideViewComponent notifierSideViewComponent = - new CaseNotifierSideViewComponent(caze); + CaseNotifierSideViewComponent notifierSideViewComponent = new CaseNotifierSideViewComponent(caze); notifierSideViewComponent.addStyleNames(CssStyles.SIDE_COMPONENT); layout.addSidePanelComponent(notifierSideViewComponent, CASE_NOTIFIER_LOC); } @@ -177,22 +179,25 @@ protected void initView(String params) { } if (UiUtil.permitted(FeatureType.IMMUNIZATION_MANAGEMENT, UserRight.IMMUNIZATION_VIEW)) { - if (!FacadeProvider.getFeatureConfigurationFacade() - .isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) { - layout.addSidePanelComponent(new SideComponentLayout(new ImmunizationListComponent(() -> { - CaseDataDto refreshedCase = FacadeProvider.getCaseFacade().getCaseDataByUuid(getCaseRef().getUuid()); - return new ImmunizationListCriteria.Builder(refreshedCase.getPerson()).withDisease(refreshedCase.getDisease()).build(); - }, null, this::showUnsavedChangesPopup, isEditAllowed)), IMMUNIZATION_LOC); - } else { - layout.addSidePanelComponent(new SideComponentLayout(new VaccinationListComponent(() -> { - CaseDataDto refreshedCase = FacadeProvider.getCaseFacade().getCaseDataByUuid(getCaseRef().getUuid()); - return new VaccinationCriteria.Builder(refreshedCase.getPerson()).withDisease(refreshedCase.getDisease()) - .build() - .vaccinationAssociationType(VaccinationAssociationType.CASE) - .caseReference(getCaseRef()) - .region(refreshedCase.getResponsibleRegion()) - .district(refreshedCase.getResponsibleDistrict()); - }, null, this::showUnsavedChangesPopup, isEditAllowed)), VACCINATIONS_LOC); + // Immunizations are not shown for Giardiasis and Cryptosporidiosis + if (!List.of(Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(caze.getDisease())) { + if (!FacadeProvider.getFeatureConfigurationFacade() + .isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) { + layout.addSidePanelComponent(new SideComponentLayout(new ImmunizationListComponent(() -> { + CaseDataDto refreshedCase = FacadeProvider.getCaseFacade().getCaseDataByUuid(getCaseRef().getUuid()); + return new ImmunizationListCriteria.Builder(refreshedCase.getPerson()).withDisease(refreshedCase.getDisease()).build(); + }, null, this::showUnsavedChangesPopup, isEditAllowed)), IMMUNIZATION_LOC); + } else { + layout.addSidePanelComponent(new SideComponentLayout(new VaccinationListComponent(() -> { + CaseDataDto refreshedCase = FacadeProvider.getCaseFacade().getCaseDataByUuid(getCaseRef().getUuid()); + return new VaccinationCriteria.Builder(refreshedCase.getPerson()).withDisease(refreshedCase.getDisease()) + .build() + .vaccinationAssociationType(VaccinationAssociationType.CASE) + .caseReference(getCaseRef()) + .region(refreshedCase.getResponsibleRegion()) + .district(refreshedCase.getResponsibleDistrict()); + }, null, this::showUnsavedChangesPopup, isEditAllowed)), VACCINATIONS_LOC); + } } } @@ -256,7 +261,7 @@ protected void initView(String params) { if (UiUtil.permitted(FeatureType.SELF_REPORTING)) { SelfReportListComponent selfReportListComponent = - new SelfReportListComponent(SelfReportType.CASE, new SelfReportCriteria().setCaze(new CaseReferenceDto(caze.getUuid()))); + new SelfReportListComponent(SelfReportType.CASE, new SelfReportCriteria().setCaze(new CaseReferenceDto(caze.getUuid()))); SelfReportListComponentLayout selfReportListComponentLayout = new SelfReportListComponentLayout(selfReportListComponent); layout.addSidePanelComponent(selfReportListComponentLayout, SELF_REPORT_LOC); } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java index bbb5e79ef1c..fad57ee88d5 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java @@ -31,27 +31,29 @@ import java.util.function.Consumer; import java.util.function.Supplier; -import com.vaadin.v7.ui.TextField; -import de.symeda.sormas.api.CountryHelper; -import de.symeda.sormas.api.epidata.ClusterType; -import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers; -import de.symeda.sormas.api.utils.fieldvisibility.checkers.CountryFieldVisibilityChecker; import org.apache.commons.collections4.CollectionUtils; import com.vaadin.shared.ui.ContentMode; import com.vaadin.v7.ui.Field; +import com.vaadin.v7.ui.TextField; +import de.symeda.sormas.api.CountryHelper; import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.EntityDto; import de.symeda.sormas.api.FacadeProvider; import de.symeda.sormas.api.caze.CaseDataDto; import de.symeda.sormas.api.contact.ContactDto; import de.symeda.sormas.api.contact.ContactReferenceDto; +import de.symeda.sormas.api.epidata.ClusterType; import de.symeda.sormas.api.epidata.EpiDataDto; +import de.symeda.sormas.api.exposure.InfectionSource; +import de.symeda.sormas.api.exposure.ModeOfTransmission; import de.symeda.sormas.api.i18n.I18nProperties; import de.symeda.sormas.api.i18n.Strings; import de.symeda.sormas.api.utils.YesNoUnknown; +import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers; import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers; +import de.symeda.sormas.api.utils.fieldvisibility.checkers.CountryFieldVisibilityChecker; import de.symeda.sormas.ui.ActivityAsCase.ActivityAsCaseField; import de.symeda.sormas.ui.exposure.ExposuresField; import de.symeda.sormas.ui.utils.AbstractEditForm; @@ -65,7 +67,7 @@ public class EpiDataForm extends AbstractEditForm { private static final long serialVersionUID = 1L; private static final String LOC_EXPOSURE_INVESTIGATION_HEADING = "locExposureInvestigationHeading"; - private static final String LOC_CASE_IMPORT_HEADING = "locCaseImportHeading"; + private static final String LOC_CONCLUSION_HEADING = "locConclusionHeading"; private static final String LOC_CLUSTER_TYPE_HEADING = "locClusterTypeHeading"; private static final String LOC_ACTIVITY_AS_CASE_INVESTIGATION_HEADING = "locActivityAsCaseInvestigationHeading"; private static final String LOC_SOURCE_CASE_CONTACTS_HEADING = "locSourceCaseContactsHeading"; @@ -76,8 +78,10 @@ public class EpiDataForm extends AbstractEditForm { loc(LOC_EXPOSURE_INVESTIGATION_HEADING) + loc(EpiDataDto.EXPOSURE_DETAILS_KNOWN) + loc(EpiDataDto.EXPOSURES) + - loc(LOC_CASE_IMPORT_HEADING) + + loc(LOC_CONCLUSION_HEADING) + fluidRowLocs(6,EpiDataDto.CASE_IMPORTED_STATUS,6,"") + + fluidRowLocs(EpiDataDto.MODE_OF_TRANSMISSION, EpiDataDto.MODE_OF_TRANSMISSION_TYPE) + + fluidRowLocs(EpiDataDto.INFECTION_SOURCE, EpiDataDto.INFECTION_SOURCE_TEXT) + loc(LOC_ACTIVITY_AS_CASE_INVESTIGATION_HEADING) + loc(EpiDataDto.ACTIVITY_AS_CASE_DETAILS_KNOWN)+ loc(EpiDataDto.ACTIVITIES_AS_CASE) + @@ -128,8 +132,14 @@ protected void addFields() { addHeadingsAndInfoTexts(); NullableOptionGroup ogExposureDetailsKnown = addField(EpiDataDto.EXPOSURE_DETAILS_KNOWN, NullableOptionGroup.class); - ExposuresField exposuresField = addField(EpiDataDto.EXPOSURES, new ExposuresField(disease, FieldVisibilityCheckers.withDisease(disease) - .add(new CountryFieldVisibilityChecker(FacadeProvider.getConfigFacade().getCountryLocale())), UiFieldAccessCheckers.getDefault(false, FacadeProvider.getConfigFacade().getCountryLocale()), true)); + ExposuresField exposuresField = addField( + EpiDataDto.EXPOSURES, + new ExposuresField( + disease, + FieldVisibilityCheckers.withDisease(disease) + .add(new CountryFieldVisibilityChecker(FacadeProvider.getConfigFacade().getCountryLocale())), + UiFieldAccessCheckers.getDefault(false, FacadeProvider.getConfigFacade().getCountryLocale()), + true)); exposuresField.setEpiDataParentClass(parentClass); exposuresField.setWidthFull(); @@ -154,8 +164,15 @@ protected void addFields() { addField(EpiDataDto.CASE_IMPORTED_STATUS); addField(EpiDataDto.CLUSTER_TYPE); addField(EpiDataDto.CLUSTER_RELATED); + + addField(EpiDataDto.MODE_OF_TRANSMISSION); + addField(EpiDataDto.MODE_OF_TRANSMISSION_TYPE); + addField(EpiDataDto.INFECTION_SOURCE); + addField(EpiDataDto.INFECTION_SOURCE_TEXT); + TextField clustorTypeTF = addField(EpiDataDto.CLUSTER_TYPE_TEXT); - FieldHelper.setVisibleWhen(getFieldGroup(), EpiDataDto.CLUSTER_TYPE, EpiDataDto.CLUSTER_RELATED, Collections.singletonList(Boolean.TRUE), true); + FieldHelper + .setVisibleWhen(getFieldGroup(), EpiDataDto.CLUSTER_TYPE, EpiDataDto.CLUSTER_RELATED, Collections.singletonList(Boolean.TRUE), true); FieldHelper.setVisibleWhen(getField(EpiDataDto.CLUSTER_TYPE), Arrays.asList(clustorTypeTF), Arrays.asList(ClusterType.OTHER), true); FieldHelper.setVisibleWhen( getFieldGroup(), @@ -163,7 +180,9 @@ protected void addFields() { EpiDataDto.EXPOSURE_DETAILS_KNOWN, Collections.singletonList(YesNoUnknown.YES), true); - + FieldHelper + .setVisibleWhen(getFieldGroup(), EpiDataDto.MODE_OF_TRANSMISSION_TYPE, EpiDataDto.MODE_OF_TRANSMISSION, ModeOfTransmission.OTHER, true); + FieldHelper.setVisibleWhen(getFieldGroup(), EpiDataDto.INFECTION_SOURCE_TEXT, EpiDataDto.INFECTION_SOURCE, InfectionSource.OTHER, true); initializeVisibilitiesAndAllowedVisibilities(); initializeAccessAndAllowedAccesses(); @@ -214,11 +233,14 @@ private void addHeadingsAndInfoTexts() { LOC_EPI_DATA_FIELDS_HINT); if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG) && Disease.MEASLES == disease) { - getContent().addComponent(new MultilineLabel(h3(I18nProperties.getString(Strings.headingEpiCaseImport)) + divsCss(VSPACE_3), ContentMode.HTML), - LOC_CASE_IMPORT_HEADING); - getContent().addComponent(new MultilineLabel(h3(I18nProperties.getString(Strings.headingClusterType)) + divsCss(VSPACE_3), ContentMode.HTML), - LOC_CLUSTER_TYPE_HEADING); + getContent().addComponent( + new MultilineLabel(h3(I18nProperties.getString(Strings.headingClusterType)) + divsCss(VSPACE_3), ContentMode.HTML), + LOC_CLUSTER_TYPE_HEADING); } + // Conclusion heading should be visible for all countries Giardiasis & Cryptosporidiosis specific fields + getContent().addComponent( + new MultilineLabel(h3(I18nProperties.getString(Strings.headingEpiConclusion)) + divsCss(VSPACE_3), ContentMode.HTML), + LOC_CONCLUSION_HEADING); getContent().addComponent( new MultilineLabel( 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 d9d43b7aee0..fa8294b5732 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 @@ -23,7 +23,6 @@ import static de.symeda.sormas.ui.utils.LayoutUtil.loc; import static de.symeda.sormas.ui.utils.LayoutUtil.locs; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -50,6 +49,8 @@ import de.symeda.sormas.api.exposure.ExposureType; import de.symeda.sormas.api.exposure.GatheringType; import de.symeda.sormas.api.exposure.HabitationType; +import de.symeda.sormas.api.exposure.SwimmingLocation; +import de.symeda.sormas.api.exposure.TravelAccommodation; import de.symeda.sormas.api.exposure.TypeOfAnimal; import de.symeda.sormas.api.exposure.TypeOfChildcareFacility; import de.symeda.sormas.api.i18n.Captions; @@ -76,6 +77,7 @@ public class ExposureForm extends AbstractEditForm { private static final String LOC_LOCATION_HEADING = "locLocationHeading"; private static final String LOC_ANIMAL_CONTACT_DETAILS_HEADING = "locAnimalContactDetailsHeading"; private static final String LOC_BURIAL_DETAILS_HEADING = "locBurialDetailsHeading"; + private static final String LOC_CONCLUSION_HEADING = "locConclusionHeading"; //@formatter:off private static final String UUID_REPORTING_USER = fluidRowLocs(ExposureDto.UUID, ExposureDto.REPORTING_USER); @@ -117,16 +119,24 @@ public class ExposureForm extends AbstractEditForm { loc(ExposureDto.CONTACT_TO_BODY_FLUIDS) + loc(ExposureDto.HANDLING_SAMPLES) + loc(ExposureDto.EATING_RAW_ANIMAL_PRODUCTS) + - loc(ExposureDto.HANDLING_ANIMALS) + + loc(ExposureDto.HANDLING_ANIMALS) + + fluidRowLocs(ExposureDto.TRAVEL_ACCOMMODATION, ExposureDto.TRAVEL_ACCOMMODATION_TYPE) + + fluidRowLocs(ExposureDto.DOMESTIC_SWIMMING, ExposureDto.INTERNATIONAL_SWIMMING) + + fluidRowLocs(ExposureDto.RAW_FOOD_CONTACT, ExposureDto.RAW_FOOD_CONTACT_TEXT) + + fluidRowLocs(ExposureDto.SWIMMING_LOCATION, ExposureDto.SWIMMING_LOCATION_TYPE) + + fluidRow(fluidColumnLoc(6,0,ExposureDto.SEXUAL_EXPOSURE_TEXT)) + + fluidRow(fluidColumnLoc(6,0,ExposureDto.SYMPTOMATIC_INDIVIDUAL_TEXT)) + loc(ExposureDto.CONTACT_TO_CASE) + - loc(LOC_ANIMAL_CONTACT_DETAILS_HEADING) + + loc(LOC_ANIMAL_CONTACT_DETAILS_HEADING) + loc(ExposureDto.ANIMAL_CONDITION) + fluidRowLocs(ExposureDto.ANIMAL_CONTACT_TYPE, ExposureDto.ANIMAL_CONTACT_TYPE_DETAILS) + + fluidRowLocs(ExposureDto.ANIMAL_LOCATION) + loc(ExposureDto.ANIMAL_VACCINATED) + loc(LOC_BURIAL_DETAILS_HEADING) + loc(ExposureDto.PHYSICAL_CONTACT_DURING_PREPARATION) + loc(ExposureDto.PHYSICAL_CONTACT_WITH_BODY) + fluidRowLocs(ExposureDto.DECEASED_PERSON_NAME, ExposureDto.DECEASED_PERSON_RELATION) + + loc(LOC_LOCATION_HEADING) + fluidRow( fluidColumn(6, 0, locs(ExposureDto.TYPE_OF_PLACE)), @@ -152,7 +162,8 @@ public ExposureForm( Class epiDataParentClass, List sourceContacts, FieldVisibilityCheckers fieldVisibilityCheckers, - UiFieldAccessCheckers fieldAccessCheckers, Disease disease) { + UiFieldAccessCheckers fieldAccessCheckers, + Disease disease) { super(ExposureDto.class, ExposureDto.I18N_PREFIX, false, fieldVisibilityCheckers, fieldAccessCheckers); setWidth(960, Unit.PIXELS); @@ -215,6 +226,8 @@ private void addHeadingsAndInfoTexts() { getContent() .addComponent(new Label(h3(I18nProperties.getString(Strings.headingBurialDetails)), ContentMode.HTML), LOC_BURIAL_DETAILS_HEADING); + + getContent().addComponent(new Label(h3(I18nProperties.getString(Strings.headingEpiConclusion)), ContentMode.HTML), LOC_CONCLUSION_HEADING); } private void addBasicFields() { @@ -250,6 +263,17 @@ private void addBasicFields() { ExposureDto.MEANS_OF_TRANSPORT_DETAILS, ExposureDto.SEAT_NUMBER, ExposureDto.EXPOSURE_ROLE, + ExposureDto.TRAVEL_ACCOMMODATION, + ExposureDto.TRAVEL_ACCOMMODATION_TYPE, + ExposureDto.DOMESTIC_SWIMMING, + ExposureDto.INTERNATIONAL_SWIMMING, + ExposureDto.SWIMMING_LOCATION, + ExposureDto.SWIMMING_LOCATION_TYPE, + ExposureDto.RAW_FOOD_CONTACT, + ExposureDto.RAW_FOOD_CONTACT_TEXT, + ExposureDto.SYMPTOMATIC_INDIVIDUAL_TEXT, + ExposureDto.ANIMAL_LOCATION, + ExposureDto.SEXUAL_EXPOSURE_TEXT, ExposureDto.WORK_ENVIRONMENT); addFieldsWithCss( @@ -274,7 +298,7 @@ private void addBasicFields() { ValoTheme.OPTIONGROUP_HORIZONTAL, CssStyles.OPTIONGROUP_CAPTION_INLINE); // Changing the distance and contact label for IMI - if(Disease.INVASIVE_MENINGOCOCCAL_INFECTION.equals(disease)){ + if (Disease.INVASIVE_MENINGOCOCCAL_INFECTION.equals(disease)) { getField(ExposureDto.SHORT_DISTANCE).setCaption(I18nProperties.getCaption(Captions.Exposure_imi_shortDistance)); getField(ExposureDto.LONG_FACE_TO_FACE_CONTACT).setCaption(I18nProperties.getCaption(Captions.Exposure_imi_longFaceToFaceContact)); } @@ -285,11 +309,27 @@ private void setUpVisibilityDependencies() { FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.GATHERING_TYPE, ExposureDto.EXPOSURE_TYPE, ExposureType.GATHERING, true); FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.HABITATION_TYPE, ExposureDto.EXPOSURE_TYPE, ExposureType.HABITATION, true); FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.TYPE_OF_ANIMAL, ExposureDto.EXPOSURE_TYPE, ExposureType.ANIMAL_CONTACT, true); - FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.TYPE_OF_CHILDCARE_FACILITY, ExposureDto.EXPOSURE_TYPE, ExposureType.CHILDCARE_FACILITY, true); + FieldHelper.setVisibleWhen( + getFieldGroup(), + List.of(ExposureDto.DOMESTIC_SWIMMING, ExposureDto.INTERNATIONAL_SWIMMING), + ExposureDto.EXPOSURE_TYPE, + ExposureType.RECREATIONAL_WATER, + true); + FieldHelper.setVisibleWhen( + getFieldGroup(), + ExposureDto.TYPE_OF_CHILDCARE_FACILITY, + ExposureDto.EXPOSURE_TYPE, + ExposureType.CHILDCARE_FACILITY, + true); FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.GATHERING_DETAILS, ExposureDto.GATHERING_TYPE, GatheringType.OTHER, true); FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.HABITATION_DETAILS, ExposureDto.HABITATION_TYPE, HabitationType.OTHER, true); FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.TYPE_OF_ANIMAL_DETAILS, ExposureDto.TYPE_OF_ANIMAL, TypeOfAnimal.OTHER, true); - FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.CHILDCARE_FACILITY_DETAILS, ExposureDto.TYPE_OF_CHILDCARE_FACILITY, TypeOfChildcareFacility.OTHER, true); + FieldHelper.setVisibleWhen( + getFieldGroup(), + ExposureDto.CHILDCARE_FACILITY_DETAILS, + ExposureDto.TYPE_OF_CHILDCARE_FACILITY, + TypeOfChildcareFacility.OTHER, + true); FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.LARGE_ATTENDANCE_NUMBER, ExposureDto.EXPOSURE_TYPE, ExposureType.GATHERING, true); FieldHelper.setVisibleWhen( getFieldGroup(), @@ -303,12 +343,15 @@ private void setUpVisibilityDependencies() { true); FieldHelper .setVisibleWhen(getFieldGroup(), ExposureDto.PROTECTIVE_MEASURES_DETAILS, ExposureDto.OTHER_PROTECTIVE_MEASURES, YesNoUnknown.YES, true); - FieldHelper.setVisibleWhen( - getFieldGroup(), - Arrays.asList(ExposureDto.ANIMAL_CONDITION, ExposureDto.ANIMAL_VACCINATED, ExposureDto.ANIMAL_CONTACT_TYPE), - ExposureDto.EXPOSURE_TYPE, - ExposureType.ANIMAL_CONTACT, - true); + // Animal-contact-related fields are not relevant for Giardiasis and Cryptosporidiosis + if (!List.of(Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(disease)) { + FieldHelper.setVisibleWhen( + getFieldGroup(), + Arrays.asList(ExposureDto.ANIMAL_CONDITION, ExposureDto.ANIMAL_VACCINATED, ExposureDto.ANIMAL_CONTACT_TYPE), + ExposureDto.EXPOSURE_TYPE, + ExposureType.ANIMAL_CONTACT, + true); + } FieldHelper .setVisibleWhen(getFieldGroup(), ExposureDto.ANIMAL_CONTACT_TYPE_DETAILS, ExposureDto.ANIMAL_CONTACT_TYPE, AnimalContactType.OTHER, true); FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.TYPE_OF_PLACE_DETAILS, ExposureDto.TYPE_OF_PLACE, TypeOfPlace.OTHER, true); @@ -334,14 +377,41 @@ private void setUpVisibilityDependencies() { Collections.singletonList(FacilityTypeGroup.WORKING_PLACE), true); + FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.TRAVEL_ACCOMMODATION, ExposureDto.EXPOSURE_TYPE, ExposureType.TRAVEL, true); + FieldHelper.setVisibleWhen( + getFieldGroup(), + ExposureDto.TRAVEL_ACCOMMODATION_TYPE, + ExposureDto.TRAVEL_ACCOMMODATION, + TravelAccommodation.OTHER, + true); + FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.SWIMMING_LOCATION, ExposureDto.INTERNATIONAL_SWIMMING, YesNoUnknown.YES, true); + FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.SWIMMING_LOCATION_TYPE, ExposureDto.SWIMMING_LOCATION, SwimmingLocation.OTHER, true); + FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.ANIMAL_LOCATION, ExposureDto.EXPOSURE_TYPE, ExposureType.ANIMAL_CONTACT, true); + FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.SEXUAL_EXPOSURE_TEXT, ExposureDto.EXPOSURE_TYPE, ExposureType.SEXUAL_CONTACT, true); + if (Disease.CRYPTOSPORIDIOSIS == disease) { + FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.RAW_FOOD_CONTACT, ExposureDto.EXPOSURE_TYPE, ExposureType.ANIMAL_CONTACT, true); + FieldHelper.setVisibleWhen(getFieldGroup(), ExposureDto.RAW_FOOD_CONTACT_TEXT, ExposureDto.RAW_FOOD_CONTACT, YesNoUnknown.YES, true); + FieldHelper.setVisibleWhen( + getFieldGroup(), + ExposureDto.SYMPTOMATIC_INDIVIDUAL_TEXT, + ExposureDto.EXPOSURE_TYPE, + ExposureType.SYMPTOMATIC_CONTACT, + true); + } + getContent().getComponent(LOC_ANIMAL_CONTACT_DETAILS_HEADING).setVisible(false); getContent().getComponent(LOC_BURIAL_DETAILS_HEADING).setVisible(false); getField(ExposureDto.EXPOSURE_TYPE).addValueChangeListener(e -> { ExposureType selectedExposureType = (ExposureType) e.getProperty().getValue(); - getContent().getComponent(LOC_ANIMAL_CONTACT_DETAILS_HEADING).setVisible(selectedExposureType == ExposureType.ANIMAL_CONTACT); - getContent().getComponent(LOC_BURIAL_DETAILS_HEADING).setVisible(selectedExposureType == ExposureType.BURIAL); + if (selectedExposureType != null) { + getContent().getComponent(LOC_ANIMAL_CONTACT_DETAILS_HEADING).setVisible(selectedExposureType == ExposureType.ANIMAL_CONTACT); + // Exposure details heading is hidden if an exposure type is Animal Contact or Other (there are no relevant fields) + getContent().getComponent(LOC_EXPOSURE_DETAILS_HEADING) + .setVisible(!List.of(ExposureType.ANIMAL_CONTACT, ExposureType.OTHER).contains(selectedExposureType)); + getContent().getComponent(LOC_BURIAL_DETAILS_HEADING).setVisible(selectedExposureType == ExposureType.BURIAL); + } }); - + getContent().getComponent(LOC_CONCLUSION_HEADING).setVisible(List.of(Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(disease)); locationForm.setFacilityFieldsVisible(getField(ExposureDto.TYPE_OF_PLACE).getValue() == TypeOfPlace.FACILITY, true); getField(ExposureDto.TYPE_OF_PLACE) .addValueChangeListener(e -> locationForm.setFacilityFieldsVisible(e.getProperty().getValue() == TypeOfPlace.FACILITY, true)); diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/hospitalization/HospitalizationForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/hospitalization/HospitalizationForm.java index 343c9ab5546..df6db9683bf 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/hospitalization/HospitalizationForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/hospitalization/HospitalizationForm.java @@ -22,6 +22,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.List; import java.util.Objects; import org.apache.commons.lang3.StringUtils; @@ -52,6 +53,7 @@ import de.symeda.sormas.api.symptoms.SymptomsDto; import de.symeda.sormas.api.user.UserRight; import de.symeda.sormas.api.utils.DateComparator; +import de.symeda.sormas.api.utils.DateHelper; import de.symeda.sormas.api.utils.YesNoUnknown; import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers; import de.symeda.sormas.ui.UiUtil; @@ -80,7 +82,7 @@ public class HospitalizationForm extends AbstractEditForm { fluidRowLocs(HospitalizationDto.CURRENTLY_HOSPITALIZED) + fluidRowLocs(HEALTH_FACILITY, HEALTH_FACILITY_DEPARTMENT) + fluidRowLocs(HospitalizationDto.ADMISSION_DATE, HospitalizationDto.DISCHARGE_DATE, HospitalizationDto.LEFT_AGAINST_ADVICE, "") + - fluidRowLocs(HospitalizationDto.HOSPITALIZATION_REASON, HospitalizationDto.OTHER_HOSPITALIZATION_REASON) + + fluidRowLocs( HospitalizationDto.DURATION_OF_HOSPITALIZATION, HospitalizationDto.HOSPITALIZATION_REASON, HospitalizationDto.OTHER_HOSPITALIZATION_REASON, "") + fluidRowLocs(3, HospitalizationDto.INTENSIVE_CARE_UNIT, 3, HospitalizationDto.INTENSIVE_CARE_UNIT_START, 3, HospitalizationDto.INTENSIVE_CARE_UNIT_END, @@ -152,8 +154,9 @@ protected void addFields() { intensiveCareUnitStart.setVisible(false); intensiveCareUnitEnd = addField(HospitalizationDto.INTENSIVE_CARE_UNIT_END, DateField.class); intensiveCareUnitEnd.setVisible(false); + DateComparisonValidator.addStartEndValidators(intensiveCareUnitStart, intensiveCareUnitEnd, true); - if (caze.getDisease() == Disease.RESPIRATORY_SYNCYTIAL_VIRUS) { + if (List.of(Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(caze.getDisease())) { FieldHelper.setVisibleWhen( intensiveCareUnit, Arrays.asList(intensiveCareUnitStart, intensiveCareUnitEnd), @@ -170,7 +173,7 @@ protected void addFields() { final NullableOptionGroup oxygenPrescribedField = addField(HospitalizationDto.OXYGEN_PRESCRIBED, NullableOptionGroup.class); final NullableOptionGroup stillHospitalizedField = addField(HospitalizationDto.STILL_HOSPITALIZED, NullableOptionGroup.class); - if (caze.getDisease() != Disease.RESPIRATORY_SYNCYTIAL_VIRUS) { + if (!List.of(Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(caze.getDisease())) { icuLengthOfStayField.setVisible(false); oxygenPrescribedField.setVisible(false); stillHospitalizedField.setVisible(false); @@ -204,6 +207,8 @@ protected void addFields() { CssStyles.style(hospitalizedPreviouslyField, CssStyles.ERROR_COLOR_PRIMARY); PreviousHospitalizationsField previousHospitalizationsField = addField(HospitalizationDto.PREVIOUS_HOSPITALIZATIONS, PreviousHospitalizationsField.class); + final TextField durationOfHospitalization = addField(HospitalizationDto.DURATION_OF_HOSPITALIZATION, TextField.class); + durationOfHospitalization.setVisible(false); FieldHelper.setEnabledWhen( admittedToHealthFacilityField, @@ -222,12 +227,31 @@ protected void addFields() { isolatedField, leftAgainstAdviceField, hospitalizationReason, + icuLengthOfStayField, + durationOfHospitalization, otherHospitalizationReason), false); + FieldHelper.setEnabledWhen( + currentlyHospitalizedField, + Arrays.asList(YesNoUnknown.YES), + Arrays.asList( + admissionDateField, + dischargeDateField, + leftAgainstAdviceField, + durationOfHospitalization, + hospitalizationReason, + otherHospitalizationReason), + true); initializeVisibilitiesAndAllowedVisibilities(); initializeAccessAndAllowedAccesses(); + if (List.of(Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(caze.getDisease())) { + FieldHelper + .setRequiredWhenNotNull(getFieldGroup(), HospitalizationDto.ADMITTED_TO_HEALTH_FACILITY, HospitalizationDto.HOSPITALIZATION_REASON); + durationOfHospitalization.setVisible(true); + } + if (isVisibleAllowed(HospitalizationDto.ISOLATION_DATE)) { FieldHelper.setVisibleWhen( getFieldGroup(), @@ -297,7 +321,7 @@ public String getFormattedHtmlMessage() { dischargeDateField.addValueChangeListener(event -> admissionDateField.markAsDirty()); // re-evaluate admission date for consistent validation of all fields // RSV specific logic - if (caze.getDisease() == Disease.RESPIRATORY_SYNCYTIAL_VIRUS) { + if (List.of(Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.CRYPTOSPORIDIOSIS, Disease.GIARDIASIS).contains(caze.getDisease())) { intensiveCareUnitStart.addValidator( new DateComparisonValidator( intensiveCareUnitStart, @@ -341,6 +365,10 @@ public String getFormattedHtmlMessage() { if (hasDischargeDate) { stillHospitalizedField.setValue(null); } + // If the discharge date is set, the duration of hospitalization must be calculated based on admission and discharge date + if (hasDischargeDate && admissionDateField.getValue() != null) { + durationOfHospitalization.setValue("" + DateHelper.getDaysBetween(admissionDateField.getValue(), dischargeDateField.getValue())); + } }); // Show icuLengthOfStay when ICU dates are not available but survey has length information FieldHelper.setVisibleWhen(intensiveCareUnit, Collections.singletonList(icuLengthOfStayField), Arrays.asList(YesNoUnknown.YES), true); 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 226ab9b10f7..b5e559c7683 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 @@ -81,6 +81,7 @@ import de.symeda.sormas.api.person.PersonDto; import de.symeda.sormas.api.person.PresentCondition; import de.symeda.sormas.api.person.Salutation; +import de.symeda.sormas.api.person.WorkPlace; import de.symeda.sormas.api.utils.DataHelper.Pair; import de.symeda.sormas.api.utils.DateHelper; import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers; @@ -165,6 +166,7 @@ public class PersonEditForm extends AbstractEditForm { divsCss(VSPACE_3, fluidRowLocs(PersonDto.OCCUPATION_TYPE, PersonDto.OCCUPATION_DETAILS) + fluidRow(oneOfTwoCol(PersonDto.ARMED_FORCES_RELATION_TYPE)), + fluidRowLocs(PersonDto.WORK_PLACE, PersonDto.WORK_PLACE_TEXT), fluidRowLocs(PersonDto.EDUCATION_TYPE, PersonDto.EDUCATION_DETAILS) ) + @@ -424,7 +426,14 @@ protected void addFields() { // Entry date is only required for foreigners in Luxembourg with the TB+IMI+IPI diseases only. if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG)) { boolean isEntryDateAllowedDisease = - Arrays.asList(Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.TUBERCULOSIS, Disease.MEASLES) + Arrays + .asList( + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + Disease.INVASIVE_MENINGOCOCCAL_INFECTION, + Disease.TUBERCULOSIS, + Disease.MEASLES, + Disease.GIARDIASIS, + Disease.CRYPTOSPORIDIOSIS) .contains(disease); birthCountryCB.addValueChangeListener(e -> { CountryReferenceDto countryRef = (CountryReferenceDto) e.getProperty().getValue(); @@ -457,6 +466,9 @@ protected void addFields() { getContent().addComponent(externalTokenWarningLabel, EXTERNAL_TOKEN_WARNING_LOC); addField(PersonDto.INTERNAL_TOKEN); + addField(PersonDto.WORK_PLACE); + addField(PersonDto.WORK_PLACE_TEXT); + AtomicBoolean nationalHealthIdFirstLoading = new AtomicBoolean(true); nationalHealthIdField.addTextFieldValueChangeListener(e -> { String currentPersonUuid = this.getValue().getUuid(); @@ -520,6 +532,7 @@ protected void addFields() { burialDate, burialPlaceDesc, burialConductor); + FieldHelper.setVisibleWhen(getFieldGroup(), PersonDto.WORK_PLACE_TEXT, PersonDto.WORK_PLACE, WorkPlace.OTHER, true); // Set initial visibilities @@ -758,9 +771,9 @@ private boolean personCanBeEmancipated(int approximateAge, boolean change) { } else { canBeEmancipated = approximateAge >= minimumEmancipatedAge && approximateAge < minimumAdultAge; } - if (!canBeEmancipated && (approximateAgeField).getValue() != null) { + if (!canBeEmancipated && (approximateAgeField).getValue() != null) { Integer age = parseApproximateAge(approximateAgeField.getValue()); - if (age != null && approximateAgeTypeField.getValue() == ApproximateAgeType.YEARS) { + if (age != null && approximateAgeTypeField.getValue() == ApproximateAgeType.YEARS) { canBeEmancipated = age >= minimumEmancipatedAge && age < minimumAdultAge; if (change) { isEmancipated.setValue(canBeEmancipated); diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java index fb904e73101..1b423ac3f77 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java @@ -23,18 +23,19 @@ import static de.symeda.sormas.ui.utils.LayoutUtil.fluidRowLocs; import static de.symeda.sormas.ui.utils.LayoutUtil.loc; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.BiConsumer; import java.util.function.Consumer; -import de.symeda.sormas.api.sample.GenoTypeResult; import org.apache.commons.collections4.CollectionUtils; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.vaadin.ui.Label; import com.vaadin.v7.data.util.converter.Converter; import com.vaadin.v7.ui.AbstractSelect.ItemCaptionMode; @@ -58,6 +59,7 @@ import de.symeda.sormas.api.i18n.Validations; import de.symeda.sormas.api.infrastructure.facility.FacilityDto; import de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto; +import de.symeda.sormas.api.sample.GenoTypeResult; import de.symeda.sormas.api.sample.PathogenStrainCallStatus; import de.symeda.sormas.api.sample.PathogenTestDto; import de.symeda.sormas.api.sample.PathogenTestResultType; @@ -149,12 +151,6 @@ public class PathogenTestForm extends AbstractEditForm { private TextField typingIdField; private ComboBox specieField; // List of tests that are used for serogrouping - List seroGrpTests = Arrays.asList( - PathogenTestType.SEROGROUPING, - PathogenTestType.MULTILOCUS_SEQUENCE_TYPING, - PathogenTestType.SLIDE_AGGLUTINATION, - PathogenTestType.WHOLE_GENOME_SEQUENCING, - PathogenTestType.SEQUENCING); public PathogenTestForm( AbstractSampleForm sampleForm, @@ -366,7 +362,8 @@ protected void addFields() { ComboBox testedPathogenField = addCustomizableEnumField(PathogenTestDto.TESTED_PATHOGEN); TextField testedPathogenDetailsField = addField(PathogenTestDto.TESTED_PATHOGEN_DETAILS, TextField.class); testedPathogenDetailsField.setVisible(false); - FieldHelper.updateItems(testedPathogenField, FacadeProvider.getCustomizableEnumFacade().getEnumValues(CustomizableEnumType.PATHOGEN, null)); + FieldHelper + .updateItems(testedPathogenField, FacadeProvider.getCustomizableEnumFacade().getEnumValues(CustomizableEnumType.PATHOGEN, disease)); testedPathogenField.addValueChangeListener(e -> { Pathogen pathogen = (Pathogen) e.getProperty().getValue(); if (pathogen != null && pathogen.isHasDetails()) { @@ -497,22 +494,6 @@ protected void addFields() { } }; FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.DRUG_SUSCEPTIBILITY, tuberculosisAntibioticDependencies, true); - - //Measles Genotyping specification - Map> measlesGenoTypingDependencies = new HashMap<>() { - - { - put(PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.MEASLES)); - put(PathogenTestDto.TEST_TYPE, Arrays.asList(PathogenTestType.GENOTYPING)); - } - }; - FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.GENOTYPE_RESULT, measlesGenoTypingDependencies, true); - FieldHelper.setVisibleWhen( - getFieldGroup(), - PathogenTestDto.GENOTYPE_RESULT_TEXT, - PathogenTestDto.GENOTYPE_RESULT, - GenoTypeResult.OTHER, - true); //test result - read only Map> tuberculosisTestResultReadOnlyDependencies = new HashMap<>() { @@ -585,9 +566,9 @@ protected void addFields() { final Boolean tubeNilGt10Value = getValue().getTubeNilGT10(); // we are called for a new entry - if(tubeNilValue == null - && tubeNilGt10Value == null - && tubeNilFieldValue == null + if(tubeNilValue == null + && tubeNilGt10Value == null + && tubeNilFieldValue == null && tubeNilGt10Field.getNullableValue() == null) { tubeNilGt10Field.select(false); return; @@ -963,6 +944,7 @@ protected void addFields() { Arrays.asList(PathogenTestType.PCR_RT_PCR, PathogenTestType.DNA_MICROARRAY, PathogenTestType.SEQUENCING), true); + // Serotype field visibility specification for CSM disease Map> serotypeVisibilityDependencies = new HashMap>() { private static final long serialVersionUID = 1967952323596082247L; @@ -972,19 +954,85 @@ protected void addFields() { put(PathogenTestDto.TEST_RESULT, Arrays.asList(PathogenTestResultType.POSITIVE)); } }; - FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.SEROTYPE, serotypeVisibilityDependencies, true); + FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(PathogenTestDto.SEROTYPE), serotypeVisibilityDependencies, true); + // End of Serotype field visibility specification for CSM disease + + // IPI visibility check with a positive test result, show serotype and serotyping method fields + Map> ipiSeroTypeAndMethodVisibilityDependencies = new HashMap>() { + + private static final long serialVersionUID = 1967952323596082247L; + { + put(PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.INVASIVE_PNEUMOCOCCAL_INFECTION)); + put(PathogenTestDto.TEST_TYPE, Arrays.asList(PathogenTestType.SEROGROUPING)); + put(PathogenTestDto.TEST_RESULT, Arrays.asList(PathogenTestResultType.POSITIVE)); + } + }; + FieldHelper.setVisibleWhen( + getFieldGroup(), + Arrays.asList(PathogenTestDto.SEROTYPE, PathogenTestDto.SEROTYPING_METHOD), + ipiSeroTypeAndMethodVisibilityDependencies, + true); + Map> ipiSeroTypeVisibilityDependencies = new HashMap>() { + + private static final long serialVersionUID = 1967952323596082247L; + { + put(PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.INVASIVE_PNEUMOCOCCAL_INFECTION)); + put( + PathogenTestDto.TEST_TYPE, + Arrays.asList( + PathogenTestType.WHOLE_GENOME_SEQUENCING, + PathogenTestType.SLIDE_AGGLUTINATION, + PathogenTestType.MULTILOCUS_SEQUENCE_TYPING, + PathogenTestType.SEROGROUPING)); + put(PathogenTestDto.TEST_RESULT, Arrays.asList(PathogenTestResultType.POSITIVE)); + } + }; + FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.SEROTYPE, ipiSeroTypeVisibilityDependencies, true); + FieldHelper.setVisibleWhen( getFieldGroup(), PathogenTestDto.SERO_TYPING_METHOD_TEXT, PathogenTestDto.SEROTYPING_METHOD, SerotypingMethod.OTHER, true); + // End of IPI visibility check + + //IMI serogroup specification + Map> imiSeroTypingDependencies = new HashMap<>() { + + { + put(PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.INVASIVE_MENINGOCOCCAL_INFECTION)); + put(PathogenTestDto.TEST_RESULT, Arrays.asList(PathogenTestResultType.POSITIVE)); + put( + PathogenTestDto.TEST_TYPE, + Arrays.asList( + PathogenTestType.SEROGROUPING, + PathogenTestType.MULTILOCUS_SEQUENCE_TYPING, + PathogenTestType.SLIDE_AGGLUTINATION, + PathogenTestType.WHOLE_GENOME_SEQUENCING)); + } + }; + FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.SERO_GROUP_SPECIFICATION, imiSeroTypingDependencies, true); FieldHelper.setVisibleWhen( getFieldGroup(), PathogenTestDto.SERO_GROUP_SPECIFICATION_TEXT, PathogenTestDto.SERO_GROUP_SPECIFICATION, SeroGroupSpecification.OTHER, true); + // End of IMI serogroup specification + //Cryptosporidiosis for all countries Genotyping specification + Map> cryptoGenoTypingDependencies = new HashMap<>() { + + { + put(PathogenTestDto.TESTED_DISEASE, Arrays.asList(Disease.MEASLES, Disease.CRYPTOSPORIDIOSIS)); + put(PathogenTestDto.TEST_TYPE, Arrays.asList(PathogenTestType.GENOTYPING)); + put(PathogenTestDto.TEST_RESULT, Arrays.asList(PathogenTestResultType.POSITIVE)); + } + }; + FieldHelper.setVisibleWhen(getFieldGroup(), PathogenTestDto.GENOTYPE_RESULT, cryptoGenoTypingDependencies, true); + + FieldHelper + .setVisibleWhen(getFieldGroup(), PathogenTestDto.GENOTYPE_RESULT_TEXT, PathogenTestDto.GENOTYPE_RESULT, GenoTypeResult.OTHER, true); Consumer updateDiseaseVariantField = disease -> { List diseaseVariants = @@ -1026,6 +1074,39 @@ protected void addFields() { diseaseVariantDetailsField.setVisible(diseaseVariant != null && diseaseVariant.matchPropertyValue(DiseaseVariant.HAS_DETAILS, true)); }); + // map to decide the result type field value and enable/disable state + ImmutableMap> resultFieldDecisionMap = ImmutableMap.of( + Disease.INVASIVE_MENINGOCOCCAL_INFECTION, + ImmutableList.of( + PathogenTestType.SEROGROUPING, + PathogenTestType.MULTILOCUS_SEQUENCE_TYPING, + PathogenTestType.SLIDE_AGGLUTINATION, + PathogenTestType.WHOLE_GENOME_SEQUENCING, + PathogenTestType.SEQUENCING, + PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY), + Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, + ImmutableList.of( + PathogenTestType.SEROGROUPING, + PathogenTestType.MULTILOCUS_SEQUENCE_TYPING, + PathogenTestType.SLIDE_AGGLUTINATION, + PathogenTestType.WHOLE_GENOME_SEQUENCING, + PathogenTestType.SEQUENCING, + PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY), + Disease.MEASLES, + ImmutableList.of(PathogenTestType.GENOTYPING), + Disease.CRYPTOSPORIDIOSIS, + ImmutableList.of(PathogenTestType.GENOTYPING)); + + BiConsumer resultField = (disease, testType) -> { + if (resultFieldDecisionMap.containsKey(disease) && resultFieldDecisionMap.get(disease).contains(testType)) { + testResultField.setValue(PathogenTestResultType.POSITIVE); + testResultField.setEnabled(false); + } else { + testResultField.clear(); + testResultField.setEnabled(true); + } + }; + testTypeField.addValueChangeListener(e -> { PathogenTestType testType = (PathogenTestType) e.getProperty().getValue(); if (testType != null) { @@ -1036,28 +1117,8 @@ protected void addFields() { fourFoldIncrease.setVisible(false); fourFoldIncrease.setEnabled(false); } - // If disease is IMI or IPI and test type is serogrouping, then test result is set to positive and not editable - if (seroGrpTests.contains(testType)) { - testResultField.setValue(PathogenTestResultType.POSITIVE); - } else { - testResultField.clear(); - } - updateDrugSusceptibilityFieldSpecifications(testType, (Disease) diseaseField.getValue()); - seroTypeMetCB.setVisible(disease == Disease.INVASIVE_PNEUMOCOCCAL_INFECTION && PathogenTestType.SEROGROUPING.equals(testType)); - seroTypeTF.setVisible(disease == Disease.INVASIVE_PNEUMOCOCCAL_INFECTION && seroGrpTests.contains(testType)); - seroGrpSepcCB.setVisible(disease == Disease.INVASIVE_MENINGOCOCCAL_INFECTION && seroGrpTests.contains(testType)); - // for enabling the test result, finding configured country and disease - boolean isLuxTbAntiSus = FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG) - && Disease.TUBERCULOSIS.equals((Disease) diseaseField.getValue()) - && PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY.equals(testType); - if (isLuxTbAntiSus) { - seroGrpTests = new ArrayList<>(seroGrpTests); - seroGrpTests.add(testType); - } - // for all serogrouping tests and isLuxTbAntiSus the test result field should be disabled - testResultField.setEnabled(!seroGrpTests.contains(testType)); setVisibleClear( PathogenTestType.PCR_RT_PCR == testType, PathogenTestDto.CQ_VALUE, @@ -1078,14 +1139,7 @@ protected void addFields() { PathogenTestDto.TUBE_AG_TB2_GT10, PathogenTestDto.TUBE_MITOGENE, PathogenTestDto.TUBE_MITOGENE_GT10); - // If the disease is IMI or IPI and the test type is antibiotic susceptibility, - // then a test result is set to positive and disabled - if (DiseaseHelper.checkDiseaseIsInvasiveBacterialDiseases((Disease) diseaseField.getValue()) - && testType == PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY) { - testResultField.setValue(PathogenTestResultType.POSITIVE); - testResultField.setEnabled(false); - } - + FieldHelper.updateItems((Disease) diseaseField.getValue(), genoTypingCB, GenoTypeResult.class); } else { setVisibleClear( testTypeField.getValue() != null, @@ -1106,17 +1160,7 @@ protected void addFields() { testResultField.clear(); testResultField.setEnabled(true); } - - // If disease is IMI or IPI and test type is antibiotic susceptibility, then test result is set to positive - if (diseaseField.getValue() != null && List.of(Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.INVASIVE_MENINGOCOCCAL_INFECTION).contains(diseaseField.getValue()) - && testType == PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY) { - testResultField.setValue(PathogenTestResultType.POSITIVE); - } - // for Measles Genotyping test result is set to positive and disabled - if (diseaseField.getValue() == Disease.MEASLES && testType == PathogenTestType.GENOTYPING) { - testResultField.setValue(PathogenTestResultType.POSITIVE); - testResultField.setEnabled(false); - } + resultField.accept((Disease) diseaseField.getValue(), testType); }); lab.addValueChangeListener(event -> { if (event.getProperty().getValue() != null diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java index 5ccc2ee1c6f..c74afa03b62 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java @@ -139,6 +139,8 @@ public PathogenTestListEntry(PathogenTestDto pathogenTest, boolean showTestResul } else if (testType == PathogenTestType.MIRU_PATTERN_CODE) { resultText = StringUtils.abbreviate(pathogenTest.getPatternProfile(), 125); } + } else if (testType == PathogenTestType.GENOTYPING) { + resultText = StringUtils.abbreviate((pathogenTest.getGenoTypeResult() != null ? pathogenTest.getGenoTypeResult().toString() : ""), 125); } else { resultText = pathogenTest.getTestResult(); } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java index 89d2d4ab35c..813c50f3993 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java @@ -17,7 +17,6 @@ import static de.symeda.sormas.api.symptoms.SymptomsDto.*; import static de.symeda.sormas.ui.utils.CssStyles.H3; -import static de.symeda.sormas.ui.utils.CssStyles.H4; import static de.symeda.sormas.ui.utils.CssStyles.VSPACE_3; import static de.symeda.sormas.ui.utils.CssStyles.VSPACE_NONE; import static de.symeda.sormas.ui.utils.LayoutUtil.fluidColumn; @@ -42,6 +41,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import com.google.common.collect.ImmutableList; import com.vaadin.server.ErrorMessage; import com.vaadin.server.ThemeResource; import com.vaadin.shared.ui.ContentMode; @@ -94,6 +94,8 @@ import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers; import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers; import de.symeda.sormas.api.visit.VisitStatus; +import de.symeda.sormas.ui.ControllerProvider; +import de.symeda.sormas.ui.hospitalization.HospitalizationView; import de.symeda.sormas.ui.utils.AbstractEditForm; import de.symeda.sormas.ui.utils.ButtonHelper; import de.symeda.sormas.ui.utils.CssStyles; @@ -130,7 +132,7 @@ public class SymptomsForm extends AbstractEditForm { private static final String TUBERCULOSIS_CLINICAL_PRESENTATION_DETAILS_LOC = "tuberculosisClinicalPresentationDetailsLoc"; private static Map> symptomGroupMap = new HashMap<>(); - public static final String SKIN_RASH_ONSET_DATE_LAYOUT = fluidRowLocs(6, "LBL_SKIN_RASH_ONSET_DATE",1,"",5, SKIN_RASH_ONSET_DATE); + public static final String SKIN_RASH_ONSET_DATE_LAYOUT = fluidRowLocs(6, "LBL_SKIN_RASH_ONSET_DATE", 1, "", 5, SKIN_RASH_ONSET_DATE); //@formatter:off private static final String HTML_LAYOUT = @@ -146,7 +148,16 @@ public class SymptomsForm extends AbstractEditForm { //XXX #1620 fluidColumnLoc? fluidColumn(8, 0, loc(SYMPTOMS_HINT_LOC))) + fluidRow(fluidColumn(8,4, locCss(CssStyles.ALIGN_RIGHT,BUTTONS_LOC)))+ + loc(CLINICAL_PRESENTATION_HEADING)+ fluidRow(fluidColumn(6, 0, locsCss(VSPACE_3, ASYMPTOMATIC)))+ + fluidRowLocs(DATE_OF_ONSET_KNOWN, TUBERCULOSIS_ONSET_DATE_LOC, "") + + fluidRowLocs(CLINICAL_PRESENTATION_STATUS, TUBERCULOSIS_CLINICAL_PRESENTATION_DETAILS_LOC) + + fluidRow( + fluidColumn(6, 0, + locsCss(VSPACE_3, + HEMORRHAGIC_RASH, ARTHRITIS, MENINGITIS, MENINGEAL_SIGNS, SEPTICAEMIA, ACUTE_ENCEPHALITIS, UNKNOWN_SYMPTOM)), + fluidColumn(6, 0, + locsCss(VSPACE_3, SHOCK, PNEUMONIA_CLINICAL_OR_RADIOLOGIC)))+ createSymptomGroupLayout(SymptomGroup.GENERAL, GENERAL_SIGNS_AND_SYMPTOMS_HEADING_LOC) + createSymptomGroupLayout(SymptomGroup.RESPIRATORY, RESPIRATORY_SIGNS_AND_SYMPTOMS_HEADING_LOC) + createSymptomGroupLayout(SymptomGroup.CARDIOVASCULAR, CARDIOVASCULAR_SIGNS_AND_SYMPTOMS_HEADING_LOC) + @@ -155,31 +166,18 @@ public class SymptomsForm extends AbstractEditForm { createSymptomGroupLayout(SymptomGroup.NERVOUS_SYSTEM, NERVOUS_SYSTEM_SIGNS_AND_SYMPTOMS_HEADING_LOC) + createSymptomGroupLayout(SymptomGroup.SKIN, SKIN_SIGNS_AND_SYMPTOMS_HEADING_LOC) + createSymptomGroupLayout(SymptomGroup.OTHER, OTHER_SIGNS_AND_SYMPTOMS_HEADING_LOC) + + fluidRowLocsCss(VSPACE_3, SYMPTOM_CURRENT_STATUS, DURATION_OF_SYMPTOMS)+ fluidRow(fluidColumn(6, 0, loc("LAYOUT_SKIN_RASH_ONSET_DATE"))) + - locsCss(VSPACE_3, PATIENT_ILL_LOCATION, SYMPTOMS_COMMENTS) + - fluidRowLocsCss(VSPACE_3, ONSET_SYMPTOM, ONSET_DATE) + + loc(COMPLICATIONS_HEADING) + fluidRow( fluidColumn(6, 0, - locsCss(VSPACE_3, - ALTERED_CONSCIOUSNESS, CONFUSED_DISORIENTED, HEMORRHAGIC_SYNDROME, - HYPERGLYCEMIA, HYPOGLYCEMIA, OTHER_COMPLICATIONS, - OTHER_COMPLICATIONS_TEXT)), + locsCss(VSPACE_3, ALTERED_CONSCIOUSNESS, CONFUSED_DISORIENTED, HEMORRHAGIC_SYNDROME, HYPERGLYCEMIA, HYPOGLYCEMIA, OVERNIGHT_STAY_REQUIRED)), fluidColumn(6, 0, - locsCss(VSPACE_3, - MENINGEAL_SIGNS, SEIZURES, SEPSIS, SHOCK)) - )+ - loc(CLINICAL_PRESENTATION_HEADING)+ - fluidRowLocs(DATE_OF_ONSET_KNOWN, TUBERCULOSIS_ONSET_DATE_LOC, "") + - fluidRowLocs(CLINICAL_PRESENTATION_STATUS, TUBERCULOSIS_CLINICAL_PRESENTATION_DETAILS_LOC) + + locsCss(VSPACE_3, MENINGEAL_SIGNS, SEIZURES, SEPSIS, SHOCK,REOCCURRENCE, OTHER_COMPLICATIONS, OTHER_COMPLICATIONS_TEXT)))+ fluidRowLocs(PARENT_TIME_OFF_WORK, TIME_OFF_WORK_DAYS) + - fluidRow( - fluidColumn(6, 0, - locsCss(VSPACE_3, - HEMORRHAGIC_RASH, ARTHRITIS, MENINGITIS, MENINGEAL_SIGNS, SEPTICAEMIA, ACUTE_ENCEPHALITIS, UNKNOWN_SYMPTOM)), - fluidColumn(6, 0, - locsCss(VSPACE_3, SHOCK,PNEUMONIA_CLINICAL_OR_RADIOLOGIC,OTHER_CLINICAL_PRESENTATION, OTHER_CLINICAL_PRESENTATION_TEXT)) - ); + locsCss(VSPACE_3, PATIENT_ILL_LOCATION, SYMPTOMS_COMMENTS) + + fluidRowLocsCss(VSPACE_3, ONSET_SYMPTOM, ONSET_DATE); //@formatter:on private static String createSymptomGroupLayout(SymptomGroup symptomGroup, String loc) { @@ -220,6 +218,7 @@ private static String createSymptomGroupLayout(SymptomGroup symptomGroup, String private List lesionsFieldIds; private List lesionsLocationFieldIds; private List monkeypoxImageFieldIds; + private boolean isListenerAction = false; public SymptomsForm( CaseDataDto caze, @@ -268,18 +267,18 @@ protected void addFields() { Label signsAndSymptomsHeadingLabel = createLabel(I18nProperties.getString(Strings.headingSignsAndSymptoms), H3, SIGNS_AND_SYMPTOMS_HEADING_LOC); - final Label generalSymptomsHeadingLabel = createLabel(SymptomGroup.GENERAL.toString(), H4, GENERAL_SIGNS_AND_SYMPTOMS_HEADING_LOC); + final Label generalSymptomsHeadingLabel = createLabel(SymptomGroup.GENERAL.toString(), H3, GENERAL_SIGNS_AND_SYMPTOMS_HEADING_LOC); final Label respiratorySymptomsHeadingLabel = - createLabel(SymptomGroup.RESPIRATORY.toString(), H4, RESPIRATORY_SIGNS_AND_SYMPTOMS_HEADING_LOC); + createLabel(SymptomGroup.RESPIRATORY.toString(), H3, RESPIRATORY_SIGNS_AND_SYMPTOMS_HEADING_LOC); final Label cardiovascularSymptomsHeadingLabel = - createLabel(SymptomGroup.CARDIOVASCULAR.toString(), H4, CARDIOVASCULAR_SIGNS_AND_SYMPTOMS_HEADING_LOC); + createLabel(SymptomGroup.CARDIOVASCULAR.toString(), H3, CARDIOVASCULAR_SIGNS_AND_SYMPTOMS_HEADING_LOC); final Label gastrointestinalSymptomsHeadingLabel = - createLabel(SymptomGroup.GASTROINTESTINAL.toString(), H4, GASTROINTESTINAL_SIGNS_AND_SYMPTOMS_HEADING_LOC); - final Label urinarySymptomsHeadingLabel = createLabel(SymptomGroup.URINARY.toString(), H4, URINARY_SIGNS_AND_SYMPTOMS_HEADING_LOC); + createLabel(SymptomGroup.GASTROINTESTINAL.toString(), H3, GASTROINTESTINAL_SIGNS_AND_SYMPTOMS_HEADING_LOC); + final Label urinarySymptomsHeadingLabel = createLabel(SymptomGroup.URINARY.toString(), H3, URINARY_SIGNS_AND_SYMPTOMS_HEADING_LOC); final Label nervousSystemSymptomsHeadingLabel = - createLabel(SymptomGroup.NERVOUS_SYSTEM.toString(), H4, NERVOUS_SYSTEM_SIGNS_AND_SYMPTOMS_HEADING_LOC); - final Label skinSymptomsHeadingLabel = createLabel(SymptomGroup.SKIN.toString(), H4, SKIN_SIGNS_AND_SYMPTOMS_HEADING_LOC); - final Label otherSymptomsHeadingLabel = createLabel(SymptomGroup.OTHER.toString(), H4, OTHER_SIGNS_AND_SYMPTOMS_HEADING_LOC); + createLabel(SymptomGroup.NERVOUS_SYSTEM.toString(), H3, NERVOUS_SYSTEM_SIGNS_AND_SYMPTOMS_HEADING_LOC); + final Label skinSymptomsHeadingLabel = createLabel(SymptomGroup.SKIN.toString(), H3, SKIN_SIGNS_AND_SYMPTOMS_HEADING_LOC); + final Label otherSymptomsHeadingLabel = createLabel(SymptomGroup.OTHER.toString(), H3, OTHER_SIGNS_AND_SYMPTOMS_HEADING_LOC); Label clinicalPresentationHeadingLabel = createLabel(I18nProperties.getString(Strings.headingClinicalPresentation), H3, CLINICAL_PRESENTATION_HEADING); @@ -501,6 +500,12 @@ public String getFormattedHtmlMessage() { HIGH_OR_LOW_BLOOD_PRESSURE, URINARY_RETENTION, FEVER, + BLOATING, + REOCCURRENCE, + WEIGHT_LOSS, + WEIGHT_LOSS_AMOUNT, + EGGY_BURPS, + SYMPTOM_CURRENT_STATUS, DIFFICULTY_BREATHING_DURING_MEALS, PARADOXICAL_BREATHING, RESPIRATORY_FATIGUE); @@ -541,17 +546,15 @@ public String getFormattedHtmlMessage() { NullableOptionGroup asymptomaticNOG = addField(ASYMPTOMATIC); asymptomaticNOG.addValueChangeListener(e -> { - if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG)) { - boolean isSymptamatic = !SymptomState.YES.equals(asymptomaticNOG.getNullableValue()); - editableAllowedFields().stream().filter(field -> !field.getId().equals(ASYMPTOMATIC)).forEach(field -> { - if (!isSymptamatic) { - field.clear(); - } - field.setEnabled(isSymptamatic); - onsetSymptom.setEnabled(isSymptamatic); - onsetDateField.setEnabled(isSymptamatic); - }); - } + boolean isSymptamatic = !SymptomState.YES.equals(asymptomaticNOG.getNullableValue()); + editableAllowedFields().stream().filter(field -> !field.getId().equals(ASYMPTOMATIC)).forEach(field -> { + if (!isSymptamatic) { + field.clear(); + } + field.setEnabled(isSymptamatic); + onsetSymptom.setEnabled(isSymptamatic); + onsetDateField.setEnabled(isSymptamatic); + }); }); monkeypoxImageFieldIds = Arrays.asList(LESIONS_RESEMBLE_IMG1, LESIONS_RESEMBLE_IMG2, LESIONS_RESEMBLE_IMG3, LESIONS_RESEMBLE_IMG4); @@ -570,7 +573,9 @@ public String getFormattedHtmlMessage() { skinRashDateLabel.setVisible(false); skinRashDateLayout.addComponent(skinRashDateLabel, "LBL_SKIN_RASH_ONSET_DATE"); - skinRashDateLabel.setVisible(isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG) && FieldHelper.getNullableSourceFieldValue(getField(SKIN_RASH)) == YesNoUnknown.YES); + skinRashDateLabel.setVisible( + isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG) + && FieldHelper.getNullableSourceFieldValue(getField(SKIN_RASH)) == YesNoUnknown.YES); DateField skinRashOnsetDate = addField(skinRashDateLayout, SKIN_RASH_ONSET_DATE, DateField.class); skinRashOnsetDate.setId(SKIN_RASH_ONSET_DATE); skinRashOnsetDate.addStyleNames(ValoTheme.DATEFIELD_BORDERLESS, CssStyles.VIEW_SECTION_WIDTH_AUTO, VSPACE_3); @@ -578,7 +583,6 @@ public String getFormattedHtmlMessage() { skinRashDateLayout.addComponent(skinRashOnsetDate, SKIN_RASH_ONSET_DATE); getContent().addComponent(skinRashDateLayout, "LAYOUT_SKIN_RASH_ONSET_DATE"); - getField(SKIN_RASH).addValueChangeListener(e -> { // Show skin rash onset date field only if skin rash is set to YES if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG)) { @@ -588,10 +592,12 @@ public String getFormattedHtmlMessage() { } }); - Field parentTimeOffWorkField = addField(PARENT_TIME_OFF_WORK); TextField timeOffWorkDaysField = addField(TIME_OFF_WORK_DAYS, TextField.class); + Field overNightStayRequiredField = addField(OVERNIGHT_STAY_REQUIRED); + addField(DURATION_OF_SYMPTOMS, TextField.class); + // Set initial visibilities initializeVisibilitiesAndAllowedVisibilities(); @@ -789,6 +795,14 @@ public String getFormattedHtmlMessage() { MENINGITIS, SEPTICAEMIA, UNKNOWN_SYMPTOM, + BLOATING, + REOCCURRENCE, + OVERNIGHT_STAY_REQUIRED, + WEIGHT_LOSS, + WEIGHT_LOSS_AMOUNT, + EGGY_BURPS, + SYMPTOM_CURRENT_STATUS, + DURATION_OF_SYMPTOMS, ACUTE_ENCEPHALITIS, OTHER_CLINICAL_PRESENTATION); @@ -985,9 +999,7 @@ public String getFormattedHtmlMessage() { clinicalMeasurementsHeadingLabel.setVisible(!lablesVisible); signsAndSymptomsHeadingLabel.setVisible(!lablesVisible); - respiratorySymptomsHeadingLabel.setVisible(!lablesVisible); complicationsHeading.setVisible(!lablesVisible && isComplicationsHeadingVisible); - clinicalPresentationHeadingLabel.setVisible(lablesVisible); if (Disease.INVASIVE_MENINGOCOCCAL_INFECTION == disease) { getField(SHOCK).setCaption(I18nProperties.getCaption(Captions.Symptoms_imi_shock)); @@ -1055,6 +1067,30 @@ public String getFormattedHtmlMessage() { timeOffWorkDaysField.setVisible(isParentTimeOffWorkYes); timeOffWorkDaysField.setValue(isParentTimeOffWorkYes ? timeOffWorkDaysField.getValue() : null); }); + + // Change captions for giardiasis and Cryptosporidiosis + if (ImmutableList.of(Disease.GIARDIASIS, Disease.CRYPTOSPORIDIOSIS).contains(disease)) { + parentTimeOffWorkField.setCaption(I18nProperties.getCaption(Captions.Symptoms_timeOffWorkOrSchool)); + timeOffWorkDaysField.setCaption(I18nProperties.getCaption(Captions.Symptoms_timeOffWorkDays_giardiasis)); + getField(OTHER_COMPLICATIONS).setCaption(I18nProperties.getCaption(Captions.Symptoms_otherComplications_CryptoGiardia)); + getField(OTHER_COMPLICATIONS_TEXT).setCaption(I18nProperties.getCaption(Captions.Symptoms_otherComplicationsText_CryptoGiardia)); + getContent().getComponent(CLINICAL_MEASUREMENTS_HEADING_LOC).setVisible(false); + } + + // Navigate to hospitalization view when overnight stay required is set to yes + overNightStayRequiredField.addValueChangeListener(e -> { + if (isListenerAction) { + final boolean isOvernightStayRequiredYes = + SymptomState.YES.equals(FieldHelper.getNullableSourceFieldValue(overNightStayRequiredField)); + if (isOvernightStayRequiredYes) { + ControllerProvider.getCaseController().navigateToView(HospitalizationView.VIEW_NAME, caze.getUuid(), null); + } + } + isListenerAction = true; + }); + + FieldHelper.setVisibleWhen(getFieldGroup(), WEIGHT_LOSS_AMOUNT, WEIGHT_LOSS, Arrays.asList(SymptomState.YES), true); + FieldHelper.setVisibleWhen(getFieldGroup(), DURATION_OF_SYMPTOMS, SYMPTOM_CURRENT_STATUS, Arrays.asList(SymptomState.YES), true); } private void toggleFeverComponentError(NullableOptionGroup feverField, ComboBox temperatureField) { diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/CssStyles.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/CssStyles.java index 569ff497a5b..d81c058ed61 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/CssStyles.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/CssStyles.java @@ -527,6 +527,10 @@ public static String getDiseaseColor(Disease disease) { return "background-disease-invasive-meningococcal-infection"; case INVASIVE_PNEUMOCOCCAL_INFECTION: return "background-disease-invasive-pneumococcal-infection"; + case GIARDIASIS: + return "background-disease-giardiasis"; + case CRYPTOSPORIDIOSIS: + return "background-disease-cryptosporidiosis"; case UNDEFINED: default: return "background-disease-undefined"; diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/FieldHelper.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/FieldHelper.java index 5f29dbeb406..f016b8bbf47 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/FieldHelper.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/utils/FieldHelper.java @@ -656,6 +656,19 @@ public static void updateItems(UserField select, List items) { select.setReadOnly(readOnly); } + public static void updateItems(Disease disease, AbstractSelect select, Class enumClass) { + + List filteredValues = Arrays.stream(enumClass.getEnumConstants()).filter(value -> { + try { + java.lang.reflect.Field enumField = enumClass.getField(value.name()); + return FieldVisibilityCheckers.withDisease(disease).isVisible(enumClass, enumField); + } catch (NoSuchFieldException e) { + return true; + } + }).collect(Collectors.toList()); + FieldHelper.updateEnumData(select, filteredValues); + } + public static void updateItems( AbstractSelect select, List items, diff --git a/sormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss b/sormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss index f58e2a3976b..9f08316279e 100644 --- a/sormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss +++ b/sormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss @@ -576,4 +576,22 @@ fill: #ca6f1e; } } + .background-disease-giardiasis{ + background-color: #22b8e6; + fill: #22b8e6; + + &.background-darker { + background-color: #064c63; + fill: #064c63; + } + } + .background-disease-cryptosporidiosis{ + background-color: #9938ca; + fill: #9938ca; + + &.background-darker { + background-color: #4b066a; + fill: #4b066a; + } + } } \ No newline at end of file