Skip to content

Commit 14dbe7e

Browse files
Merge pull request #13630 from SORMAS-Foundation/13610-cryptosporidium-enhance-case-data-form
RSV bug fixes and other minor issues
2 parents 5f89986 + f09355c commit 14dbe7e

File tree

27 files changed

+392
-209
lines changed

27 files changed

+392
-209
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/Disease.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public enum Disease
2525
implements
2626
StatisticsGroupingKey {
2727

28-
AFP(true, true, true, false, false, 0, true, false, false),
28+
AFP(true, true, true, false, true, 60, true, false, false),
2929
CHOLERA(true, true, true, false, true, 5, true, false, false),
3030
CONGENITAL_RUBELLA(true, true, true, false, true, 21, true, false, false),
3131
CSM(true, true, true, false, false, 10, true, false, false),
@@ -70,9 +70,9 @@ public enum Disease
7070
YAWS_ENDEMIC_SYPHILIS(true, false, false, true, false, 0, true, false, false),
7171
MATERNAL_DEATHS(true, false, false, true, false, 0, true, false, false),
7272
PERINATAL_DEATHS(true, false, false, true, false, 0, true, false, false),
73-
INFLUENZA(false, false, false, false, false, 0, true, false, false),
74-
INFLUENZA_A(true, true, true, false, false, 0, true, false, false),
75-
INFLUENZA_B(true, true, true, false, false, 0, true, false, false),
73+
INFLUENZA(true, false, false, false, false, 0, true, false, false),
74+
INFLUENZA_A(false, true, true, false, false, 0, true, false, false),
75+
INFLUENZA_B(false, true, true, false, false, 0, true, false, false),
7676
H_METAPNEUMOVIRUS(true, false, true, false, false, 0, true, false, false),
7777
RESPIRATORY_SYNCYTIAL_VIRUS(true, false, true, false, false, 0, true, false, false),
7878
PARAINFLUENZA_1_4(true, false, true, false, false, 0, true, false, false),

sormas-api/src/main/java/de/symeda/sormas/api/caze/classification/ClassificationExposureCriteriaDto.java

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ public ClassificationExposureCriteriaDto() {
4141
super();
4242
}
4343

44+
public ClassificationExposureCriteriaDto(ExposureType exposureType) {
45+
super();
46+
this.exposureType = exposureType;
47+
}
48+
4449
public ClassificationExposureCriteriaDto(String propertyId, ExposureType exposureType, Object... propertyValues) {
4550

4651
super(propertyId, propertyValues);
@@ -56,30 +61,35 @@ protected Class<? extends EntityDto> getInvokeClass() {
5661
public boolean eval(CaseDataDto caze, PersonDto person, List<PathogenTestDto> pathogenTests, List<EventDto> events, Date lastVaccinationDate) {
5762

5863
for (ExposureDto exposure : caze.getEpiData().getExposures()) {
59-
if (exposureType != null && exposure.getExposureType() != exposureType) {
60-
continue;
61-
}
62-
63-
Method method;
64-
try {
65-
method = getInvokeClass().getMethod("get" + propertyId.substring(0, 1).toUpperCase() + propertyId.substring(1));
66-
} catch (NoSuchMethodException e) {
64+
// To handle a case, like an exposure type present in the case, we should return true
65+
// This case is to handle the Giardiasis and Cryptosporidiosis diseases where only the exposure available but not its related property.
66+
if (propertyId == null && exposure.getExposureType() == exposureType) {
67+
return true;
68+
} else {
69+
if (exposureType != null && exposure.getExposureType() != exposureType) {
70+
continue;
71+
}
72+
Method method;
6773
try {
68-
method = getInvokeClass().getMethod("is" + propertyId.substring(0, 1).toUpperCase() + propertyId.substring(1));
69-
} catch (NoSuchMethodException newE) {
70-
throw new RuntimeException(newE);
74+
method = getInvokeClass().getMethod("get" + propertyId.substring(0, 1).toUpperCase() + propertyId.substring(1));
75+
} catch (NoSuchMethodException e) {
76+
try {
77+
method = getInvokeClass().getMethod("is" + propertyId.substring(0, 1).toUpperCase() + propertyId.substring(1));
78+
} catch (NoSuchMethodException newE) {
79+
throw new RuntimeException(newE);
80+
}
81+
} catch (SecurityException e) {
82+
throw new RuntimeException(e);
7183
}
72-
} catch (SecurityException e) {
73-
throw new RuntimeException(e);
74-
}
7584

76-
try {
77-
Object value = method.invoke(exposure);
78-
if (propertyValues.contains(value) || CollectionUtils.isEmpty(propertyValues) && YesNoUnknown.YES.equals(value)) {
79-
return true;
85+
try {
86+
Object value = method.invoke(exposure);
87+
if (propertyValues.contains(value) || CollectionUtils.isEmpty(propertyValues) && YesNoUnknown.YES.equals(value)) {
88+
return true;
89+
}
90+
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) {
91+
throw new RuntimeException(e);
8092
}
81-
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) {
82-
throw new RuntimeException(e);
8393
}
8494
}
8595

@@ -90,9 +100,16 @@ public boolean eval(CaseDataDto caze, PersonDto person, List<PathogenTestDto> pa
90100
public String buildDescription() {
91101

92102
StringBuilder sb = new StringBuilder();
93-
sb.append(I18nProperties.getPrefixCaption(ExposureDto.I18N_PREFIX, propertyId));
94103
if (exposureType != null) {
95-
sb.append(" ").append(I18nProperties.getString(Strings.classificationCriteriaForExposureType)).append(exposureType.toString());
104+
if (propertyId != null) {
105+
sb.append(I18nProperties.getPrefixCaption(ExposureDto.I18N_PREFIX, propertyId));
106+
sb.append(" ").append(I18nProperties.getString(Strings.classificationCriteriaForExposureType)).append(exposureType.toString());
107+
} else {
108+
sb.append(I18nProperties.getString(Strings.classificationCriteriaRestrictedToExposureType))
109+
.append(" ")
110+
.append(exposureType.toString());
111+
}
112+
96113
}
97114

98115
return sb.toString();

sormas-api/src/main/java/de/symeda/sormas/api/clinicalcourse/HealthConditionsDto.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public class HealthConditionsDto extends PseudonymizableDto {
5454
public static final String PREVIOUS_TUBERCULOSIS_TREATMENT = "previousTuberculosisTreatment";
5555
public static final String COMPLIANCE_WITH_TREATMENT = "complianceWithTreatment";
5656
public static final String RECURRENT_BRONCHIOLITIS = "recurrentBronchiolitis";
57-
public static final String IMMUNODEPRESSION = "immunodepression";
5857

5958
@HideForCountries(countries = {
6059
CountryHelper.COUNTRY_CODE_GERMANY,
@@ -146,10 +145,6 @@ public class HealthConditionsDto extends PseudonymizableDto {
146145
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
147146
private YesNoUnknown recurrentBronchiolitis;
148147

149-
@Diseases(value = {
150-
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
151-
private YesNoUnknown immunodepression;
152-
153148
public static HealthConditionsDto build() {
154149
HealthConditionsDto healthConditions = new HealthConditionsDto();
155150
healthConditions.setUuid(DataHelper.createUuid());
@@ -395,12 +390,4 @@ public YesNoUnknown getRecurrentBronchiolitis() {
395390
public void setRecurrentBronchiolitis(YesNoUnknown recurrentBronchiolitis) {
396391
this.recurrentBronchiolitis = recurrentBronchiolitis;
397392
}
398-
399-
public YesNoUnknown getImmunodepression() {
400-
return immunodepression;
401-
}
402-
403-
public void setImmunodepression(YesNoUnknown immunodepression) {
404-
this.immunodepression = immunodepression;
405-
}
406393
}

sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public class ExposureDto extends PseudonymizableDto {
113113
public static final String SWIMMING_LOCATION = "swimmingLocation";
114114
public static final String SWIMMING_LOCATION_TYPE = "swimmingLocationType";
115115
public static final String ANIMAL_LOCATION = "animalLocation";
116+
public static final String ANIMAL_LOCATION_TEXT = "animalLocationText";
116117
public static final String DOMESTIC_SWIMMING = "domesticSwimming";
117118
public static final String INTERNATIONAL_SWIMMING = "internationalSwimming";
118119
public static final String SEXUAL_EXPOSURE_TEXT = "sexualExposureText";
@@ -271,6 +272,11 @@ public class ExposureDto extends PseudonymizableDto {
271272
Disease.GIARDIASIS,
272273
Disease.CRYPTOSPORIDIOSIS })
273274
private AnimalLocation animalLocation;
275+
@Diseases({
276+
Disease.GIARDIASIS,
277+
Disease.CRYPTOSPORIDIOSIS })
278+
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
279+
private String animalLocationText;
274280
@Diseases({
275281
Disease.AFP,
276282
Disease.CHOLERA,
@@ -853,6 +859,14 @@ public void setAnimalLocation(AnimalLocation animalLocation) {
853859
this.animalLocation = animalLocation;
854860
}
855861

862+
public String getAnimalLocationText() {
863+
return animalLocationText;
864+
}
865+
866+
public void setAnimalLocationText(String animalLocationText) {
867+
this.animalLocationText = animalLocationText;
868+
}
869+
856870
public TravelAccommodation getTravelAccommodation() {
857871
return travelAccommodation;
858872
}

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,7 @@ public interface Captions {
18071807
String Exposure_animalContactType = "Exposure.animalContactType";
18081808
String Exposure_animalContactTypeDetails = "Exposure.animalContactTypeDetails";
18091809
String Exposure_animalLocation = "Exposure.animalLocation";
1810+
String Exposure_animalLocationText = "Exposure.animalLocationText";
18101811
String Exposure_animalMarket = "Exposure.animalMarket";
18111812
String Exposure_animalVaccinated = "Exposure.animalVaccinated";
18121813
String Exposure_bodyOfWater = "Exposure.bodyOfWater";

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public interface Strings {
2828
String classificationConfirmedUnknownSymptoms = "classificationConfirmedUnknownSymptoms";
2929
String classificationCriteriaForExposureType = "classificationCriteriaForExposureType";
3030
String classificationCriteriaForTestType = "classificationCriteriaForTestType";
31+
String classificationCriteriaRestrictedToExposureType = "classificationCriteriaRestrictedToExposureType";
3132
String classificationDaysBeforeCaseStart = "classificationDaysBeforeCaseStart";
3233
String classificationEventCluster = "classificationEventCluster";
3334
String classificationForDisease = "classificationForDisease";
@@ -423,6 +424,7 @@ public interface Strings {
423424
String forContact = "forContact";
424425
String forEnvironment = "forEnvironment";
425426
String forEventParticipant = "forEventParticipant";
427+
String giardiaInfoExposureInvestigation = "giardiaInfoExposureInvestigation";
426428
String headingAccessDenied = "headingAccessDenied";
427429
String headingActivityAsCase = "headingActivityAsCase";
428430
String headingActivityAsCaseDetails = "headingActivityAsCaseDetails";

sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,29 +218,35 @@ public class PersonDto extends PseudonymizableDto implements IsPerson {
218218
@Outbreaks
219219
private Date approximateAgeReferenceDate;
220220
@Diseases({
221-
Disease.CONGENITAL_RUBELLA })
221+
Disease.CONGENITAL_RUBELLA,
222+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
222223
@HideForCountries
223224
private RegionReferenceDto placeOfBirthRegion;
224225
@Diseases({
225-
Disease.CONGENITAL_RUBELLA })
226+
Disease.CONGENITAL_RUBELLA,
227+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
226228
@HideForCountries
227229
private DistrictReferenceDto placeOfBirthDistrict;
228230
@Diseases({
229-
Disease.CONGENITAL_RUBELLA })
231+
Disease.CONGENITAL_RUBELLA,
232+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
230233
@HideForCountries
231234
@SensitiveData
232235
private CommunityReferenceDto placeOfBirthCommunity;
233236
@Diseases({
234-
Disease.CONGENITAL_RUBELLA })
237+
Disease.CONGENITAL_RUBELLA,
238+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
235239
@HideForCountries
236240
private FacilityType placeOfBirthFacilityType;
237241
@Diseases({
238-
Disease.CONGENITAL_RUBELLA })
242+
Disease.CONGENITAL_RUBELLA,
243+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
239244
@HideForCountries
240245
@SensitiveData
241246
private FacilityReferenceDto placeOfBirthFacility;
242247
@Diseases({
243-
Disease.CONGENITAL_RUBELLA })
248+
Disease.CONGENITAL_RUBELLA,
249+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
244250
@HideForCountries
245251
@SensitiveData
246252
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)

sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,6 +2218,7 @@ public static SymptomsDto build() {
22182218
@HideForCountries(countries = {
22192219
CountryHelper.COUNTRY_CODE_GERMANY,
22202220
CountryHelper.COUNTRY_CODE_SWITZERLAND })
2221+
@SymptomGrouping(SymptomGroup.RESPIRATORY)
22212222
private SymptomState wheezing;
22222223

22232224
@Diseases({
@@ -2609,7 +2610,8 @@ public static SymptomsDto build() {
26092610
PERTUSSIS,
26102611
MEASLES,
26112612
GIARDIASIS,
2612-
CRYPTOSPORIDIOSIS })
2613+
CRYPTOSPORIDIOSIS,
2614+
RESPIRATORY_SYNCYTIAL_VIRUS })
26132615
private SymptomState asymptomatic;
26142616
@Diseases({
26152617
INVASIVE_MENINGOCOCCAL_INFECTION })
@@ -2675,8 +2677,7 @@ public static SymptomsDto build() {
26752677
GIARDIASIS,
26762678
CRYPTOSPORIDIOSIS })
26772679
@DependantOn("parentTimeOffWork")
2678-
@Size(max = 50, message = Validations.textTooLong)
2679-
private String timeOffWorkDays;
2680+
private Float timeOffWorkDays;
26802681

26812682
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG)
26822683
@Diseases({
@@ -4540,11 +4541,11 @@ public void setParentTimeOffWork(YesNoUnknown parentTimeOffWork) {
45404541
this.parentTimeOffWork = parentTimeOffWork;
45414542
}
45424543

4543-
public String getTimeOffWorkDays() {
4544+
public Float getTimeOffWorkDays() {
45444545
return timeOffWorkDays;
45454546
}
45464547

4547-
public void setTimeOffWorkDays(String timeOffWorkDays) {
4548+
public void setTimeOffWorkDays(Float timeOffWorkDays) {
45484549
this.timeOffWorkDays = timeOffWorkDays;
45494550
}
45504551

sormas-api/src/main/resources/captions.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,8 @@ Exposure.domesticSwimming=Swimming in Luxembourg
15771577
Exposure.internationalSwimming=Swimming abroad
15781578
Exposure.swimmingLocation=Swimming Location
15791579
Exposure.swimmingLocationType=Specify swimming location
1580-
Exposure.animalLocation= Animal Location
1580+
Exposure.animalLocation= Animal location
1581+
Exposure.animalLocationText= Specify animal location
15811582
Exposure.sexualExposureText= Specify sexual exposure
15821583

15831584
Exposure.rawFoodContact= Contact with raw pet food

sormas-api/src/main/resources/enum.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2440,7 +2440,7 @@ MedicallyAssociatedTransmissionMode.INJECTION_FOR_MEDICAL_PURPOSES=Injection for
24402440

24412441
# MultipleBirth
24422442
MultipleBirth.SINGLE=Single birth (Singleton - 1)
2443-
MultipleBirth.TWIN=Twin birth (Twins - 2)
2443+
MultipleBirth.TWINS=Twin birth (Twins - 2)
24442444
MultipleBirth.MULTIPLE=Multiple birth (Triplet 3+ or more)
24452445

24462446
# ExternalShareDateType

0 commit comments

Comments
 (0)