Support for additional checking in IG Publisher

This commit is contained in:
Grahame Grieve 2020-10-01 11:05:24 +10:00
parent 77d33e8afa
commit 3e6863ef70
4 changed files with 28 additions and 1 deletions

View File

@ -1,7 +1,10 @@
Validator: Validator:
* Add date addition/subtraction to FHIRPath * Add date addition/subtraction to FHIRPath + add parsing comments
* Fix questionnaire mode parameter support for validator * Fix questionnaire mode parameter support for validator
* add extra debugging when valdiator can't fetch content to validate * add extra debugging when valdiator can't fetch content to validate
Other code changes: Other code changes:
* rename org.hl7.fhir.utilities.cache to org.hl7.fhir.utilities.npm * rename org.hl7.fhir.utilities.cache to org.hl7.fhir.utilities.npm
* report error locations for run time FHIRPath errors
* add search on IG registry to PackageClient
* add focus to FHIRPath function extensions

View File

@ -102,6 +102,7 @@ public class NPMPackageGenerator {
private JsonObject packageJ; private JsonObject packageJ;
private JsonObject packageManifest; private JsonObject packageManifest;
private NpmPackageIndexBuilder indexer; private NpmPackageIndexBuilder indexer;
private String igVersion;
public NPMPackageGenerator(String destFile, String canonical, String url, PackageType kind, ImplementationGuide ig, Date date, boolean notForPublication) throws FHIRException, IOException { public NPMPackageGenerator(String destFile, String canonical, String url, PackageType kind, ImplementationGuide ig, Date date, boolean notForPublication) throws FHIRException, IOException {
@ -184,6 +185,7 @@ public class NPMPackageGenerator {
JsonObject npm = new JsonObject(); JsonObject npm = new JsonObject();
npm.addProperty("name", ig.getPackageId()); npm.addProperty("name", ig.getPackageId());
npm.addProperty("version", ig.getVersion()); npm.addProperty("version", ig.getVersion());
igVersion = ig.getVersion();
npm.addProperty("tools-version", ToolsVersion.TOOLS_VERSION); npm.addProperty("tools-version", ToolsVersion.TOOLS_VERSION);
npm.addProperty("type", kind.getCode()); npm.addProperty("type", kind.getCode());
npm.addProperty("date", dt); npm.addProperty("date", dt);
@ -395,5 +397,9 @@ public class NPMPackageGenerator {
} }
} }
public String version() {
return igVersion;
}
} }

View File

@ -1,5 +1,7 @@
package org.hl7.fhir.utilities; package org.hl7.fhir.utilities;
import java.util.List;
/* /*
Copyright (c) 2011+, HL7, Inc. Copyright (c) 2011+, HL7, Inc.
All rights reserved. All rights reserved.
@ -76,4 +78,11 @@ public class CommaSeparatedStringBuilder {
append(s); append(s);
} }
public void addAll(List<String> list) {
for (String s : list) {
append(s);
}
}
} }

View File

@ -36,6 +36,8 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map; import java.util.Map;
import java.util.Stack; import java.util.Stack;
@ -671,6 +673,13 @@ public class JsonTrackingParser {
Gson gson = new GsonBuilder().setPrettyPrinting().create(); Gson gson = new GsonBuilder().setPrettyPrinting().create();
return gson.toJson(json); return gson.toJson(json);
} }
public static JsonObject fetchJson(String source) throws IOException {
URL url = new URL(source+"?nocache=" + System.currentTimeMillis());
HttpURLConnection c = (HttpURLConnection) url.openConnection();
c.setInstanceFollowRedirects(true);
return parseJson(c.getInputStream());
}
} }