Fix loading issues in test mode for simplifier packages

This commit is contained in:
Grahame Grieve 2023-08-11 12:25:01 +10:00
parent 9625f9b818
commit 1208d691b2
2 changed files with 8 additions and 1 deletions

View File

@ -498,7 +498,11 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
for (PackageResourceInformation pri : pi.listIndexedResources(types)) { for (PackageResourceInformation pri : pi.listIndexedResources(types)) {
if (!pri.getFilename().contains("ig-r4") && (loader == null || loader.wantLoad(pi, pri))) { if (!pri.getFilename().contains("ig-r4") && (loader == null || loader.wantLoad(pi, pri))) {
try { try {
if (!pri.hasId()) {
loadDefinitionItem(pri.getFilename(), new FileInputStream(pri.getFilename()), loader, null, new PackageInformation(pi));
} else {
registerResourceFromPackage(new PackageResourceLoader(pri, loader), new PackageInformation(pi)); registerResourceFromPackage(new PackageResourceLoader(pri, loader), new PackageInformation(pi));
}
t++; t++;
} catch (FHIRException e) { } catch (FHIRException e) {
throw new FHIRException(formatMessage(I18nConstants.ERROR_READING__FROM_PACKAGE__, pri.getFilename(), pi.name(), pi.version(), e.getMessage()), e); throw new FHIRException(formatMessage(I18nConstants.ERROR_READING__FROM_PACKAGE__, pri.getFilename(), pi.name(), pi.version(), e.getMessage()), e);

View File

@ -144,6 +144,9 @@ public class NpmPackage {
public String getSupplements() { public String getSupplements() {
return supplements; return supplements;
} }
public boolean hasId() {
return !Utilities.noString(id);
}
} }
public class IndexVersionSorter implements Comparator<JsonObject> { public class IndexVersionSorter implements Comparator<JsonObject> {