Skip to content

Commit 822b267

Browse files
Merge pull request #13595 from SORMAS-Foundation/bugfix-measles-minor-issues
Minor issue fixes for Measles
2 parents 930050a + 9e2d226 commit 822b267

11 files changed

Lines changed: 79 additions & 15 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public class EpiDataDto extends PseudonymizableDto {
5656
public static final String CASE_IMPORTED_STATUS = "caseImportedStatus";
5757
public static final String CLUSTER_TYPE = "clusterType";
5858
public static final String CLUSTER_TYPE_TEXT = "clusterTypeText";
59+
public static final String CLUSTER_RELATED = "clusterRelated";
5960

6061
private YesNoUnknown exposureDetailsKnown;
6162
private YesNoUnknown activityAsCaseDetailsKnown;
@@ -71,6 +72,11 @@ public class EpiDataDto extends PseudonymizableDto {
7172
@HideForCountriesExcept(countries = {CountryHelper.COUNTRY_CODE_LUXEMBOURG})
7273
private ClusterType clusterType;
7374

75+
@Diseases({
76+
Disease.MEASLES})
77+
@HideForCountriesExcept(countries = {CountryHelper.COUNTRY_CODE_LUXEMBOURG})
78+
private boolean clusterRelated;
79+
7480
@HideForCountriesExcept(countries = {CountryHelper.COUNTRY_CODE_LUXEMBOURG})
7581
@Diseases({
7682
Disease.MEASLES})
@@ -189,6 +195,14 @@ public void setClusterTypeText(String clusterTypeText) {
189195
this.clusterTypeText = clusterTypeText;
190196
}
191197

198+
public boolean isClusterRelated() {
199+
return clusterRelated;
200+
}
201+
202+
public void setClusterRelated(boolean clusterRelated) {
203+
this.clusterRelated = clusterRelated;
204+
}
205+
192206
@Override
193207
public EpiDataDto clone() throws CloneNotSupportedException {
194208
EpiDataDto clone = (EpiDataDto) super.clone();

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
@@ -1561,6 +1561,7 @@ public interface Captions {
15611561
String EpiData_activityAsCaseDetailsKnown = "EpiData.activityAsCaseDetailsKnown";
15621562
String EpiData_areaInfectedAnimals = "EpiData.areaInfectedAnimals";
15631563
String EpiData_caseImportedStatus = "EpiData.caseImportedStatus";
1564+
String EpiData_clusterRelated = "EpiData.clusterRelated";
15641565
String EpiData_clusterType = "EpiData.clusterType";
15651566
String EpiData_clusterTypeText = "EpiData.clusterTypeText";
15661567
String EpiData_contactWithSourceCaseKnown = "EpiData.contactWithSourceCaseKnown";

sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ public enum PathogenTestType {
134134
CQ_VALUE_DETECTION,
135135

136136
@Diseases(value = {
137-
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
137+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
138+
Disease.MEASLES})
138139
SEQUENCING,
139140

140141
@Diseases(value = {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,7 @@ EpiData.highTransmissionRiskArea=Residing or working in an area with high risk o
11451145
EpiData.largeOutbreaksArea=Residing or travelling to countries/territories/areas experiencing larger outbreaks of local transmission
11461146
EpiData.contactWithSourceCaseKnown=Contacts with source case known
11471147
EpiData.caseImportedStatus=Case imported status
1148+
EpiData.clusterRelated=Cluster Related
11481149
EpiData.clusterType=Cluster type
11491150
EpiData.clusterTypeText=Specify cluster type text
11501151
#Therapy

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

Lines changed: 11 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+
private boolean clusterRelated;
5961

6062
private List<Exposure> exposures = new ArrayList<>();
6163
private List<ActivityAsCase> activitiesAsCase = new ArrayList<>();
@@ -170,4 +172,13 @@ public String getClusterTypeText() {
170172
public void setClusterTypeText(String clusterTypeText) {
171173
this.clusterTypeText = clusterTypeText;
172174
}
175+
176+
@Column(nullable = false)
177+
public boolean isClusterRelated() {
178+
return clusterRelated;
179+
}
180+
181+
public void setClusterRelated(boolean clusterRelated) {
182+
this.clusterRelated = clusterRelated;
183+
}
173184
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public EpiData fillOrBuildEntity(EpiDataDto source, EpiData target, boolean chec
103103
target.setClusterType(source.getClusterType());
104104
target.setCaseImportedStatus(source.getCaseImportedStatus());
105105
target.setClusterTypeText(source.getClusterTypeText());
106+
target.setClusterRelated(source.isClusterRelated());
106107

107108
return target;
108109
}
@@ -249,6 +250,7 @@ public static EpiDataDto toDto(EpiData epiData) {
249250
target.setClusterType(source.getClusterType());
250251
target.setCaseImportedStatus(source.getCaseImportedStatus());
251252
target.setClusterTypeText(source.getClusterTypeText());
253+
target.setClusterRelated(source.isClusterRelated());
252254

253255
return target;
254256
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14647,5 +14647,13 @@ ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS tubemitogenegt10 boolean
1464714647

1464814648
INSERT INTO schema_version (version_number, comment) VALUES (591, 'Implement functionality to receive messages from laboratory for TB #13563');
1464914649

14650+
-- 2025-09-09 - Lux measles - cluster related checkbox #13365
14651+
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;
14654+
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;
14657+
INSERT INTO schema_version (version_number, comment) VALUES (592, 'Added cluster related checkbox for LUX Measles #13365');
1465014658

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

sormas-backend/src/test/java/de/symeda/sormas/backend/caze/CaseClassificationLogicTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ public void testAutomaticClassificationForIMI() {
10791079
caze.setEpidemiologicalConfirmation(YesNoUnknown.YES);
10801080
caze = getCaseFacade().save(caze);
10811081
caze = getCaseFacade().getCaseDataByUuid(caze.getUuid());
1082-
assertEquals(CaseClassification.PROBABLE, caze.getCaseClassification());
1082+
assertEquals(CaseClassification.SUSPECT, caze.getCaseClassification());
10831083

10841084
// Confirmed
10851085
caze = getCaseFacade().save(buildSuspectCase(Disease.INVASIVE_MENINGOCOCCAL_INFECTION));
@@ -1137,7 +1137,7 @@ public void ruleOutFalsePositivesForIMI() {
11371137
PathogenTestType.PCR_RT_PCR,
11381138
PathogenTestType.ANTIGEN_DETECTION, PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY);
11391139
caze = getCaseFacade().getCaseDataByUuid(caze.getUuid());
1140-
assertEquals(CaseClassification.PROBABLE, caze.getCaseClassification());
1140+
assertEquals(CaseClassification.SUSPECT, caze.getCaseClassification());
11411141
}
11421142

11431143
@Test

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

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ public class ContactDataForm extends AbstractEditForm<ContactDto> {
179179
private final ViewMode viewMode;
180180
private final Disease disease;
181181
private final boolean diseaseHasFollowUp;
182+
private final boolean luxMeasles;
182183
private NullableOptionGroup contactProximity;
183184
private ComboBox region;
184185
private ComboBox district;
@@ -219,6 +220,7 @@ public ContactDataForm(Disease disease, ViewMode viewMode, boolean isPseudonymiz
219220
this.viewMode = viewMode;
220221
this.disease = disease;
221222
this.diseaseHasFollowUp = FacadeProvider.getDiseaseConfigurationFacade().hasFollowUp(disease);
223+
this.luxMeasles = Disease.MEASLES == disease && FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_LUXEMBOURG);
222224
addFields();
223225
}
224226

@@ -241,7 +243,7 @@ protected void addFields() {
241243
Label followUpStausHeadingLabel = new Label(I18nProperties.getString(Strings.headingFollowUpStatus));
242244
followUpStausHeadingLabel.addStyleName(H3);
243245
getContent().addComponent(followUpStausHeadingLabel, FOLLOW_UP_STATUS_HEADING_LOC);
244-
followUpStausHeadingLabel.setVisible(diseaseHasFollowUp);
246+
followUpStausHeadingLabel.setVisible(diseaseHasFollowUp && !isLuxMeasles(this.disease));
245247

246248
Label prophylaxisLabel = new Label(I18nProperties.getString(Strings.headingProphylaxisLoc));
247249
prophylaxisLabel.addStyleName(H3);
@@ -889,6 +891,20 @@ private void updateDiseaseConfiguration(Disease disease) {
889891
field -> diseaseHasFollowUp,
890892
field -> false);
891893

894+
// For LUX measles cases do not require the follow-up details. For other countries works as it is
895+
FieldHelper.setMultipleVisible(
896+
getFieldGroup(),
897+
Arrays.asList(
898+
ContactDto.FOLLOW_UP_STATUS,
899+
ContactDto.FOLLOW_UP_STATUS_CHANGE_DATE,
900+
ContactDto.FOLLOW_UP_STATUS_CHANGE_USER,
901+
ContactDto.FOLLOW_UP_COMMENT,
902+
ContactDto.FOLLOW_UP_UNTIL,
903+
ContactDto.CONTACT_OFFICER,
904+
ContactDto.OVERWRITE_FOLLOW_UP_UNTIL),
905+
field -> !isLuxMeasles(disease),
906+
field -> false);
907+
892908
FieldHelper.updateEnumData(
893909
contactProximity,
894910
Arrays.asList(ContactProximity.getValues(disease, FacadeProvider.getConfigFacade().getCountryLocale())));
@@ -1140,4 +1156,14 @@ public void setValue(ContactDto newFieldValue) throws ReadOnlyException, Convert
11401156
// this hopefully resets everything to its correct value
11411157
discard();
11421158
}
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+
}
11431169
}

sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.function.Supplier;
3333

3434
import com.vaadin.v7.ui.TextField;
35+
import de.symeda.sormas.api.CountryHelper;
3536
import de.symeda.sormas.api.epidata.ClusterType;
3637
import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers;
3738
import de.symeda.sormas.api.utils.fieldvisibility.checkers.CountryFieldVisibilityChecker;
@@ -81,7 +82,7 @@ public class EpiDataForm extends AbstractEditForm<EpiDataDto> {
8182
loc(EpiDataDto.ACTIVITY_AS_CASE_DETAILS_KNOWN)+
8283
loc(EpiDataDto.ACTIVITIES_AS_CASE) +
8384
loc(LOC_CLUSTER_TYPE_HEADING)+
84-
fluidRowLocs(6,EpiDataDto.CLUSTER_TYPE,6,EpiDataDto.CLUSTER_TYPE_TEXT) +
85+
fluidRowLocs(3, EpiDataDto.CLUSTER_RELATED,5,EpiDataDto.CLUSTER_TYPE,4,EpiDataDto.CLUSTER_TYPE_TEXT) +
8586
locCss(VSPACE_TOP_3, LOC_EPI_DATA_FIELDS_HINT) +
8687
loc(EpiDataDto.HIGH_TRANSMISSION_RISK_AREA) +
8788
loc(EpiDataDto.LARGE_OUTBREAKS_AREA) +
@@ -152,7 +153,9 @@ protected void addFields() {
152153

153154
addField(EpiDataDto.CASE_IMPORTED_STATUS);
154155
addField(EpiDataDto.CLUSTER_TYPE);
156+
addField(EpiDataDto.CLUSTER_RELATED);
155157
TextField clustorTypeTF = addField(EpiDataDto.CLUSTER_TYPE_TEXT);
158+
FieldHelper.setVisibleWhen(getFieldGroup(), EpiDataDto.CLUSTER_TYPE, EpiDataDto.CLUSTER_RELATED, Collections.singletonList(Boolean.TRUE), true);
156159
FieldHelper.setVisibleWhen(getField(EpiDataDto.CLUSTER_TYPE), Arrays.asList(clustorTypeTF), Arrays.asList(ClusterType.OTHER), true);
157160
FieldHelper.setVisibleWhen(
158161
getFieldGroup(),
@@ -210,11 +213,12 @@ private void addHeadingsAndInfoTexts() {
210213
new MultilineLabel(divsCss(VSPACE_3, I18nProperties.getString(Strings.infoEpiDataFieldsHint)), ContentMode.HTML),
211214
LOC_EPI_DATA_FIELDS_HINT);
212215

213-
getContent().addComponent(new MultilineLabel(h3(I18nProperties.getString(Strings.headingEpiCaseImport)) + divsCss(VSPACE_3), ContentMode.HTML),
214-
LOC_CASE_IMPORT_HEADING);
215-
216-
getContent().addComponent(new MultilineLabel(h3(I18nProperties.getString(Strings.headingClusterType)) + divsCss(VSPACE_3), ContentMode.HTML),
217-
LOC_CLUSTER_TYPE_HEADING);
216+
if (isConfiguredServer(CountryHelper.COUNTRY_CODE_LUXEMBOURG) && Disease.MEASLES == disease) {
217+
getContent().addComponent(new MultilineLabel(h3(I18nProperties.getString(Strings.headingEpiCaseImport)) + divsCss(VSPACE_3), ContentMode.HTML),
218+
LOC_CASE_IMPORT_HEADING);
219+
getContent().addComponent(new MultilineLabel(h3(I18nProperties.getString(Strings.headingClusterType)) + divsCss(VSPACE_3), ContentMode.HTML),
220+
LOC_CLUSTER_TYPE_HEADING);
221+
}
218222

219223
getContent().addComponent(
220224
new MultilineLabel(

0 commit comments

Comments
 (0)