Skip to content

Commit 3b63518

Browse files
authored
Merge pull request #13385 from SORMAS-Foundation/feature-13317-integration-of-tuberculosis-disease
Feature 13317 integration of tuberculosis disease
2 parents 8b97231 + d08c036 commit 3b63518

File tree

55 files changed

+3950
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3950
-315
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/Disease.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public enum Disease
5858
SNAKE_BITE(true, false, false, true, false, 0, true, false, false),
5959
RUBELLA(true, false, false, true, false, 0, true, false, false),
6060
TUBERCULOSIS(true, true, true, true, false, 0, true, false, false),
61+
LATENT_TUBERCULOSIS(true, true, true, true, false, 0, true, false, false),
6162
LEPROSY(true, false, false, true, false, 0, true, false, false),
6263
LYMPHATIC_FILARIASIS(true, false, false, true, false, 0, true, false, false),
6364
BURULI_ULCER(true, false, false, true, false, 0, true, false, false),

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
233233
public static final String DEPARTMENT = "department";
234234

235235
public static final String NOTIFIER = "notifier";
236+
public static final String RADIOGRAPHY_COMPATIBILITY = "radiographyCompatibility";
237+
public static final String OTHER_DIAGNOSTIC_CRITERIA = "otherDiagnosticCriteria";
236238

237239
// Fields are declared in the order they should appear in the import template
238240

@@ -639,6 +641,8 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
639641
private String department;
640642

641643
private NotifierReferenceDto notifier;
644+
private RadiographyCompatibility radiographyCompatibility;
645+
private String otherDiagnosticCriteria;
642646

