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:
* Add date addition/subtraction to FHIRPath
* Add date addition/subtraction to FHIRPath + add parsing comments
* Fix questionnaire mode parameter support for validator
* add extra debugging when valdiator can't fetch content to validate
Other code changes:
* 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 packageManifest;
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 {
@ -184,6 +185,7 @@ public class NPMPackageGenerator {
JsonObject npm = new JsonObject();
npm.addProperty("name", ig.getPackageId());
npm.addProperty("version", ig.getVersion());
igVersion = ig.getVersion();
npm.addProperty("tools-version", ToolsVersion.TOOLS_VERSION);
npm.addProperty("type", kind.getCode());
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;
import java.util.List;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
@ -76,4 +78,11 @@ public class CommaSeparatedStringBuilder {
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.InputStream;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
import java.util.Stack;
@ -672,5 +674,12 @@ public class JsonTrackingParser {
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());
}
}