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

Commit 365cfec

Browse files
author
vlad-ciucescu
authored
Merge pull request SORMAS-Foundation#3496 from hzi-braunschweig/feat-3101-split-contact-address
SORMAS-Foundation#3101 split address into street, number, additional info in contacts view
2 parents 5bd1726 + 1d1ce61 commit 365cfec

4 files changed

Lines changed: 35 additions & 11 deletions

File tree

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

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public class ContactIndexDetailedDto extends ContactIndexDto {
2222
public static final String APPROXIMATE_AGE = "approximateAge";
2323
public static final String DISTRICT_NAME = "districtName";
2424
public static final String CITY = "city";
25-
public static final String ADDRESS = "address";
25+
public static final String STREET = "street";
26+
public static final String HOUSE_NUMBER = "houseNumber";
27+
public static final String ADDITIONAL_INFORMATION = "additionalInformation";
2628
public static final String POSTAL_CODE = "postalCode";
2729
public static final String PHONE = "phone";
2830
public static final String REPORTING_USER = "reportingUser";
@@ -37,7 +39,13 @@ public class ContactIndexDetailedDto extends ContactIndexDto {
3739
private String city;
3840
@PersonalData
3941
@SensitiveData
40-
private String address;
42+
private String street;
43+
@PersonalData
44+
@SensitiveData
45+
private String houseNumber;
46+
@PersonalData
47+
@SensitiveData
48+
private String additionalInformation;
4149
@PersonalData
4250
@SensitiveData
4351
@Pseudonymizer(PostalCodePseudonymizer.class)
@@ -59,7 +67,7 @@ public ContactIndexDetailedDto(String uuid, String personFirstName, String perso
5967
String caseReportingUserUid, String caseRegionUuid, String caseDistrictUud, String caseCommunityUuid,
6068
String caseHealthFacilityUuid, String casePointOfEntryUuid, Date changeDate, String externalID,
6169
Sex sex, Integer approximateAge, ApproximateAgeType approximateAgeType,
62-
String districtName, String city, String street, String houseNumber, String postalCode, String phone,
70+
String districtName, String city, String street, String houseNumber, String additionalInformation, String postalCode, String phone,
6371
String reportingUserFirstName, String reportingUserLastName, int visitCount, long eventCount
6472
) {
6573
//@formatter:on
@@ -75,7 +83,9 @@ public ContactIndexDetailedDto(String uuid, String personFirstName, String perso
7583
this.approximateAge = ApproximateAgeType.ApproximateAgeHelper.formatApproximateAge(approximateAge, approximateAgeType);
7684
this.districtName = districtName;
7785
this.city = city;
78-
this.address = LocationDto.buildStreetAndHouseNumberCaption(street, houseNumber);
86+
this.street = street;
87+
this.houseNumber = houseNumber;
88+
this.additionalInformation = additionalInformation;
7989
this.postalCode = postalCode;
8090
this.phone = phone;
8191
this.reportingUser = new UserReferenceDto(reportingUserUuid, reportingUserFirstName, reportingUserLastName, null);
@@ -98,8 +108,16 @@ public String getCity() {
98108
return city;
99109
}
100110

101-
public String getAddress() {
102-
return address;
111+
public String getStreet() {
112+
return street;
113+
}
114+
115+
public String getHouseNumber() {
116+
return houseNumber;
117+
}
118+
119+
public String getAdditionalInformation() {
120+
return additionalInformation;
103121
}
104122

105123
public String getPostalCode() {

sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactListCriteriaBuilder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ private List<Selection<?>> getContactIndexDetailedSelections(Root<Contact> conta
178178
joins.getAddress().get(Location.CITY),
179179
joins.getAddress().get(Location.STREET),
180180
joins.getAddress().get(Location.HOUSE_NUMBER),
181+
joins.getAddress().get(Location.ADDITIONAL_INFORMATION),
181182
joins.getAddress().get(Location.POSTAL_CODE),
182183
joins.getPerson().get(Person.PHONE),
183184
joins.getReportingUser().get(User.FIRST_NAME),
@@ -196,10 +197,11 @@ private List<Expression<?>> getIndexDetailOrders(SortProperty sortProperty, Root
196197
case ContactIndexDetailedDto.DISTRICT_NAME:
197198
return Collections.singletonList(joins.getDistrict().get(District.NAME));
198199
case ContactIndexDetailedDto.CITY:
200+
case ContactIndexDetailedDto.STREET:
201+
case ContactIndexDetailedDto.HOUSE_NUMBER:
202+
case ContactIndexDetailedDto.ADDITIONAL_INFORMATION:
199203
case ContactIndexDetailedDto.POSTAL_CODE:
200204
return Collections.singletonList(joins.getAddress().get(sortProperty.propertyName));
201-
case ContactIndexDetailedDto.ADDRESS:
202-
return Collections.singletonList(joins.getAddress().get(Location.STREET));
203205
case ContactIndexDetailedDto.REPORTING_USER:
204206
return Arrays.asList(joins.getReportingUser().get(User.FIRST_NAME), joins.getReportingUser().get(User.LAST_NAME));
205207
default:

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseGridDetailed.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ protected Stream<String> getPersonColumns() {
4848
return Stream.concat(
4949
super.getPersonColumns(),
5050
Stream.of(
51-
CaseIndexDetailedDto.AGE_AND_BIRTH_DATE,
5251
CaseIndexDetailedDto.SEX,
52+
CaseIndexDetailedDto.AGE_AND_BIRTH_DATE,
5353
CaseIndexDetailedDto.CITY,
5454
CaseIndexDetailedDto.STREET,
5555
CaseIndexDetailedDto.HOUSE_NUMBER,

sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactGridDetailed.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ protected Stream<String> getPersonColumns() {
4646
ContactIndexDetailedDto.APPROXIMATE_AGE,
4747
ContactIndexDetailedDto.DISTRICT_NAME,
4848
ContactIndexDetailedDto.CITY,
49-
ContactIndexDetailedDto.ADDRESS,
49+
ContactIndexDetailedDto.STREET,
50+
ContactIndexDetailedDto.HOUSE_NUMBER,
51+
ContactIndexDetailedDto.ADDITIONAL_INFORMATION,
5052
ContactIndexDetailedDto.POSTAL_CODE,
5153
ContactIndexDetailedDto.PHONE));
5254
}
@@ -66,7 +68,9 @@ protected void initColumns() {
6668
getColumn(ContactIndexDetailedDto.APPROXIMATE_AGE).setWidth(50);
6769
getColumn(ContactIndexDetailedDto.DISTRICT_NAME).setWidth(150);
6870
getColumn(ContactIndexDetailedDto.CITY).setWidth(150);
69-
getColumn(ContactIndexDetailedDto.ADDRESS).setWidth(200);
71+
getColumn(ContactIndexDetailedDto.STREET).setWidth(150);
72+
getColumn(ContactIndexDetailedDto.HOUSE_NUMBER).setWidth(50);
73+
getColumn(ContactIndexDetailedDto.ADDITIONAL_INFORMATION).setWidth(200);
7074
getColumn(ContactIndexDetailedDto.POSTAL_CODE).setWidth(100);
7175
getColumn(ContactIndexDetailedDto.PHONE).setWidth(100);
7276
((Column<ContactIndexDetailedDto, CaseReferenceDto>) getColumn(ContactIndexDetailedDto.CAZE)).setWidth(150)

0 commit comments

Comments
 (0)