Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/HL7/fhir-ig-publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Dec 25, 2023
2 parents b596a94 + 8a8c2fb commit ea10868
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 48 deletions.
21 changes: 0 additions & 21 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
* Loader: Fix problems setting owning committee consistently
* Loader: Fix bug loading packages with partially specified version that doesn't exist
* Loader: Fix problem with profiled resources being called examples in IG publisher
* Package Manager: Write locking on FilesystemPackageCacheManager
* Version Conversion: Fix StringType element properties not being copied in various Address, HumanName convertors
* Validator: Fix narrative link validation and add id/idref validation (for IPS)
* Validator: Fix to CDA xsi:type validation per SD decision
* Validator: Apply regex pattern to literal format if defined
* Validator: Improvements to vital signs related messages
* Validator: Fix R4 con-3 FHIRPath expression
* Validator: Fix for occasional missing warnings around bundle link validation
* Validator: Fix NPE in validator processing CCDA examples
* Validator: Fix for SearchParameter validation using custom resource types
* Validator: Fix stated path for error when code not in value set
* Renderer: Fix rendering of trigger definition using tables inside paragraphs
* Renderer: Fix problem with profiled resources being called examples in IG publisher
* Renderer: Fix bug where version specific references to profiles not picked up
* Renderer: Add more data to qa.json
* Renderer: Fix rendering of trigger definition using tables inside paragraphs
* Renderer: Handle all initial value types when rendering Questionnaires
* US Realm: Add link to US Core derivation process
2 changes: 1 addition & 1 deletion org.hl7.fhir.publisher.cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>org.hl7.fhir.publisher</artifactId>
<groupId>org.hl7.fhir.publisher</groupId>
<version>1.5.6-SNAPSHOT</version>
<version>1.5.9-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion org.hl7.fhir.publisher.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.hl7.fhir.publisher</groupId>
<artifactId>org.hl7.fhir.publisher</artifactId>
<version>1.5.6-SNAPSHOT</version>
<version>1.5.9-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.hl7.fhir.utilities.json.model.JsonObject;
import org.hl7.fhir.utilities.json.parser.JsonParser;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode;

