Skip to content

Commit 6eb327b

Browse files
authored
Merge branch 'HL7:master' into master
2 parents 636b012 + ee2db7f commit 6eb327b

48 files changed

Lines changed: 5987 additions & 872 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM maven:3.9.9-eclipse-temurin-11 AS build
1+
FROM maven:3.9.9-eclipse-temurin-17 AS build
22
WORKDIR /build
33
COPY lib ./lib
44
COPY pom.xml ./pom.xml
@@ -8,7 +8,7 @@ RUN mvn dependency:go-offline
88
COPY . .
99
RUN mvn install -Dmaven.test.skip=true
1010

11-
FROM eclipse-temurin:11
11+
FROM eclipse-temurin:17
1212
WORKDIR /app
1313

1414
USER root

master-branch-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
mavenOptions: '-Xmx3072m'
6767
options: '--settings $(System.DefaultWorkingDirectory)/settings.xml'
6868
javaHomeOption: 'JDKVersion'
69-
jdkVersionOption: '1.11'
69+
jdkVersionOption: '1.17'
7070
jdkArchitectureOption: 'x64'
7171
publishJUnitResults: true
7272
testResultsFiles: '**/surefire-reports/TEST-*.xml'

nightly-xig-pipeline.yml

Lines changed: 7 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ variables:
2222
value: xig.db
2323

2424
jobs:
25-
- job: xig_step_1
26-
timeoutInMinutes: 70
25+
- job: xig_step_0
26+
timeoutInMinutes: 150
2727
steps:
2828
- task: Bash@3
2929
displayName: 'Download latest publisher'
@@ -44,99 +44,24 @@ jobs:
4444
script: 'mkdir $(XIG_CACHE_FOLDER)'
4545

4646
- task: Bash@3
47-
displayName: 'Run publisher with xig param step 1'
47+
displayName: 'Run publisher with xig param step 0 (all steps)'
4848
inputs:
4949
targetType: 'inline'
50-
script: 'java -Xmx7168m -jar ./publisher.jar -xig $(XIG_DB_FOLDER)/$(XIG_DB_FILE) -xig-cache $(XIG_CACHE_FOLDER) -xig-step 1'
50+
script: 'java -Xmx7168m -jar ./publisher.jar -xig $(XIG_DB_FOLDER)/$(XIG_DB_FILE) -xig-cache $(XIG_CACHE_FOLDER) -xig-step 0'
5151

