Skip to content

Commit 94829c8

Browse files
committed
Fixes related tests & sample testing issues
- #14025 - #14023 - #14034 - #14026 - #14031 - #14024
1 parent 360b19e commit 94829c8

9 files changed

Lines changed: 123 additions & 35 deletions

File tree

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
@@ -2431,6 +2431,7 @@ public interface Captions {
24312431
String PathogenTest_rifampicinResistant = "PathogenTest.rifampicinResistant";
24322432
String PathogenTest_rsv_testedDiseaseVariant = "PathogenTest.rsv.testedDiseaseVariant";
24332433
String PathogenTest_rsv_testedDiseaseVariantDetails = "PathogenTest.rsv.testedDiseaseVariantDetails";
2434+
String PathogenTest_rsvSubtype = "PathogenTest.rsvSubtype";
24342435
String PathogenTest_seroGrouping_INVASIVE_PNEUMOCOCCAL_INFECTION = "PathogenTest.seroGrouping.INVASIVE_PNEUMOCOCCAL_INFECTION";
24352436
String PathogenTest_seroGroupSpecification = "PathogenTest.seroGroupSpecification";
24362437
String PathogenTest_seroGroupSpecificationText = "PathogenTest.seroGroupSpecificationText";

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

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ public enum PathogenTestType {
4343
@NotSelectableForNewTests
4444
ANTIBODY_DETECTION,
4545

46+
// Resurrected for new-test selection (#14026 Measles, #14031 Giardia): scoped to the requesting diseases.
47+
@Diseases(value = {
48+
Disease.MEASLES,
49+
Disease.GIARDIASIS })
4650
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
47-
@NotSelectableForNewTests
51+
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
4852
ANTIGEN_DETECTION,
4953

5054
// Merged Culture entry (bacterial + fungal) — supersedes BACTERIAL_CULTURE / FUNGAL_CULTURE for new
@@ -118,19 +122,11 @@ public enum PathogenTestType {
118122
@NotSelectableForNewTests
119123
MICROSCOPY,
120124

125+
// Resurrected for IMI new-test selection (#14034): scoped to Invasive Meningococcal Infection only.
121126
@Diseases(value = {
122-
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
123-
Disease.INVASIVE_MENINGOCOCCAL_INFECTION,
124-
Disease.INVASIVE_PNEUMOCOCCAL_INFECTION,
125-
Disease.MEASLES,
126-
Disease.GIARDIASIS,
127-
Disease.CRYPTOSPORIDIOSIS,
128-
Disease.DENGUE,
129-
Disease.MALARIA,
130-
Disease.SALMONELLOSIS,
131-
Disease.SHIGELLOSIS }, hide = true)
127+
Disease.INVASIVE_MENINGOCOCCAL_INFECTION })
132128
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
133-
@NotSelectableForNewTests
129+
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
134130
LATEX_AGGLUTINATION,
135131

136132
@Diseases(value = {
@@ -347,6 +343,12 @@ public enum PathogenTestType {
347343
@ResultValueTypeRel(ResultValueType.TEXT)
348344
GENOTYPING,
349345

346+
@Diseases(value = {
347+
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
348+
@PathogenTestCategoryRel(PathogenTestCategory.MOLECULAR_ASSAYS)
349+
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
350+
RSV_SUBTYPING,
351+
350352
@Diseases(value = {
351353
Disease.TUBERCULOSIS,
352354
Disease.LATENT_TUBERCULOSIS })
@@ -440,7 +442,8 @@ public enum PathogenTestType {
440442

441443
@Diseases(value = {
442444
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
443-
Disease.DENGUE })
445+
Disease.DENGUE,
446+
Disease.GIARDIASIS })
444447
@PathogenTestCategoryRel(PathogenTestCategory.ANTIGEN_DETECTION)
445448
@ResultValueTypeRel(ResultValueType.QUALITATIVE)
446449
RAPID_ANTIGEN_DETECTION,

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,12 @@ public enum SampleMaterial {
310310
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
311311
Disease.INVASIVE_MENINGOCOCCAL_INFECTION,
312312
Disease.INVASIVE_PNEUMOCOCCAL_INFECTION,
313-
Disease.MEASLES,
314313
Disease.GIARDIASIS,
315314
Disease.CRYPTOSPORIDIOSIS,
316315
Disease.MALARIA,
317316
Disease.DENGUE,
318317
Disease.SALMONELLOSIS,
319318
Disease.SHIGELLOSIS }, hide = true)
320-
@HideForCountries(countries = {
321-
CountryHelper.COUNTRY_CODE_LUXEMBOURG })
322319
OP_ASPIRATE,
323320

324321
@Diseases(value = {
@@ -330,8 +327,6 @@ public enum SampleMaterial {
330327
Disease.DENGUE,
331328
Disease.SALMONELLOSIS,
332329
Disease.SHIGELLOSIS }, hide = true)
333-
@HideForCountries(countries = {
334-
CountryHelper.COUNTRY_CODE_LUXEMBOURG })
335330
NP_ASPIRATE,
336331

337332
@Diseases(value = {
@@ -346,13 +341,13 @@ public enum SampleMaterial {
346341
Disease.SHIGELLOSIS }, hide = true)
347342
PLEURAL_FLUID,
348343

344+
// Re-activated for RSV new samples (#14023): the RSV specimen requirements list Nasopharyngeal lavage.
345+
// No canonical SNOMED-CT code on the specimen sheet, so its SNOMED export stays null.
349346
@Diseases(value = {
350347
Disease.RESPIRATORY_SYNCYTIAL_VIRUS })
351-
@Deprecated
352348
NASOPHARYNGEAL_LAVAGE,
353349

354350
@Diseases(value = {
355-
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
356351
Disease.INVASIVE_MENINGOCOCCAL_INFECTION,
357352
Disease.INVASIVE_PNEUMOCOCCAL_INFECTION,
358353
Disease.GIARDIASIS,
@@ -372,8 +367,6 @@ public enum SampleMaterial {
372367
Disease.DENGUE,
373368
Disease.SALMONELLOSIS,
374369
Disease.SHIGELLOSIS }, hide = true)
375-
@HideForCountries(countries = {
376-
CountryHelper.COUNTRY_CODE_LUXEMBOURG })
377370
AMNIOTIC_FLUID,
378371

379372
@Diseases(value = {
@@ -499,12 +492,12 @@ public enum SampleMaterial {
499492
@Diseases(value = {
500493
Disease.SALMONELLOSIS,
501494
Disease.SHIGELLOSIS,
502-
Disease.DENGUE}, hide = true)
495+
Disease.DENGUE }, hide = true)
503496
BONE,
504497

505498
@Diseases(value = {
506499
Disease.SHIGELLOSIS,
507-
Disease.DENGUE}, hide = true)
500+
Disease.DENGUE }, hide = true)
508501
BONE_MARROW,
509502

510503
@Diseases(value = {
@@ -546,7 +539,7 @@ public enum SampleMaterial {
546539
@Diseases(value = {
547540
Disease.SALMONELLOSIS,
548541
Disease.SHIGELLOSIS,
549-
Disease.DENGUE}, hide = true)
542+
Disease.DENGUE }, hide = true)
550543
LUNG_TISSUE,
551544

552545
@Diseases(value = {
@@ -639,8 +632,8 @@ public enum SampleMaterial {
639632
* new samples. This set is the runtime index used by {@link #isDeprecated()}; it must stay in sync
640633
* with the {@code @Deprecated} constants above.
641634
*/
642-
private static final Set<SampleMaterial> DEPRECATED_MATERIALS = Collections.unmodifiableSet(
643-
EnumSet.of(URINE_PM, CORNEA_PM, NASAL_SWAB, NASOPHARYNGEAL_LAVAGE, THROAT_SWAB, THROAT_ASPIRATE, SOFT_TISSUE, BONE_AND_JOINT, OTHER));
635+
private static final Set<SampleMaterial> DEPRECATED_MATERIALS =
636+
Collections.unmodifiableSet(EnumSet.of(URINE_PM, CORNEA_PM, NASAL_SWAB, THROAT_SWAB, THROAT_ASPIRATE, SOFT_TISSUE, BONE_AND_JOINT, OTHER));
644637

645638
/**
646639
* @return SNOMED-CT code for this sample material, or {@code null} if no canonical code is mapped.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,7 @@ PathogenTest.seroGroupSpecification=Serogroup Specification
19981998
PathogenTest.seroGroupSpecificationText=Specify Serogroup Specification Method
19991999
PathogenTest.genoType=Genotype result
20002000
PathogenTest.genoTypeText=Specify genotype text
2001+
PathogenTest.rsvSubtype=RSV subtype
20012002
PathogenTest.tubeNil=Tube Nil
20022003
PathogenTest.tubeNilGT10=Tube Nil >10
20032004
PathogenTest.tubeAgTb1=Tube Ag TB1

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@ PathogenTestType.SLIDE_AGGLUTINATION = Slide Agglutination
12751275
PathogenTestType.WHOLE_GENOME_SEQUENCING = Whole-Genome Sequencing (WGS)
12761276
PathogenTestType.SEROGROUPING = Serogrouping
12771277
PathogenTestType.GENOTYPING = Genotyping
1278+
PathogenTestType.RSV_SUBTYPING = RSV subtyping
12781279
PathogenTestType.RAPID_ANTIGEN_DETECTION = Rapid antigen detection test
12791280
PathogenTestType.ENZYME_LINKED_IMMUNOSORBENT_ASSAY = Enzyme-linked immunosorbent assay (ELISA)
12801281
PathogenTestType.NAAT = Nucleic acid amplification test (NAAT)
@@ -1470,7 +1471,7 @@ SampleMaterial.NP_ASPIRATE = Nasopharyngeal aspirate
14701471
SampleMaterial.NP_SWAB = Nasopharyngeal swab
14711472
SampleMaterial.NUCHAL_SKIN_BIOPSY = Nuchal skin biopsy
14721473
SampleMaterial.OP_ASPIRATE = Oropharyngeal (throat) aspirate
1473-
SampleMaterial.THROAT_SWAB = Oropharyngeal (throat) swab
1474+
SampleMaterial.THROAT_SWAB = Oropharyngeal (throat) swab (old)
14741475
SampleMaterial.PERITONEAL_FLUID = Peritoneal fluid
14751476
SampleMaterial.PLASMA = Plasma
14761477
SampleMaterial.PLEURAL_FLUID = Pleural fluid
@@ -1498,7 +1499,7 @@ SampleMaterial.NASAL_SWAB = Nasal swab
14981499
SampleMaterial.OTHER = Other
14991500
SampleMaterial.CORNEA_PM = Cornea p.m
15001501
SampleMaterial.URINE_PM = Urine p.m
1501-
SampleMaterial.OROPHARYNGEAL_SWAB = Oropharyngeal swab
1502+
SampleMaterial.OROPHARYNGEAL_SWAB = Oropharyngeal (throat) swab
15021503
SampleMaterial.THROAT_ASPIRATE = Throat aspirate
15031504
SampleMaterial.NASOPHARYNGEAL_LAVAGE = Nasopharyngeal lavage
15041505
SampleMaterial.INTESTINAL_FLUID = Intestinal fluid

sormas-api/src/test/java/de/symeda/sormas/api/sample/PathogenTestTypeTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ public class PathogenTestTypeTest {
3030
*/
3131
private static final Set<PathogenTestType> EXPECTED_LEGACY = EnumSet.of(
3232
PathogenTestType.ANTIBODY_DETECTION,
33-
PathogenTestType.ANTIGEN_DETECTION,
3433
PathogenTestType.INCUBATION_TIME,
3534
PathogenTestType.MICROSCOPY,
36-
PathogenTestType.LATEX_AGGLUTINATION,
3735
PathogenTestType.CQ_VALUE_DETECTION,
3836
PathogenTestType.SEQUENCING,
3937
// Superseded by the per-Ig-class ELISA split (#13951); kept so historic records still render and
@@ -100,7 +98,10 @@ public void newMethodsAreSelectable() {
10098
PathogenTestType.MALDI_TOF,
10199
PathogenTestType.ACID_FAST_STAIN,
102100
PathogenTestType.GENOTYPIC_RESISTANCE_TEST,
103-
PathogenTestType.FLOW_CYTOMETRY);
101+
PathogenTestType.FLOW_CYTOMETRY,
102+
PathogenTestType.ANTIGEN_DETECTION,
103+
PathogenTestType.LATEX_AGGLUTINATION,
104+
PathogenTestType.RSV_SUBTYPING);
104105
for (PathogenTestType type : newlyAdded) {
105106
assertTrue(PathogenTestType.isSelectableForNewTests(type), type.name() + " should be selectable for new tests");
106107
assertFalse(EXPECTED_LEGACY.contains(type), type.name() + " is a new method, not legacy");

sormas-api/src/test/java/de/symeda/sormas/api/sample/SampleMaterialTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ public void testActiveMaterialsMatchUpgradedSpec() {
2222

2323
// Issue #13948 (#1): 44 from #13560 + 4 new (cord blood, lung tissue, placenta, ulcer swab)
2424
// + 4 un-deprecated (biopsy, duodenum/intestinal fluid, lower respiratory tract)
25-
// + oropharyngeal swab un-deprecated, throat swab now deprecated = 52 active specimen types
26-
assertThat(active, hasSize(52));
25+
// + oropharyngeal swab un-deprecated, throat swab now deprecated = 52
26+
// + nasopharyngeal lavage re-activated for RSV (#14023) = 53 active specimen types
27+
assertThat(active, hasSize(53));
2728
}
2829

2930
@Test
@@ -37,7 +38,6 @@ public void testDeprecatedMaterials() {
3738
SampleMaterial.URINE_PM,
3839
SampleMaterial.CORNEA_PM,
3940
SampleMaterial.NASAL_SWAB,
40-
SampleMaterial.NASOPHARYNGEAL_LAVAGE,
4141
SampleMaterial.THROAT_SWAB,
4242
SampleMaterial.THROAT_ASPIRATE,
4343
SampleMaterial.SOFT_TISSUE,

sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/DiseaseSectionFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public static AbstractDiseaseSectionComponent forDisease(Disease disease) {
5151
return new MalariaSectionComponent();
5252
case SHIGELLOSIS:
5353
return new ShigellosisSectionComponent();
54+
case RESPIRATORY_SYNCYTIAL_VIRUS:
55+
return new RsvSectionComponent();
5456
default:
5557
return new DefaultSectionComponent();
5658
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*******************************************************************************
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*******************************************************************************/
18+
package de.symeda.sormas.ui.samples.diseasesection;
19+
20+
import com.vaadin.ui.ComboBox;
21+
22+
import de.symeda.sormas.api.sample.PathogenTestDto;
23+
import de.symeda.sormas.api.sample.PathogenTestResultType;
24+
import de.symeda.sormas.api.sample.PathogenTestType;
25+
import de.symeda.sormas.api.sample.RsvSubtype;
26+
import de.symeda.sormas.ui.samples.events.TestResultChangedEvent;
27+
import de.symeda.sormas.ui.samples.events.TestTypeChangedEvent;
28+
29+
/**
30+
* RSV section: reveals the RSV subtype (A or B) selector on a positive {@link PathogenTestType#RSV_SUBTYPING}
31+
* result (#14024). The subtype is captured in {@link PathogenTestDto#getRsvSubtype()}.
32+
*/
33+
public class RsvSectionComponent extends AbstractDiseaseSectionComponent {
34+
35+
private ComboBox<RsvSubtype> rsvSubtypeField;
36+
37+
private PathogenTestType currentTestType;
38+
private PathogenTestResultType currentResult;
39+
40+
@Override
41+
protected void buildLayout() {
42+
rsvSubtypeField = createComboBox(PathogenTestDto.RSV_SUBTYPE);
43+
rsvSubtypeField.setItemCaptionGenerator(RsvSubtype::toString);
44+
rsvSubtypeField.setVisible(false);
45+
updateRsvSubtypeItems();
46+
addRow(rsvSubtypeField);
47+
48+
binder.forField(rsvSubtypeField).bind(PathogenTestDto::getRsvSubtype, PathogenTestDto::setRsvSubtype);
49+
}
50+
51+
@Override
52+
protected void wireVisibility() {
53+
track(eventBus.on(TestTypeChangedEvent.class, event -> {
54+
currentTestType = event.getTestType();
55+
updateVisibility();
56+
updateRsvSubtypeItems();
57+
}));
58+
59+
track(eventBus.on(TestResultChangedEvent.class, event -> {
60+
currentResult = event.getTestResult();
61+
updateVisibility();
62+
}));
63+
}
64+
65+
private void updateVisibility() {
66+
boolean visible = currentTestType == PathogenTestType.RSV_SUBTYPING && currentResult == PathogenTestResultType.POSITIVE;
67+
rsvSubtypeField.setVisible(visible);
68+
if (!visible) {
69+
rsvSubtypeField.clear();
70+
}
71+
updateRowAndSelfVisibility();
72+
}
73+
74+
@Override
75+
protected void clearOwnedFields() {
76+
PathogenTestDto dto = binder.getBean();
77+
if (dto == null) {
78+
return;
79+
}
80+
dto.setRsvSubtype(null);
81+
}
82+
83+
private void updateRsvSubtypeItems() {
84+
updateComboBoxByDisease(rsvSubtypeField, RsvSubtype.class, disease);
85+
}
86+
}

0 commit comments

Comments
 (0)