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

Commit d05ea4f

Browse files
Merge pull request SORMAS-Foundation#3670 from hzi-braunschweig/3413_add-name-of-other-guardian-to-person
SORMAS-Foundation#3413 add name of other guardians to person
2 parents 35669a2 + 1ac4af1 commit d05ea4f

13 files changed

Lines changed: 74 additions & 4 deletions

File tree

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
@@ -1136,6 +1136,7 @@ public interface Captions {
11361136
String Person_matchingCase = "Person.matchingCase";
11371137
String Person_mothersMaidenName = "Person.mothersMaidenName";
11381138
String Person_mothersName = "Person.mothersName";
1139+
String Person_namesOfOtherGuardians = "Person.namesOfOtherGuardians";
11391140
String Person_nationalHealthId = "Person.nationalHealthId";
11401141
String Person_nickname = "Person.nickname";
11411142
String Person_occupationCommunity = "Person.occupationCommunity";

sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public class PersonDto extends PseudonymizableDto {
8787

8888
public static final String FATHERS_NAME = "fathersName";
8989
public static final String MOTHERS_NAME = "mothersName";
90+
public static final String NAMES_OF_OTHER_GUARDIANS = "namesOfOtherGuardians";
9091
public static final String PLACE_OF_BIRTH_REGION = "placeOfBirthRegion";
9192
public static final String PLACE_OF_BIRTH_DISTRICT = "placeOfBirthDistrict";
9293
public static final String PLACE_OF_BIRTH_COMMUNITY = "placeOfBirthCommunity";
@@ -132,6 +133,10 @@ public class PersonDto extends PseudonymizableDto {
132133
@PersonalData
133134
@SensitiveData
134135
private String fathersName;
136+
@PersonalData
137+
@SensitiveData
138+
@HideForCountriesExcept
139+
private String namesOfOtherGuardians;
135140
@Outbreaks
136141
private Sex sex;
137142
@Outbreaks
@@ -526,6 +531,14 @@ public void setFathersName(String fathersName) {
526531
this.fathersName = fathersName;
527532
}
528533

534+
public String getNamesOfOtherGuardians() {
535+
return namesOfOtherGuardians;
536+
}
537+
538+
public void setNamesOfOtherGuardians(String namesOfOtherGuardians) {
539+
this.namesOfOtherGuardians = namesOfOtherGuardians;
540+
}
541+
529542
public RegionReferenceDto getPlaceOfBirthRegion() {
530543
return placeOfBirthRegion;
531544
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,7 @@ Person.districtName=District
12401240
Person.educationType=Education
12411241
Person.educationDetails=Details
12421242
Person.fathersName=Father's name
1243+
Person.namesOfOtherGuardians=Names of other guardians
12431244
Person.gestationAgeAtBirth=Gestation age at birth (weeks)
12441245
Person.healthcare.occupationDetails=Position
12451246
Person.lastDisease=Last disease

sormas-api/src/main/resources/captions_de-DE.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,7 @@ Person.districtName=Landkreis/Kreisfreie Stadt
12361236
Person.educationType=Bildung
12371237
Person.educationDetails=Details
12381238
Person.fathersName=Name des Vaters
1239+
Person.namesOfOtherGuardians=Andere/r Erziehungsberechtigte/r
12391240
Person.gestationAgeAtBirth=Gestationsalter bei der Geburt (Wochen)
12401241
Person.healthcare.occupationDetails=Position
12411242
Person.lastDisease=Letzte Krankheit

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
152152
public static final String DATABASE_NAME = "sormas.db";
153153
// any time you make changes to your database objects, you may have to increase the database version
154154

155-
public static final int DATABASE_VERSION = 250;
155+
public static final int DATABASE_VERSION = 251;
156156

157157
private static DatabaseHelper instance = null;
158158

@@ -1789,6 +1789,13 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
17891789
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN nosocomialOutbreak boolean DEFAULT false");
17901790
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN infectionSetting varchar(255)");
17911791

1792+
break;
1793+
1794+
case 250:
1795+
currentVersion = 248;
1796+
1797+
getDao(Person.class).executeRaw("ALTER TABLE person ADD column namesOfOtherGuardians varchar(512);");
1798+
17921799
// ATTENTION: break should only be done after last version
17931800
break;
17941801
default:

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/Person.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public class Person extends PseudonymizableAdo {
8282
private String mothersName;
8383
@Column(length = COLUMN_LENGTH_DEFAULT)
8484
private String fathersName;
85+
@Column(length = COLUMN_LENGTH_DEFAULT)
86+
private String namesOfOtherGuardians;
8587
@Column
8688
private Integer birthdateDD;
8789
@Column
@@ -439,6 +441,14 @@ public void setFathersName(String fathersName) {
439441
this.fathersName = fathersName;
440442
}
441443

444+
public String getNamesOfOtherGuardians() {
445+
return namesOfOtherGuardians;
446+
}
447+
448+
public void setNamesOfOtherGuardians(String namesOfOtherGuardians) {
449+
this.namesOfOtherGuardians = namesOfOtherGuardians;
450+
}
451+
442452
public Region getPlaceOfBirthRegion() {
443453
return placeOfBirthRegion;
444454
}

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/PersonDtoHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public void fillInnerFromDto(Person target, PersonDto source) {
103103
target.setCauseOfDeathDetails(source.getCauseOfDeathDetails());
104104
target.setMothersName(source.getMothersName());
105105
target.setFathersName(source.getFathersName());
106+
target.setNamesOfOtherGuardians(source.getNamesOfOtherGuardians());
106107
target.setPlaceOfBirthRegion(DatabaseHelper.getRegionDao().getByReferenceDto(source.getPlaceOfBirthRegion()));
107108
target.setPlaceOfBirthDistrict(DatabaseHelper.getDistrictDao().getByReferenceDto(source.getPlaceOfBirthDistrict()));
108109
target.setPlaceOfBirthCommunity(DatabaseHelper.getCommunityDao().getByReferenceDto(source.getPlaceOfBirthCommunity()));
@@ -173,6 +174,7 @@ public void fillInnerFromAdo(PersonDto target, Person source) {
173174

174175
target.setMothersName(source.getMothersName());
175176
target.setFathersName(source.getFathersName());
177+
target.setNamesOfOtherGuardians(source.getNamesOfOtherGuardians());
176178

177179
if (source.getPlaceOfBirthRegion() != null) {
178180
target.setPlaceOfBirthRegion(

sormas-app/app/src/main/res/layout/fragment_person_edit_layout.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,20 @@
484484

485485
<de.symeda.sormas.app.component.controls.ControlTextEditField
486486
android:id="@+id/person_fathersName"
487-
android:nextFocusForward="@+id/person_phone"
487+
android:nextFocusForward="@+id/person_namesOfOtherGuardians"
488488
app:value="@={data.fathersName}"
489489
app:imeOptions="actionNext"
490490
style="@style/ControlSecondOfTwoColumnsStyle" />
491491

492492
</LinearLayout>
493493

494+
<de.symeda.sormas.app.component.controls.ControlTextEditField
495+
android:id="@+id/person_namesOfOtherGuardians"
496+
android:nextFocusForward="@+id/person_phone"
497+
app:value="@={data.namesOfOtherGuardians}"
498+
app:imeOptions="actionNext"
499+
style="@style/ControlSingleColumnStyle" />
500+
494501
<LinearLayout
495502
android:layout_width="match_parent"
496503
android:layout_height="wrap_content"

sormas-app/app/src/main/res/layout/fragment_person_read_layout.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,11 @@
370370

371371
</LinearLayout>
372372

373+
<de.symeda.sormas.app.component.controls.ControlTextReadField
374+
android:id="@+id/person_namesOfOtherGuardians"
375+
app:value="@{data.namesOfOtherGuardians}"
376+
style="@style/ControlSingleColumnStyle" />
377+
373378
<LinearLayout
374379
android:layout_width="match_parent"
375380
android:layout_height="wrap_content"

sormas-backend/src/main/java/de/symeda/sormas/backend/person/Person.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public class Person extends AbstractDomainObject {
128128
private String mothersName;
129129
private String mothersMaidenName;
130130
private String fathersName;
131+
private String namesOfOtherGuardians;
131132

132133
private Integer approximateAge;
133134
private ApproximateAgeType approximateAgeType;
@@ -460,6 +461,15 @@ public void setFathersName(String fathersName) {
460461
this.fathersName = fathersName;
461462
}
462463

464+
@Column(length = COLUMN_LENGTH_DEFAULT)
465+
public String getNamesOfOtherGuardians() {
466+
return namesOfOtherGuardians;
467+
}
468+
469+
public void setNamesOfOtherGuardians(String namesOfOtherGuardians) {
470+
this.namesOfOtherGuardians = namesOfOtherGuardians;
471+
}
472+
463473
@ManyToOne(cascade = {})
464474
public Region getPlaceOfBirthRegion() {
465475
return placeOfBirthRegion;

0 commit comments

Comments
 (0)