(rename fields)

This commit is contained in:
Grahame Grieve 2024-10-08 05:55:52 +08:00
parent eb149f5abd
commit 10d854f242
1 changed files with 13 additions and 13 deletions

View File

@ -58,21 +58,21 @@ public class Validator {
private FHIRPathEngine fpe;
private List<String> prohibitedNames = new ArrayList<String>();
private List<ValidationMessage> issues = new ArrayList<ValidationMessage>();
private TrueFalseOrUnknown arrays;
private TrueFalseOrUnknown complexTypes;
private TrueFalseOrUnknown needsName;
private TrueFalseOrUnknown supportsArrays;
private TrueFalseOrUnknown supportsComplexTypes;
private TrueFalseOrUnknown supportsNeedsName;
private String resourceName;
private String name;
public Validator(IWorkerContext context, FHIRPathEngine fpe, List<String> prohibitedNames, TrueFalseOrUnknown arrays, TrueFalseOrUnknown complexTypes, TrueFalseOrUnknown needsName) {
public Validator(IWorkerContext context, FHIRPathEngine fpe, List<String> prohibitedNames, TrueFalseOrUnknown supportsArrays, TrueFalseOrUnknown supportsComplexTypes, TrueFalseOrUnknown supportsNeedsName) {
super();
this.context = context;
this.fpe = fpe;
this.prohibitedNames = prohibitedNames;
this.arrays = arrays;
this.complexTypes = complexTypes;
this.needsName = needsName;
this.supportsArrays = supportsArrays;
this.supportsComplexTypes = supportsComplexTypes;
this.supportsNeedsName = supportsNeedsName;
}
public String getResourceName() {
@ -85,9 +85,9 @@ public class Validator {
JsonElement nameJ = viewDefinition.get("name");
if (nameJ == null) {
if (needsName == null) {
if (supportsNeedsName == null) {
hint(path, viewDefinition, "No name provided. A name is required in many contexts where a ViewDefinition is used");
} else if (needsName == TrueFalseOrUnknown.TRUE) {
} else if (supportsNeedsName == TrueFalseOrUnknown.TRUE) {
error(path, viewDefinition, "No name provided", IssueType.REQUIRED);
}
} else if (!(nameJ instanceof JsonString)) {
@ -339,9 +339,9 @@ public class Validator {
hint(path, column, "collection is true, but the path statement(s) can only return single values for the column '"+columnName+"'");
}
} else {
if (arrays == TrueFalseOrUnknown.UNKNOWN) {
if (supportsArrays == TrueFalseOrUnknown.UNKNOWN) {
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 == TrueFalseOrUnknown.FALSE) {
} else if (supportsArrays == TrueFalseOrUnknown.FALSE) {
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");
}
if (td.getCollectionStatus() != CollectionStatus.SINGLETON) {
@ -378,9 +378,9 @@ public class Validator {
String type = types.iterator().next();
boolean ok = false;
if (!isSimpleType(type) && !"null".equals(type)) {
if (complexTypes == TrueFalseOrUnknown.UNKNOWN) {
if (supportsComplexTypes == TrueFalseOrUnknown.UNKNOWN) {
warning(path, expression, "Column is a complex type. This is not supported in some Runners");
} else if (complexTypes == TrueFalseOrUnknown.FALSE) {
} else if (supportsComplexTypes == TrueFalseOrUnknown.FALSE) {
error(path, expression, "Column is a complex type but this is not allowed in this context", IssueType.BUSINESSRULE);
} else {
ok = true;