Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 11 gg custom resources #997

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
* validator: fix pattern discriminator validation rule
* Loader: Support for Custom resources from other packages in publisher
* Loader: fix NPE processing issue from template
* validator: fix pattern discriminator validation rule
* validator: fix issue with FHIRPath engine throwing exception for an invalid path
* Renderer: Add FeatureDefinition renderer
* Renderer: fix NPE rendering reference
* Renderer: fix NPE processing search references

Original file line number Diff line number Diff line change
Expand Up @@ -4968,6 +4968,16 @@ private FetchedResource findLoadedStructure(StructureDefinition sd) {
*
*/
private void loadCustomResources() throws FileNotFoundException, FHIRException, IOException {
// scan existing load for custom resources
for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) {
if (sd.getKind() == StructureDefinitionKind.RESOURCE && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) {
String scope = sd.getUrl().substring(0, sd.getUrl().lastIndexOf("/"));
if (!"http://hl7.org/fhir/StructureDefinition".equals(scope)) {
customResourceNames.add(sd.getTypeTail());
}
}
}
// look for new custom resources in this IG
for (String s : customResourceFiles) {
System.out.print("Load Custom Resource from "+s+":");
System.out.println(loadCustomResource(s));
Expand Down Expand Up @@ -8943,7 +8953,7 @@ private void generateSummaryOutputs(DBBuilder db) throws Exception {
types.add(sd.getType());
long start = System.currentTimeMillis();
String src = msr.render(sd);
fragment("maps-"+sd.getType(), src, otherFilesRun, start, "maps", "Cross");
fragment("maps-"+sd.getTypeTail(), src, otherFilesRun, start, "maps", "Cross");
}
}
long start = System.currentTimeMillis();
Expand Down Expand Up @@ -10836,6 +10846,7 @@ private void generateResourceReferences() throws Exception {
for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) {
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && sd.getKind() == StructureDefinitionKind.RESOURCE) {
resourceTypes.add(sd.getType());
resourceTypes.add(sd.getTypeTail());
}
}
for (String rt : resourceTypes) {
Expand Down Expand Up @@ -11576,7 +11587,12 @@ private byte[] processCustomLiquid(DBBuilder db, byte[] content, FetchedFile f)
}

private String processRefTag(DBBuilder db, String src, FetchedFile f) {
if (Utilities.isAbsoluteUrl(src)) {
if (Utilities.existsInList(src, "$ver")) {
switch (src) {
case "$ver": return businessVersion;
}
} else if (Utilities.isAbsoluteUrl(src)) {

try {
CanonicalResource cr = (CanonicalResource) context.fetchResource(Resource.class, src);
if (cr != null && cr.hasWebPath()) {
Expand Down Expand Up @@ -13761,12 +13777,11 @@ public static void main(String[] args) throws Exception {
int exitCode = 0;

org.hl7.fhir.utilities.FileFormat.checkCharsetAndWarnIfNotUTF8(System.out);

NpmPackage.setLoadCustomResources(true);

if (CliParams.hasNamedParam(args, FHIR_SETTINGS_PARAM)) {
FhirSettings.setExplicitFilePath(CliParams.getNamedParam(args, FHIR_SETTINGS_PARAM));
}



if (CliParams.hasNamedParam(args, "-gui")) {
runGUI(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@ public String references() throws FHIRFormatError, IOException {
if (r.fhirType().equals("SearchParameter")) {
SearchParameter sp = (SearchParameter) r.getResource();
String exp = sp.getExpression();
if (exp.contains("extension('"+sd.getUrl()+"')")) {
if (exp != null && exp.contains("extension('"+sd.getUrl()+"')")) {
searches.put(igp.getLinkFor(r, true), r.getTitle());
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<packaging>pom</packaging>

<properties>
<core_version>6.4.4-SNAPSHOT</core_version>
<core_version>6.4.4</core_version>
<maven_surefire_version>3.0.0-M5</maven_surefire_version>
<apache_poi_version>5.2.1</apache_poi_version>
<lombok_version>1.18.32</lombok_version>
Expand Down
Loading