diff --git a/src/main/java/org/snomed/snowstorm/core/data/services/ModuleDependencyService.java b/src/main/java/org/snomed/snowstorm/core/data/services/ModuleDependencyService.java index b76238402..7093e567f 100644 --- a/src/main/java/org/snomed/snowstorm/core/data/services/ModuleDependencyService.java +++ b/src/main/java/org/snomed/snowstorm/core/data/services/ModuleDependencyService.java @@ -62,9 +62,6 @@ public class ModuleDependencyService extends ComponentService { @Lazy private ReferenceSetMemberService refsetService; - @Value("${mdrs.exclude.derivative-modules}") - private boolean excludeDerivativeModules; - @Value("#{'${mdrs.blocklist}'.split('\\s*,\\s*')}") //Split and trim spaces private List blockListedModules; @@ -73,10 +70,6 @@ public class ModuleDependencyService extends ComponentService { private long cacheValidAt = 0L; private Set cachedInternationalModules; - //Derivative modules are those belonging with the International Edition (like the GPS) - //but not packaged with it, so not included eg in the US Edition - private Set derivativeModules; - //Refresh when the HEAD time is greater than the HEAD time on MAIN //Check every 30 mins to save time when export operation actually called @Scheduled(fixedDelay = 1800_000, initialDelay = 180_000) @@ -97,12 +90,6 @@ public synchronized void refreshCache() { if (!cachedInternationalModules.contains(Concepts.ICD10_MODULE)) { SI_MODULES.remove(Concepts.ICD10_MODULE); } - - derivativeModules = cachedInternationalModules.stream() - .filter(m -> !SI_MODULES.contains(m)) - .collect(Collectors.toSet()); - - logger.info("{} derivative modules set to be {} in MDRS export.", derivativeModules.size(), (excludeDerivativeModules?"excluded":"included")); } } @@ -350,7 +337,7 @@ private String determineClosestParentFromExistingHierarchy(String module, List ancestors = findAncestorModules(module, selfMappedModules, moduleMap.get(module)); //If we only see a single ancestor, that's our closest parent - if (ancestors.size() == 0) { + if (ancestors.isEmpty()) { return module; } else if (ancestors.size() == 1) { return ancestors.get(0); @@ -525,17 +512,11 @@ private Map getModuleOfModule(String branchPath, Set mod public boolean isExportable(ReferenceSetMember rm, boolean isExtension) { //Extensions don't list dependencies of core modules - if (isExtension && SI_MODULES.contains(rm.getModuleId())) { - return false; - } - if (excludeDerivativeModules && derivativeModules.contains(rm.getModuleId())) { - return false; - } - - if (blockListedModules != null && blockListedModules.contains(rm.getModuleId())) { + if ((isExtension && SI_MODULES.contains(rm.getModuleId()) + || (blockListedModules != null && blockListedModules.contains(rm.getModuleId())))) { return false; } - + return true; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b592d3aa1..858b94de5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -877,7 +877,6 @@ daily-build.import.resources.cloud.path= # Configuration around MDRS behaviour on versioning and export # The blocklisted modules (comma separatate SCTIDs) will not be included in an exported MDRS # ---------------------------------------- -mdrs.exclude.derivative-modules=true mdrs.blocklist= # Particular code systems in which the version will appear after the published date