Skip to content

Commit ac9aafa

Browse files
Minar code reviews
1 parent 5b4d498 commit ac9aafa

2 files changed

Lines changed: 9 additions & 23 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14578,7 +14578,7 @@ alter table contact add column IF NOT EXISTS vaccination_dose1_date timestamp;
1457814578
alter table contact add column IF NOT EXISTS vaccination_dose2_date timestamp;
1457914579
alter table contact add column IF NOT EXISTS vaccinationProposed boolean default false;
1458014580
alter table contact add column IF NOT EXISTS immuneGlobulinProposed boolean default false;
14581-
alter table testreport add column genoTypeResult varchar(255);
14581+
alter table testreport add column IF NOT EXISTS genoTypeResult varchar(255);
1458214582

1458314583
alter table symptoms_history add column if not exists skinRashOnsetDate timestamp;
1458414584
alter table symptoms_history add column if not exists acuteencephalitis varchar(255);
@@ -14591,7 +14591,7 @@ alter table contact_history add column IF NOT EXISTS vaccination_dose1_date time
1459114591
alter table contact_history add column IF NOT EXISTS vaccination_dose2_date timestamp;
1459214592
alter table contact_history add column IF NOT EXISTS vaccinationProposed boolean default false;
1459314593
alter table contact_history add column IF NOT EXISTS immuneGlobulinProposed boolean default false;
14594-
alter table testreport_history add column genoTypeResult varchar(255);
14594+
alter table testreport_history add column IF NOT EXISTS genoTypeResult varchar(255);
1459514595

1459614596
INSERT INTO schema_version (version_number, comment) VALUES (589, 'Customized Measles for Lux #13365');
1459714597

sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -542,20 +542,13 @@ public String getFormattedHtmlMessage() {
542542

543543
asymptomaticNOG.addValueChangeListener(e -> {
544544
if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG)) {
545-
if (SymptomState.YES.equals(asymptomaticNOG.getNullableValue())) {
545+
boolean isSymptamatic = !SymptomState.YES.equals(asymptomaticNOG.getNullableValue());
546546
editableAllowedFields().stream().filter(field -> !field.getId().equals(ASYMPTOMATIC)).forEach(field -> {
547547
field.clear();
548-
field.setEnabled(false);
549-
onsetSymptom.setEnabled(false);
550-
onsetDateField.setEnabled(false);
548+
field.setEnabled(isSymptamatic);
549+
onsetSymptom.setEnabled(isSymptamatic);
550+
onsetDateField.setEnabled(isSymptamatic);
551551
});
552-
} else {
553-
editableAllowedFields().stream().filter(field -> !field.getId().equals(ASYMPTOMATIC)).forEach(field -> {
554-
field.setEnabled(true);
555-
onsetSymptom.setEnabled(true);
556-
onsetDateField.setEnabled(true);
557-
});
558-
}
559552
}
560553
});
561554

@@ -587,16 +580,9 @@ public String getFormattedHtmlMessage() {
587580
getField(SKIN_RASH).addValueChangeListener(e -> {
588581
// Show skin rash onset date field only if skin rash is set to YES
589582
if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG)) {
590-
Set<Object> value1 = (Set<Object>) e.getProperty().getValue();
591-
value1.stream().filter(value -> value instanceof SymptomState).findFirst().ifPresent(value -> {
592-
if (value == SymptomState.YES) {
593-
skinRashDateLabel.setVisible(true);
594-
skinRashOnsetDate.setVisible(true);
595-
} else {
596-
skinRashDateLabel.setVisible(false);
597-
skinRashOnsetDate.setVisible(false);
598-
}
599-
});
583+
Object v = FieldHelper.getNullableSourceFieldValue((Field) e.getProperty());
584+
boolean isVisible = v == SymptomState.YES || (v instanceof java.util.Set && ((java.util.Set<?>) v).contains(SymptomState.YES));
585+
skinRashDateLabel.setVisible(isVisible);
600586
}
601587
});
602588

0 commit comments

Comments
 (0)