import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.utilities.npm.PackageClient;
import org.hl7.fhir.utilities.npm.PackageList;
Expand Down Expand Up @@ -113,7 +113,7 @@ public DepInfo(String pid, String path) {
public DependentIGFinder(String id) throws IOException {
super();
this.id = id;
pcm = new FilesystemPackageCacheManager(FilesystemPackageCacheMode.USER);
pcm = new FilesystemPackageCacheManager.Builder().build();
pcm.setSilent(true);
outcome = "Finding Dependent IGs not done yet";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class FetchedResource {
private String path; // where published
private Resource resource;
private Element element;
private Element logicalElement;
private JsonObject config;
private boolean validated;
private boolean validateAsResource;
Expand Down Expand Up @@ -291,5 +292,13 @@ public String getNameForErrors() {
public void setNameForErrors(String nameForErrors) {
this.nameForErrors = nameForErrors;
}

public Element getLogicalElement() {
return logicalElement;
}

public void setLogicalElement(Element logicalElement) {
this.logicalElement = logicalElement;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void execute() throws IOException {
}

private void init() throws IOException {
pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
pcm = new FilesystemPackageCacheManager.Builder().build();
scanner = new Scanner(System. in);
paths = new ArrayList<String>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2417,9 +2417,12 @@ public void initialize() throws Exception {
@Nonnull
private FilesystemPackageCacheManager getFilesystemPackageCacheManager() throws IOException {
if (getPackageCacheFolder() != null) {
return new FilesystemPackageCacheManager(getPackageCacheFolder());
return new FilesystemPackageCacheManager.Builder().withCacheFolder(getPackageCacheFolder()).build();
}
return new FilesystemPackageCacheManager(mode == null || mode == IGBuildMode.MANUAL || mode == IGBuildMode.PUBLICATION);
return mode == null || mode == IGBuildMode.MANUAL || mode == IGBuildMode.PUBLICATION ?
new FilesystemPackageCacheManager.Builder().build()
: new FilesystemPackageCacheManager.Builder().withSystemCacheFolder().build();

}

private Coding checkForJurisdiction() {
Expand Down Expand Up @@ -3949,7 +3952,7 @@ private void copyDefaultTemplate() throws IOException, FHIRException {
Utilities.createDirectory(adHocTmpDir);
Utilities.clearDirectory(adHocTmpDir);

FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();

NpmPackage npm = null;
if (specifiedVersion == null) {
Expand Down Expand Up @@ -7103,7 +7106,7 @@ private void validate() throws Exception {

private void validate(FetchedFile f, FetchedResource r, Binary bin, List<ValidationMessage> errs, FhirFormat fmt, List<StructureDefinition> profiles) {
long ts = System.currentTimeMillis();
validator.validate(r.getElement(), errs, new ByteArrayInputStream(bin.getContent()), fmt, profiles);
r.setLogicalElement(validator.validate(r.getElement(), errs, new ByteArrayInputStream(bin.getContent()), fmt, profiles));
long tf = System.currentTimeMillis();
if (tf-ts > validationLogTime && validationLogTime > 0) {
reportLongValidation(f, r, tf-ts);
Expand Down Expand Up @@ -12137,7 +12140,9 @@ public static void main(String[] args) throws Exception {
s = s + " "+removePassword(args, i);
}
System.out.println(s);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(!CliParams.hasNamedParam(args, "system"));
FilesystemPackageCacheManager pcm = CliParams.hasNamedParam(args, "system")
? new FilesystemPackageCacheManager.Builder().withSystemCacheFolder().build()
: new FilesystemPackageCacheManager.Builder().build();
System.out.println("Cache = "+pcm.getFolder());
for (String p : CliParams.getNamedParam(args, "-package").split("\\;")) {
NpmPackage npm = pcm.loadPackage(p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ private void processPackage(String filename) throws FileNotFoundException, IOExc
String pid = VersionUtilities.packageForVersion(version);
String specPath = VersionUtilities.getSpecUrl(version);
System.out.println("Loaded. Version = "+version);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
System.out.println("Preparing using "+pid);
NpmPackage pi = pcm.loadPackage(pid);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void startChecks(ImplementationGuide ig) {
String filename = "";
try {
vi.resources = new ArrayList<>();
BasePackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
BasePackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage current = pcm.loadPackage(pid, vi.version);
for (String id : current.listResources("StructureDefinition", "ValueSet", "CodeSystem", "CapabilityStatement")) {
filename = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void startChecks(ImplementationGuide ig) {
String filename = "";
try {
vi.resources = new ArrayList<>();
BasePackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
BasePackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage current = pcm.loadPackage(pid, vi.version);
for (String id : current.listResources("StructureDefinition", "ValueSet", "CodeSystem", "CapabilityStatement")) {
filename = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void startChecks(ImplementationGuide ig) {
String filename = "";
try {
vi.resources = new ArrayList<>();
BasePackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
BasePackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage current = pcm.loadPackage(pid, vi.version);
for (String id : current.listResources("StructureDefinition", "ValueSet", "CodeSystem", "CapabilityStatement")) {
filename = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void startChecks(ImplementationGuide ig) {
String filename = "";
try {
vi.resources = new ArrayList<>();
BasePackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
BasePackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage current = pcm.loadPackage(pid, vi.version);
for (String id : current.listResources("StructureDefinition", "ValueSet", "CodeSystem")) {
filename = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,18 @@ private NpmPackage fetchLatestUSCore() throws IOException {
PackageList pl = PackageList.fromUrl("https://hl7.org/fhir/us/core/package-list.json");
for (PackageListEntry v : pl.versions()) {
if (VersionUtilities.versionsCompatible(version, v.fhirVersion())) {
return new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER).loadPackage("hl7.fhir.us.core", v.version());
return new FilesystemPackageCacheManager.Builder().build().loadPackage("hl7.fhir.us.core", v.version());
}
}
// we didn't find a compatible version, we'll just take the last version
for (PackageListEntry v : pl.versions()) {
return new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER).loadPackage("hl7.fhir.us.core", v.version());
return new FilesystemPackageCacheManager.Builder().build().loadPackage("hl7.fhir.us.core", v.version());
}
return null;
} catch (Exception e) {
System.out.println("Error checking US Core: "+e.getMessage());
}
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(true);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
return pcm.loadPackage("hl7.fhir.us.core");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private List<String> getOids(LoadedCanonicalResource lcr) {

private void loadPackage(String pid, List<LoadedCanonicalResource> reslist) throws IOException {
System.out.println("Load Package "+pid);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage npm = pcm.loadPackage(pid);
// SpecMapManager spm = new SpecMapManager(TextFile.streamToBytes(npm.load("other", "spec.internals")), npm.fhirVersion());
IContextResourceLoader loader = new PublisherLoader(npm, null, npm.getWebLocation(), null).makeLoader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.hl7.fhir.utilities.json.model.JsonObject;
import org.hl7.fhir.utilities.json.parser.JsonParser;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode;
import org.hl7.fhir.utilities.npm.NpmPackage;


Expand All @@ -36,7 +35,7 @@ public static void main(String[] args) throws IOException {
private FilesystemPackageCacheManager pcm;

public IGCategorizer() throws IOException {
pcm = new FilesystemPackageCacheManager(FilesystemPackageCacheMode.USER);
pcm = new FilesystemPackageCacheManager.Builder().build();
pcm.setSuppressErrors(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void checkResources(String s, List<LoadedCanonicalResource> list) throws

private void check(String pid) throws IOException {
System.out.println("Load Package "+pid);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage npm = pcm.loadPackage(pid);
// SpecMapManager spm = new SpecMapManager(TextFile.streamToBytes(npm.load("other", "spec.internals")), npm.fhirVersion());
IContextResourceLoader loader = new PublisherLoader(npm, null, npm.getWebLocation(), null).makeLoader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private void packPackage(String path, String dst) throws IOException {
}

private void release(String source, String dest) throws Exception {
pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
pcm = new FilesystemPackageCacheManager.Builder().build();
System.out.println("Load hl7.fhir.r4.core");
r4 = org.hl7.fhir.r4.context.SimpleWorkerContext.fromPackage(pcm.loadPackage("hl7.fhir.r4.core", "4.0.1"));
System.out.println("Load hl7.fhir.r3.core");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public XIGGenerator(String target, String cache) throws FHIRException, IOExcepti
this.target = target;
this.cache = cache;
Utilities.createDirectory(cache);
pcm = new FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.FilesystemPackageCacheMode.USER);
pcm = new FilesystemPackageCacheManager.Builder().build();
String ds = new SimpleDateFormat("dd MMM yyyy", new Locale("en", "US")).format(Calendar.getInstance().getTime());
String dl = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ", new Locale("en", "US")).format(Calendar.getInstance().getTime());
date = "<span title=\""+dl+"\">"+ds+"</span>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ public String references() throws FHIRFormatError, IOException {
}
if (VersionUtilities.isR5Plus(context.getVersion())) {
if (usages == null) {
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(true);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage npm = pcm.loadPackage("hl7.fhir.r5.core");
usages = org.hl7.fhir.utilities.json.parser.JsonParser.parseObject(npm.load("other", "sdmap.details"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ private void checkTemplateId(String template, String packageId, String reason) {
"hl7.davinci.template",
"openhie.fhir.template",
"who.fhir.template",
"who.template.root",
"ihe.fhir.template")) {
canExecute = false;
templateThatCantExecute = template;
Expand Down
Binary file modified plot-ig-builder-auto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<!-- <version>5.3.14</version>-->
<!-- </parent>-->

<version>1.5.6-SNAPSHOT</version> <!-- See the note above -->
<version>1.5.9-SNAPSHOT</version> <!-- See the note above -->

<properties>
<core_version>6.2.6-SNAPSHOT</core_version>
<core_version>6.2.7-SNAPSHOT</core_version>
<maven_surefire_version>3.0.0-M5</maven_surefire_version>
<apache_poi_version>5.2.1</apache_poi_version>
<okhttp.version>4.11.0</okhttp.version>
Expand Down

0 comments on commit ea10868

Please sign in to comment.