5252
- task: PublishPipelineArtifact@1
5353
inputs:
5454
targetPath: $(XIG_DB_FOLDER)
55-
artifactName: xig_step_1_db
56-
- task: PublishPipelineArtifact@1
57-
inputs:
58-
targetPath: $(XIG_CACHE_FOLDER)
59-
artifactName: xig_step_1_cache
60-
61-
- job: xig_step_2
62-
dependsOn: xig_step_1
63-
steps:
64-
- task: Bash@3
65-
displayName: 'Download latest publisher'
66-
inputs:
67-
targetType: 'inline'
68-
script: 'wget https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar'
69-
70-
- task: DownloadPipelineArtifact@2
71-
inputs:
72-
buildType: 'current'
73-
artifactName: xig_step_1_cache
74-
targetPath: $(XIG_CACHE_FOLDER)
75-
- task: DownloadPipelineArtifact@2
76-
inputs:
77-
buildType: 'current'
78-
artifactName: xig_step_1_db
79-
targetPath: $(XIG_DB_FOLDER)
80-
81-
- task: Bash@3
82-
displayName: 'Run publisher with xig param step 2'
83-
inputs:
84-
targetType: 'inline'
85-
script: 'java -Xmx7168m -jar ./publisher.jar -xig $(XIG_DB_FOLDER)/$(XIG_DB_FILE) -xig-cache $(XIG_CACHE_FOLDER) -xig-step 2'
86-
87-
- task: PublishPipelineArtifact@1
88-
inputs:
89-
targetPath: $(XIG_DB_FOLDER)
90-
artifactName: xig_step_2_db
91-
- task: PublishPipelineArtifact@1
92-
inputs:
93-
targetPath: $(XIG_CACHE_FOLDER)
94-
artifactName: xig_step_2_cache
95-
96-
- job: xig_step_3
97-
dependsOn: xig_step_2
98-
pool:
99-
vmImage: 'macOS-latest'
100-
timeoutInMinutes: 360
101-
steps:
102-
- task: Bash@3
103-
displayName: 'Download latest publisher'
104-
inputs:
105-
targetType: 'inline'
106-
script: 'wget https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar'
107-
108-
- task: DownloadPipelineArtifact@2
109-
inputs:
110-
buildType: 'current'
111-
artifactName: xig_step_2_cache
112-
targetPath: $(XIG_CACHE_FOLDER)
113-
- task: DownloadPipelineArtifact@2
114-
inputs:
115-
buildType: 'current'
116-
artifactName: xig_step_2_db
117-
targetPath: $(XIG_DB_FOLDER)
118-
119-
- task: Bash@3
120-
displayName: 'Run publisher with xig param step 3'
121-
inputs:
122-
targetType: 'inline'
123-
script: 'java -Xmx13G -jar ./publisher.jar -xig $(XIG_DB_FOLDER)/$(XIG_DB_FILE) -xig-cache $(XIG_CACHE_FOLDER) -xig-step 3'
124-
125-
- task: PublishPipelineArtifact@1
126-
inputs:
127-
targetPath: $(XIG_DB_FOLDER)
128-
artifactName: xig_step_3_db
55+
artifactName: xig_step_0_db
12956

13057
- job: transfer_db_to_remote
13158
dependsOn:
132-
- xig_step_1
133-
- xig_step_2
134-
- xig_step_3
59+
- xig_step_0
13560
steps:
13661
- task: DownloadPipelineArtifact@2
13762
inputs:
13863
buildType: 'current'
139-
artifactName: xig_step_3_db
64+
artifactName: xig_step_0_db
14065
targetPath: $(XIG_DB_FOLDER)
14166

14267
- task: DownloadSecureFile@1

org.hl7.fhir.publisher.cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>org.hl7.fhir.publisher</artifactId>
77
<groupId>org.hl7.fhir.publisher</groupId>
8-
<version>2.0.10-SNAPSHOT</version>
8+
<version>2.0.13-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

org.hl7.fhir.publisher.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.hl7.fhir.publisher</groupId>
77
<artifactId>org.hl7.fhir.publisher</artifactId>
8-
<version>2.0.10-SNAPSHOT</version>
8+
<version>2.0.13-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/openehr/ArchetypeImporter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import org.hl7.fhir.exceptions.FHIRException;
1515
import org.hl7.fhir.r5.context.IWorkerContext;
16+
import org.hl7.fhir.r5.extensions.ExtensionDefinitions;
1617
import org.hl7.fhir.r5.model.Bundle;
1718
import org.hl7.fhir.r5.model.Bundle.BundleType;
1819
import org.hl7.fhir.r5.model.CanonicalResource;
@@ -36,7 +37,6 @@
3637
import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
3738
import org.hl7.fhir.r5.model.ValueSet;
3839
import org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent;
39-
import org.hl7.fhir.r5.utils.ToolingExtensions;
4040
import org.hl7.fhir.utilities.FileUtilities;
4141
import org.hl7.fhir.utilities.Utilities;
4242
import org.hl7.fhir.utilities.xml.XMLUtil;
@@ -352,7 +352,7 @@ private void processDefinition(List<ElementDefinition> defns, ElementDefinition
352352
at = at.substring(at.indexOf("[")+1).replace("]", "");
353353
var ct = ed.addType().setCode(c.getRmTypeName()).addProfileElement();
354354
ct.setValue(sd.getUrl());
355-
ct.addExtension(ToolingExtensions.EXT_PROFILE_ELEMENT, new StringType(atMap.get(at)));
355+
ct.addExtension(ExtensionDefinitions.EXT_PROFILE_ELEMENT, new StringType(atMap.get(at)));
356356
} else {
357357
System.out.println("not done yet: "+path+"."+name+": "+o.getClass().getName());
358358
}

