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

Commit b02210f

Browse files
lgallgal
authored andcommitted
SORMAS-Foundation#3210 sormas to sormas transfer samples backend
1 parent 8840a0c commit b02210f

22 files changed

Lines changed: 700 additions & 83 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
@@ -1344,6 +1344,7 @@ public interface Captions {
13441344
String SormasToSormasOptions_pseudonymizePersonalData = "SormasToSormasOptions.pseudonymizePersonalData";
13451345
String SormasToSormasOptions_pseudonymizeSensitiveData = "SormasToSormasOptions.pseudonymizeSensitiveData";
13461346
String SormasToSormasOptions_withAssociatedContacts = "SormasToSormasOptions.withAssociatedContacts";
1347+
String SormasToSormasOptions_withSamples = "SormasToSormasOptions.withSamples";
13471348
String sormasToSormasSentFrom = "sormasToSormasSentFrom";
13481349
String sormasToSormasShare = "sormasToSormasShare";
13491350
String sormasToSormasSharedBy = "sormasToSormasSharedBy";

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

Lines changed: 11 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,8 @@ public class SampleDto extends PseudonymizableDto {
117118
private String requestedOtherPathogenTests;
118119
private String requestedOtherAdditionalTests;
119120

121+
private SormasToSormasOriginInfoDto sormasToSormasOriginInfo;
122+
120123
@ImportIgnore
121124
public CaseReferenceDto getAssociatedCase() {
122125
return associatedCase;
@@ -367,6 +370,14 @@ public void setRequestedOtherAdditionalTests(String requestedOtherAdditionalTest
367370
this.requestedOtherAdditionalTests = requestedOtherAdditionalTests;
368371
}
369372

373+
public SormasToSormasOriginInfoDto getSormasToSormasOriginInfo() {
374+
return sormasToSormasOriginInfo;
375+
}
376+
377+
public void setSormasToSormasOriginInfo(SormasToSormasOriginInfoDto sormasToSormasOriginInfo) {
378+
this.sormasToSormasOriginInfo = sormasToSormasOriginInfo;
379+
}
380+
370381
public static SampleDto build(UserReferenceDto userRef, CaseReferenceDto caseRef) {
371382

372383
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
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,6 +1893,7 @@ WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports
18931893
# SORMAS to SORMAS
18941894
SormasToSormasOptions.organization=Orgainzation
18951895
SormasToSormasOptions.withAssociatedContacts=Share associated contacts
1896+
SormasToSormasOptions.withSamples=Share samples
18961897
SormasToSormasOptions.handOverOwnership=Hand over the ownership
18971898
SormasToSormasOptions.pseudonymizePersonalData=Pseudonymize personal data
18981899
SormasToSormasOptions.pseudonymizeSensitiveData=Pseudonymize sensitive data

0 commit comments

Comments
 (0)