More renaming

This commit is contained in:
dotasek 2022-10-28 16:43:38 -04:00
parent 25ef2dca4d
commit 827d088732
3 changed files with 42 additions and 42 deletions

View File

@ -569,7 +569,7 @@ public class FHIRPathEngine {
return executeType(new ExecutionTypeContext(appContext, resourceType, types, types), types, expr, true); return executeType(new ExecutionTypeContext(appContext, resourceType, types, types), types, expr, true);
} }
private FHIRException makeExceptionPL(Integer num, ExpressionNode holder, String constName, Object... args) { private FHIRException makeExceptionPlural(Integer num, ExpressionNode holder, String constName, Object... args) {
String fmt = worker.formatMessagePlural(num, constName, args); String fmt = worker.formatMessagePlural(num, constName, args);
if (location != null) { if (location != null) {
fmt = fmt + " "+worker.formatMessage(I18nConstants.FHIRPATH_LOCATION, location); fmt = fmt + " "+worker.formatMessage(I18nConstants.FHIRPATH_LOCATION, location);
@ -2486,13 +2486,13 @@ public class FHIRPathEngine {
return new ArrayList<Base>(); return new ArrayList<Base>();
} }
if (left.size() > 1) { if (left.size() > 1) {
throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "+"); throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "+");
} }
if (!left.get(0).isPrimitive()) { if (!left.get(0).isPrimitive()) {
throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "+", left.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "+", left.get(0).fhirType());
} }
if (right.size() > 1) { if (right.size() > 1) {
throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "+"); throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "+");
} }
if (!right.get(0).isPrimitive() && !((left.get(0).isDateTime() || "0".equals(left.get(0).primitiveValue()) || left.get(0).hasType("Quantity")) && right.get(0).hasType("Quantity"))) { if (!right.get(0).isPrimitive() && !((left.get(0).isDateTime() || "0".equals(left.get(0).primitiveValue()) || left.get(0).hasType("Quantity")) && right.get(0).hasType("Quantity"))) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "+", right.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "+", right.get(0).fhirType());
@ -2573,13 +2573,13 @@ public class FHIRPathEngine {
return new ArrayList<Base>(); return new ArrayList<Base>();
} }
if (left.size() > 1) { if (left.size() > 1) {
throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "*"); throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "*");
} }
if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) {
throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "*", left.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "*", left.get(0).fhirType());
} }
if (right.size() > 1) { if (right.size() > 1) {
throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "*"); throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "*");
} }
if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "*", right.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "*", right.get(0).fhirType());
@ -2612,13 +2612,13 @@ public class FHIRPathEngine {
private List<Base> opConcatenate(List<Base> left, List<Base> right, ExpressionNode expr) throws PathEngineException { private List<Base> opConcatenate(List<Base> left, List<Base> right, ExpressionNode expr) throws PathEngineException {
if (left.size() > 1) { if (left.size() > 1) {
throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "&"); throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "&");
} }
if (left.size() > 0 && !left.get(0).hasType(FHIR_TYPES_STRING)) { if (left.size() > 0 && !left.get(0).hasType(FHIR_TYPES_STRING)) {
throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "&", left.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "&", left.get(0).fhirType());
} }
if (right.size() > 1) { if (right.size() > 1) {
throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "&"); throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "&");
} }
if (right.size() > 0 && !right.get(0).hasType(FHIR_TYPES_STRING)) { if (right.size() > 0 && !right.get(0).hasType(FHIR_TYPES_STRING)) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "&", right.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "&", right.get(0).fhirType());
@ -2745,13 +2745,13 @@ public class FHIRPathEngine {
return new ArrayList<Base>(); return new ArrayList<Base>();
} }
if (left.size() > 1) { if (left.size() > 1) {
throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "-"); throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "-");
} }
if (!left.get(0).isPrimitive() && !left.get(0).hasType("Quantity")) { if (!left.get(0).isPrimitive() && !left.get(0).hasType("Quantity")) {
throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "-", left.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "-", left.get(0).fhirType());
} }
if (right.size() > 1) { if (right.size() > 1) {
throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "-"); throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "-");
} }
if (!right.get(0).isPrimitive() && !((left.get(0).isDateTime() || "0".equals(left.get(0).primitiveValue()) || left.get(0).hasType("Quantity")) && right.get(0).hasType("Quantity"))) { if (!right.get(0).isPrimitive() && !((left.get(0).isDateTime() || "0".equals(left.get(0).primitiveValue()) || left.get(0).hasType("Quantity")) && right.get(0).hasType("Quantity"))) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "-", right.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "-", right.get(0).fhirType());
@ -2784,13 +2784,13 @@ public class FHIRPathEngine {
return new ArrayList<Base>(); return new ArrayList<Base>();
} }
if (left.size() > 1) { if (left.size() > 1) {
throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "/"); throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "/");
} }
if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) {
throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "/", left.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "/", left.get(0).fhirType());
} }
if (right.size() > 1) { if (right.size() > 1) {
throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "/"); throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "/");
} }
if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "/", right.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "/", right.get(0).fhirType());
@ -2830,13 +2830,13 @@ public class FHIRPathEngine {
return new ArrayList<Base>(); return new ArrayList<Base>();
} }
if (left.size() > 1) { if (left.size() > 1) {
throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "div"); throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "div");
} }
if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) {
throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "div", left.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "div", left.get(0).fhirType());
} }
if (right.size() > 1) { if (right.size() > 1) {
throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "div"); throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "div");
} }
if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "div", right.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "div", right.get(0).fhirType());
@ -2870,13 +2870,13 @@ public class FHIRPathEngine {
if (left.size() == 0 || right.size() == 0) { if (left.size() == 0 || right.size() == 0) {
return new ArrayList<Base>(); return new ArrayList<Base>();
} if (left.size() > 1) { } if (left.size() > 1) {
throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "mod"); throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "mod");
} }
if (!left.get(0).isPrimitive()) { if (!left.get(0).isPrimitive()) {
throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "mod", left.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "mod", left.get(0).fhirType());
} }
if (right.size() > 1) { if (right.size() > 1) {
throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "mod"); throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "mod");
} }
if (!right.get(0).isPrimitive()) { if (!right.get(0).isPrimitive()) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "mod", right.get(0).fhirType()); throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "mod", right.get(0).fhirType());
@ -3611,7 +3611,7 @@ public class FHIRPathEngine {
private List<Base> funcSqrt(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcSqrt(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "sqrt", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "sqrt", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3631,7 +3631,7 @@ public class FHIRPathEngine {
private List<Base> funcAbs(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcAbs(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "abs", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "abs", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3654,7 +3654,7 @@ public class FHIRPathEngine {
private List<Base> funcCeiling(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcCeiling(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ceiling", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ceiling", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3672,7 +3672,7 @@ public class FHIRPathEngine {
private List<Base> funcFloor(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcFloor(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "floor", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "floor", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3695,7 +3695,7 @@ public class FHIRPathEngine {
return new ArrayList<Base>(); return new ArrayList<Base>();
} }
if (focus.size() > 1) { if (focus.size() > 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "exp", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "exp", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3716,7 +3716,7 @@ public class FHIRPathEngine {
private List<Base> funcLn(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcLn(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ln", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ln", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3736,7 +3736,7 @@ public class FHIRPathEngine {
private List<Base> funcLog(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcLog(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "log", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "log", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3764,7 +3764,7 @@ public class FHIRPathEngine {
private List<Base> funcPower(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcPower(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "power", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "power", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3788,7 +3788,7 @@ public class FHIRPathEngine {
private List<Base> funcTruncate(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcTruncate(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "truncate", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "truncate", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3806,7 +3806,7 @@ public class FHIRPathEngine {
private List<Base> funcLowBoundary(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcLowBoundary(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "lowBoundary", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "lowBoundary", focus.size());
} }
int precision = 0; int precision = 0;
if (expr.getParameters().size() > 0) { if (expr.getParameters().size() > 0) {
@ -3836,7 +3836,7 @@ public class FHIRPathEngine {
private List<Base> funcHighBoundary(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcHighBoundary(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size());
} }
int precision = 0; int precision = 0;
if (expr.getParameters().size() > 0) { if (expr.getParameters().size() > 0) {
@ -3866,7 +3866,7 @@ public class FHIRPathEngine {
private List<Base> funcPrecision(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcPrecision(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -3884,7 +3884,7 @@ public class FHIRPathEngine {
private List<Base> funcRound(ExecutionContext context, List<Base> focus, ExpressionNode expr) { private List<Base> funcRound(ExecutionContext context, List<Base> focus, ExpressionNode expr) {
if (focus.size() != 1) { if (focus.size() != 1) {
throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "round", focus.size()); throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "round", focus.size());
} }
Base base = focus.get(0); Base base = focus.get(0);
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
@ -5794,13 +5794,13 @@ public class FHIRPathEngine {
throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE, element.getElement().getId()); throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE, element.getElement().getId());
} }
if (element.getTypes().size() > 1) { if (element.getTypes().size() > 1) {
throw makeExceptionPL(element.getTypes().size(), expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_PLURAL, element.getElement().getId()); throw makeExceptionPlural(element.getTypes().size(), expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_PLURAL, element.getElement().getId());
} }
if (!element.getTypes().get(0).hasTarget()) { if (!element.getTypes().get(0).hasTarget()) {
throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_NOT_REFERENCE, element.getElement().getId(), element.getElement().getType().get(0).getCode()+")"); throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_NOT_REFERENCE, element.getElement().getId(), element.getElement().getType().get(0).getCode()+")");
} }
if (element.getTypes().get(0).getTargetProfile().size() > 1) { if (element.getTypes().get(0).getTargetProfile().size() > 1) {
throw makeExceptionPL(element.getTypes().get(0).getTargetProfile().size(), expr, I18nConstants.FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_PLURAL, element.getElement().getId()); throw makeExceptionPlural(element.getTypes().get(0).getTargetProfile().size(), expr, I18nConstants.FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_PLURAL, element.getElement().getId());
} }
sd = worker.fetchResource(StructureDefinition.class, element.getTypes().get(0).getTargetProfile().get(0).getValue()); sd = worker.fetchResource(StructureDefinition.class, element.getTypes().get(0).getTargetProfile().get(0).getValue());
if (sd == null) { if (sd == null) {
@ -5897,10 +5897,10 @@ public class FHIRPathEngine {
throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_NOTYPE, ed.getElement().getId()); throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_NOTYPE, ed.getElement().getId());
} }
if (ed.getTypes().size() > 1) { if (ed.getTypes().size() > 1) {
throw makeExceptionPL(ed.getTypes().size(), expr, I18nConstants.FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_PLURAL, ed.getElement().getId()); throw makeExceptionPlural(ed.getTypes().size(), expr, I18nConstants.FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_PLURAL, ed.getElement().getId());
} }
if (ed.getTypes().get(0).getProfile().size() > 1) { if (ed.getTypes().get(0).getProfile().size() > 1) {
throw makeExceptionPL(ed.getTypes().get(0).getProfile().size(), expr, I18nConstants.FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_PLURAL, ed.getElement().getId()); throw makeExceptionPlural(ed.getTypes().get(0).getProfile().size(), expr, I18nConstants.FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_PLURAL, ed.getElement().getId());
} }
if (ed.getTypes().get(0).hasProfile()) { if (ed.getTypes().get(0).hasProfile()) {
return worker.fetchResource(StructureDefinition.class, ed.getTypes().get(0).getProfile().get(0).getValue()); return worker.fetchResource(StructureDefinition.class, ed.getTypes().get(0).getProfile().get(0).getValue());

View File

@ -322,7 +322,7 @@ public class BaseValidator implements IValidationContextResourceLoader {
protected boolean hintPL(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { protected boolean hintPL(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) {
if (!thePass && doingHints()) { if (!thePass && doingHints()) {
String message = context.formatMessagePL(num, theMessage, theMessageArguments); String message = context.formatMessagePlural(num, theMessage, theMessageArguments);
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.INFORMATION, theMessage); addValidationMessage(errors, type, line, col, path, message, IssueSeverity.INFORMATION, theMessage);
} }
return thePass; return thePass;
@ -389,7 +389,7 @@ public class BaseValidator implements IValidationContextResourceLoader {
protected boolean rulePL(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { protected boolean rulePL(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) {
if (!thePass && doingErrors()) { if (!thePass && doingErrors()) {
String message = context.formatMessagePL(num, theMessage, theMessageArguments); String message = context.formatMessagePlural(num, theMessage, theMessageArguments);
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.ERROR, theMessage); addValidationMessage(errors, type, line, col, path, message, IssueSeverity.ERROR, theMessage);
} }
return thePass; return thePass;
@ -456,7 +456,7 @@ public class BaseValidator implements IValidationContextResourceLoader {
protected boolean rulePL(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { protected boolean rulePL(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) {
if (!thePass && doingErrors()) { if (!thePass && doingErrors()) {
String message = context.formatMessagePL(num, theMessage, theMessageArguments); String message = context.formatMessagePlural(num, theMessage, theMessageArguments);
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR, theMessage); addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR, theMessage);
} }
return thePass; return thePass;
@ -530,9 +530,9 @@ public class BaseValidator implements IValidationContextResourceLoader {
} }
protected boolean warningPL(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String msg, Object... theMessageArguments) { protected boolean warningPlural(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String msg, Object... theMessageArguments) {
if (!thePass && doingWarnings()) { if (!thePass && doingWarnings()) {
String nmsg = context.formatMessagePL(num, msg, theMessageArguments); String nmsg = context.formatMessagePlural(num, msg, theMessageArguments);
IssueSeverity severity = IssueSeverity.WARNING; IssueSeverity severity = IssueSeverity.WARNING;
addValidationMessage(errors, type, line, col, path, nmsg, severity, msg); addValidationMessage(errors, type, line, col, path, nmsg, severity, msg);
} }

View File

@ -2824,7 +2824,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (invalidChars.isEmpty()) { if (invalidChars.isEmpty()) {
return null; return null;
} else { } else {
return context.formatMessagePL(c, I18nConstants.XHTML_URL_INVALID_CHARS_PLURAL, invalidChars.toString()); return context.formatMessagePlural(c, I18nConstants.XHTML_URL_INVALID_CHARS_PLURAL, invalidChars.toString());
} }
} }
} }
@ -4242,7 +4242,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
throw new DefinitionException(context.formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES, discriminator, ed.getId(), profile.getUrl())); throw new DefinitionException(context.formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES, discriminator, ed.getId(), profile.getUrl()));
} }
} else if (criteriaElement.getType().size() > 1) { } else if (criteriaElement.getType().size() > 1) {
throw new DefinitionException(context.formatMessagePL(criteriaElement.getType().size(), I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_MULTIPLE_TYPES_PLURAL, discriminator, ed.getId(), profile.getUrl(), criteriaElement.typeSummary())); throw new DefinitionException(context.formatMessagePlural(criteriaElement.getType().size(), I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_MULTIPLE_TYPES_PLURAL, discriminator, ed.getId(), profile.getUrl(), criteriaElement.typeSummary()));
} else } else
throw new DefinitionException(context.formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES, discriminator, ed.getId(), profile.getUrl())); throw new DefinitionException(context.formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES, discriminator, ed.getId(), profile.getUrl()));
if (discriminator.isEmpty()) { if (discriminator.isEmpty()) {
@ -4255,7 +4255,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl())); throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl()));
} }
if (criteriaElement.getType().size() != 1) { if (criteriaElement.getType().size() != 1) {
throw new DefinitionException(context.formatMessagePL(criteriaElement.getType().size(), I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_ONLY_ONE_TYPE__IN_PROFILE_PLURAL, criteriaElement.getId(), profile.getUrl())); throw new DefinitionException(context.formatMessagePlural(criteriaElement.getType().size(), I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_ONLY_ONE_TYPE__IN_PROFILE_PLURAL, criteriaElement.getId(), profile.getUrl()));
} }
List<CanonicalType> list = discriminator.endsWith(".resolve()") || discriminator.equals("resolve()") ? criteriaElement.getType().get(0).getTargetProfile() : criteriaElement.getType().get(0).getProfile(); List<CanonicalType> list = discriminator.endsWith(".resolve()") || discriminator.equals("resolve()") ? criteriaElement.getType().get(0).getTargetProfile() : criteriaElement.getType().get(0).getProfile();
if (list.size() == 0) { if (list.size() == 0) {
@ -4293,7 +4293,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
anyFound = true; anyFound = true;
} }
if (!anyFound) { if (!anyFound) {
throw new DefinitionException(context.formatMessagePL(slicer.getSlicing().getDiscriminator().size(), I18nConstants.Could_not_match_discriminator_for_slice_in_profile_PLURAL, discriminators, ed.getId(), profile.getUrl(), discriminators)); throw new DefinitionException(context.formatMessagePlural(slicer.getSlicing().getDiscriminator().size(), I18nConstants.Could_not_match_discriminator_for_slice_in_profile_PLURAL, discriminators, ed.getId(), profile.getUrl(), discriminators));
} }
try { try {
@ -5522,7 +5522,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} }
} }
} else { } else {
warningPL(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.getPath(), false, goodProfiles.size(), I18nConstants.VALIDATION_VAL_PROFILE_MULTIPLEMATCHES_PLURAL, ResourceUtilities.listStrings(goodProfiles.keySet())); warningPlural(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.getPath(), false, goodProfiles.size(), I18nConstants.VALIDATION_VAL_PROFILE_MULTIPLEMATCHES_PLURAL, ResourceUtilities.listStrings(goodProfiles.keySet()));
for (String m : goodProfiles.keySet()) { for (String m : goodProfiles.keySet()) {
p = this.context.fetchResource(StructureDefinition.class, m); p = this.context.fetchResource(StructureDefinition.class, m);
for (ValidationMessage message : goodProfiles.get(m)) { for (ValidationMessage message : goodProfiles.get(m)) {