Skip to content

Commit ef13b2b

Browse files
authored
chore: Format data-processing-service (#533)
This PR is the result of temporarily removing the ratchetFrom: 'origin/main' specification in the root build.gradle, running ./gradlew spotlessApply across the repository, and adding the relevant updates for data-processing-service.
1 parent d22c91c commit ef13b2b

768 files changed

Lines changed: 89807 additions & 88604 deletions

File tree

Some content is hidden

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

data-processing-service/src/main/java/gov/cdc/dataprocessing/ServiceApplication.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
import org.springframework.scheduling.annotation.EnableScheduling;
88
import org.springframework.transaction.annotation.EnableTransactionManagement;
99

10-
1110
@SpringBootApplication
1211
@EnableCaching
1312
@EnableTransactionManagement
1413
@EnableScheduling
1514
@EnableRetry
1615
public class ServiceApplication {
17-
/**
18-
* Main method for spring boot application.
19-
* @param args
20-
*/
21-
public static void main(final String[] args) {
22-
SpringApplication.run(ServiceApplication.class, args);
23-
}
24-
16+
/**
17+
* Main method for spring boot application.
18+
*
19+
* @param args
20+
*/
21+
public static void main(final String[] args) {
22+
SpringApplication.run(ServiceApplication.class, args);
23+
}
2524
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package gov.cdc.dataprocessing.cache;
22

3-
43
import gov.cdc.dataprocessing.service.model.auth_user.AuthUserProfileInfo;
54

65
public class AuthUserProfile {
7-
private AuthUserProfile() {
8-
// for SONARQ
9-
}
10-
public static AuthUserProfileInfo authUserProfileInfo; // NOSONAR
11-
}
6+
private AuthUserProfile() {
7+
// for SONARQ
8+
}
9+
10+
public static AuthUserProfileInfo authUserProfileInfo; // NOSONAR
11+
}

data-processing-service/src/main/java/gov/cdc/dataprocessing/cache/DpStatic.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
import java.util.concurrent.atomic.AtomicBoolean;
44

55
public class DpStatic {
6-
private DpStatic() {}
7-
private static final AtomicBoolean uuidPoolInitialized = new AtomicBoolean(false);
6+
private DpStatic() {}
87

9-
public static boolean isUuidPoolInitialized() {
10-
return uuidPoolInitialized.get();
11-
}
8+
private static final AtomicBoolean uuidPoolInitialized = new AtomicBoolean(false);
129

13-
public static void setUuidPoolInitialized(boolean value) {
14-
uuidPoolInitialized.set(value);
15-
}
10+
public static boolean isUuidPoolInitialized() {
11+
return uuidPoolInitialized.get();
12+
}
1613

17-
public static boolean compareAndSetUuidPoolInitialized(boolean expected, boolean newValue) {
18-
return uuidPoolInitialized.compareAndSet(expected, newValue);
19-
}
14+
public static void setUuidPoolInitialized(boolean value) {
15+
uuidPoolInitialized.set(value);
16+
}
17+
18+
public static boolean compareAndSetUuidPoolInitialized(boolean expected, boolean newValue) {
19+
return uuidPoolInitialized.compareAndSet(expected, newValue);
20+
}
2021
}

data-processing-service/src/main/java/gov/cdc/dataprocessing/cache/OdseCache.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
import java.util.TreeMap;
55

66
public class OdseCache {
7-
public static Map<Object,Object> fromPrePopFormMapping = new TreeMap<>();
8-
public static Map<Object,Object> toPrePopFormMapping = new TreeMap<>();
9-
public static Map<Object,Object> dmbMap = new TreeMap<>();
10-
public static Map<Object,Object> map = new TreeMap<>();
11-
12-
13-
public static TreeMap<Object,Object> DMB_QUESTION_MAP = new TreeMap<>();
14-
public static String GUEST_LIST_HASHED_PA_J = "";
15-
public static String OWNER_LIST_HASHED_PA_J = "";
16-
7+
public static Map<Object, Object> fromPrePopFormMapping = new TreeMap<>();
8+
public static Map<Object, Object> toPrePopFormMapping = new TreeMap<>();
9+
public static Map<Object, Object> dmbMap = new TreeMap<>();
10+
public static Map<Object, Object> map = new TreeMap<>();
11+
12+
public static TreeMap<Object, Object> DMB_QUESTION_MAP = new TreeMap<>();
13+
public static String GUEST_LIST_HASHED_PA_J = "";
14+
public static String OWNER_LIST_HASHED_PA_J = "";
1715
}

data-processing-service/src/main/java/gov/cdc/dataprocessing/cache/PropertyUtilCache.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import java.util.ArrayList;
44

55
public class PropertyUtilCache {
6-
public static ArrayList<Object> cachedHivList = new ArrayList<>();
6+
public static ArrayList<Object> cachedHivList = new ArrayList<>();
77

8-
public static int kafkaFailedCheckStep1 = 0;
9-
public static int kafkaFailedCheckStep2 = 0;
10-
public static int kafkaFailedCheckStep3 = 0;
8+
public static int kafkaFailedCheckStep1 = 0;
9+
public static int kafkaFailedCheckStep2 = 0;
10+
public static int kafkaFailedCheckStep3 = 0;
1111
}

data-processing-service/src/main/java/gov/cdc/dataprocessing/cache/cache_model/SrteCache.java

Lines changed: 63 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,80 @@
22

33
import gov.cdc.dataprocessing.repository.nbs.srte.model.ConditionCode;
44
import gov.cdc.dataprocessing.repository.nbs.srte.model.ElrXref;
5-
65
import java.util.ArrayList;
76
import java.util.HashMap;
87
import java.util.List;
98
import java.util.Objects;
109

11-
@SuppressWarnings({"java:S125", "java:S1118", "java:S1104", "java:S1319", "java:S1444", "java:S2386"})
10+
@SuppressWarnings({
11+
"java:S125",
12+
"java:S1118",
13+
"java:S1104",
14+
"java:S1319",
15+
"java:S1444",
16+
"java:S2386"
17+
})
1218
public class SrteCache {
13-
// usage: SrteCache.loinCodeWithComponentNameMap.get(resVO.getResultedTestCd());
14-
public static HashMap<String, String> loinCodeWithComponentNameMap = new HashMap<>();
15-
// usage: SrteCache.labResultByDescMap.get(susVO.getCodedResultValue());
16-
public static HashMap<String, String> labResultByDescMap = new HashMap<>();
17-
//usage: SrteCache.labResultWithOrganismNameIndMap.get(resVO.getCodedResultValue());
18-
public static HashMap<String, String> labResultWithOrganismNameIndMap = new HashMap<>();
19-
//usage: SrteCache.snomedCodeByDescMap.get(resVO.getCodedResultValue());
20-
public static HashMap<String, String> snomedCodeByDescMap = new HashMap<>();
21-
// usage: aOELOINCs.containsKey(observationDto.getCd())
22-
public static HashMap<String, String> loincCodesMap = new HashMap<>();
23-
// usage: codeMap.containsKey(raceDT.getRaceCd())
24-
public static HashMap<String, String> raceCodesMap = new HashMap<>();
25-
// usage: SrteCache.programAreaCodesMap.get(labVO.getProgramArea());
26-
public static HashMap<String, String> programAreaCodesMap = new HashMap<>();
27-
// usage: SrteCache.programAreaCodesMapWithNbsUid.get(programAreaCode);
28-
public static HashMap<String, Integer> programAreaCodesMapWithNbsUid = new HashMap<>();
29-
// usage: SrteCache.jurisdictionCodeMap.get(labVO.getJurisdiction());
30-
public static HashMap<String, String> jurisdictionCodeMap = new HashMap<>();
31-
// usage: SrteCache.jurisdictionCodeMapWithNbsUid.get(jurisdictionCode);
32-
public static HashMap<String, Integer> jurisdictionCodeMapWithNbsUid = new HashMap<>();
33-
34-
public static HashMap<String, String> codedValuesMap = new HashMap<>();
19+
// usage: SrteCache.loinCodeWithComponentNameMap.get(resVO.getResultedTestCd());
20+
public static HashMap<String, String> loinCodeWithComponentNameMap = new HashMap<>();
21+
// usage: SrteCache.labResultByDescMap.get(susVO.getCodedResultValue());
22+
public static HashMap<String, String> labResultByDescMap = new HashMap<>();
23+
// usage: SrteCache.labResultWithOrganismNameIndMap.get(resVO.getCodedResultValue());
24+
public static HashMap<String, String> labResultWithOrganismNameIndMap = new HashMap<>();
25+
// usage: SrteCache.snomedCodeByDescMap.get(resVO.getCodedResultValue());
26+
public static HashMap<String, String> snomedCodeByDescMap = new HashMap<>();
27+
// usage: aOELOINCs.containsKey(observationDto.getCd())
28+
public static HashMap<String, String> loincCodesMap = new HashMap<>();
29+
// usage: codeMap.containsKey(raceDT.getRaceCd())
30+
public static HashMap<String, String> raceCodesMap = new HashMap<>();
31+
// usage: SrteCache.programAreaCodesMap.get(labVO.getProgramArea());
32+
public static HashMap<String, String> programAreaCodesMap = new HashMap<>();
33+
// usage: SrteCache.programAreaCodesMapWithNbsUid.get(programAreaCode);
34+
public static HashMap<String, Integer> programAreaCodesMapWithNbsUid = new HashMap<>();
35+
// usage: SrteCache.jurisdictionCodeMap.get(labVO.getJurisdiction());
36+
public static HashMap<String, String> jurisdictionCodeMap = new HashMap<>();
37+
// usage: SrteCache.jurisdictionCodeMapWithNbsUid.get(jurisdictionCode);
38+
public static HashMap<String, Integer> jurisdictionCodeMapWithNbsUid = new HashMap<>();
3539

36-
public static HashMap<String, String> codeDescTxtMap = new HashMap<>();
37-
public static HashMap<String, String> countyCodeByDescMap = new HashMap<>();
40+
public static HashMap<String, String> codedValuesMap = new HashMap<>();
3841

39-
public static List<ElrXref> elrXrefsList = new ArrayList<>();
42+
public static HashMap<String, String> codeDescTxtMap = new HashMap<>();
43+
public static HashMap<String, String> countyCodeByDescMap = new HashMap<>();
4044

41-
public static List<ConditionCode> conditionCodes = new ArrayList<>();
42-
// usage: (SrteCache.coInfectionConditionCode.containsKey(edxLabInformationDT.getConditionCode()));
43-
public static HashMap<String, String> coInfectionConditionCode = new HashMap<>();
44-
// usage: condAndFormCdTreeMap.get(phcDT.getCd());
45-
// (SrteCache.investigationFormConditionCode.containsKey(conditionCode))
46-
public static HashMap<String, String> investigationFormConditionCode = new HashMap<>();
45+
public static List<ElrXref> elrXrefsList = new ArrayList<>();
4746

48-
public static ElrXref findRecordForElrXrefsList(String fromCodeSetNm, String fromCode, String toCodeSetNm) {
49-
var option = elrXrefsList.stream()
50-
.filter(x -> x.getFromCodeSetNm().equals(fromCodeSetNm))
51-
.filter(x -> x.getFromCode().equals(fromCode))
52-
.filter(x -> x.getToCodeSetNm().equals(toCodeSetNm))
53-
.findFirst();
54-
return option.orElse(null);
55-
}
47+
public static List<ConditionCode> conditionCodes = new ArrayList<>();
48+
// usage:
49+
// (SrteCache.coInfectionConditionCode.containsKey(edxLabInformationDT.getConditionCode()));
50+
public static HashMap<String, String> coInfectionConditionCode = new HashMap<>();
51+
// usage: condAndFormCdTreeMap.get(phcDT.getCd());
52+
// (SrteCache.investigationFormConditionCode.containsKey(conditionCode))
53+
public static HashMap<String, String> investigationFormConditionCode = new HashMap<>();
5654

57-
public static boolean checkWhetherPAIsStdOrHiv(String paCode) {
58-
if (paCode == null) {
59-
return false;
60-
}
61-
return jurisdictionCodeMapWithNbsUid.containsKey(paCode);
62-
}
55+
public static ElrXref findRecordForElrXrefsList(
56+
String fromCodeSetNm, String fromCode, String toCodeSetNm) {
57+
var option =
58+
elrXrefsList.stream()
59+
.filter(x -> x.getFromCodeSetNm().equals(fromCodeSetNm))
60+
.filter(x -> x.getFromCode().equals(fromCode))
61+
.filter(x -> x.getToCodeSetNm().equals(toCodeSetNm))
62+
.findFirst();
63+
return option.orElse(null);
64+
}
6365

64-
public static ConditionCode findConditionCodeByDescription(String description) {
65-
var option = conditionCodes.stream()
66-
.filter(Objects::nonNull) // Filter out null elements
67-
.filter(cc -> Objects.equals(cc.getConditionShortNm(), description))
68-
.findFirst();
69-
return option.orElse(null);
66+
public static boolean checkWhetherPAIsStdOrHiv(String paCode) {
67+
if (paCode == null) {
68+
return false;
7069
}
70+
return jurisdictionCodeMapWithNbsUid.containsKey(paCode);
71+
}
7172

72-
}
73+
public static ConditionCode findConditionCodeByDescription(String description) {
74+
var option =
75+
conditionCodes.stream()
76+
.filter(Objects::nonNull) // Filter out null elements
77+
.filter(cc -> Objects.equals(cc.getConditionShortNm(), description))
78+
.findFirst();
79+
return option.orElse(null);
80+
}
81+
}

0 commit comments

Comments
 (0)