diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java
index bb44c437f1d..b14cd329c87 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java
@@ -128,6 +128,8 @@ public class CaseDataDto extends EntityDto {
public static final String QUARANTINE_HOME_SUPPLY_ENSURED = "quarantineHomeSupplyEnsured";
public static final String QUARANTINE_HOME_SUPPLY_ENSURED_COMMENT = "quarantineHomeSupplyEnsuredComment";
public static final String REPORTING_TYPE = "reportingType";
+ public static final String POSTPARTUM = "postpartum";
+ public static final String TRIMESTER = "trimester";
// Fields are declared in the order they should appear in the import template
@@ -256,6 +258,8 @@ public class CaseDataDto extends EntityDto {
private YesNoUnknown quarantineHomeSupplyEnsured;
private String quarantineHomeSupplyEnsuredComment;
private ReportingType reportingType;
+ private YesNoUnknown postpartum;
+ private Trimester trimester;
public static CaseDataDto build(PersonReferenceDto person, Disease disease) {
CaseDataDto caze = new CaseDataDto();
@@ -899,4 +903,20 @@ public ReportingType getReportingType() {
public void setReportingType(ReportingType reportingType) {
this.reportingType = reportingType;
}
+
+ public YesNoUnknown getPostpartum() {
+ return postpartum;
+ }
+
+ public void setPostpartum(YesNoUnknown postpartum) {
+ this.postpartum = postpartum;
+ }
+
+ public Trimester getTrimester() {
+ return trimester;
+ }
+
+ public void setTrimester(Trimester trimester) {
+ this.trimester = trimester;
+ }
}
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseExportDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseExportDto.java
index 964dae5a29a..e6dd585ca4b 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseExportDto.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseExportDto.java
@@ -161,6 +161,9 @@ public class CaseExportDto implements Serializable {
private Date quarantineFrom;
private Date quarantineTo;
+ private YesNoUnknown postpartum;
+ private Trimester trimester;
+
public CaseExportDto(long id, long personId, long personAddressId, long epiDataId, long symptomsId,
long hospitalizationId, long districtId, long healthConditionsId, String uuid, String epidNumber,
Disease disease, String diseaseDetails, String firstName, String lastName, Sex sex, YesNoUnknown pregnant,
@@ -180,7 +183,8 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
String occupationFacilityUuid, String occupationFacilityDetails, YesNoUnknown traveled,
YesNoUnknown burialAttended, YesNoUnknown directContactConfirmedCase, YesNoUnknown directContactProbableCase, YesNoUnknown contactWithRodent,
//Date onsetDate,
- Vaccination vaccination, String vaccinationDoses, Date vaccinationDate, VaccinationInfoSource vaccinationInfoSource) {
+ Vaccination vaccination, String vaccinationDoses, Date vaccinationDate,
+ VaccinationInfoSource vaccinationInfoSource, YesNoUnknown postpartum, Trimester trimester) {
this.id = id;
this.personId = personId;
this.personAddressId = personAddressId;
@@ -238,6 +242,8 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
this.vaccinationDoses = vaccinationDoses;
this.vaccinationDate = vaccinationDate;
this.vaccinationInfoSource = vaccinationInfoSource;
+ this.postpartum = postpartum;
+ this.trimester = trimester;
}
public CaseReferenceDto toReference() {
@@ -345,6 +351,22 @@ public YesNoUnknown getPregnant() {
}
@Order(14)
+ @ExportTarget(caseExportTypes = { CaseExportType.CASE_SURVEILLANCE, CaseExportType.CASE_MANAGEMENT })
+ @ExportProperty(CaseDataDto.TRIMESTER)
+ @ExportGroup(ExportGroupType.SENSITIVE)
+ public Trimester getTrimester() {
+ return trimester;
+ }
+
+ @Order(15)
+ @ExportTarget(caseExportTypes = { CaseExportType.CASE_SURVEILLANCE, CaseExportType.CASE_MANAGEMENT })
+ @ExportProperty(CaseDataDto.POSTPARTUM)
+ @ExportGroup(ExportGroupType.SENSITIVE)
+ public YesNoUnknown getPostpartum() {
+ return postpartum;
+ }
+
+ @Order(16)
@ExportTarget(caseExportTypes = {CaseExportType.CASE_SURVEILLANCE, CaseExportType.CASE_MANAGEMENT})
@ExportProperty(PersonDto.APPROXIMATE_AGE)
@ExportGroup(ExportGroupType.SENSITIVE)
@@ -352,7 +374,7 @@ public String getApproximateAge() {
return approximateAge;
}
- @Order(15)
+ @Order(17)
@ExportTarget(caseExportTypes = {CaseExportType.CASE_SURVEILLANCE, CaseExportType.CASE_MANAGEMENT})
@ExportProperty(AGE_GROUP)
@ExportGroup(ExportGroupType.PERSON)
@@ -360,7 +382,7 @@ public String getAgeGroup() {
return ageGroup;
}
- @Order(16)
+ @Order(18)
@ExportTarget(caseExportTypes = {CaseExportType.CASE_SURVEILLANCE, CaseExportType.CASE_MANAGEMENT})
@ExportProperty(PersonDto.BIRTH_DATE)
@ExportGroup(ExportGroupType.SENSITIVE)
@@ -922,6 +944,14 @@ public void setPregnant(YesNoUnknown pregnant) {
this.pregnant = pregnant;
}
+ public void setTrimester(Trimester trimester) {
+ this.trimester = trimester;
+ }
+
+ public void setPostpartum(YesNoUnknown postpartum) {
+ this.postpartum = postpartum;
+ }
+
public void setApproximateAge(String age) {
this.approximateAge = age;
}
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/caze/Trimester.java b/sormas-api/src/main/java/de/symeda/sormas/api/caze/Trimester.java
new file mode 100644
index 00000000000..3150c3c8337
--- /dev/null
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/caze/Trimester.java
@@ -0,0 +1,12 @@
+package de.symeda.sormas.api.caze;
+
+import de.symeda.sormas.api.i18n.I18nProperties;
+
+public enum Trimester {
+
+ FIRST, SECOND, THIRD, UNKNOWN;
+
+ public String toString() {
+ return I18nProperties.getEnumCaption(this);
+ }
+}
diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties
index a732b228e99..94c888218f7 100644
--- a/sormas-api/src/main/resources/captions.properties
+++ b/sormas-api/src/main/resources/captions.properties
@@ -227,6 +227,7 @@ CaseData.pointOfEntry = Point of entry
CaseData.pointOfEntryDetails = Point of entry name & description
CaseData.pointOfEntryName = Point of entry
CaseData.portHealthInfo = Port health
+CaseData.postpartum = Postpartum
CaseData.pregnant = Pregnancy
CaseData.regionLevelDate = Date received at region level
CaseData.reportDate = Date of report
@@ -242,6 +243,7 @@ CaseData.smallpoxVaccinationScar = Is a Smallpox vaccination scar present?
CaseData.surveillanceOfficer = Responsible surveillance officer
CaseData.symptoms = Symptoms
CaseData.therapy = Therapy
+CaseData.trimester = Trimester
CaseData.uuid = Case ID
CaseData.vaccination = Vaccination status for this disease
CaseData.vaccinationDate = Date of last vaccination
diff --git a/sormas-api/src/main/resources/enum.properties b/sormas-api/src/main/resources/enum.properties
index f0678f47d34..d3e1eb2752d 100644
--- a/sormas-api/src/main/resources/enum.properties
+++ b/sormas-api/src/main/resources/enum.properties
@@ -743,6 +743,12 @@ TreatmentType.INVASIVE_MECHANICAL_VENTILATION = Invasive mechanical ventilation
TreatmentType.VASOPRESSORS_INOTROPES = Vasopressors/Inotropes
TreatmentType.OTHER = Other
+# Trimester
+Trimester.FIRST = First
+Trimester.SECOND = Second
+Trimester.THIRD = Third
+Trimester.UNKNOWN = Unknown
+
# TypeOfDrug
TypeOfDrug.ANTIMICROBIAL = Antimicrobial
TypeOfDrug.ANTIVIRAL = Antiviral
diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/Case.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/Case.java
index d5a2148fe04..1d2ad08d8e7 100644
--- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/Case.java
+++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/Case.java
@@ -39,6 +39,7 @@
import de.symeda.sormas.api.caze.InvestigationStatus;
import de.symeda.sormas.api.caze.PlagueType;
import de.symeda.sormas.api.caze.ReportingType;
+import de.symeda.sormas.api.caze.Trimester;
import de.symeda.sormas.api.caze.Vaccination;
import de.symeda.sormas.api.caze.VaccinationInfoSource;
import de.symeda.sormas.api.contact.QuarantineType;
@@ -279,6 +280,10 @@ public class Case extends AbstractDomainObject {
private String quarantineHomeSupplyEnsuredComment;
@Enumerated(EnumType.STRING)
private ReportingType reportingType;
+ @Enumerated(EnumType.STRING)
+ private YesNoUnknown postpartum;
+ @Enumerated(EnumType.STRING)
+ private Trimester trimester;
public boolean isUnreferredPortHealthCase() {
@@ -874,4 +879,20 @@ public ReportingType getReportingType() {
public void setReportingType(ReportingType reportingType) {
this.reportingType = reportingType;
}
+
+ public YesNoUnknown getPostpartum() {
+ return postpartum;
+ }
+
+ public void setPostpartum(YesNoUnknown postpartum) {
+ this.postpartum = postpartum;
+ }
+
+ public Trimester getTrimester() {
+ return trimester;
+ }
+
+ public void setTrimester(Trimester trimester) {
+ this.trimester = trimester;
+ }
}
diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/CaseDtoHelper.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/CaseDtoHelper.java
index 8ac505e1e96..1c5b3a6c5fe 100644
--- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/CaseDtoHelper.java
+++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/caze/CaseDtoHelper.java
@@ -175,6 +175,9 @@ public void fillInnerFromDto(Case target, CaseDataDto source) {
target.setQuarantineHomeSupplyEnsured(source.getQuarantineHomeSupplyEnsured());
target.setQuarantineHomeSupplyEnsuredComment(source.getQuarantineHomeSupplyEnsuredComment());
target.setReportingType(source.getReportingType());
+
+ target.setPostpartum(source.getPostpartum());
+ target.setTrimester(source.getTrimester());
}
@Override
@@ -350,6 +353,9 @@ public void fillInnerFromAdo(CaseDataDto target, Case source) {
target.setQuarantineHomeSupplyEnsured(source.getQuarantineHomeSupplyEnsured());
target.setQuarantineHomeSupplyEnsuredComment(source.getQuarantineHomeSupplyEnsuredComment());
target.setReportingType(source.getReportingType());
+
+ target.setPostpartum(source.getPostpartum());
+ target.setTrimester(source.getTrimester());
}
public static CaseReferenceDto toReferenceDto(Case ado) {
diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java
index 25c7bb38eec..488c019cf1c 100644
--- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java
+++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java
@@ -127,7 +127,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
// name of the database file for your application. Stored in data/data/de.symeda.sormas.app/databases
public static final String DATABASE_NAME = "sormas.db";
// any time you make changes to your database objects, you may have to increase the database version
- public static final int DATABASE_VERSION = 202;
+ public static final int DATABASE_VERSION = 203;
private static DatabaseHelper instance = null;
public static void init(Context context) {
@@ -1531,6 +1531,10 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
case 201:
currentVersion = 201;
getDao(Contact.class).executeRaw("ALTER TABLE contacts ADD COLUMN additionalDetails varchar(512);");
+ case 202:
+ currentVersion = 202;
+ getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN postpartum varchar(255);");
+ getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN trimester varchar(255);");
// ATTENTION: break should only be done after last version
break;
diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditFragment.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditFragment.java
index 4849ef5a9c7..85763c2d174 100644
--- a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditFragment.java
+++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditFragment.java
@@ -36,6 +36,7 @@
import de.symeda.sormas.api.caze.PlagueType;
import de.symeda.sormas.api.caze.RabiesType;
import de.symeda.sormas.api.caze.ReportingType;
+import de.symeda.sormas.api.caze.Trimester;
import de.symeda.sormas.api.caze.Vaccination;
import de.symeda.sormas.api.caze.VaccinationInfoSource;
import de.symeda.sormas.api.contact.QuarantineType;
@@ -111,7 +112,8 @@ private void setUpFieldVisibilities(final FragmentCaseEditLayoutBinding contentB
// Pregnancy
if (record.getPerson().getSex() != Sex.FEMALE) {
- contentBinding.caseDataPregnant.setVisibility(View.GONE);
+ contentBinding.caseDataPregnant.setVisibility(GONE);
+ contentBinding.caseDataPostpartum.setVisibility(GONE);
}
// Smallpox vaccination scar image
@@ -264,6 +266,7 @@ public void onChange(ControlPropertyField field) {
contentBinding.setData(record);
contentBinding.setYesNoUnknownClass(YesNoUnknown.class);
contentBinding.setVaccinationClass(Vaccination.class);
+ contentBinding.setTrimesterClass(Trimester.class);
InfrastructureHelper.initializeHealthFacilityDetailsFieldVisibility(contentBinding.caseDataHealthFacility,
contentBinding.caseDataHealthFacilityDetails);
diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/read/CaseReadFragment.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/read/CaseReadFragment.java
index c79e72090ff..99ac87f4416 100644
--- a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/read/CaseReadFragment.java
+++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/read/CaseReadFragment.java
@@ -67,6 +67,7 @@ private void setUpFieldVisibilities(FragmentCaseReadLayoutBinding contentBinding
// Pregnancy
if (record.getPerson().getSex() != Sex.FEMALE) {
contentBinding.caseDataPregnant.setVisibility(GONE);
+ contentBinding.caseDataPostpartum.setVisibility(GONE);
}
// Port Health fields
diff --git a/sormas-app/app/src/main/res/layout/fragment_case_edit_layout.xml b/sormas-app/app/src/main/res/layout/fragment_case_edit_layout.xml
index 369f3598298..2646d6223fa 100644
--- a/sormas-app/app/src/main/res/layout/fragment_case_edit_layout.xml
+++ b/sormas-app/app/src/main/res/layout/fragment_case_edit_layout.xml
@@ -42,6 +42,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
tasks;
@ManyToOne(cascade = {})
@@ -993,4 +999,22 @@ public ReportingType getReportingType() {
public void setReportingType(ReportingType reportingType) {
this.reportingType = reportingType;
}
+
+ @Enumerated(EnumType.STRING)
+ public YesNoUnknown getPostpartum() {
+ return postpartum;
+ }
+
+ public void setPostpartum(YesNoUnknown postpartum) {
+ this.postpartum = postpartum;
+ }
+
+ @Enumerated(EnumType.STRING)
+ public Trimester getTrimester() {
+ return trimester;
+ }
+
+ public void setTrimester(Trimester trimester) {
+ this.trimester = trimester;
+ }
}
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java
index 71d4525a98c..7cacf4fb709 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java
@@ -432,7 +432,8 @@ public List getExportList(CaseCriteria caseCriteria, CaseExportTy
epiDataJoin.get(EpiData.TRAVELED), epiDataJoin.get(EpiData.BURIAL_ATTENDED),
epiDataJoin.get(EpiData.DIRECT_CONTACT_CONFIRMED_CASE), epiDataJoin.get(EpiData.DIRECT_CONTACT_PROBABLE_CASE),
epiDataJoin.get(EpiData.RODENTS), caseRoot.get(Case.VACCINATION), caseRoot.get(Case.VACCINATION_DOSES),
- caseRoot.get(Case.VACCINATION_DATE), caseRoot.get(Case.VACCINATION_INFO_SOURCE)
+ caseRoot.get(Case.VACCINATION_DATE), caseRoot.get(Case.VACCINATION_INFO_SOURCE),
+ caseRoot.get(Case.POSTPARTUM), caseRoot.get(Case.TRIMESTER)
);
cq.distinct(true);
@@ -1655,6 +1656,8 @@ public Case fillOrBuildEntity(@NotNull CaseDataDto source, Case target) {
target.setQuarantineHomeSupplyEnsured(source.getQuarantineHomeSupplyEnsured());
target.setQuarantineHomeSupplyEnsuredComment(source.getQuarantineHomeSupplyEnsuredComment());
target.setReportingType(source.getReportingType());
+ target.setPostpartum(source.getPostpartum());
+ target.setTrimester(source.getTrimester());
return target;
}
@@ -1762,6 +1765,8 @@ public static CaseDataDto toDto(Case source) {
target.setQuarantineHomeSupplyEnsured(source.getQuarantineHomeSupplyEnsured());
target.setQuarantineHomeSupplyEnsuredComment(source.getQuarantineHomeSupplyEnsuredComment());
target.setReportingType(source.getReportingType());
+ target.setPostpartum(source.getPostpartum());
+ target.setTrimester(source.getTrimester());
return target;
}
diff --git a/sormas-backend/src/main/resources/sql/sormas_schema.sql b/sormas-backend/src/main/resources/sql/sormas_schema.sql
index 2ecd2acfc78..aff36eb711e 100644
--- a/sormas-backend/src/main/resources/sql/sormas_schema.sql
+++ b/sormas-backend/src/main/resources/sql/sormas_schema.sql
@@ -4247,6 +4247,14 @@ INSERT INTO schema_version (version_number, comment) VALUES (207, 'Added table f
ALTER TABLE contact ADD COLUMN additionaldetails varchar(512);
ALTER TABLE contact_history ADD COLUMN additionaldetails varchar(512);
-INSERT INTO schema_version (version_number, comment) VALUES (208, '2020-05-11 Add additionalDetails to contact #1933');
+INSERT INTO schema_version (version_number, comment) VALUES (208, 'Add additionalDetails to contact #1933');
+
+-- 2020-05-18 Add Trimester and Postpartum selection to case #1981
+ALTER TABLE cases ADD COLUMN postpartum varchar(255);
+ALTER TABLE cases ADD COLUMN trimester varchar(255);
+ALTER TABLE cases_history ADD COLUMN postpartum varchar(255);
+ALTER TABLE cases_history ADD COLUMN trimester varchar(255);
+
+INSERT INTO schema_version (version_number, comment) VALUES (209, 'Add Trimester and Postpartum selection to case #1981');
-- *** Insert new sql commands BEFORE this line ***
\ No newline at end of file
diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
index ebc603f16c1..8bf4dca7565 100644
--- a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
+++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
@@ -150,7 +150,8 @@ public class CaseDataForm extends AbstractEditForm {
fluidRowLocs(ContactDto.QUARANTINE_HELP_NEEDED) +
fluidRowLocs(CaseDataDto.REPORT_LAT, CaseDataDto.REPORT_LON, CaseDataDto.REPORT_LAT_LON_ACCURACY) +
loc(MEDICAL_INFORMATION_LOC) +
- fluidRowLocs(CaseDataDto.PREGNANT, "") +
+ fluidRowLocs(CaseDataDto.PREGNANT, CaseDataDto.POSTPARTUM) + fluidRowLocs(CaseDataDto.TRIMESTER, "")
+ +
fluidRowLocs(CaseDataDto.VACCINATION, CaseDataDto.VACCINATION_DOSES) +
fluidRowLocs(CaseDataDto.VACCINE, "") +
fluidRowLocs(CaseDataDto.SMALLPOX_VACCINATION_RECEIVED, CaseDataDto.SMALLPOX_VACCINATION_SCAR) +
@@ -172,6 +173,8 @@ public class CaseDataForm extends AbstractEditForm {
private DateField quarantineTo;
private CheckBox quarantineOrderedVerbally;
private CheckBox quarantineOrderedOfficialDocument;
+ private OptionGroup pregnant;
+ private OptionGroup trimester;
public CaseDataForm(PersonDto person, Disease disease, UserRight editOrCreateUserRight, ViewMode viewMode) {
super(CaseDataDto.class, CaseDataDto.I18N_PREFIX, editOrCreateUserRight);
@@ -298,7 +301,7 @@ protected void addFields() {
});
if (!FacadeProvider.getFeatureConfigurationFacade().isFeatureDisabled(FeatureType.NATIONAL_CASE_SHARING)) {
- CheckBox cbSharedToCountry = addField(CaseDataDto.SHARED_TO_COUNTRY, CheckBox.class);
+ addField(CaseDataDto.SHARED_TO_COUNTRY, CheckBox.class);
setReadOnly(!UserProvider.getCurrent().hasUserRight(UserRight.CASE_SHARE), CaseDataDto.SHARED_TO_COUNTRY);
}
@@ -318,9 +321,15 @@ protected void addFields() {
additionalDetails.setRows(3);
CssStyles.style(additionalDetails, CssStyles.CAPTION_HIDDEN);
- addFields(CaseDataDto.PREGNANT, CaseDataDto.VACCINATION, CaseDataDto.VACCINATION_DOSES,
- CaseDataDto.VACCINATION_INFO_SOURCE, CaseDataDto.VACCINE, CaseDataDto.SMALLPOX_VACCINATION_SCAR,
- CaseDataDto.SMALLPOX_VACCINATION_RECEIVED, CaseDataDto.VACCINATION_DATE);
+ pregnant = addField(CaseDataDto.PREGNANT, OptionGroup.class);
+ pregnant.addValueChangeListener(e -> handleTrimesterField());
+ addField(CaseDataDto.POSTPARTUM, OptionGroup.class);
+ trimester = addField(CaseDataDto.TRIMESTER, OptionGroup.class);
+ trimester.setVisible(false);
+
+ addFields(CaseDataDto.VACCINATION, CaseDataDto.VACCINATION_DOSES, CaseDataDto.VACCINATION_INFO_SOURCE,
+ CaseDataDto.VACCINE, CaseDataDto.SMALLPOX_VACCINATION_SCAR, CaseDataDto.SMALLPOX_VACCINATION_RECEIVED,
+ CaseDataDto.VACCINATION_DATE);
// Set initial visibilities
@@ -342,7 +351,7 @@ protected void addFields() {
// dynamically setting the visibility
if (isVisibleAllowed(CaseDataDto.PREGNANT)) {
- setVisible(person.getSex() == Sex.FEMALE, CaseDataDto.PREGNANT);
+ setVisible(person.getSex() == Sex.FEMALE, CaseDataDto.PREGNANT, CaseDataDto.POSTPARTUM);
}
if (isVisibleAllowed(CaseDataDto.VACCINATION_DOSES)) {
FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.VACCINATION_DOSES, CaseDataDto.VACCINATION,
@@ -518,6 +527,15 @@ protected void addFields() {
});
}
+ private void handleTrimesterField() {
+ if (YesNoUnknown.YES.equals(pregnant.getValue())) {
+ trimester.setVisible(true);
+ } else {
+ trimester.setVisible(false);
+ trimester.clear();
+ }
+ }
+
private void updateQuarantineFields() {
QuarantineType quarantineType = (QuarantineType) quarantine.getValue();
boolean visible;