Skip to content

Commit

Permalink
Temp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
QuyenLy87 committed Jun 10, 2024
1 parent 7fd309d commit 2a6a467
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public Set<ReferenceSetMember> generateModuleDependencies(String branchPath, Str
boolean isEdition = true;
boolean isInternational = true;
Integer dependencyET = null;
String defaultModuleId = null;
if (cs == null) {
logger.warn("No CodeSystem associated with branch {} assuming International CodeSystem", branchPath);
} else {
Expand All @@ -145,8 +146,9 @@ public Set<ReferenceSetMember> generateModuleDependencies(String branchPath, Str
isInternational = false;
}

if (branch.getMetadata() != null && branch.getMetadata().getString(BranchMetadataKeys.DEPENDENCY_PACKAGE) != null ) {
isEdition = false;
if (branch.getMetadata() != null) {
if (branch.getMetadata().getString(BranchMetadataKeys.DEPENDENCY_PACKAGE) != null) isEdition = false;
if (branch.getMetadata().containsKey(BranchMetadataKeys.DEFAULT_MODULE_ID)) defaultModuleId = branch.getMetadata().getString(BranchMetadataKeys.DEFAULT_MODULE_ID);
}

//What modules are actually present in the content?
Expand All @@ -161,7 +163,9 @@ public Set<ReferenceSetMember> generateModuleDependencies(String branchPath, Str
if (isEdition) {
modulesRequired.addAll(SI_MODULES);
}

if (defaultModuleId != null) {
modulesRequired.add(defaultModuleId);
}
if (modulesIncluded != null && !modulesIncluded.isEmpty()) {
modulesRequired.addAll(modulesIncluded);
//But we only want to retain those modules that actually have content
Expand All @@ -187,7 +191,15 @@ public Set<ReferenceSetMember> generateModuleDependencies(String branchPath, Str
if (!isEdition) {
modulesRequired.removeAll(cachedInternationalModules);
}

if (modulesIncluded != null && !modulesIncluded.isEmpty()) {
modulesRequired.addAll(modulesIncluded);
}

//Make sure there is no Derivative Module left behind after removing all cachedInternationalModules
if (defaultModuleId != null && !modulesRequired.contains(defaultModuleId)) {
modulesRequired.add(defaultModuleId);
}

//Recover all these module concepts to find out what module they themselves were defined in.
//Generally, refset type modules are defined in the main extension module
Map<String, String> moduleHierarchyMap = getModuleOfModule(branchPath, new HashSet<>(modulesRequired));
Expand All @@ -197,7 +209,7 @@ public Set<ReferenceSetMember> generateModuleDependencies(String branchPath, Str

//Remove any map entries that we don't need
moduleMap.keySet().retainAll(modulesRequired);
logger.info("Generating MDRS for {}, {} modules [{}]", branchPath, isInternational ? "international" : "extension", String.join(", ", modulesRequired));
logger.info("Generating MDRS for {}, {} modules [{}], modules with content [{}]", branchPath, isInternational ? "international" : "extension", String.join(", ", modulesRequired), String.join(", ", modulesWithContent));

//Update or augment module dependencies as required
for (String moduleId : modulesRequired) {
Expand Down

0 comments on commit 2a6a467

Please sign in to comment.