Skip to content

Commit 72886de

Browse files
Fixed the possible issues
1 parent cd45796 commit 72886de

9 files changed

Lines changed: 36 additions & 20 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public enum PathogenSpecie {
5252
PathogenTestType.OTHER_MOLECULAR_ASSAY,
5353
PathogenTestType.OTHER_SEROLOGICAL_TEST })
5454
SPP,
55+
@Diseases({
56+
Disease.MALARIA })
5557
@ApplicableToPathogenTests(value = {
5658
PathogenTestType.THIN_BLOOD_SMEAR,
5759
PathogenTestType.RAPID_TEST,

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import javax.validation.constraints.NotNull;
2020
import javax.validation.constraints.Size;
2121

22+
import com.fasterxml.jackson.annotation.JsonAlias;
2223
import com.fasterxml.jackson.annotation.JsonIgnore;
2324

2425
import de.symeda.sormas.api.CountryHelper;
@@ -229,6 +230,7 @@ public class PathogenTestDto extends PseudonymizableDto {
229230
private YesNoUnknown rifampicinResistant;
230231
private YesNoUnknown isoniazidResistant;
231232
private PathogenSpecie specie;
233+
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
232234
private String specieText;
233235
private String patternProfile;
234236
private PathogenStrainCallStatus strainCallStatus;
@@ -322,12 +324,14 @@ public class PathogenTestDto extends PseudonymizableDto {
322324
// Dengue and Malaria changes
323325
@Diseases(value = {
324326
Disease.DENGUE })
327+
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
325328
private String antibodyTitre;
326329
private Boolean performedByReferenceLaboratory;
327330
// defaulting this test to false.
328331
private Boolean retestRequested = false;
329332
@Diseases({
330333
Disease.MALARIA })
334+
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
331335
private String resultDetails;
332336

333337
public static PathogenTestDto build(SampleDto sample, UserDto currentUser) {
@@ -813,6 +817,7 @@ public void setSeroTypingMethod(SerotypingMethod seroTypingMethod) {
813817
this.seroTypingMethod = seroTypingMethod;
814818
}
815819

820+
@JsonAlias("genoTypeResult")
816821
public GenoType getGenoType() {
817822
return genoType;
818823
}
@@ -821,6 +826,7 @@ public void setGenoType(GenoType genoType) {
821826
this.genoType = genoType;
822827
}
823828

829+
@JsonAlias("genoTypeResultText")
824830
public String getGenoTypeText() {
825831
return genoTypeText;
826832
}

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public enum PathogenTestType {
111111
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
112112
Disease.INVASIVE_MENINGOCOCCAL_INFECTION,
113113
Disease.INVASIVE_PNEUMOCOCCAL_INFECTION,
114-
Disease.MEASLES })
114+
Disease.MEASLES,
115+
Disease.MALARIA })
115116
INDIRECT_FLUORESCENT_ANTIBODY,
116117

117118
@Diseases(value = {
@@ -295,10 +296,6 @@ public enum PathogenTestType {
295296
@Diseases({
296297
Disease.MALARIA })
297298
OTHER_SEROLOGICAL_TEST,
298-
// Indirect Fluorescent Antibody Test
299-
@Diseases({
300-
Disease.MALARIA })
301-
IFAT,
302299
OTHER;
303300

304301
@Override

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package de.symeda.sormas.api.sample;
2020

2121
import java.util.Arrays;
22+
import java.util.Locale;
2223

2324
import org.apache.commons.lang3.StringUtils;
2425

@@ -51,7 +52,7 @@ public static Serotype fromString(String serotype) {
5152
if (StringUtils.isBlank(serotype)) {
5253
return null;
5354
}
54-
String serotypeEnumVal = serotype.toUpperCase().replaceAll("[-_]", "_");
55+
String serotypeEnumVal = StringUtils.trim(serotype).toUpperCase(Locale.ROOT).replaceAll("[-_\\s]+", "_");
5556

5657
return Arrays.asList(Serotype.values()).stream().noneMatch(s -> s.name().equals(serotypeEnumVal)) ? OTHER : Serotype.valueOf(serotypeEnumVal);
5758
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,6 @@ PathogenTestType.LAMP = Lamp
12041204
PathogenTestType.OTHER_ANTIGEN_DETECTION_TEST = Other antigen detection test
12051205
PathogenTestType.OTHER_MOLECULAR_ASSAY = Other molecular assay
12061206
PathogenTestType.OTHER_SEROLOGICAL_TEST = Other serological test
1207-
PathogenTestType.IFAT = Indirect Fluorescent Antibody Test
12081207

12091208
PCRTestSpecification.VARIANT_SPECIFIC = Variant specific
12101209
PCRTestSpecification.N501Y_MUTATION_DETECTION = N501Y mutation detection

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ private void includeExposureDates(Date symptomOnsetDate, EpiDataDto epiDataDto,
14401440
if (!diseaseConfigurationDto.getIncubationPeriodEnabled()) {
14411441
return;
14421442
}
1443-
if (diseaseConfigurationDto.getMaxIncubationPeriod() == 0 || diseaseConfigurationDto.getMaxIncubationPeriod() == null) {
1443+
if (diseaseConfigurationDto.getMaxIncubationPeriod() == null || diseaseConfigurationDto.getMaxIncubationPeriod() == 0) {
14441444
return;
14451445
}
14461446
if (diseaseConfigurationDto.getMinIncubationPeriod() == null) {

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseSymptomSideViewComponent.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,26 @@ public void toggleComplicationSymptom(Field sourceField) {
9595
componentMap.put(sourceField.getId(), label);
9696
return;
9797
}
98-
// if the source field value is String type, and it's value is not empty, and a map does not have that symptom, and its a complicated symptom, add it to the layout and map
99-
// This is to set the entered value as a caption.
100-
if (sourceFieldObj instanceof String
101-
&& StringUtils.isNotBlank((String) sourceFieldObj)
102-
&& !componentMap.containsKey(sourceField.getId())
103-
&& complicatedSymptoms.contains(sourceField.getId())) {
104-
Label label = new Label(sourceField.getValue().toString());
105-
componentMap.put(sourceField.getId(), label);
98+
99+
// if the source field value is String type
100+
if (sourceFieldObj instanceof String && StringUtils.isNotBlank((String) sourceFieldObj)) {
101+
Label label;
102+
if (componentMap.containsKey(sourceField.getId())) {
103+
// if the map has a different value, then remove the old value from the layout and add the new value.
104+
layout.removeComponent(componentMap.get(sourceField.getId()));
105+
label = new Label(sourceField.getValue().toString());
106+
} else if (!componentMap.containsKey(sourceField.getId()) && complicatedSymptoms.contains(sourceField.getId())) {
107+
// If the map not has a key, and it's a complicated symptom, then add it to the layout.
108+
label = new Label(sourceField.getValue().toString());
109+
} else {
110+
label = null;
111+
}
112+
if (label != null) {
113+
componentMap.put(sourceField.getId(), label);
114+
}
106115
}
116+
// , and it's value is not empty, and a map does not have that symptom, and its a complicated symptom, add it to the layout and map
117+
// This is to set the entered value as a caption.
107118
}
108119

109120
/**

sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ public class PathogenTestForm extends AbstractEditForm<PathogenTestDto> {
159159
put(Disease.CRYPTOSPORIDIOSIS, new ArrayList<>(List.of(PathogenTestType.GENOTYPING)));
160160
put(Disease.DENGUE, new ArrayList<>(List.of(PathogenTestType.NAAT, PathogenTestType.NEUTRALIZING_ANTIBODIES, PathogenTestType.PCR_RT_PCR)));
161161
put(Disease.MALARIA, new ArrayList<>(List.of( PathogenTestType.ANTIGEN_DETECTION, PathogenTestType.THIN_BLOOD_SMEAR, PathogenTestType.RAPID_TEST,
162-
PathogenTestType.PCR_RT_PCR, PathogenTestType.Q_PCR, PathogenTestType.ENZYME_LINKED_IMMUNOSORBENT_ASSAY, PathogenTestType.LAMP,
163-
PathogenTestType.IFAT, PathogenTestType.OTHER_ANTIGEN_DETECTION_TEST, PathogenTestType.OTHER_SEROLOGICAL_TEST, PathogenTestType.OTHER_MOLECULAR_ASSAY)));
162+
PathogenTestType.INDIRECT_FLUORESCENT_ANTIBODY,PathogenTestType.PCR_RT_PCR, PathogenTestType.Q_PCR, PathogenTestType.ENZYME_LINKED_IMMUNOSORBENT_ASSAY, PathogenTestType.LAMP,
163+
PathogenTestType.OTHER_ANTIGEN_DETECTION_TEST, PathogenTestType.OTHER_SEROLOGICAL_TEST, PathogenTestType.OTHER_MOLECULAR_ASSAY)));
164164
}
165165
});
166166

@@ -207,7 +207,7 @@ public class PathogenTestForm extends AbstractEditForm<PathogenTestDto> {
207207
put(Disease.LATENT_TUBERCULOSIS, Collections.unmodifiableList(Arrays.asList(PathogenTestType.SPOLIGOTYPING)));
208208
put(Disease.TUBERCULOSIS, Collections.unmodifiableList(Arrays.asList(PathogenTestType.SPOLIGOTYPING)));
209209
put(Disease.MALARIA, Collections.unmodifiableList(Arrays.asList(PathogenTestType.THIN_BLOOD_SMEAR, PathogenTestType.ANTIGEN_DETECTION,
210-
PathogenTestType.RAPID_TEST, PathogenTestType.PCR_RT_PCR, PathogenTestType.Q_PCR, PathogenTestType.LAMP, PathogenTestType.IFAT,
210+
PathogenTestType.RAPID_TEST, PathogenTestType.PCR_RT_PCR, PathogenTestType.Q_PCR, PathogenTestType.LAMP,PathogenTestType.INDIRECT_FLUORESCENT_ANTIBODY,
211211
PathogenTestType.OTHER_MOLECULAR_ASSAY, PathogenTestType.OTHER_SEROLOGICAL_TEST, PathogenTestType.OTHER_ANTIGEN_DETECTION_TEST,
212212
PathogenTestType.ENZYME_LINKED_IMMUNOSORBENT_ASSAY)));
213213
}

sormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class PathogenTestListEntry extends SideComponentField {
5757
public static final Map<Disease, List<PathogenTestType>> VARIANT_MAP = Collections.unmodifiableMap(new HashMap<>() {
5858
{
5959
put(Disease.MALARIA, Collections.unmodifiableList(Arrays.asList(PathogenTestType.THIN_BLOOD_SMEAR, PathogenTestType.RAPID_TEST, PathogenTestType.PCR_RT_PCR,
60-
PathogenTestType.Q_PCR, PathogenTestType.LAMP, PathogenTestType.IFAT)));
60+
PathogenTestType.Q_PCR, PathogenTestType.LAMP, PathogenTestType.INDIRECT_FLUORESCENT_ANTIBODY)));
6161
put(Disease.DENGUE, Collections.unmodifiableList(Arrays.asList(PathogenTestType.NAAT, PathogenTestType.NEUTRALIZING_ANTIBODIES, PathogenTestType.PCR_RT_PCR)));
6262
put(Disease.MEASLES, Collections.unmodifiableList(Arrays.asList(PathogenTestType.GENOTYPING)));
6363
put(Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Collections.unmodifiableList(Arrays.asList(PathogenTestType.SEROGROUPING, PathogenTestType.MULTILOCUS_SEQUENCE_TYPING,

0 commit comments

Comments
 (0)