This commit is contained in:
Grahame Grieve 2019-05-10 00:08:31 +10:00
commit 8837fb3fd3
2 changed files with 30 additions and 22 deletions

View File

@ -1098,7 +1098,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
}
} catch (Exception e) {
rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "Error "+e.getMessage()+" validating Coding");
rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "Error "+e.getMessage()+" validating Coding: " + e.toString());
}
}
}
@ -2371,13 +2371,17 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
return null;
} else {
long t = System.nanoTime();
if (!Utilities.isAbsoluteUrl(reference))
reference = resolve(uri, reference);
ValueSet fr = context.fetchResource(ValueSet.class, reference);
txTime = txTime + (System.nanoTime() - t);
ValueSet fr = context.fetchResource(ValueSet.class, reference);
if (fr == null) {
if (!Utilities.isAbsoluteUrl(reference)) {
reference = resolve(uri, reference);
fr = context.fetchResource(ValueSet.class, reference);
}
}
txTime = txTime + (System.nanoTime() - t);
return fr;
}
} else
} else
return null;
}
@ -2942,11 +2946,11 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L
}
}
// ok, now we have a list of known items, grouped by linkId. We"ve made an error for anything out of order
// ok, now we have a list of known items, grouped by linkId. We've made an error for anything out of order
for (QuestionnaireItemComponent qItem : qItems) {
List<Element> mapItem = map.get(qItem.getLinkId());
if (mapItem != null){
rule(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), myEnableWhenEvaluator.isQuestionEnabled(qItem, questionnaireResponseRoot), "Item has answer, even though it is not enabled "+qItem.getLinkId());
rule(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), myEnableWhenEvaluator.isQuestionEnabled(qItem, questionnaireResponseRoot), "Item with linkId [{0}] has answer, even though it is not enabled", qItem.getLinkId());
validateQuestionannaireResponseItem(qsrc, qItem, errors, mapItem, stack, inProgress, questionnaireResponseRoot);
} else {
//item is missing, is the question enabled?
@ -3984,11 +3988,11 @@ private String misplacedItemError(QuestionnaireItemComponent qItem) {
warning(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
else if (bpWarnings == BestPracticeWarningLevel.Error)
rule(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
} else if (inv.getSeverity() == ConstraintSeverity.ERROR) {
rule(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman() + msg + " [" + n.toString() + "]");
} else if (inv.getSeverity() == ConstraintSeverity.WARNING) {
warning(errors, IssueType.INVARIANT, element.line(), element.line(), path, ok, inv.getHuman() + msg + " [" + n.toString() + "]");
}
if (inv.getSeverity() == ConstraintSeverity.ERROR)
rule(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
else if (inv.getSeverity() == ConstraintSeverity.WARNING)
warning(errors, IssueType.INVARIANT, element.line(), element.line(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
}
}

View File

@ -1106,7 +1106,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
}
} catch (Exception e) {
rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "Error "+e.getMessage()+" validating Coding");
rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "Error "+e.getMessage()+" validating Coding: " + e.toString());
}
}
}
@ -2381,13 +2381,17 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
return null;
} else {
long t = System.nanoTime();
if (!Utilities.isAbsoluteUrl(reference))
reference = resolve(uri, reference);
ValueSet fr = context.fetchResource(ValueSet.class, reference);
txTime = txTime + (System.nanoTime() - t);
ValueSet fr = context.fetchResource(ValueSet.class, reference);
if (fr == null) {
if (!Utilities.isAbsoluteUrl(reference)) {
reference = resolve(uri, reference);
fr = context.fetchResource(ValueSet.class, reference);
}
}
txTime = txTime + (System.nanoTime() - t);
return fr;
}
} else
} else
return null;
}
@ -4057,11 +4061,11 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L
warning(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
else if (bpWarnings == BestPracticeWarningLevel.Error)
rule(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
} else if (inv.getSeverity() == ConstraintSeverity.ERROR) {
rule(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman() + msg + " [" + n.toString() + "]");
} else if (inv.getSeverity() == ConstraintSeverity.WARNING) {
warning(errors, IssueType.INVARIANT, element.line(), element.line(), path, ok, inv.getHuman() + msg + " [" + n.toString() + "]");
}
if (inv.getSeverity() == ConstraintSeverity.ERROR)
rule(errors, IssueType.INVARIANT, element.line(), element.col(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
else if (inv.getSeverity() == ConstraintSeverity.WARNING)
warning(errors, IssueType.INVARIANT, element.line(), element.line(), path, ok, inv.getHuman()+msg+" ["+n.toString()+"]");
}
}