org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/ConfigFileConverter.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
1313
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50;
1414
import org.hl7.fhir.r5.context.IWorkerContext;
15+
import org.hl7.fhir.r5.extensions.ExtensionDefinitions;
1516
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
1617
import org.hl7.fhir.r5.formats.JsonParser;
1718
import org.hl7.fhir.r5.formats.XmlParser;
@@ -31,7 +32,6 @@
3132
import org.hl7.fhir.r5.terminologies.utilities.ValidationResult;
3233
import org.hl7.fhir.r5.utils.GuideParameterCode;
3334
import org.hl7.fhir.r5.utils.IGHelper;
34-
import org.hl7.fhir.r5.utils.ToolingExtensions;
3535
import org.hl7.fhir.utilities.FhirPublication;
3636
import org.hl7.fhir.utilities.FileUtilities;
3737
import org.hl7.fhir.utilities.IniFile;
@@ -121,9 +121,9 @@ public void convert(String configFile, IWorkerContext context, FilesystemPackage
121121
if (configuration.has("html-template"))
122122
IGHelper.setParameter(ig.getDefinition(), GuideParameterCode.HTMLTEMPLATE.toCode(), configuration.asString("html-template"));
123123
for (String s : resourceDirs)
124-
ig.addExtension(ToolingExtensions.EXT_IGP_RESOURCES, new StringType(s));
124+
ig.addExtension(ExtensionDefinitions.EXT_IGP_RESOURCES, new StringType(s));
125125
for (String s : pagesDirs)
126-
ig.addExtension(ToolingExtensions.EXT_IGP_PAGES, new StringType(s));
126+
ig.addExtension(ExtensionDefinitions.EXT_IGP_PAGES, new StringType(s));
127127
ig.setPackageId(configuration.asString("npm-name"));
128128
if (configuration.has("jurisdiction")) {
129129
ig.getJurisdiction().clear();
@@ -167,11 +167,11 @@ public void convert(String configFile, IWorkerContext context, FilesystemPackage
167167
new JsonParser().compose(new FileOutputStream(Utilities.path(FileUtilities.getDirectoryForFile(igName), "ig-validation-parameters.json")), ig);
168168
if (paths.get("spreadsheets") instanceof JsonArray) {
169169
for (JsonElement e : (JsonArray) paths.get("spreadsheets"))
170-
ig.addExtension(ToolingExtensions.EXT_IGP_SPREADSHEET, new StringType(e.asJsonPrimitive().asString()));
170+
ig.addExtension(ExtensionDefinitions.EXT_IGP_SPREADSHEET, new StringType(e.asJsonPrimitive().asString()));
171171
}
172172
if (paths.get("bundles") instanceof JsonArray) {
173173
for (JsonElement e : (JsonArray) paths.get("bundles"))
174-
ig.addExtension(ToolingExtensions.EXT_IGP_BUNDLE, new StringType(e.asJsonPrimitive().asString()));
174+
ig.addExtension(ExtensionDefinitions.EXT_IGP_BUNDLE, new StringType(e.asJsonPrimitive().asString()));
175175
}
176176
JsonObject defaults = configuration.getJsonObject("defaults");
177177
if (defaults != null) {
@@ -229,10 +229,10 @@ public void convert(String configFile, IWorkerContext context, FilesystemPackage
229229
res = ig.getDefinition().addResource();
230230
res.setReference(new Reference(s));
231231
}
232-
res.addExtension(ToolingExtensions.EXT_IGP_BASE, new StringType(vb.asJsonPrimitive().asString()));
233-
res.addExtension(ToolingExtensions.EXT_IGP_DEFNS, new StringType(vd.asJsonPrimitive().asString()));
234-
res.addExtension(ToolingExtensions.EXT_IGP_FORMAT, new StringType(vf.asJsonPrimitive().asString()));
235-
res.addExtension(ToolingExtensions.EXT_IGP_SOURCE, new StringType(vs.asJsonPrimitive().asString()));
232+
res.addExtension(ExtensionDefinitions.EXT_IGP_BASE, new StringType(vb.asJsonPrimitive().asString()));
233+
res.addExtension(ExtensionDefinitions.EXT_IGP_DEFNS, new StringType(vd.asJsonPrimitive().asString()));
234+
res.addExtension(ExtensionDefinitions.EXT_IGP_FORMAT, new StringType(vf.asJsonPrimitive().asString()));
235+
res.addExtension(ExtensionDefinitions.EXT_IGP_SOURCE, new StringType(vs.asJsonPrimitive().asString()));
236236
}
237237
}
238238
}

org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/IGKnowledgeProvider.java

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
*/
2222

2323

24-
import java.util.HashSet;
25-
import java.util.List;
26-
import java.util.Map;
27-
import java.util.Set;
24+
import java.util.*;
2825

2926
import org.hl7.fhir.convertors.VersionConvertorConstants;
3027
import org.hl7.fhir.exceptions.FHIRException;
@@ -81,6 +78,7 @@ public class IGKnowledgeProvider implements ProfileKnowledgeProvider, ParserBase
8178
private XVerExtensionManager xver;
8279
private List<FetchedFile> files;
8380
private IPublisherModule module;
81+
private Map<String, List<ExtensionUsage>> coreExtensionMap;
8482

8583
public IGKnowledgeProvider(IWorkerContext context, String pathToSpec, String canonical, JsonObject igs, List<ValidationMessage> errors, boolean noXhtml, Template template, List<String> listedURLExemptions, String altCanonical, List<FetchedFile> files, IPublisherModule module) throws Exception {
8684
super();
@@ -844,7 +842,28 @@ public String getCanonicalForDefaultContext() {
844842
return canonical;
845843
}
846844

847-
845+
public Map<String, List<ExtensionUsage>> getCoreExtensionMap() {
846+
if (coreExtensionMap == null) {
847+
coreExtensionMap = new HashMap<>();
848+
}
849+
return coreExtensionMap;
850+
}
848851

849-
852+
public static class ExtensionUsage {
853+
private String name;
854+
private String url;
855+
856+
public ExtensionUsage(String name, String url) {
857+
this.name = name;
858+
this.url = url;
859+
}
860+
861+
public String getName() {
862+
return name;
863+
}
864+
865+
public String getUrl() {
866+
return url;
867+
}
868+
}
850869
}

org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/IGPublisherHostServices.java

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,47 @@
11
package org.hl7.fhir.igtools.publisher;
22

33
import java.util.ArrayList;
4-
import java.util.HashMap;
54
import java.util.List;
6-
import java.util.Map;
75

86
import org.apache.commons.lang3.NotImplementedException;
97
import org.hl7.fhir.exceptions.FHIRException;
108
import org.hl7.fhir.exceptions.PathEngineException;
119
import org.hl7.fhir.r5.context.SimpleWorkerContext;
10+
import org.hl7.fhir.r5.fhirpath.BaseHostServices;
1211
import org.hl7.fhir.r5.fhirpath.FHIRPathEngine;
1312
import org.hl7.fhir.r5.fhirpath.TypeDetails;
1413
import org.hl7.fhir.r5.liquid.GlobalObject;
1514
import org.hl7.fhir.r5.fhirpath.ExpressionNode.CollectionStatus;
16-
import org.hl7.fhir.r5.fhirpath.FHIRPathEngine.IEvaluationContext;
17-
import org.hl7.fhir.r5.fhirpath.FHIRPathUtilityClasses.FunctionDetails;
1815
import org.hl7.fhir.r5.model.Base;
1916
import org.hl7.fhir.r5.model.DateTimeType;
2017
import org.hl7.fhir.r5.model.Resource;
2118
import org.hl7.fhir.r5.model.StringType;
2219
import org.hl7.fhir.r5.model.ValueSet;
2320
import org.hl7.fhir.r5.utils.validation.IResourceValidator;
2421
import org.hl7.fhir.utilities.Utilities;
22+
import org.hl7.fhir.utilities.fhirpath.FHIRPathConstantEvaluationMode;
2523
import org.hl7.fhir.utilities.validation.ValidationMessage;
2624

27-
public class IGPublisherHostServices implements IEvaluationContext {
28-
29-
25+
public class IGPublisherHostServices extends BaseHostServices {
26+
3027
private IGKnowledgeProvider igpkp;
3128
private List<FetchedFile> fileList = new ArrayList<FetchedFile>();
3229
private SimpleWorkerContext context;
3330
private DateTimeType dt;
3431
private StringType pathToSpec;
35-
private Map<String, FunctionDefinition> functions = new HashMap<>();
3632

3733
public IGPublisherHostServices(IGKnowledgeProvider igpkp, List<FetchedFile> fileList,
3834
SimpleWorkerContext context, DateTimeType dt, StringType pathToSpec) {
39-
super();
35+
super(context);
4036
this.igpkp = igpkp;
4137
this.fileList = fileList;
4238
this.context = context;
4339
this.dt = dt;
4440
this.pathToSpec = pathToSpec;
4541
}
46-
47-
public IGPublisherHostServices registerFunction(FunctionDefinition function) {
48-
functions.put(function.name(), function);
49-
return this;
50-
}
5142

5243
@Override
53-
public List<Base> resolveConstant(FHIRPathEngine engine, Object appContext, String name, boolean beforeContext, boolean explicitConstant) throws PathEngineException {
44+
public List<Base> resolveConstant(FHIRPathEngine engine, Object appContext, String name, FHIRPathConstantEvaluationMode mode) throws PathEngineException {
5445
if ("Globals".equals(name)) {
5546
List<Base> list = new ArrayList<Base>();
5647
list.add(new GlobalObject(dt, pathToSpec));
@@ -61,7 +52,7 @@ public List<Base> resolveConstant(FHIRPathEngine engine, Object appContext, Stri
6152
}
6253

6354
@Override
64-
public TypeDetails resolveConstantType(FHIRPathEngine engine, Object appContext, String name, boolean explicitConstant) throws PathEngineException {
55+
public TypeDetails resolveConstantType(FHIRPathEngine engine, Object appContext, String name, FHIRPathConstantEvaluationMode mode) throws PathEngineException {
6556
if ("Globals".equals(name)) {
6657
return new TypeDetails(CollectionStatus.SINGLETON, "GlobalObject");
6758
} else {
@@ -79,24 +70,6 @@ public boolean log(String argument, List<Base> focus) {
7970
return false;
8071
}
8172

82-
@Override
83-
public FunctionDetails resolveFunction(FHIRPathEngine engine, String functionName) {
84-
FunctionDefinition fd = functions.get(functionName);
85-
return fd == null ? null : fd.details();
86-
}
87-
88-
@Override
89-
public TypeDetails checkFunction(FHIRPathEngine engine, Object appContext, String functionName, TypeDetails focus, List<TypeDetails> parameters) throws PathEngineException {
90-
FunctionDefinition fd = functions.get(functionName);
91-
return fd == null ? null : fd.check(engine, appContext, focus, parameters);
92-
}
93-
94-
@Override
95-
public List<Base> executeFunction(FHIRPathEngine engine, Object appContext, List<Base> focus, String functionName, List<List<Base>> parameters) {
96-
FunctionDefinition fd = functions.get(functionName);
97-
return fd == null ? null : fd.execute(engine, appContext, focus, parameters);
98-
}
99-
10073
@Override
10174
public Base resolveReference(FHIRPathEngine engine, Object appContext, String url, Base refContext) {
10275
if (Utilities.isAbsoluteUrl(url)) {

0 commit comments

Comments
 (0)