fix for bug loading Measures from packages

This commit is contained in:
Grahame Grieve 2020-08-06 22:35:14 +10:00
parent 9b0ce65f08
commit f93f47ee24
2 changed files with 10 additions and 10 deletions

View File

@ -386,7 +386,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
return new String[] {"CodeSystem", "ValueSet", "ConceptMap", "NamingSystem", return new String[] {"CodeSystem", "ValueSet", "ConceptMap", "NamingSystem",
"StructureDefinition", "StructureMap", "StructureDefinition", "StructureMap",
"SearchParameter", "OperationDefinition", "CapabilityStatement", "Conformance", "SearchParameter", "OperationDefinition", "CapabilityStatement", "Conformance",
"Questionnaire", "ImplementationGuide" }; "Questionnaire", "ImplementationGuide", "Measure" };
} }
@Override @Override
@ -441,7 +441,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
} }
} else { } else {
if (types.length == 0) { if (types.length == 0) {
types = new String[] { "StructureDefinition", "ValueSet", "CodeSystem", "SearchParameter", "OperationDefinition", "Questionnaire", "ConceptMap", "StructureMap", "NamingSystem" }; types = new String[] { "StructureDefinition", "ValueSet", "CodeSystem", "SearchParameter", "OperationDefinition", "Questionnaire", "ConceptMap", "StructureMap", "NamingSystem", "Measures" };
} }
for (PackageResourceInformation pri : pi.listIndexedResources(types)) { for (PackageResourceInformation pri : pi.listIndexedResources(types)) {
try { try {

View File

@ -336,8 +336,7 @@ public class NpmPackage {
throw new IOException("Error parsing "+ij.getAbsolutePath()+": "+e.getMessage(), e); throw new IOException("Error parsing "+ij.getAbsolutePath()+": "+e.getMessage(), e);
} }
} }
loadSubFolders(rootPath, f); loadSubFolders(rootPath, f);
} }
} }
} }
@ -536,13 +535,14 @@ public class NpmPackage {
public List<PackageResourceInformation> listIndexedResources(String... types) throws IOException { public List<PackageResourceInformation> listIndexedResources(String... types) throws IOException {
List<PackageResourceInformation> res = new ArrayList<PackageResourceInformation>(); List<PackageResourceInformation> res = new ArrayList<PackageResourceInformation>();
NpmPackageFolder folder = folders.get("package"); for (NpmPackageFolder folder : folders.values()) {
for (JsonElement e : folder.index.getAsJsonArray("files")) { for (JsonElement e : folder.index.getAsJsonArray("files")) {
JsonObject fi = e.getAsJsonObject(); JsonObject fi = e.getAsJsonObject();
if (Utilities.existsInList(JSONUtil.str(fi, "resourceType"), types)) { if (Utilities.existsInList(JSONUtil.str(fi, "resourceType"), types)) {
res.add(new PackageResourceInformation(folder.folder.getAbsolutePath(), fi)); res.add(new PackageResourceInformation(folder.folder.getAbsolutePath(), fi));
}
} }
} }
// Collections.sort(res, new PackageResourceInformationSorter()); // Collections.sort(res, new PackageResourceInformationSorter());
return res; return res;
} }