Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 08859b0

Browse files
author
barnabartha
committed
Merge branch 'development' into feature-2527-CampaignDashboard
2 parents 76116fe + 6cefe6b commit 08859b0

35 files changed

Lines changed: 1764 additions & 153 deletions

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

Lines changed: 22 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import de.symeda.sormas.api.person.Sex;
4646
import de.symeda.sormas.api.sample.PathogenTestResultType;
4747
import de.symeda.sormas.api.symptoms.SymptomsDto;
48-
import de.symeda.sormas.api.utils.DateHelper;
4948
import de.symeda.sormas.api.utils.HideForCountriesExcept;
5049
import de.symeda.sormas.api.utils.Order;
5150
import de.symeda.sormas.api.utils.PersonalData;
@@ -186,10 +185,10 @@ public class CaseExportDto implements Serializable {
186185
private int numberOfPrescriptions;
187186
private int numberOfTreatments;
188187
private int numberOfClinicalVisits;
189-
private CaseExportSampleDto sample1 = new CaseExportSampleDto();
190-
private CaseExportSampleDto sample2 = new CaseExportSampleDto();
191-
private CaseExportSampleDto sample3 = new CaseExportSampleDto();
192-
private List<CaseExportSampleDto> otherSamples = new ArrayList<>();
188+
private EmbeddedSampleExportDto sample1 = new EmbeddedSampleExportDto();
189+
private EmbeddedSampleExportDto sample2 = new EmbeddedSampleExportDto();
190+
private EmbeddedSampleExportDto sample3 = new EmbeddedSampleExportDto();
191+
private List<EmbeddedSampleExportDto> otherSamples = new ArrayList<>();
193192

194193
private QuarantineType quarantine;
195194
@SensitiveData
@@ -1104,7 +1103,7 @@ public int getNumberOfClinicalVisits() {
11041103
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11051104
@ExportGroup(ExportGroupType.ADDITIONAL)
11061105
public Date getSampleDateTime1() {
1107-
return sample1.dateTime;
1106+
return sample1.getDateTime();
11081107
}
11091108

11101109
@Order(121)
@@ -1113,7 +1112,7 @@ public Date getSampleDateTime1() {
11131112
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11141113
@ExportGroup(ExportGroupType.ADDITIONAL)
11151114
public String getSampleLab1() {
1116-
return sample1.lab;
1115+
return sample1.getLab();
11171116
}
11181117

11191118
@Order(122)
@@ -1122,7 +1121,7 @@ public String getSampleLab1() {
11221121
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11231122
@ExportGroup(ExportGroupType.ADDITIONAL)
11241123
public PathogenTestResultType getSampleResult1() {
1125-
return sample1.result;
1124+
return sample1.getResult();
11261125
}
11271126

11281127
@Order(123)
@@ -1131,7 +1130,7 @@ public PathogenTestResultType getSampleResult1() {
11311130
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11321131
@ExportGroup(ExportGroupType.ADDITIONAL)
11331132
public Date getSampleDateTime2() {
1134-
return sample2.dateTime;
1133+
return sample2.getDateTime();
11351134
}
11361135

11371136
@Order(124)
@@ -1140,7 +1139,7 @@ public Date getSampleDateTime2() {
11401139
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11411140
@ExportGroup(ExportGroupType.ADDITIONAL)
11421141
public String getSampleLab2() {
1143-
return sample2.lab;
1142+
return sample2.getLab();
11441143
}
11451144

11461145
@Order(125)
@@ -1149,7 +1148,7 @@ public String getSampleLab2() {
11491148
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11501149
@ExportGroup(ExportGroupType.ADDITIONAL)
11511150
public PathogenTestResultType getSampleResult2() {
1152-
return sample2.result;
1151+
return sample2.getResult();
11531152
}
11541153

11551154
@Order(126)
@@ -1158,7 +1157,7 @@ public PathogenTestResultType getSampleResult2() {
11581157
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11591158
@ExportGroup(ExportGroupType.ADDITIONAL)
11601159
public Date getSampleDateTime3() {
1161-
return sample3.dateTime;
1160+
return sample3.getDateTime();
11621161
}
11631162

11641163
@Order(127)
@@ -1167,7 +1166,7 @@ public Date getSampleDateTime3() {
11671166
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11681167
@ExportGroup(ExportGroupType.ADDITIONAL)
11691168
public String getSampleLab3() {
1170-
return sample3.lab;
1169+
return sample3.getLab();
11711170
}
11721171

11731172
@Order(128)
@@ -1176,7 +1175,7 @@ public String getSampleLab3() {
11761175
@ExportProperty(value = SAMPLE_INFORMATION, combined = true)
11771176
@ExportGroup(ExportGroupType.ADDITIONAL)
11781177
public PathogenTestResultType getSampleResult3() {
1179-
return sample3.result;
1178+
return sample3.getResult();
11801179
}
11811180

11821181
@Order(130)
@@ -1188,7 +1187,7 @@ public String getOtherSamplesString() {
11881187
StringBuilder samples = new StringBuilder();
11891188
String separator = ", ";
11901189

1191-
for (CaseExportSampleDto sample : otherSamples) {
1190+
for (EmbeddedSampleExportDto sample : otherSamples) {
11921191
samples.append(sample.formatString()).append(separator);
11931192
}
11941193

@@ -1457,71 +1456,42 @@ public void setNumberOfClinicalVisits(int numberOfClinicalVisits) {
14571456
this.numberOfClinicalVisits = numberOfClinicalVisits;
14581457
}
14591458

1460-
public CaseExportSampleDto getSample1() {
1459+
public EmbeddedSampleExportDto getSample1() {
14611460
return sample1;
14621461
}
14631462

1464-
public void setSample1(CaseExportSampleDto sample1) {
1463+
public void setSample1(EmbeddedSampleExportDto sample1) {
14651464
this.sample1 = sample1;
14661465
}
14671466

1468-
public CaseExportSampleDto getSample2() {
1467+
public EmbeddedSampleExportDto getSample2() {
14691468
return sample2;
14701469
}
14711470

1472-
public void setSample2(CaseExportSampleDto sample2) {
1471+
public void setSample2(EmbeddedSampleExportDto sample2) {
14731472
this.sample2 = sample2;
14741473
}
14751474

1476-
public CaseExportSampleDto getSample3() {
1475+
public EmbeddedSampleExportDto getSample3() {
14771476
return sample3;
14781477
}
14791478

1480-
public void setSample3(CaseExportSampleDto sample3) {
1479+
public void setSample3(EmbeddedSampleExportDto sample3) {
14811480
this.sample3 = sample3;
14821481
}
14831482

1484-
public List<CaseExportSampleDto> getOtherSamples() {
1483+
public List<EmbeddedSampleExportDto> getOtherSamples() {
14851484
return otherSamples;
14861485
}
14871486

1488-
public void addOtherSample(CaseExportSampleDto otherSample) {
1487+
public void addOtherSample(EmbeddedSampleExportDto otherSample) {
14891488
this.otherSamples.add(otherSample);
14901489
}
14911490

14921491
public CaseJurisdictionDto getJurisdiction() {
14931492
return jurisdiction;
14941493
}
14951494

1496-
public static class CaseExportSampleDto implements Serializable {
1497-
1498-
private Date dateTime;
1499-
@SensitiveData
1500-
private String lab;
1501-
private PathogenTestResultType result;
1502-
1503-
public CaseExportSampleDto() {
1504-
}
1505-
1506-
public CaseExportSampleDto(Date dateTime, String lab, PathogenTestResultType result) {
1507-
this.dateTime = dateTime;
1508-
this.lab = lab;
1509-
this.result = result;
1510-
}
1511-
1512-
public String formatString() {
1513-
StringBuilder sb = new StringBuilder();
1514-
1515-
sb.append(DateHelper.formatDateForExport(dateTime)).append(" (");
1516-
if (lab != null && lab.length() > 0) {
1517-
sb.append(lab).append(", ");
1518-
}
1519-
sb.append(result).append(")");
1520-
1521-
return sb.toString();
1522-
}
1523-
}
1524-
15251495
public void setFollowUpStatus(FollowUpStatus followUpStatus) {
15261496
this.followUpStatus = followUpStatus;
15271497
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* ******************************************************************************
3+
* * SORMAS® - Surveillance Outbreak Response Management & Analysis System
4+
* * Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
5+
* *
6+
* * This program is free software: you can redistribute it and/or modify
7+
* * it under the terms of the GNU General Public License as published by
8+
* * the Free Software Foundation, either version 3 of the License, or
9+
* * (at your option) any later version.
10+
* *
11+
* * This program is distributed in the hope that it will be useful,
12+
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* * GNU General Public License for more details.
15+
* *
16+
* * You should have received a copy of the GNU General Public License
17+
* * along with this program. If not, see <https://www.gnu.org/licenses/>.
18+
* ******************************************************************************
19+
*/
20+
21+
package de.symeda.sormas.api.caze;
22+
23+
import java.io.Serializable;
24+
import java.util.Date;
25+
26+
import de.symeda.sormas.api.sample.PathogenTestResultType;
27+
import de.symeda.sormas.api.utils.DateHelper;
28+
import de.symeda.sormas.api.utils.SensitiveData;
29+
30+
public class EmbeddedSampleExportDto implements Serializable {
31+
32+
private Date dateTime;
33+
@SensitiveData
34+
private String lab;
35+
private PathogenTestResultType result;
36+
37+
public EmbeddedSampleExportDto() {
38+
}
39+
40+
public EmbeddedSampleExportDto(Date dateTime, String lab, PathogenTestResultType result) {
41+
this.dateTime = dateTime;
42+
this.lab = lab;
43+
this.result = result;
44+
}
45+
46+
public String formatString() {
47+
StringBuilder sb = new StringBuilder();
48+
49+
sb.append(DateHelper.formatDateForExport(dateTime)).append(" (");
50+
if (lab != null && lab.length() > 0) {
51+
sb.append(lab).append(", ");
52+
}
53+
sb.append(result).append(")");
54+
55+
return sb.toString();
56+
}
57+
58+
public Date getDateTime() {
59+
return dateTime;
60+
}
61+
62+
public void setDateTime(Date dateTime) {
63+
this.dateTime = dateTime;
64+
}
65+
66+
public String getLab() {
67+
return lab;
68+
}
69+
70+
public void setLab(String lab) {
71+
this.lab = lab;
72+
}
73+
74+
public PathogenTestResultType getResult() {
75+
return result;
76+
}
77+
78+
public void setResult(PathogenTestResultType result) {
79+
this.result = result;
80+
}
81+
}

0 commit comments

Comments
 (0)