Skip to content

Commit 9ccad2c

Browse files
vectortypes added
1 parent bde8316 commit 9ccad2c

File tree

15 files changed

+145
-13
lines changed

15 files changed

+145
-13
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/environment/EnvironmentDto.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class EnvironmentDto extends PseudonymizableDto {
4646
public static final String LOCATION = "location";
4747
public static final String DELETION_REASON = "deletionReason";
4848
public static final String OTHER_DELETION_REASON = "otherDeletionReason";
49+
public static final String VECTOR_TYPE = "vectorType";
4950

5051
@NotNull(message = Validations.validReportDateTime)
5152
private Date reportDate;
@@ -81,6 +82,7 @@ public class EnvironmentDto extends PseudonymizableDto {
8182
private DeletionReason deletionReason;
8283
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
8384
private String otherDeletionReason;
85+
private VectorType vectorType;
8486

8587
public static EnvironmentDto build() {
8688
final EnvironmentDto environment = new EnvironmentDto();
@@ -248,4 +250,12 @@ public void setOtherDeletionReason(String otherDeletionReason) {
248250
public EnvironmentReferenceDto toReference() {
249251
return new EnvironmentReferenceDto(getUuid(), getEnvironmentName());
250252
}
253+
254+
public VectorType getVectorType() {
255+
return vectorType;
256+
}
257+
258+
public void setVectorType(VectorType vectorType) {
259+
this.vectorType = vectorType;
260+
}
251261
}

sormas-api/src/main/java/de/symeda/sormas/api/environment/EnvironmentMedia.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ public enum EnvironmentMedia {
77
WATER,
88
SOIL_ROCK,
99
AIR,
10-
BIOTA;
10+
BIOTA,
11+
VECTORS;
1112

1213
@Override
1314
public String toString() {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package de.symeda.sormas.api.environment;
2+
3+
import de.symeda.sormas.api.i18n.I18nProperties;
4+
5+
public enum VectorType {
6+
MOSQUITOS,
7+
TICKS;
8+
9+
@Override
10+
public String toString() {
11+
return I18nProperties.getEnumCaption(this);
12+
}
13+
}

sormas-api/src/main/java/de/symeda/sormas/api/environment/environmentsample/EnvironmentSampleDto.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import de.symeda.sormas.api.common.DeletionReason;
3030
import de.symeda.sormas.api.environment.EnvironmentReferenceDto;
31+
import de.symeda.sormas.api.environment.VectorType;
3132
import de.symeda.sormas.api.feature.FeatureType;
3233
import de.symeda.sormas.api.i18n.Validations;
3334
import de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto;
@@ -80,6 +81,7 @@ public class EnvironmentSampleDto extends PseudonymizableDto {
8081
public static final String DELETION_REASON = "deletionReason";
8182
public static final String OTHER_DELETION_REASON = "otherDeletionReason";
8283
public static final String REPORTING_USER = "reportingUser";
84+
public static final String VECTOR_TYPE = "vectorType";
8385

8486
@NotNull
8587
private EnvironmentReferenceDto environment;
@@ -141,6 +143,7 @@ public class EnvironmentSampleDto extends PseudonymizableDto {
141143
private DeletionReason deletionReason;
142144
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
143145
private String otherDeletionReason;
146+
private VectorType vectorType;
144147

145148
public static EnvironmentSampleDto build(EnvironmentReferenceDto environment, UserReferenceDto reportingUser) {
146149
EnvironmentSampleDto sample = new EnvironmentSampleDto();
@@ -399,4 +402,12 @@ public void setOtherDeletionReason(String otherDeletionReason) {
399402
public EnvironmentSampleReferenceDto toReference() {
400403
return new EnvironmentSampleReferenceDto(getUuid());
401404
}
405+
406+
public VectorType getVectorType() {
407+
return vectorType;
408+
}
409+
410+
public void setVectorType(VectorType vectorType) {
411+
this.vectorType = vectorType;
412+
}
402413
}

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
@@ -1459,6 +1459,7 @@ public interface Captions {
14591459
String Environment_uuid = "Environment.uuid";
14601460
String Environment_waterType = "Environment.waterType";
14611461
String Environment_waterUse = "Environment.waterUse";
1462+
String Environment_vectorType = "Environment.vectorType";
14621463
String environmentActiveEnvironments = "environmentActiveEnvironments";
14631464
String environmentAllActiveAndArchivedEnvironments = "environmentAllActiveAndArchivedEnvironments";
14641465
String environmentArchivedEnvironments = "environmentArchivedEnvironments";

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,7 @@ Environment.otherInfrastructureDetails=Other infrastructure details
11921192
Environment.waterUse=Water use
11931193
Environment.otherWaterUse=Other water use
11941194
Environment.location=Location
1195+
Environment.vectorType=Vector Type
11951196

11961197
environmentActiveEnvironments=Active environments
11971198
environmentArchivedEnvironments = Archived environments
@@ -1232,6 +1233,7 @@ EnvironmentSample.generalComment = General comment
12321233
EnvironmentSample.positivePathogenTests = Positive pathogen tests
12331234
EnvironmentSample.latestPathogenTest = Latest pathogen test
12341235
EnvironmentSample.numberOfTests = Number of tests
1236+
EnvironmentSample.vectorType=Vector Type
12351237

12361238
# Event
12371239
eventActiveEvents=Active events

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ EnvironmentMedia.WATER = Water
633633
EnvironmentMedia.SOIL_ROCK = Soil or rock
634634
EnvironmentMedia.AIR = Air
635635
EnvironmentMedia.BIOTA = Biota
636+
EnvironmentMedia.VECTORS = Vectors
636637

637638
# EpiCurveGrouping
638639
EpiCurveGrouping.DAY = Day
@@ -1930,6 +1931,11 @@ VisitStatus.Short.UNCOOPERATIVE = Uncooperative
19301931
VisitOrigin.USER = Created by user
19311932
VisitOrigin.EXTERNAL_JOURNAL = External symptom journal
19321933

1934+
# VectorType
1935+
1936+
VectorType.MOSQUITOS = Mosquitos
1937+
VectorType.TICKS = Ticks
1938+
19331939
# WaterSource
19341940
WaterSource.COMMUNITY_BOREHOLE_WELL = Community borehole/well
19351941
WaterSource.OTHER = Other

sormas-backend/src/main/java/de/symeda/sormas/backend/environment/Environment.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import de.symeda.sormas.api.caze.InvestigationStatus;
2727
import de.symeda.sormas.api.environment.EnvironmentInfrastructureDetails;
2828
import de.symeda.sormas.api.environment.EnvironmentMedia;
29+
import de.symeda.sormas.api.environment.VectorType;
2930
import de.symeda.sormas.api.environment.WaterType;
3031
import de.symeda.sormas.api.environment.WaterUse;
3132
import de.symeda.sormas.backend.common.CoreAdo;
@@ -56,6 +57,7 @@ public class Environment extends CoreAdo {
5657
public static final String OTHER_WATER_USE = "otherWaterUse";
5758
public static final String LOCATION = "location";
5859
public static final String ENVIRONMENT_SAMPLES = "environmentSamples";
60+
public static final String VECTOR_TYPE = "vectorType";
5961

6062
private Date reportDate;
6163
private User reportingUser;
@@ -73,6 +75,7 @@ public class Environment extends CoreAdo {
7375
private String otherWaterUse;
7476
private Location location;
7577
private Set<EnvironmentSample> environmentSamples = new HashSet<>();
78+
private VectorType vectorType;
7679

7780
@Temporal(TemporalType.TIMESTAMP)
7881
@Column(nullable = false)
@@ -225,4 +228,13 @@ public Set<EnvironmentSample> getEnvironmentSamples() {
225228
public void setEnvironmentSamples(Set<EnvironmentSample> environmentSamples) {
226229
this.environmentSamples = environmentSamples;
227230
}
231+
232+
@Enumerated(EnumType.STRING)
233+
public VectorType getVectorType() {
234+
return vectorType;
235+
}
236+
237+
public void setVectorType(VectorType vectorType) {
238+
this.vectorType = vectorType;
239+
}
228240
}

sormas-backend/src/main/java/de/symeda/sormas/backend/environment/EnvironmentFacadeEjb.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ protected Environment fillOrBuildEntity(EnvironmentDto source, Environment targe
312312
target.setResponsibleUser(userService.getByReferenceDto(source.getResponsibleUser()));
313313
target.setWaterType(source.getWaterType());
314314
target.setWaterUse(source.getWaterUse());
315+
target.setVectorType(EnvironmentMedia.VECTORS.equals(source.getEnvironmentMedia()) ? source.getVectorType() : null);
315316

316317
target.setDeleted(source.isDeleted());
317318
target.setDeletionReason(source.getDeletionReason());
@@ -343,6 +344,7 @@ protected EnvironmentDto toDto(Environment source) {
343344
target.setResponsibleUser(UserFacadeEjb.toReferenceDto(source.getResponsibleUser()));
344345
target.setWaterType(source.getWaterType());
345346
target.setWaterUse(source.getWaterUse());
347+
target.setVectorType(source.getVectorType());
346348

347349
target.setDeleted(source.isDeleted());
348350
target.setDeletionReason(source.getDeletionReason());

sormas-backend/src/main/java/de/symeda/sormas/backend/environment/environmentsample/EnvironmentSample.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import javax.persistence.TemporalType;
3535
import javax.persistence.Transient;
3636

37+
import de.symeda.sormas.api.environment.VectorType;
3738
import org.hibernate.annotations.Type;
3839

3940
import de.symeda.sormas.api.environment.environmentsample.EnvironmentSampleMaterial;
@@ -68,6 +69,7 @@ public class EnvironmentSample extends DeletableAdo {
6869
public static final String OTHER_SAMPLE_MATERIAL = "otherSampleMaterial";
6970
public static final String FIELD_SAMPLE_ID = "fieldSampleId";
7071
public static final String PATHOGEN_TESTS = "pathogenTests";
72+
public static final String VECTOR_TYPE = "vectorType";
7173

7274
private static final long serialVersionUID = 7237701234186874155L;
7375

@@ -99,6 +101,7 @@ public class EnvironmentSample extends DeletableAdo {
99101
private SpecimenCondition specimenCondition;
100102
private Location location;
101103
private String generalComment;
104+
private VectorType vectorType;
102105

103106
private List<PathogenTest> pathogenTests;
104107

@@ -372,4 +375,13 @@ public List<PathogenTest> getPathogenTests() {
372375
public void setPathogenTests(List<PathogenTest> pathogenTests) {
373376
this.pathogenTests = pathogenTests;
374377
}
378+
379+
@Enumerated(EnumType.STRING)
380+
public VectorType getVectorType() {
381+
return vectorType;
382+
}
383+
384+
public void setVectorType(VectorType vectorType) {
385+
this.vectorType = vectorType;
386+
}
375387
}

0 commit comments

Comments
 (0)