Skip to content

Commit 65a85aa

Browse files
committed
Merge development into master
2 parents f2786b3 + 87e7d44 commit 65a85aa

290 files changed

Lines changed: 19015 additions & 2153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sormas-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<parent>
33
<groupId>de.symeda.sormas</groupId>
44
<artifactId>sormas-base</artifactId>
5-
<version>1.102.0</version>
5+
<version>1.103.0-SNAPSHOT</version>
66
<relativePath>../sormas-base</relativePath>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ 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),
31-
CSM(true, true, true, false, false, 10, true, false, false),
31+
CSM(true, true, true, false, true, 10, true, false, false),
3232
DENGUE(true, true, true, false, false, 14, true, false, false),
3333
EVD(true, true, true, false, true, 21, true, false, false),
3434
GUINEA_WORM(true, true, true, false, false, 0, true, false, false),
@@ -37,7 +37,7 @@ public enum Disease
3737
MONKEYPOX(true, true, true, false, true, 21, true, false, false),
3838
NEW_INFLUENZA(true, true, true, false, true, 17, true, false, false),
3939
PLAGUE(true, true, true, false, true, 7, true, false, false),
40-
POLIO(true, true, true, false, false, 0, true, false, false),
40+
POLIO(true, true, true, false, true, 60, true, false, false),
4141
UNSPECIFIED_VHF(true, true, true, false, true, 21, true, false, false),
4242
WEST_NILE_FEVER(true, false, true, false, false, 0, true, false, false),
4343
YELLOW_FEVER(true, true, true, false, false, 6, true, false, false),
@@ -57,25 +57,25 @@ public enum Disease
5757
DIARRHEA_BLOOD(true, false, false, true, false, 0, true, false, false),
5858
SNAKE_BITE(true, false, false, true, false, 0, true, false, false),
5959
RUBELLA(true, false, false, true, false, 0, true, false, false),
60-
TUBERCULOSIS(true, true, true, true, false, 0, true, false, false),
61-
LATENT_TUBERCULOSIS(true, true, true, true, false, 0, true, false, false),
60+
TUBERCULOSIS(false, true, true, true, true, 365, true, false, false),
61+
LATENT_TUBERCULOSIS(false, true, true, true, true, 30, true, false, false),
6262
LEPROSY(true, false, false, true, false, 0, true, false, false),
6363
LYMPHATIC_FILARIASIS(true, false, false, true, false, 0, true, false, false),
6464
BURULI_ULCER(true, false, false, true, false, 0, true, false, false),
65-
PERTUSSIS(true, false, false, true, false, 0, true, false, false),
65+
PERTUSSIS(true, false, false, true, true, 0, true, false, false),
6666
NEONATAL_TETANUS(true, false, false, true, false, 0, true, false, false),
6767
ONCHOCERCIASIS(true, false, false, true, false, 0, true, false, false),
6868
DIPHTERIA(true, false, false, true, false, 0, true, false, false),
6969
TRACHOMA(true, false, false, true, false, 0, true, false, false),
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(true, true, true, false, false, 0, true, false, false),
74-
INFLUENZA_A(false, false, true, false, false, 0, true, false, false),
75-
INFLUENZA_B(false, false, 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),
78-
PARAINFLUENZA_1_4(true, false, true, false, false, 0, true, false, false),
78+
PARAINFLUENZA_1_4(false, false, true, false, false, 0, true, false, false),
7979
ADENOVIRUS(true, false, true, false, false, 0, true, false, false),
8080
RHINOVIRUS(true, false, true, false, false, 0, true, false, false),
8181
ENTEROVIRUS(true, false, true, false, false, 0, true, false, false),
@@ -88,6 +88,8 @@ public enum Disease
8888
FHA(true, false, false, true, false, 0, true, false, false),
8989
INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, false, 0, false, false, false),
9090
INVASIVE_MENINGOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
91+
GIARDIASIS(true, true, true, false, true, 14, false, false, false),
92+
CRYPTOSPORIDIOSIS(true, true, true, false, true, 14, false, false, false),
9193
OTHER(true, true, true, false, true, 21, false, false, false),
9294
UNDEFINED(true, true, true, false, true, 0, false, false, false);
9395

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
*******************************************************************************/
1818
package de.symeda.sormas.api;
1919

