Skip to content

Commit

Permalink
#138 #135 lab validation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveregger committed Sep 20, 2023
1 parent 9d6a643 commit 534563b
Show file tree
Hide file tree
Showing 5 changed files with 6,713 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,27 @@ private void listSpecs(Map<String, String> specList, PackageServer server) throw

protected InputStreamWithSrc loadFromPackageServer(String id, String version) {

// matchbox-engine PATCH, we do not want to load from a package server for hl7.fhir.xver-extension :
if (CommonPackages.ID_XVER.equals(id)) {
// matchbox-engine PATCH, we do not want to load from a package server for hl7.fhir.xver-extension :
if (CommonPackages.ID_XVER.equals(id)) {
ourLog.info("loading " +id+ " form classpath");
version = VER_XVER_PROVIDED;
InputStream stream = getClass().getResourceAsStream("/"+id+"#"+version+".tgz");
if (stream==null) {
ourLog.error("Unable to find/resolve/read from classpath (we dont' want go to the package server) for :" + id+"#"+version+".tgz");
throw new FHIRException("Unable to find/resolve/read from classpath (we dont' want go to the package server) for :" + id+"#"+version+".tgz");
}
return new InputStreamWithSrc(stream, "http://fhir.org/packages/hl7.fhir.xver-extensions", version);
}
}

if ("hl7.fhir.r5.core".equals(id)) {
ourLog.info("loading hl7.fhir.r5.core form classpath");
InputStream stream = getClass().getResourceAsStream("/"+id+".tgz");
if (stream==null) {
ourLog.error("Unable to find/resolve/read from classpath (we dont' want go to the package server) for :" + id+"#"+version+".tgz");
throw new FHIRException("Unable to find/resolve/read from classpath (we dont' want go to the package server) for :" + id+"#"+version+".tgz");
}
return new InputStreamWithSrc(stream, "https://hl7.org/fhir/R5/hl7.fhir.r5.core.tgz", version);
}

InputStreamWithSrc retVal = super.loadFromPackageServer(id, version);
if (retVal != null) {
Expand Down Expand Up @@ -600,6 +611,12 @@ public NpmPackage loadPackage(String id, String version) throws FHIRException, I
return npm;
}

if ("hl7.fhir.r5.core".equals(id)) {
InputStreamWithSrc packageTgzInputStream = this.loadFromPackageServer(id, version);
NpmPackage npm = NpmPackage.fromPackage(packageTgzInputStream.stream);
return npm;
}

if (!Utilities.noString(version) && version.startsWith("file:")) {
return loadPackageFromFile(id, version.substring(5));
}
Expand Down
Loading

0 comments on commit 534563b

Please sign in to comment.