643647
public static CaseDataDto build(PersonReferenceDto person, Disease disease) {
644648
return build(person, disease, HealthConditionsDto.build());
@@ -1820,6 +1824,22 @@ public void setDepartment(String department) {
18201824
this.department = department;
18211825
}
18221826

1827+
public RadiographyCompatibility getRadiographyCompatibility() {
1828+
return radiographyCompatibility;
1829+
}
1830+
1831+
public void setRadiographyCompatibility(RadiographyCompatibility radiographyCompatibility) {
1832+
this.radiographyCompatibility = radiographyCompatibility;
1833+
}
1834+
1835+
public String getOtherDiagnosticCriteria() {
1836+
return otherDiagnosticCriteria;
1837+
}
1838+
1839+
public void setOtherDiagnosticCriteria(String otherDiagnosticCriteria) {
1840+
this.otherDiagnosticCriteria = otherDiagnosticCriteria;
1841+
}
1842+
18231843
/**
18241844
* Checks if the case is an invasive bacterial disease (meningococcal or pneumococcal)
18251845
* @return boolean
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.caze;
17+
18+
import de.symeda.sormas.api.Disease;
19+
import de.symeda.sormas.api.i18n.I18nProperties;
20+
import de.symeda.sormas.api.utils.Diseases;
21+
22+
public enum RadiographyCompatibility {
23+
24+
@Diseases(value = {
25+
Disease.TUBERCULOSIS })
26+
COMPATIBLE_WITH_TB,
27+
@Diseases(value = {
28+
Disease.TUBERCULOSIS })
29+
NOT_COMPATIBLE_WITH_TB;
30+
31+
@Override
32+
public String toString() {
33+
return I18nProperties.getEnumCaption(this);
34+
}
35+
}

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ public interface Captions {
730730
String CaseData_notifyingClinicDetails = "CaseData.notifyingClinicDetails";
731731
String CaseData_numberOfVisits = "CaseData.numberOfVisits";
732732
String CaseData_otherDeletionReason = "CaseData.otherDeletionReason";
733+
String CaseData_otherDiagnosticCriteria = "CaseData.otherDiagnosticCriteria";
733734
String CaseData_outcome = "CaseData.outcome";
734735
String CaseData_outcomeDate = "CaseData.outcomeDate";
735736
String CaseData_overwriteFollowUpUntil = "CaseData.overwriteFollowUpUntil";
@@ -773,6 +774,7 @@ public interface Captions {
773774
String CaseData_quarantineTo = "CaseData.quarantineTo";
774775
String CaseData_quarantineTypeDetails = "CaseData.quarantineTypeDetails";
775776
String CaseData_rabiesType = "CaseData.rabiesType";
777+
String CaseData_radiographyCompatibility = "CaseData.radiographyCompatibility";
776778
String CaseData_region = "CaseData.region";
777779
String CaseData_regionLevelDate = "CaseData.regionLevelDate";
778780
String CaseData_reInfection = "CaseData.reInfection";
@@ -1381,6 +1383,14 @@ public interface Captions {
13811383
String devModeSampleSendDispatch = "devModeSampleSendDispatch";
13821384
String devModeSampleStartDate = "devModeSampleStartDate";
13831385
String devModeUseSeed = "devModeUseSeed";
1386+
String diagnosisCriteriaDetailTestResult = "diagnosisCriteriaDetailTestResult";
1387+
String diagnosisCriteriaDetailTestResultDate = "diagnosisCriteriaDetailTestResultDate";
1388+
String diagnosisCriteriaDetailTestResultNeg = "diagnosisCriteriaDetailTestResultNeg";
1389+
String diagnosisCriteriaDetailTestResultOngoing = "diagnosisCriteriaDetailTestResultOngoing";
1390+
String diagnosisCriteriaDetailTestResultPos = "diagnosisCriteriaDetailTestResultPos";
1391+
String diagnosisCriteriaDetailTestTypeNo = "diagnosisCriteriaDetailTestTypeNo";
1392+
String diagnosisCriteriaDetailTestTypeNotApplicable = "diagnosisCriteriaDetailTestTypeNotApplicable";
1393+
String diagnosisCriteriaDetailTestTypeYes = "diagnosisCriteriaDetailTestTypeYes";
13841394
String disease = "disease";
13851395
String DiseaseBurden_caseCount = "DiseaseBurden.caseCount";
13861396
String DiseaseBurden_caseDeathCount = "DiseaseBurden.caseDeathCount";
@@ -2190,12 +2200,15 @@ public interface Captions {
21902200
String PathogenTest_ctValueRdrpS = "PathogenTest.ctValueRdrpS";
21912201
String PathogenTest_ctValueS = "PathogenTest.ctValueS";
21922202
String PathogenTest_deletionReason = "PathogenTest.deletionReason";
2203+
String PathogenTest_drugSusceptibility = "PathogenTest.drugSusceptibility";
21932204
String PathogenTest_externalId = "PathogenTest.externalId";
21942205
String PathogenTest_externalOrderId = "PathogenTest.externalOrderId";
21952206
String PathogenTest_fourFoldIncreaseAntibodyTiter = "PathogenTest.fourFoldIncreaseAntibodyTiter";
2207+
String PathogenTest_isoniazidResistant = "PathogenTest.isoniazidResistant";
21962208
String PathogenTest_lab = "PathogenTest.lab";
21972209
String PathogenTest_labDetails = "PathogenTest.labDetails";
21982210
String PathogenTest_otherDeletionReason = "PathogenTest.otherDeletionReason";
2211+
String PathogenTest_patternProfile = "PathogenTest.patternProfile";
21992212
String PathogenTest_pcrTestSpecification = "PathogenTest.pcrTestSpecification";
22002213
String PathogenTest_preliminary = "PathogenTest.preliminary";
22012214
String PathogenTest_prescriber = "PathogenTest.prescriber";
@@ -2208,9 +2221,12 @@ public interface Captions {
22082221
String PathogenTest_prescriberPhysicianCode = "PathogenTest.prescriberPhysicianCode";
22092222
String PathogenTest_prescriberPostalCode = "PathogenTest.prescriberPostalCode";
22102223
String PathogenTest_reportDate = "PathogenTest.reportDate";
2224+
String PathogenTest_rifampicinResistant = "PathogenTest.rifampicinResistant";
22112225
String PathogenTest_seroGroupSpecification = "PathogenTest.seroGroupSpecification";
22122226
String PathogenTest_seroGroupSpecificationText = "PathogenTest.seroGroupSpecificationText";
22132227
String PathogenTest_serotype = "PathogenTest.serotype";
2228+
String PathogenTest_specie = "PathogenTest.specie";
2229+
String PathogenTest_strainCallStatus = "PathogenTest.strainCallStatus";
22142230
String PathogenTest_seroTypingMethod = "PathogenTest.seroTypingMethod";
22152231
String PathogenTest_seroTypingMethodText = "PathogenTest.seroTypingMethodText";
22162232
String PathogenTest_testDateTime = "PathogenTest.testDateTime";
@@ -2223,6 +2239,7 @@ public interface Captions {
22232239
String PathogenTest_testResult = "PathogenTest.testResult";
22242240
String PathogenTest_testResultText = "PathogenTest.testResultText";
22252241
String PathogenTest_testResultVerified = "PathogenTest.testResultVerified";
2242+
String PathogenTest_testScale = "PathogenTest.testScale";
22262243
String PathogenTest_testType = "PathogenTest.testType";
22272244
String PathogenTest_testTypeText = "PathogenTest.testTypeText";
22282245
String PathogenTest_typingId = "PathogenTest.typingId";
@@ -3052,6 +3069,9 @@ public interface Captions {
30523069
String TestReport_testLabPostalCode = "TestReport.testLabPostalCode";
30533070
String TestReport_testResult = "TestReport.testResult";
30543071
String TestReport_testType = "TestReport.testType";
3072+
String Therapy_beijingLineage = "Therapy.beijingLineage";
3073+
String Therapy_directlyObservedTreatment = "Therapy.directlyObservedTreatment";
3074+
String Therapy_mdrXdrTuberculosis = "Therapy.mdrXdrTuberculosis";
30553075
String titleAefiInvestigationBasicDetails = "titleAefiInvestigationBasicDetails";
30563076
String titleAefiInvestigationColdChainAndTransport = "titleAefiInvestigationColdChainAndTransport";
30573077
String titleAefiInvestigationColdChainAndTransportLastVaccineStoragePoint = "titleAefiInvestigationColdChainAndTransportLastVaccineStoragePoint";

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ public interface Strings {
589589
String headingDeleteContacts = "headingDeleteContacts";
590590
String headingDeleteUserRoleNotPossible = "headingDeleteUserRoleNotPossible";
591591
String headingDeleteVaccinations = "headingDeleteVaccinations";
592+
String headingDiagnosisCriteria = "headingDiagnosisCriteria";
592593
String headingDisableLineListing = "headingDisableLineListing";
593594
String headingDiscardUnsavedChanges = "headingDiscardUnsavedChanges";
594595
String headingDocumentCreated = "headingDocumentCreated";
@@ -597,6 +598,7 @@ public interface Strings {
597598
String headingDownloadErrorReport = "headingDownloadErrorReport";
598599
String headingDownloadImportGuide = "headingDownloadImportGuide";
599600
String headingDownloadImportTemplate = "headingDownloadImportTemplate";
601+
String headingDrugSusceptibility = "headingDrugSusceptibility";
600602
String headingEditAction = "headingEditAction";
601603
String headingEditAdditionalTest = "headingEditAdditionalTest";
602604
String headingEditAggregateReport = "headingEditAggregateReport";
@@ -1818,6 +1820,7 @@ public interface Strings {
18181820
String promptImmunizationRecoveryDateFrom = "promptImmunizationRecoveryDateFrom";
18191821
String promptImmunizationStartDateFrom = "promptImmunizationStartDateFrom";
18201822
String promptImmunizationValidFrom = "promptImmunizationValidFrom";
1823+
String promptMicValue = "promptMicValue";
18211824
String promptNamePhoneEmail = "promptNamePhoneEmail";
18221825
String promptNewCaseDateType = "promptNewCaseDateType";
18231826
String promptPersonDuplicateSearchIdExternalId = "promptPersonDuplicateSearchIdExternalId";
@@ -1826,6 +1829,7 @@ public interface Strings {
18261829
String promptRegion = "promptRegion";
18271830
String promptRelatedPersonLikeField = "promptRelatedPersonLikeField";
18281831
String promptRemarks = "promptRemarks";
1832+
String promptResistanceResult = "promptResistanceResult";
18291833
String promptSampleDashboardFilterDateType = "promptSampleDashboardFilterDateType";
18301834
String promptSampleDateFrom = "promptSampleDateFrom";
18311835
String promptSampleDateTo = "promptSampleDateTo";

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Validations.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ public interface Validations {
202202
String patchUnsupportedCollectionFieldType = "patchUnsupportedCollectionFieldType";
203203
String patchWrongUuid = "patchWrongUuid";
204204
String pathogenTestValidDisease = "pathogenTestValidDisease";
205+
String pathogenTestValidDrugSusceptibility = "pathogenTestValidDrugSusceptibility";
205206
String pathogenTestValidPathogen = "pathogenTestValidPathogen";
206207
String pathogenTestValidSampleOrEnvironment = "pathogenTestValidSampleOrEnvironment";
207208
String patternNotMatching = "patternNotMatching";
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.sample;
17+
18+
import java.lang.reflect.Field;
19+
import java.util.Arrays;
20+
import java.util.List;
21+
import java.util.stream.Collectors;
22+
23+
import de.symeda.sormas.api.i18n.I18nProperties;
24+
import de.symeda.sormas.api.utils.ApplicableToPathogenTests;
25+
26+
public enum PathogenSpecie {
27+
28+
@ApplicableToPathogenTests(value = {
29+
PathogenTestType.SPOLIGOTYPING })
30+
MYCOBATERIUM_AFRICANUM,
31+
@ApplicableToPathogenTests(value = {
32+
PathogenTestType.SPOLIGOTYPING })
33+
MYCOBATERIUM_BOVIS,
34+
@ApplicableToPathogenTests(value = {
35+
PathogenTestType.SPOLIGOTYPING })
36+
MYCOBATERIUM_TUBERCULOSIS,
37+
@ApplicableToPathogenTests(value = {
38+
PathogenTestType.SPOLIGOTYPING })
39+
OTHER_MTBC_MEMBER,
40+
@ApplicableToPathogenTests(value = {
41+
PathogenTestType.SPOLIGOTYPING })
42+
UNKNOWN,
43+
@ApplicableToPathogenTests(value = {
44+
PathogenTestType.SPOLIGOTYPING })
45+
NOT_APPLICABLE;
46+
47+
@Override
48+
public String toString() {
49+
return I18nProperties.getEnumCaption(this);
50+
}
51+
52+
public static List<PathogenSpecie> forPathogenTest(PathogenTestType pathogenTest) {
53+
return Arrays.stream(values()).filter(status -> {
54+
try {
55+
Field f = PathogenSpecie.class.getField(status.name());
56+
ApplicableToPathogenTests ann = f.getAnnotation(ApplicableToPathogenTests.class);
57+
return ann != null && Arrays.asList(ann.value()).contains(pathogenTest);
58+
} catch (NoSuchFieldException e) {
59+
return false;
60+
}
61+
}).collect(Collectors.toList());
62+
}
63+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.sample;
17+
18+
import java.lang.reflect.Field;
19+
import java.util.Arrays;
20+
import java.util.List;
21+
import java.util.stream.Collectors;
22+
23+
import de.symeda.sormas.api.Disease;
24+
import de.symeda.sormas.api.i18n.I18nProperties;
25+
import de.symeda.sormas.api.utils.ApplicableToPathogenTests;
26+
import de.symeda.sormas.api.utils.Diseases;
27+
28+
public enum PathogenStrainCallStatus {
29+
30+
@Diseases(value = {
31+
Disease.TUBERCULOSIS })
32+
@ApplicableToPathogenTests(value = {
33+
PathogenTestType.BEIJINGGENOTYPING })
34+
BEIJING,
35+
@Diseases(value = {
36+
Disease.TUBERCULOSIS })
37+
@ApplicableToPathogenTests(value = {
38+
PathogenTestType.BEIJINGGENOTYPING })
39+
NOBEIJING,
40+
@Diseases(value = {
41+
Disease.TUBERCULOSIS })
42+
@ApplicableToPathogenTests(value = {
43+
PathogenTestType.BEIJINGGENOTYPING })
44+
POSSBEIJING,
45+
@Diseases(value = {
46+
Disease.TUBERCULOSIS })
47+
@ApplicableToPathogenTests(value = {
48+
PathogenTestType.BEIJINGGENOTYPING })
49+
UNKNOWN;
50+
51+
@Override
52+
public String toString() {
53+
return I18nProperties.getEnumCaption(this);
54+
}
55+
56+
public static List<PathogenStrainCallStatus> forDisease(Disease disease) {
57+
return Arrays.stream(values()).filter(status -> {
58+
try {
59+
Field f = PathogenStrainCallStatus.class.getField(status.name());
60+
Diseases ann = f.getAnnotation(Diseases.class);
61+
return ann != null && Arrays.asList(ann.value()).contains(disease);
62+
} catch (NoSuchFieldException e) {
63+
return false;
64+
}
65+
}).collect(Collectors.toList());
66+
}
67+
68+
public static List<PathogenStrainCallStatus> forPathogenTest(PathogenTestType pathogenTest) {
69+
return Arrays.stream(values()).filter(status -> {
70+
try {
71+
Field f = PathogenStrainCallStatus.class.getField(status.name());
72+
ApplicableToPathogenTests ann = f.getAnnotation(ApplicableToPathogenTests.class);
73+
return ann != null && Arrays.asList(ann.value()).contains(pathogenTest);
74+
} catch (NoSuchFieldException e) {
75+
return false;
76+
}
77+
}).collect(Collectors.toList());
78+
}
79+
80+
public static List<PathogenStrainCallStatus> forDiseaseAndTest(Disease disease, PathogenTestType pathogenTest) {
81+
return Arrays.stream(values()).filter(status -> {
82+
try {
83+
Field f = PathogenStrainCallStatus.class.getField(status.name());
84+
Diseases diseaseAnn = f.getAnnotation(Diseases.class);
85+
ApplicableToPathogenTests testAnn = f.getAnnotation(ApplicableToPathogenTests.class);
86+
return diseaseAnn != null
87+
&& testAnn != null
88+
&& Arrays.asList(diseaseAnn.value()).contains(disease)
89+
&& Arrays.asList(testAnn.value()).contains(pathogenTest);
90+
} catch (NoSuchFieldException e) {
91+
return false;
92+
}
93+
}).collect(Collectors.toList());
94+
}
95+
}

0 commit comments

Comments
 (0)