minor fixes for standalone ViewDefinition validator

This commit is contained in:
Grahame Grieve 2023-11-05 09:17:08 +11:00
parent cb8b959322
commit 0a1bf05a8e
3 changed files with 7 additions and 6 deletions

View File

@ -1507,7 +1507,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
if (lt == null || !lt.hasValueBooleanType()) { if (lt == null || !lt.hasValueBooleanType()) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ;
} else if (lt.getValue().hasExtension(ToolingExtensions.DAR)) { } else if (lt.getValue().hasExtension(ToolingExtensions.EXT_DAR)) {
} else if (!lt.getValueBooleanType().hasValue()) { } else if (!lt.getValueBooleanType().hasValue()) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ;
@ -3565,7 +3565,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
Extension lt = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_TARGET); Extension lt = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_TARGET);
if (lt == null || !lt.hasValue()) { if (lt == null || !lt.hasValue()) {
tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference"); tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference");
} else if (lt.getValue().hasExtension(ToolingExtensions.DAR)) { } else if (lt.getValue().hasExtension(ToolingExtensions.EXT_DAR)) {
} else if (lt.getValueBooleanType().hasValue()) { } else if (lt.getValueBooleanType().hasValue()) {
tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference"); tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference");
} else if (lt.getValueBooleanType().booleanValue()) { } else if (lt.getValueBooleanType().booleanValue()) {

View File

@ -444,6 +444,7 @@ public class Runner implements IEvaluationContext {
} }
return null; return null;
} }
@Override @Override
public Base resolveReference(FHIRPathEngine engine, Object appContext, String url, Base refContext) throws FHIRException { public Base resolveReference(FHIRPathEngine engine, Object appContext, String url, Base refContext) throws FHIRException {
throw new Error("Not implemented yet: resolveReference"); throw new Error("Not implemented yet: resolveReference");

View File

@ -54,7 +54,7 @@ public class Validator {
public void checkViewDefinition(String path, JsonObject viewDefinition) { public void checkViewDefinition(String path, JsonObject viewDefinition) {
checkProperties(viewDefinition, path, "url", "identifier", "name", "version", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "copyright", "resource", "constant", "select", "where"); checkProperties(viewDefinition, path, "resourceType", "url", "identifier", "name", "version", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "copyright", "resource", "constant", "select", "where");
JsonElement nameJ = viewDefinition.get("name"); JsonElement nameJ = viewDefinition.get("name");
if (nameJ == null) { if (nameJ == null) {
@ -310,9 +310,9 @@ public class Validator {
} }
if (isColl) { if (isColl) {
if (arrays == null) { if (arrays == null) {
warning(path, expression, "column appears to be a collection. Collections are not supported in all Runners"); warning(path, expression, "The column '"+columnName+"' appears to be a collection based on it's path. Collections are not supported in all execution contexts");
} else if (!arrays) { } else if (!arrays) {
warning(path, expression, "column appears to be a collection, but this is not allowed in this context"); warning(path, expression, "The column '"+columnName+"' appears to be a collection based on it's path, but this is not allowed in the current execution context");
} }
} }
Set<String> types = new HashSet<>(); Set<String> types = new HashSet<>();
@ -574,7 +574,7 @@ public class Validator {
nameOk = nameOk || name.equals(p.getName()); nameOk = nameOk || name.equals(p.getName());
} }
if (!nameOk) { if (!nameOk) {
error(path+"."+p.getName(), p.getValue(), "Unknown JSON "+p.getValue().type().name(), IssueType.UNKNOWN); error(path+"."+p.getName(), p.getValue(), "Unknown JSON property "+p.getName(), IssueType.UNKNOWN);
} }
} }