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

Commit 550332a

Browse files
lgallgal
authored andcommitted
SORMAS-Foundation#3416 add nosocomial outbreak and infection setting to cases
1 parent 69aba83 commit 550332a

17 files changed

Lines changed: 234 additions & 1 deletion

File tree

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ public class CaseDataDto extends PseudonymizableDto {
165165
public static final String END_OF_ISOLATION_REASON = "endOfIsolationReason";
166166
public static final String END_OF_ISOLATION_REASON_DETAILS = "endOfIsolationReasonDetails";
167167

168+
public static final String NOSOCOMIAL_OUTBREAK = "nosocomialOutbreak";
169+
public static final String INFECTION_SETTING = "infectionSetting";
170+
168171
// Fields are declared in the order they should appear in the import template
169172

170173
@Outbreaks
@@ -443,6 +446,10 @@ public class CaseDataDto extends PseudonymizableDto {
443446
@HideForCountriesExcept(countries = COUNTRY_CODE_SWITZERLAND)
444447
@SensitiveData
445448
private String endOfIsolationReasonDetails;
449+
@HideForCountriesExcept
450+
private boolean nosocomialOutbreak;
451+
@HideForCountriesExcept
452+
private InfectionSetting infectionSetting;
446453

447454
public static CaseDataDto build(PersonReferenceDto person, Disease disease) {
448455
return build(person, disease, null);
@@ -1288,6 +1295,22 @@ public void setEndOfIsolationReasonDetails(String endOfIsolationReasonDetails) {
12881295
this.endOfIsolationReasonDetails = endOfIsolationReasonDetails;
12891296
}
12901297

1298+
public boolean isNosocomialOutbreak() {
1299+
return nosocomialOutbreak;
1300+
}
1301+
1302+
public void setNosocomialOutbreak(boolean nosocomialOutbreak) {
1303+
this.nosocomialOutbreak = nosocomialOutbreak;
1304+
}
1305+
1306+
public InfectionSetting getInfectionSetting() {
1307+
return infectionSetting;
1308+
}
1309+
1310+
public void setInfectionSetting(InfectionSetting infectionSetting) {
1311+
this.infectionSetting = infectionSetting;
1312+
}
1313+
12911314
public SormasToSormasOriginInfoDto getSormasToSormasOriginInfo() {
12921315
return sormasToSormasOriginInfo;
12931316
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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.caze;
17+
18+
import de.symeda.sormas.api.i18n.I18nProperties;
19+
20+
public enum InfectionSetting {
21+
22+
UNKNOWN(null),
23+
AMBULANT(null),
24+
MEDICAL_PRACTICE(AMBULANT),
25+
OPERATIVE_1200(AMBULANT),
26+
HOSPITAL_1300(AMBULANT),
27+
OTHER_OUTPATIENT_FACILITY(AMBULANT),
28+
STATIONARY(null),
29+
HOSPITAL_2100(STATIONARY),
30+
NORMAL_WARD(HOSPITAL_2100),
31+
OPERATIVE_2111(NORMAL_WARD),
32+
NOT_OPERATIVE(NORMAL_WARD),
33+
HEMATOLOGICAL_ONCOLOGY(NORMAL_WARD),
34+
CHILDREN_WARD(HOSPITAL_2100),
35+
NEONATOLOGY(HOSPITAL_2100),
36+
INTENSIVE_CARE_UNIT(HOSPITAL_2100),
37+
OTHER_STATION(HOSPITAL_2100),
38+
NURSING_HOME(STATIONARY),
39+
REHAB_FACILITY(STATIONARY),
40+
OTHER_STATIONARY_FACILITY(STATIONARY);
41+
42+
private final InfectionSetting parent;
43+
44+
InfectionSetting(InfectionSetting parent) {
45+
this.parent = parent;
46+
}
47+
48+
public InfectionSetting getParent() {
49+
return this.parent;
50+
}
51+
52+
public String toString() {
53+
String caption = I18nProperties.getEnumCaption(this);
54+
if (this.parent != null) {
55+
caption = this.parent.toString() + " / " + caption;
56+
}
57+
58+
return caption;
59+
}
60+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ public interface Captions {
222222
String CaseData_healthFacilityDetails = "CaseData.healthFacilityDetails";
223223
String CaseData_healthFacilityName = "CaseData.healthFacilityName";
224224
String CaseData_hospitalization = "CaseData.hospitalization";
225+
String CaseData_infectionSetting = "CaseData.infectionSetting";
225226
String CaseData_investigatedDate = "CaseData.investigatedDate";
226227
String CaseData_investigationStatus = "CaseData.investigationStatus";
227228
String CaseData_laboratoryDiagnosticConfirmation = "CaseData.laboratoryDiagnosticConfirmation";
@@ -231,6 +232,7 @@ public interface Captions {
231232
String CaseData_maternalHistory = "CaseData.maternalHistory";
232233
String CaseData_nationalLevelDate = "CaseData.nationalLevelDate";
233234
String CaseData_noneHealthFacilityDetails = "CaseData.noneHealthFacilityDetails";
235+
String CaseData_nosocomialOutbreak = "CaseData.nosocomialOutbreak";
234236
String CaseData_notifyingClinic = "CaseData.notifyingClinic";
235237
String CaseData_notifyingClinicDetails = "CaseData.notifyingClinicDetails";
236238
String CaseData_numberOfVisits = "CaseData.numberOfVisits";

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ CaseData.quarantineReasonBeforeIsolationDetails=Other reason
393393
CaseData.endOfIsolationReason=Reason for end of isolation
394394
CaseData.endOfIsolationReasonDetails=Other reason
395395
CaseData.sormasToSormasOriginInfo=Shared by
396+
CaseData.nosocomialOutbreak=Nosocomial outbreak
397+
CaseData.infectionSetting=Infection setting
396398

397399
# CaseExport
398400
CaseExport.address=Address

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ CaseData.quarantineReasonBeforeIsolationDetails=Anderer Grund
390390
CaseData.endOfIsolationReason=Grund für das Ende der Isolation
391391
CaseData.endOfIsolationReasonDetails=Anderer Grund
392392
CaseData.sormasToSormasOriginInfo=Geteilt von
393+
CaseData.nosocomialOutbreak=Nosocomialer Ausbruch
394+
CaseData.infectionSetting=Infektionsumfeld
393395

394396
# CaseExport
395397
CaseExport.address=Adresse

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,3 +1214,23 @@ EndOfQuarantineReason.ASYMPTOMATIC=Asymptomatic after 10 days
12141214
EndOfQuarantineReason.ISOLATED_AS_CASE=Isolated as Case
12151215
EndOfQuarantineReason.LOST_TO_FOLLOWUP=Lost to follow-up
12161216
EndOfQuarantineReason.OTHER=Other
1217+
1218+
InfectionSetting.UNKNOWN=Unknown
1219+
InfectionSetting.AMBULANT=Ambulant
1220+
InfectionSetting.MEDICAL_PRACTICE=Medical practice
1221+
InfectionSetting.OPERATIVE_1200=Operative
1222+
InfectionSetting.HOSPITAL_1300=Hospital
1223+
InfectionSetting.OTHER_OUTPATIENT_FACILITY=Other outpatient facility
1224+
InfectionSetting.STATIONARY=In-patient
1225+
InfectionSetting.HOSPITAL_2100=Hospital
1226+
InfectionSetting.NORMAL_WARD=Normal ward
1227+
InfectionSetting.OPERATIVE_2111=Operative
1228+
InfectionSetting.NOT_OPERATIVE=Non-operative
1229+
InfectionSetting.HEMATOLOGICAL_ONCOLOGY=Hematological oncology
1230+
InfectionSetting.CHILDREN_WARD=Children's ward
1231+
InfectionSetting.NEONATOLOGY=Neonatology
1232+
InfectionSetting.INTENSIVE_CARE_UNIT=Intensive Care Unit
1233+
InfectionSetting.OTHER_STATION=Other station
1234+
InfectionSetting.NURSING_HOME=Nursing home
1235+
InfectionSetting.REHAB_FACILITY=Rehab facility
1236+
InfectionSetting.OTHER_STATIONARY_FACILITY=Other in-patient facililty

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,3 +1209,23 @@ EndOfQuarantineReason.ASYMPTOMATIC=Asymptomatisch nach 10 Tagen
12091209
EndOfQuarantineReason.ISOLATED_AS_CASE=Als Fall isoliert
12101210
EndOfQuarantineReason.LOST_TO_FOLLOWUP=Keine Nachverfolgung möglich
12111211
EndOfQuarantineReason.OTHER=Sonstiges
1212+
1213+
InfectionSetting.UNKNOWN=Nicht erhoben
1214+
InfectionSetting.AMBULANT=Ambulant
1215+
InfectionSetting.MEDICAL_PRACTICE=Arztpraxis
1216+
InfectionSetting.OPERATIVE_1200=Operativ
1217+
InfectionSetting.HOSPITAL_1300=Krankenhaus
1218+
InfectionSetting.OTHER_OUTPATIENT_FACILITY=Sonstige Ambulante Einrichtung
1219+
InfectionSetting.STATIONARY=Stationär
1220+
InfectionSetting.HOSPITAL_2100=Krankenhaus
1221+
InfectionSetting.NORMAL_WARD=Normalstation
1222+
InfectionSetting.OPERATIVE_2111=Operativ
1223+
InfectionSetting.NOT_OPERATIVE=Nicht Operativ
1224+
InfectionSetting.HEMATOLOGICAL_ONCOLOGY=Hamatoonkologie
1225+
InfectionSetting.CHILDREN_WARD=Kinderstation
1226+
InfectionSetting.NEONATOLOGY=Neonatologie
1227+
InfectionSetting.INTENSIVE_CARE_UNIT=Intensivstation
1228+
InfectionSetting.OTHER_STATION=Sonstige Station
1229+
InfectionSetting.NURSING_HOME=Pflege Einrichtung
1230+
InfectionSetting.REHAB_FACILITY=Reha-Einrichtung
1231+
InfectionSetting.OTHER_STATIONARY_FACILITY=Sonstige Stationare Einrichtung

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/Case.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import de.symeda.sormas.api.caze.DengueFeverType;
3939
import de.symeda.sormas.api.caze.EndOfIsolationReason;
4040
import de.symeda.sormas.api.caze.HospitalWardType;
41+
import de.symeda.sormas.api.caze.InfectionSetting;
4142
import de.symeda.sormas.api.caze.InvestigationStatus;
4243
import de.symeda.sormas.api.caze.PlagueType;
4344
import de.symeda.sormas.api.caze.QuarantineReason;
@@ -333,6 +334,10 @@ public class Case extends PseudonymizableAdo {
333334
private EndOfIsolationReason endOfIsolationReason;
334335
@Column(length = COLUMN_LENGTH_DEFAULT)
335336
private String endOfIsolationReasonDetails;
337+
@DatabaseField
338+
private boolean nosocomialOutbreak;
339+
@Enumerated(EnumType.STRING)
340+
private InfectionSetting infectionSetting;
336341

337342
@DatabaseField(foreign = true, foreignAutoRefresh = true)
338343
private SormasToSormasOriginInfo sormasToSormasOriginInfo;
@@ -1103,6 +1108,22 @@ public void setEndOfIsolationReasonDetails(String endOfIsolationReasonDetails) {
11031108
this.endOfIsolationReasonDetails = endOfIsolationReasonDetails;
11041109
}
11051110

1111+
public boolean isNosocomialOutbreak() {
1112+
return nosocomialOutbreak;
1113+
}
1114+
1115+
public void setNosocomialOutbreak(boolean nosocomialOutbreak) {
1116+
this.nosocomialOutbreak = nosocomialOutbreak;
1117+
}
1118+
1119+
public InfectionSetting getInfectionSetting() {
1120+
return infectionSetting;
1121+
}
1122+
1123+
public void setInfectionSetting(InfectionSetting infectionSetting) {
1124+
this.infectionSetting = infectionSetting;
1125+
}
1126+
11061127
public SormasToSormasOriginInfo getSormasToSormasOriginInfo() {
11071128
return sormasToSormasOriginInfo;
11081129
}

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/CaseDtoHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ public void fillInnerFromDto(Case target, CaseDataDto source) {
196196
target.setQuarantineReasonBeforeIsolationDetails(source.getQuarantineReasonBeforeIsolationDetails());
197197
target.setEndOfIsolationReason(source.getEndOfIsolationReason());
198198
target.setEndOfIsolationReasonDetails(source.getEndOfIsolationReasonDetails());
199+
target.setNosocomialOutbreak(source.isNosocomialOutbreak());
200+
target.setInfectionSetting(source.getInfectionSetting());
199201

200202
target.setSormasToSormasOriginInfo(
201203
sormasToSormasOriginInfoDtoHelper.fillOrCreateFromDto(target.getSormasToSormasOriginInfo(), source.getSormasToSormasOriginInfo()));
@@ -399,6 +401,8 @@ public void fillInnerFromAdo(CaseDataDto target, Case source) {
399401
target.setQuarantineReasonBeforeIsolationDetails(source.getQuarantineReasonBeforeIsolationDetails());
400402
target.setEndOfIsolationReason(source.getEndOfIsolationReason());
401403
target.setEndOfIsolationReasonDetails(source.getEndOfIsolationReasonDetails());
404+
target.setNosocomialOutbreak(source.isNosocomialOutbreak());
405+
target.setInfectionSetting(source.getInfectionSetting());
402406

403407
if (source.getSormasToSormasOriginInfo() != null) {
404408
target.setSormasToSormasOriginInfo(sormasToSormasOriginInfoDtoHelper.adoToDto(source.getSormasToSormasOriginInfo()));

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

Lines changed: 7 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 = 247;
155+
public static final int DATABASE_VERSION = 249;
156156

157157
private static DatabaseHelper instance = null;
158158

@@ -1779,6 +1779,12 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
17791779
getDao(Contact.class).executeRaw("ALTER TABLE contacts ADD column multidaycontact boolean default false;");
17801780
getDao(Contact.class).executeRaw("ALTER TABLE contacts ADD column firstcontactdate timestamp;");
17811781

1782+
case 248:
1783+
currentVersion = 248;
1784+
1785+
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN nosocomialOutbreak boolean DEFAULT false");
1786+
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN infectionSetting varchar(255)");
1787+
17821788
// ATTENTION: break should only be done after last version
17831789
break;
17841790
default:

0 commit comments

Comments
 (0)