20+
import java.util.Arrays;
21+
import java.util.Collections;
22+
import java.util.Set;
23+
2024
import org.apache.commons.lang3.StringUtils;
2125

2226
import de.symeda.sormas.api.caze.PlagueType;
@@ -27,6 +31,12 @@
2731

2832
public final class DiseaseHelper {
2933

34+
/**
35+
* Diseases which are having subtypes.
36+
*/
37+
public static final Set<Disease> SUBTYPE_ALLOWED_DISEASES =
38+
Collections.unmodifiableSet(new java.util.HashSet<Disease>(Arrays.asList(Disease.INFLUENZA, Disease.RESPIRATORY_SYNCYTIAL_VIRUS)));
39+
3040
private DiseaseHelper() {
3141
// Hide Utility Class Constructor
3242
}
@@ -73,10 +83,10 @@ public static String variantInBrackets(DiseaseVariant diseaseVariant) {
7383

7484
/**
7585
* Checks if the case is an invasive bacterial disease (meningococcal or pneumococcal)
86+
*
7687
* @return boolean
7788
*/
78-
public static boolean checkDiseaseIsInvasiveBacterialDiseases(Disease disease){
79-
return disease != null && (disease == Disease.INVASIVE_MENINGOCOCCAL_INFECTION ||
80-
disease == Disease.INVASIVE_PNEUMOCOCCAL_INFECTION);
89+
public static boolean checkDiseaseIsInvasiveBacterialDiseases(Disease disease) {
90+
return disease != null && (disease == Disease.INVASIVE_MENINGOCOCCAL_INFECTION || disease == Disease.INVASIVE_PNEUMOCOCCAL_INFECTION);
8191
}
8292
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import de.symeda.sormas.api.environment.EnvironmentImportFacade;
5353
import de.symeda.sormas.api.environment.environmentsample.EnvironmentSampleFacade;
5454
import de.symeda.sormas.api.epidata.EpiDataFacade;
55+
import de.symeda.sormas.api.epipulse.EpipulseExportFacade;
5556
import de.symeda.sormas.api.event.EventFacade;
5657
import de.symeda.sormas.api.event.EventGroupFacade;
5758
import de.symeda.sormas.api.event.EventParticipantFacade;
@@ -579,6 +580,10 @@ public static NotifierFacade getNotifierFacade() {
579580
return get().lookupEjbRemote(NotifierFacade.class);
580581
}
581582

583+
public static EpipulseExportFacade getEpipulseExportFacade() {
584+
return get().lookupEjbRemote(EpipulseExportFacade.class);
585+
}
586+
582587
@SuppressWarnings("unchecked")
583588
public <P> P lookupEjbRemote(Class<P> clazz) {
584589
try {

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
364364
@SensitiveData
365365
@Diseases(value = {
366366
Disease.INVASIVE_MENINGOCOCCAL_INFECTION,
367-
Disease.INVASIVE_PNEUMOCOCCAL_INFECTION}, hide = true)
367+
Disease.INVASIVE_PNEUMOCOCCAL_INFECTION,
368+
Disease.GIARDIASIS,
369+
Disease.CRYPTOSPORIDIOSIS }, hide = true)
368370
private HealthConditionsDto healthConditions;
369371
private YesNoUnknown pregnant;
370372
@Diseases({
@@ -641,6 +643,8 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
641643
private String department;
642644

643645
private NotifierReferenceDto notifier;
646+
@Diseases(value = {
647+
Disease.TUBERCULOSIS })
644648
private RadiographyCompatibility radiographyCompatibility;
645649
private String otherDiagnosticCriteria;
646650

@@ -1840,8 +1844,6 @@ public void setOtherDiagnosticCriteria(String otherDiagnosticCriteria) {
18401844
this.otherDiagnosticCriteria = otherDiagnosticCriteria;
18411845
}
18421846

1843-
1844-
18451847
@JsonIgnore
18461848
public String i18nPrefix() {
18471849
return I18N_PREFIX;

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseIndexDetailedDto.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import de.symeda.sormas.api.Disease;
66
import de.symeda.sormas.api.common.DeletionReason;
77
import de.symeda.sormas.api.contact.FollowUpStatus;
8-
import de.symeda.sormas.api.disease.DiseaseVariant;
98
import de.symeda.sormas.api.event.EventStatus;
109
import de.symeda.sormas.api.person.ApproximateAgeType;
1110
import de.symeda.sormas.api.person.PresentCondition;
@@ -74,7 +73,7 @@ public class CaseIndexDetailedDto extends CaseIndexDto {
7473
private UserReferenceDto reportingUser;
7574

7675
//@formatter:off
77-
public CaseIndexDetailedDto(long id, String uuid, String epidNumber, String externalID, String externalToken, String internalToken,String caseReferenceNumber, String personUuid, String personFirstName, String personLastName,
76+
public CaseIndexDetailedDto(long id, String uuid, String epidNumber, String externalID, String externalToken, String internalToken,String caseReferenceNumber, String personUuid, String nationalHealthId, String personFirstName, String personLastName,
7877
Disease disease, String diseaseVariant, String diseaseDetails, CaseClassification caseClassification, InvestigationStatus investigationStatus,
7978
PresentCondition presentCondition, Date reportDate, Date creationDate,
8079
String regionUuid, String districtUuid,
@@ -88,7 +87,7 @@ public CaseIndexDetailedDto(long id, String uuid, String epidNumber, String exte
8887
String reportingUserUuid, String reportingUserFirstName, String reportingUserLastName, Date symptomOnsetDate,
8988
String responsibleRegion, String responsibleCommunity,
9089
int visitCount, long eventCount, Date latestSampleDateTime, long sampleCount) {
91-
super(id, uuid, epidNumber, externalID, externalToken, internalToken, caseReferenceNumber, personUuid, personFirstName, personLastName,
90+
super(id, uuid, epidNumber, externalID, externalToken, internalToken, caseReferenceNumber, personUuid, nationalHealthId, personFirstName, personLastName,
9291
disease, diseaseVariant, diseaseDetails, caseClassification, investigationStatus,
9392
presentCondition, reportDate, creationDate,
9493
regionUuid, districtUuid, healthFacilityUuid,

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseIndexDto.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class CaseIndexDto extends PseudonymizableIndexDto implements MergeableIn
5353
public static final String INTERNAL_TOKEN = "internalToken";
5454
public static final String CASE_REFERENCE_NUMBER = "caseReferenceNumber";
5555
public static final String PERSON_UUID = "personUuid";
56+
public static final String PERSON_NATIONAL_HEALTH_ID = "nationalHealthId";
5657
public static final String PERSON_FIRST_NAME = "personFirstName";
5758
public static final String PERSON_LAST_NAME = "personLastName";
5859
public static final String DISEASE = "disease";
@@ -91,6 +92,7 @@ public class CaseIndexDto extends PseudonymizableIndexDto implements MergeableIn
9192
private String internalToken;
9293
private String caseReferenceNumber;
9394
private String personUuid;
95+
private String nationalHealthId;
9496
@PersonalData
9597
@SensitiveData
9698
private String personFirstName;
@@ -141,7 +143,7 @@ public class CaseIndexDto extends PseudonymizableIndexDto implements MergeableIn
141143
private Boolean isInJurisdiction;
142144

143145
//@formatter:off
144-
public CaseIndexDto(long id, String uuid, String epidNumber, String externalID, String externalToken, String internalToken, String caseReferenceNumber, String personUuid, String personFirstName, String personLastName, Disease disease,
146+
public CaseIndexDto(long id, String uuid, String epidNumber, String externalID, String externalToken, String internalToken, String caseReferenceNumber, String personUuid, String nationalHealthId, String personFirstName, String personLastName, Disease disease,
145147
String diseaseVariant, String diseaseDetails, CaseClassification caseClassification, InvestigationStatus investigationStatus,
146148
PresentCondition presentCondition, Date reportDate, Date creationDate, String regionUuid,
147149
String districtUuid, String healthFacilityUuid, String healthFacilityName, String healthFacilityDetails,
@@ -164,6 +166,7 @@ public CaseIndexDto(long id, String uuid, String epidNumber, String externalID,
164166
this.internalToken = internalToken;
165167
this.caseReferenceNumber = caseReferenceNumber;
166168
this.personUuid = personUuid;
169+
this.nationalHealthId = nationalHealthId;
167170
this.personFirstName = personFirstName;
168171
this.personLastName = personLastName;
169172
this.disease = disease;
@@ -225,6 +228,14 @@ public void setPersonUuid(String personUuid) {
225228
this.personUuid = personUuid;
226229
}
227230

231+
public String getNationalHealthId() {
232+
return nationalHealthId;
233+
}
234+
235+
public void setNationalHealthId(String nationalHealthId) {
236+
this.nationalHealthId = nationalHealthId;
237+
}
238+
228239
public String getPersonFirstName() {
229240
return personFirstName;
230241
}

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseMergeIndexDto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import de.symeda.sormas.api.Disease;
66
import de.symeda.sormas.api.common.DeletionReason;
77
import de.symeda.sormas.api.contact.FollowUpStatus;
8-
import de.symeda.sormas.api.disease.DiseaseVariant;
98
import de.symeda.sormas.api.person.ApproximateAgeType;
109
import de.symeda.sormas.api.person.PresentCondition;
1110
import de.symeda.sormas.api.person.Sex;
@@ -20,7 +19,7 @@ public class CaseMergeIndexDto extends CaseIndexDto {
2019

2120
//@formatter:off
2221
public CaseMergeIndexDto(
23-
long id, String uuid, String epidNumber, String externalID, String externalToken, String internalToken, String caseReferenceNumber, String personUuid, String personFirstName, String personLastName, Disease disease,
22+
long id, String uuid, String epidNumber, String externalID, String externalToken, String internalToken, String caseReferenceNumber, String personUuid, String nationalHealthId, String personFirstName, String personLastName, Disease disease,
2423
String diseaseVariant, String diseaseDetails, CaseClassification caseClassification, InvestigationStatus investigationStatus,
2524
PresentCondition presentCondition, Date reportDate, Date creationDate, String regionUuid,
2625
String districtUuid, String healthFacilityUuid, String healthFacilityName, String healthFacilityDetails,
@@ -39,6 +38,7 @@ public CaseMergeIndexDto(
3938
internalToken,
4039
caseReferenceNumber,
4140
personUuid,
41+
nationalHealthId,
4242
personFirstName,
4343
personLastName,
4444
disease,

sormas-api/src/main/java/de/symeda/sormas/api/caze/VaccinationStatus.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,22 @@
1717
*******************************************************************************/
1818
package de.symeda.sormas.api.caze;
1919

20+
import de.symeda.sormas.api.CountryHelper;
21+
import de.symeda.sormas.api.Disease;
2022
import de.symeda.sormas.api.i18n.I18nProperties;
23+
import de.symeda.sormas.api.utils.Diseases;
24+
import de.symeda.sormas.api.utils.HideForCountriesExcept;
2125

2226
public enum VaccinationStatus {
2327

2428
VACCINATED,
2529
UNVACCINATED,
30+
@Diseases(value = {Disease.MEASLES})
31+
VACCINATED_ONE_DOSE,
32+
@Diseases(value = {Disease.MEASLES})
33+
VACCINATED_TWO_DOSE,
34+
@Diseases(value = {Disease.MEASLES})
35+
RECOVERED,
2636
UNKNOWN;
2737

2838
@Override

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();

0 commit comments

Comments
 (0)