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

Commit 4298f0e

Browse files
Merge pull request SORMAS-Foundation#3298 from hzi-braunschweig/3210_sormas-to-sormas-samples
3210 sormas to sormas samples
2 parents 4294320 + da00458 commit 4298f0e

36 files changed

Lines changed: 875 additions & 102 deletions

sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactReferenceDto.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ public static class PersonName implements Serializable {
116116
@SensitiveData
117117
private String lastName;
118118

119+
public PersonName() {
120+
}
121+
119122
public PersonName(String firstName, String lastName) {
120123
this.firstName = firstName;
121124
this.lastName = lastName;

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
@@ -1366,6 +1366,7 @@ public interface Captions {
13661366
String SormasToSormasOptions_pseudonymizePersonalData = "SormasToSormasOptions.pseudonymizePersonalData";
13671367
String SormasToSormasOptions_pseudonymizeSensitiveData = "SormasToSormasOptions.pseudonymizeSensitiveData";
13681368
String SormasToSormasOptions_withAssociatedContacts = "SormasToSormasOptions.withAssociatedContacts";
1369+
String SormasToSormasOptions_withSamples = "SormasToSormasOptions.withSamples";
13691370
String sormasToSormasSentFrom = "sormasToSormasSentFrom";
13701371
String sormasToSormasShare = "sormasToSormasShare";
13711372
String sormasToSormasSharedBy = "sormasToSormasSharedBy";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public interface Validations {
8585
String sormasToSormasContactCaseNotExists = "sormasToSormasContactCaseNotExists";
8686
String sormasToSormasContactExists = "sormasToSormasContactExists";
8787
String sormasToSormasOrganizationIdMissing = "sormasToSormasOrganizationIdMissing";
88+
String sormasToSormasSampleExists = "sormasToSormasSampleExists";
8889
String sormasToSormasSenderNameMissing = "sormasToSormasSenderNameMissing";
8990
String sormasToSormasShareInfoMissing = "sormasToSormasShareInfoMissing";
9091
String specifyFirstName = "specifyFirstName";

sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleDto.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import de.symeda.sormas.api.contact.ContactReferenceDto;
2626
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
2727
import de.symeda.sormas.api.facility.FacilityReferenceDto;
28+
import de.symeda.sormas.api.sormastosormas.SormasToSormasOriginInfoDto;
2829
import de.symeda.sormas.api.user.UserReferenceDto;
2930
import de.symeda.sormas.api.utils.DataHelper;
3031
import de.symeda.sormas.api.utils.Required;
@@ -117,6 +118,9 @@ public class SampleDto extends PseudonymizableDto {
117118
private String requestedOtherPathogenTests;
118119
private String requestedOtherAdditionalTests;
119120

121+
private SormasToSormasOriginInfoDto sormasToSormasOriginInfo;
122+
private boolean ownershipHandedOver;
123+
120124
@ImportIgnore
121125
public CaseReferenceDto getAssociatedCase() {
122126
return associatedCase;
@@ -367,6 +371,22 @@ public void setRequestedOtherAdditionalTests(String requestedOtherAdditionalTest
367371
this.requestedOtherAdditionalTests = requestedOtherAdditionalTests;
368372
}
369373

374+
public SormasToSormasOriginInfoDto getSormasToSormasOriginInfo() {
375+
return sormasToSormasOriginInfo;
376+
}
377+
378+
public void setSormasToSormasOriginInfo(SormasToSormasOriginInfoDto sormasToSormasOriginInfo) {
379+
this.sormasToSormasOriginInfo = sormasToSormasOriginInfo;
380+
}
381+
382+
public boolean isOwnershipHandedOver() {
383+
return ownershipHandedOver;
384+
}
385+
386+
public void setOwnershipHandedOver(boolean ownershipHandedOver) {
387+
this.ownershipHandedOver = ownershipHandedOver;
388+
}
389+
370390
public static SampleDto build(UserReferenceDto userRef, CaseReferenceDto caseRef) {
371391

372392
final SampleDto sampleDto = getSampleDto(userRef);

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasCaseDto.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public class SormasToSormasCaseDto implements Serializable {
3030

3131
private CaseDataDto caze;
3232

33-
private List<AssociatedContactDto> associatedContacts;
33+
private List<SormasToSormasCaseDto.AssociatedContactDto> associatedContacts;
34+
35+
private List<SormasToSormasSampleDto> samples;
3436

3537
private SormasToSormasOriginInfoDto originInfo;
3638

@@ -51,14 +53,22 @@ public CaseDataDto getCaze() {
5153
return caze;
5254
}
5355

54-
public List<AssociatedContactDto> getAssociatedContacts() {
56+
public List<SormasToSormasCaseDto.AssociatedContactDto> getAssociatedContacts() {
5557
return associatedContacts;
5658
}
5759

58-
public void setAssociatedContacts(List<AssociatedContactDto> associatedContacts) {
60+
public void setAssociatedContacts(List<SormasToSormasCaseDto.AssociatedContactDto> associatedContacts) {
5961
this.associatedContacts = associatedContacts;
6062
}
6163

64+
public List<SormasToSormasSampleDto> getSamples() {
65+
return samples;
66+
}
67+
68+
public void setSamples(List<SormasToSormasSampleDto> samples) {
69+
this.samples = samples;
70+
}
71+
6272
public SormasToSormasOriginInfoDto getOriginInfo() {
6373
return originInfo;
6474
}

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasContactDto.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package de.symeda.sormas.api.sormastosormas;
1717

1818
import java.io.Serializable;
19+
import java.util.List;
1920

2021
import de.symeda.sormas.api.contact.ContactDto;
2122
import de.symeda.sormas.api.person.PersonDto;
@@ -28,12 +29,17 @@ public class SormasToSormasContactDto implements Serializable {
2829

2930
private ContactDto contact;
3031

32+
private List<SormasToSormasSampleDto> samples;
33+
34+
private SormasToSormasOriginInfoDto originInfo;
35+
3136
public SormasToSormasContactDto() {
3237
}
3338

34-
public SormasToSormasContactDto(PersonDto person, ContactDto contact) {
39+
public SormasToSormasContactDto(PersonDto person, ContactDto contact, SormasToSormasOriginInfoDto originInfo) {
3540
this.person = person;
3641
this.contact = contact;
42+
this.originInfo = originInfo;
3743
}
3844

3945
public PersonDto getPerson() {
@@ -43,4 +49,16 @@ public PersonDto getPerson() {
4349
public ContactDto getContact() {
4450
return contact;
4551
}
52+
53+
public List<SormasToSormasSampleDto> getSamples() {
54+
return samples;
55+
}
56+
57+
public void setSamples(List<SormasToSormasSampleDto> samples) {
58+
this.samples = samples;
59+
}
60+
61+
public SormasToSormasOriginInfoDto getOriginInfo() {
62+
return originInfo;
63+
}
4664
}

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasOptionsDto.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class SormasToSormasOptionsDto implements Serializable {
2828
public static final String COMMENT = "comment";
2929

3030
public static final String WITH_ASSOCIATED_CONTACTS = "withAssociatedContacts";
31+
public static final String WITH_SAMPLES = "withSamples";
3132

3233
private ServerAccessDataReferenceDto organization;
3334

@@ -41,6 +42,8 @@ public class SormasToSormasOptionsDto implements Serializable {
4142

4243
private boolean withAssociatedContacts;
4344

45+
private boolean withSamples;
46+
4447
public ServerAccessDataReferenceDto getOrganization() {
4548
return organization;
4649
}
@@ -88,4 +91,12 @@ public boolean isWithAssociatedContacts() {
8891
public void setWithAssociatedContacts(boolean withAssociatedContacts) {
8992
this.withAssociatedContacts = withAssociatedContacts;
9093
}
94+
95+
public boolean isWithSamples() {
96+
return withSamples;
97+
}
98+
99+
public void setWithSamples(boolean withSamples) {
100+
this.withSamples = withSamples;
101+
}
91102
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.sormastosormas;
17+
18+
import java.io.Serializable;
19+
import java.util.List;
20+
21+
import de.symeda.sormas.api.sample.AdditionalTestDto;
22+
import de.symeda.sormas.api.sample.PathogenTestDto;
23+
import de.symeda.sormas.api.sample.SampleDto;
24+
25+
public class SormasToSormasSampleDto implements Serializable {
26+
27+
private static final long serialVersionUID = 5867733293483599601L;
28+
29+
private SampleDto sample;
30+
31+
private List<PathogenTestDto> pathogenTests;
32+
33+
private List<AdditionalTestDto> additionalTests;
34+
35+
public SormasToSormasSampleDto() {
36+
}
37+
38+
public SormasToSormasSampleDto(SampleDto sample, List<PathogenTestDto> pathogenTests, List<AdditionalTestDto> additionalTests) {
39+
this.sample = sample;
40+
this.pathogenTests = pathogenTests;
41+
this.additionalTests = additionalTests;
42+
}
43+
44+
public SampleDto getSample() {
45+
return sample;
46+
}
47+
48+
public void setSample(SampleDto sample) {
49+
this.sample = sample;
50+
}
51+
52+
public List<PathogenTestDto> getPathogenTests() {
53+
return pathogenTests;
54+
}
55+
56+
public void setPathogenTests(List<PathogenTestDto> pathogenTests) {
57+
this.pathogenTests = pathogenTests;
58+
}
59+
60+
public List<AdditionalTestDto> getAdditionalTests() {
61+
return additionalTests;
62+
}
63+
64+
public void setAdditionalTests(List<AdditionalTestDto> additionalTests) {
65+
this.additionalTests = additionalTests;
66+
}
67+
}

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasShareInfoCriteria.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import de.symeda.sormas.api.BaseCriteria;
1919
import de.symeda.sormas.api.caze.CaseReferenceDto;
2020
import de.symeda.sormas.api.contact.ContactReferenceDto;
21+
import de.symeda.sormas.api.sample.SampleReferenceDto;
2122

2223
public class SormasToSormasShareInfoCriteria extends BaseCriteria {
2324

@@ -27,6 +28,8 @@ public class SormasToSormasShareInfoCriteria extends BaseCriteria {
2728

2829
private ContactReferenceDto contact;
2930

31+
private SampleReferenceDto sample;
32+
3033
public CaseReferenceDto getCaze() {
3134
return caze;
3235
}
@@ -46,4 +49,14 @@ public SormasToSormasShareInfoCriteria contact(ContactReferenceDto contact) {
4649

4750
return this;
4851
}
52+
53+
public SampleReferenceDto getSample() {
54+
return sample;
55+
}
56+
57+
public SormasToSormasShareInfoCriteria sample(SampleReferenceDto sample) {
58+
this.sample = sample;
59+
60+
return this;
61+
}
4962
}

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasShareInfoDto.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import de.symeda.sormas.api.EntityDto;
1919
import de.symeda.sormas.api.caze.CaseReferenceDto;
2020
import de.symeda.sormas.api.contact.ContactReferenceDto;
21+
import de.symeda.sormas.api.sample.SampleReferenceDto;
2122
import de.symeda.sormas.api.user.UserReferenceDto;
2223

2324
public class SormasToSormasShareInfoDto extends EntityDto {
@@ -26,6 +27,7 @@ public class SormasToSormasShareInfoDto extends EntityDto {
2627

2728
private CaseReferenceDto caze;
2829
private ContactReferenceDto contact;
30+
private SampleReferenceDto sample;
2931
private ServerAccessDataReferenceDto target;
3032
private UserReferenceDto sender;
3133
private boolean ownershipHandedOver;
@@ -47,6 +49,14 @@ public void setContact(ContactReferenceDto contact) {
4749
this.contact = contact;
4850
}
4951

52+
public SampleReferenceDto getSample() {
53+
return sample;
54+
}
55+
56+
public void setSample(SampleReferenceDto sample) {
57+
this.sample = sample;
58+
}
59+
5060
public ServerAccessDataReferenceDto getTarget() {
5161
return target;
5262
}

0 commit comments

Comments
 (0)