Skip to content

Commit

Permalink
revert back to Boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
bashir2 committed Sep 11, 2024
1 parent 875e9e0 commit c439b2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public void checkViewDefinition(String path, JsonObject viewDefinition) {

JsonElement nameJ = viewDefinition.get("name");
if (nameJ == null) {
if (!needsName) {
if (needsName == null) {
hint(path, viewDefinition, "No name provided. A name is required in many contexts where a ViewDefinition is used");
} else {
} else if (needsName) {
error(path, viewDefinition, "No name provided", IssueType.REQUIRED);
}
} else if (!(nameJ instanceof JsonString)) {
Expand Down Expand Up @@ -340,14 +340,13 @@ private Column checkColumn(JsonObject vd, String path, JsonObject column, TypeDe
}
}
if (isColl) {
//if (acceptArrays) {
if (td.getCollectionStatus() == CollectionStatus.SINGLETON) {
hint(path, column, "collection is true, but the path statement(s) can only return single values for the column '"+columnName+"'");
}
} else {
if (acceptArrays == null) {
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 {
} else if (!acceptArrays) {
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) {
Expand Down Expand Up @@ -384,10 +383,10 @@ private Column checkColumn(JsonObject vd, String path, JsonObject column, TypeDe
String type = types.iterator().next();
boolean ok = false;
if (!isSimpleType(type) && !"null".equals(type)) {
if (acceptComplexTypes) {
if (acceptComplexTypes == null) {
warning(path, expression, "The column '"+columnName+"' is a complex type. This is not supported in some Runners");
ok = true;
} else {
} else if (!acceptComplexTypes) {
error(path, expression, "The column '"+columnName+"' is a complex type but this is not allowed in this context", IssueType.BUSINESSRULE);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5754,7 +5754,7 @@ public boolean checkSpecials(ValidationContext valContext, List<ValidationMessag
} else if ("http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition".equals(element.getProperty().getStructure().getUrl())) {
if (element.getNativeObject() != null && element.getNativeObject() instanceof JsonObject) {
JsonObject json = (JsonObject) element.getNativeObject();
Validator sqlv = new Validator(context, fpe, new ArrayList<>(), true, true, false);
Validator sqlv = new Validator(context, fpe, new ArrayList<>(), null, null, null);
sqlv.checkViewDefinition(stack.getLiteralPath(), json);
errors.addAll(sqlv.getIssues());
ok = sqlv.isOk() && ok;
Expand Down

0 comments on commit c439b2a

Please sign in to comment.