Merge pull request #1826 from hapifhir/2024-11-gg-clean0up

2024 11 gg clean0up
This commit is contained in:
Grahame Grieve 2024-11-22 23:12:48 +11:00 committed by GitHub
commit 59680b914d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 60 additions and 31 deletions

View File

@ -1,7 +1,11 @@
## Validator Changes
* fix pattern discriminator validation rule
* fix issue with FHIRPath engine throwing exception for an invalid path
## Other code changes
* no changes
* fix NPE rendering reference
* fix NPE processing issue from template
* Add FeatureDefinition renderer
* Support for Custom resources in publisher

View File

@ -874,6 +874,9 @@ public class ToolingExtensions {
}
private static IssueSeverity mapSeverity(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity) {
if (severity == null) {
return null;
}
switch (severity) {
case ERROR:
return IssueSeverity.ERROR;

View File

@ -903,6 +903,9 @@ public class ToolingExtensions {
}
private static IssueSeverity mapSeverity(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity severity) {
if (severity == null) {
return null;
}
switch (severity) {
case ERROR:
return IssueSeverity.ERROR;

View File

@ -846,6 +846,7 @@ public abstract class ResourceRenderer extends DataRenderer {
if (!Utilities.noString(r.getId())) {
if (!context.isSecondaryLang()) {
String sid = r.getScopedId();
if (sid != null) {
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
x.an(context.prefixAnchor(sid));
@ -856,8 +857,10 @@ public abstract class ResourceRenderer extends DataRenderer {
x.an(context.prefixAnchor(sid));
}
}
}
if (context.getLocale() != null) {
String langSuffix = "-"+context.getLocale().toLanguageTag();
if (r.getScopedId() != null) {
String sid = r.getScopedId()+langSuffix;
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
@ -865,6 +868,7 @@ public abstract class ResourceRenderer extends DataRenderer {
}
}
}
}
if (context.isTechnicalMode()) {
RenderingStatus status = new RenderingStatus();

View File

@ -1071,6 +1071,9 @@ public class ToolingExtensions {
}
private static IssueSeverity mapSeverity(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity severity) {
if (severity == null) {
return null;
}
switch (severity) {
case ERROR: return IssueSeverity.ERROR;
case FATAL: return IssueSeverity.FATAL;

View File

@ -331,6 +331,7 @@ public class NpmPackage {
}
private String path;
private JsonObject npm;
private Map<String, NpmPackageFolder> folders = new HashMap<>();
@ -339,6 +340,7 @@ public class NpmPackage {
private boolean minimalMemory;
private int size;
private boolean warned = false;
private static boolean loadCustomResources;
/**
* Constructor
@ -431,6 +433,7 @@ public class NpmPackage {
}
}
loadSubFolders(dir.getAbsolutePath(), f);
} else {
NpmPackageFolder folder = this.new NpmPackageFolder(Utilities.path("package", "$root"));
folder.folder = dir;
@ -448,6 +451,7 @@ public class NpmPackage {
private void loadSubFolders(String rootPath, File dir) throws IOException {
for (File f : dir.listFiles()) {
if (f.isDirectory()) {
if (!"custom".equals(f.getName()) || loadCustomResources) {
String d = f.getAbsolutePath().substring(rootPath.length()+1);
if (!d.startsWith("package")) {
d = Utilities.path("package", d);
@ -469,6 +473,7 @@ public class NpmPackage {
}
}
}
}
public static NpmPackage fromFolder(String folder, PackageType defType, String... exemptions) throws IOException {
NpmPackage res = new NpmPackage();
@ -1510,5 +1515,12 @@ public class NpmPackage {
return id()+"#"+version();
}
public static boolean isLoadCustomResources() {
return loadCustomResources;
}
public static void setLoadCustomResources(boolean loadCustomResources) {
NpmPackage.loadCustomResources = loadCustomResources;
}
}