Skip to content

Commit 0404e77

Browse files
Code review fix
1 parent f741918 commit 0404e77

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.List;
2323

2424
import javax.persistence.CascadeType;
25+
import javax.persistence.Column;
2526
import javax.persistence.Entity;
2627
import javax.persistence.EnumType;
2728
import javax.persistence.Enumerated;
@@ -56,6 +57,7 @@ public class EpiData extends AbstractDomainObject {
5657
private CaseImportedStatus caseImportedStatus;
5758
private ClusterType clusterType;
5859
private String clusterTypeText;
60+
@Column(nullable = false)
5961
private boolean clusterRelated;
6062

6163
private List<Exposure> exposures = new ArrayList<>();

sormas-backend/src/main/resources/sql/sormas_schema.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14649,7 +14649,11 @@ INSERT INTO schema_version (version_number, comment) VALUES (591, 'Implement fun
1464914649

1465014650
-- 2025-09-09 - Lux measles - cluster related checkbox #13365
1465114651
alter table epidata add column IF NOT EXISTS clusterRelated boolean DEFAULT false;
14652+
update epidata set clusterRelated = false where clusterRelated is null;
14653+
alter table epidata alter column clusterRelated set not null;
1465214654
alter table epidata_history add column IF NOT EXISTS clusterRelated boolean DEFAULT false;
14655+
update epidata_history set clusterRelated = false where clusterRelated is null;
14656+
alter table epidata_history alter column clusterRelated set not null;
1465314657
INSERT INTO schema_version (version_number, comment) VALUES (592, 'Added cluster related checkbox for LUX Measles #13365');
1465414658

1465514659
-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ protected void addFields() {
243243
Label followUpStausHeadingLabel = new Label(I18nProperties.getString(Strings.headingFollowUpStatus));
244244
followUpStausHeadingLabel.addStyleName(H3);
245245
getContent().addComponent(followUpStausHeadingLabel, FOLLOW_UP_STATUS_HEADING_LOC);
246-
followUpStausHeadingLabel.setVisible(diseaseHasFollowUp && !luxMeasles);
246+
followUpStausHeadingLabel.setVisible(diseaseHasFollowUp && !isLuxMeasles(this.disease));
247247

248248
Label prophylaxisLabel = new Label(I18nProperties.getString(Strings.headingProphylaxisLoc));
249249
prophylaxisLabel.addStyleName(H3);
@@ -902,7 +902,7 @@ private void updateDiseaseConfiguration(Disease disease) {
902902
ContactDto.FOLLOW_UP_UNTIL,
903903
ContactDto.CONTACT_OFFICER,
904904
ContactDto.OVERWRITE_FOLLOW_UP_UNTIL),
905-
field -> !luxMeasles,
905+
field -> !isLuxMeasles(disease),
906906
field -> false);
907907

908908
FieldHelper.updateEnumData(
@@ -1156,4 +1156,14 @@ public void setValue(ContactDto newFieldValue) throws ReadOnlyException, Convert
11561156
// this hopefully resets everything to its correct value
11571157
discard();
11581158
}
1159+
1160+
/**
1161+
* To validate the Lux specific measles rules
1162+
*
1163+
* @param disease
1164+
* @return
1165+
*/
1166+
private boolean isLuxMeasles(Disease disease) {
1167+
return Disease.MEASLES == disease && isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG);
1168+
}
11591169
}

0 commit comments

Comments
 (0)