diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/IWorkerContext.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/IWorkerContext.java index ec707c517..e92d7a0d3 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/IWorkerContext.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/IWorkerContext.java @@ -45,7 +45,6 @@ import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.TerminologyServiceException; import org.hl7.fhir.r4b.context.TerminologyCache.CacheToken; -import org.hl7.fhir.r4b.elementmodel.Element; import org.hl7.fhir.r4b.formats.IParser; import org.hl7.fhir.r4b.formats.ParserType; import org.hl7.fhir.r4b.model.Bundle; @@ -71,7 +70,6 @@ import org.hl7.fhir.utilities.TranslationServices; import org.hl7.fhir.utilities.npm.BasePackageCacheManager; import org.hl7.fhir.utilities.npm.NpmPackage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; -import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationOptions; import com.google.gson.JsonSyntaxException; @@ -554,7 +552,7 @@ public interface IWorkerContext { void setLocale(Locale locale); String formatMessage(String theMessage, Object... theMessageArguments); - String formatMessagePL(Integer pl, String theMessage, Object... theMessageArguments); + String formatMessagePlural(Integer pl, String theMessage, Object... theMessageArguments); void setValidationMessageLanguage(Locale locale); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java index 2834a2f7b..4e442b527 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java @@ -1,33 +1,33 @@ package org.hl7.fhir.r4b.terminologies; -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - */ +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + */ @@ -386,7 +386,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } } } - return new ValidationResult(IssueSeverity.WARNING, context.formatMessagePL(b.count(), I18nConstants.DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF_PLURAL, code.getSystem(), code.getCode(), b.toString(), code.getDisplay()), code.getSystem(), cc); + return new ValidationResult(IssueSeverity.WARNING, context.formatMessagePlural(b.count(), I18nConstants.DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF, code.getSystem(), code.getCode(), b.toString(), code.getDisplay()), code.getSystem(), cc); } private ConceptReferenceComponent findValueSetRef(String system, String code) { diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java index e990fb71d..fe3bdca4d 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java @@ -2,7 +2,6 @@ package org.hl7.fhir.r4b.utils; import java.math.BigDecimal; import java.math.RoundingMode; -import java.rmi.server.LoaderHandler; import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; @@ -17,14 +16,11 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.lang3.NotImplementedException; -import org.apache.commons.lang3.RegExUtils; import org.fhir.ucum.Decimal; import org.fhir.ucum.Pair; import org.fhir.ucum.UcumException; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.exceptions.PathEngineException; import org.hl7.fhir.r4b.conformance.ProfileUtilities; import org.hl7.fhir.r4b.context.IWorkerContext; @@ -45,7 +41,6 @@ import org.hl7.fhir.r4b.model.ExpressionNode.CollectionStatus; import org.hl7.fhir.r4b.model.ExpressionNode.Function; import org.hl7.fhir.r4b.model.ExpressionNode.Kind; import org.hl7.fhir.r4b.model.ExpressionNode.Operation; -import org.hl7.fhir.r4b.model.InstantType; import org.hl7.fhir.r4b.model.Property.PropertyMatcher; import org.hl7.fhir.r4b.model.IntegerType; import org.hl7.fhir.r4b.model.Property; @@ -60,7 +55,6 @@ import org.hl7.fhir.r4b.model.TypeConvertor; import org.hl7.fhir.r4b.model.TypeDetails; import org.hl7.fhir.r4b.model.TypeDetails.ProfiledType; import org.hl7.fhir.r4b.model.ValueSet; -import org.hl7.fhir.r4b.renderers.DataRenderer; import org.hl7.fhir.r4b.utils.FHIRLexer.FHIRLexerException; import org.hl7.fhir.r4b.utils.FHIRPathEngine.IEvaluationContext.FunctionDetails; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; @@ -69,9 +63,7 @@ import org.hl7.fhir.utilities.MergedList.MergeNode; import org.hl7.fhir.utilities.SourceLocation; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.i18n.I18nConstants; -import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationOptions; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -577,8 +569,8 @@ public class FHIRPathEngine { return executeType(new ExecutionTypeContext(appContext, resourceType, types, types), types, expr, true); } - private FHIRException makeExceptionPL(Integer num, ExpressionNode holder, String constName, Object... args) { - String fmt = worker.formatMessagePL(num, constName, args); + private FHIRException makeExceptionPlural(Integer num, ExpressionNode holder, String constName, Object... args) { + String fmt = worker.formatMessagePlural(num, constName, args); if (location != null) { fmt = fmt + " "+worker.formatMessage(I18nConstants.FHIRPATH_LOCATION, location); } @@ -2494,13 +2486,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "+"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "+"); } if (!left.get(0).isPrimitive()) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "+", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "+"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "+"); } 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()); @@ -2581,13 +2573,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "*"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "*"); } if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "*", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "*"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "*"); } if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "*", right.get(0).fhirType()); @@ -2620,13 +2612,13 @@ public class FHIRPathEngine { private List opConcatenate(List left, List right, ExpressionNode expr) throws PathEngineException { if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "&"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "&"); } if (left.size() > 0 && !left.get(0).hasType(FHIR_TYPES_STRING)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "&", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "&"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "&"); } if (right.size() > 0 && !right.get(0).hasType(FHIR_TYPES_STRING)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "&", right.get(0).fhirType()); @@ -2753,13 +2745,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "-"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "-"); } if (!left.get(0).isPrimitive() && !left.get(0).hasType("Quantity")) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "-", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "-"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "-"); } 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()); @@ -2792,13 +2784,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "/"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "/"); } if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "/", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "/"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "/"); } if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "/", right.get(0).fhirType()); @@ -2838,13 +2830,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "div"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "div"); } if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "div", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "div"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "div"); } if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "div", right.get(0).fhirType()); @@ -2878,13 +2870,13 @@ public class FHIRPathEngine { if (left.size() == 0 || right.size() == 0) { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "mod"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "mod"); } if (!left.get(0).isPrimitive()) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "mod", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "mod"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "mod"); } if (!right.get(0).isPrimitive()) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "mod", right.get(0).fhirType()); @@ -3619,7 +3611,7 @@ public class FHIRPathEngine { private List funcSqrt(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "sqrt", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "sqrt", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3639,7 +3631,7 @@ public class FHIRPathEngine { private List funcAbs(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "abs", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "abs", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3662,7 +3654,7 @@ public class FHIRPathEngine { private List funcCeiling(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ceiling", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "ceiling", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3680,7 +3672,7 @@ public class FHIRPathEngine { private List funcFloor(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "floor", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "floor", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3703,7 +3695,7 @@ public class FHIRPathEngine { return new ArrayList(); } if (focus.size() > 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "exp", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "exp", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3724,7 +3716,7 @@ public class FHIRPathEngine { private List funcLn(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ln", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "ln", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3744,7 +3736,7 @@ public class FHIRPathEngine { private List funcLog(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "log", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "log", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3772,7 +3764,7 @@ public class FHIRPathEngine { private List funcPower(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "power", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "power", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3796,7 +3788,7 @@ public class FHIRPathEngine { private List funcTruncate(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "truncate", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "truncate", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3814,7 +3806,7 @@ public class FHIRPathEngine { private List funcLowBoundary(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "lowBoundary", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "lowBoundary", focus.size()); } int precision = 0; if (expr.getParameters().size() > 0) { @@ -3844,7 +3836,7 @@ public class FHIRPathEngine { private List funcHighBoundary(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "highBoundary", focus.size()); } int precision = 0; if (expr.getParameters().size() > 0) { @@ -3874,7 +3866,7 @@ public class FHIRPathEngine { private List funcPrecision(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "highBoundary", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3892,7 +3884,7 @@ public class FHIRPathEngine { private List funcRound(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "round", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "round", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -5802,13 +5794,13 @@ public class FHIRPathEngine { throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE, element.getElement().getId()); } 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, element.getElement().getId()); } if (!element.getTypes().get(0).hasTarget()) { 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) { - 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, element.getElement().getId()); } sd = worker.fetchResource(StructureDefinition.class, element.getTypes().get(0).getTargetProfile().get(0).getValue()); if (sd == null) { @@ -5905,10 +5897,10 @@ public class FHIRPathEngine { throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_NOTYPE, ed.getElement().getId()); } 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, ed.getElement().getId()); } 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, ed.getElement().getId()); } if (ed.getTypes().get(0).hasProfile()) { return worker.fetchResource(StructureDefinition.class, ed.getTypes().get(0).getProfile().get(0).getValue()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java index ba7e9a137..f41bd5da6 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java @@ -638,7 +638,7 @@ public interface IWorkerContext { * @return */ String formatMessage(String theMessage, Object... theMessageArguments); - String formatMessagePL(Integer pluralNum, String theMessage, Object... theMessageArguments); + String formatMessagePlural(Integer pluralNum, String theMessage, Object... theMessageArguments); /** * Validation of a code - consult the terminology infrstructure and/or service diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java index c8bccf21a..8d0203d13 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java @@ -43,7 +43,6 @@ import java.util.Set; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.NoTerminologyServiceException; import org.hl7.fhir.r5.context.IWorkerContext; -import org.hl7.fhir.r5.context.IWorkerContext.PackageDetails; import org.hl7.fhir.r5.context.IWorkerContext.PackageVersion; import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult; import org.hl7.fhir.r5.model.CanonicalType; @@ -61,7 +60,6 @@ import org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent; import org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent; import org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent; import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent; -import org.hl7.fhir.r5.terminologies.ValueSetChecker.ValidationProcessInfo; import org.hl7.fhir.r5.terminologies.ValueSetExpander.TerminologyServiceErrorClass; import org.hl7.fhir.r5.terminologies.ValueSetExpander.ValueSetExpansionOutcome; import org.hl7.fhir.r5.utils.ToolingExtensions; @@ -71,7 +69,6 @@ import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.i18n.I18nConstants; -import org.hl7.fhir.utilities.npm.PackageInfo; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationOptions; import org.hl7.fhir.utilities.validation.ValidationOptions.ValueSetMode; @@ -423,7 +420,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } } } - return new ValidationResult(IssueSeverity.WARNING, context.formatMessagePL(b.count(), I18nConstants.DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF_PLURAL, code.getSystem(), code.getCode(), b.toString(), code.getDisplay()), code.getSystem(), cc); + return new ValidationResult(IssueSeverity.WARNING, context.formatMessagePlural(b.count(), I18nConstants.DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF, code.getSystem(), code.getCode(), b.toString(), code.getDisplay()), code.getSystem(), cc); } private ConceptReferenceComponent findValueSetRef(String system, String code) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java index 905e962bc..4c48df74f 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java @@ -2,7 +2,6 @@ package org.hl7.fhir.r5.utils; import java.math.BigDecimal; import java.math.RoundingMode; -import java.rmi.server.LoaderHandler; import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; @@ -17,14 +16,11 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.lang3.NotImplementedException; -import org.apache.commons.lang3.RegExUtils; import org.fhir.ucum.Decimal; import org.fhir.ucum.Pair; import org.fhir.ucum.UcumException; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.exceptions.PathEngineException; import org.hl7.fhir.r5.conformance.ProfileUtilities; import org.hl7.fhir.r5.conformance.ProfileUtilities.SourcedChildDefinitions; @@ -47,7 +43,6 @@ import org.hl7.fhir.r5.model.ExpressionNode.CollectionStatus; import org.hl7.fhir.r5.model.ExpressionNode.Function; import org.hl7.fhir.r5.model.ExpressionNode.Kind; import org.hl7.fhir.r5.model.ExpressionNode.Operation; -import org.hl7.fhir.r5.model.InstantType; import org.hl7.fhir.r5.model.Property.PropertyMatcher; import org.hl7.fhir.r5.model.IntegerType; import org.hl7.fhir.r5.model.Property; @@ -62,7 +57,6 @@ import org.hl7.fhir.r5.model.TypeConvertor; import org.hl7.fhir.r5.model.TypeDetails; import org.hl7.fhir.r5.model.TypeDetails.ProfiledType; import org.hl7.fhir.r5.model.ValueSet; -import org.hl7.fhir.r5.renderers.DataRenderer; import org.hl7.fhir.r5.utils.FHIRLexer.FHIRLexerException; import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext.FunctionDetails; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; @@ -71,9 +65,7 @@ import org.hl7.fhir.utilities.MergedList.MergeNode; import org.hl7.fhir.utilities.SourceLocation; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.i18n.I18nConstants; -import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationOptions; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -579,10 +571,10 @@ public class FHIRPathEngine { return executeType(new ExecutionTypeContext(appContext, resourceType, types, types), types, expr, true); } - private FHIRException makeExceptionPL(Integer num, ExpressionNode holder, String constName, Object... args) { - String fmt = worker.formatMessagePL(num, constName, args); + private FHIRException makeExceptionPlural(Integer num, ExpressionNode holder, String constName, Object... args) { + String fmt = worker.formatMessagePlural(num, constName, args); if (location != null) { - fmt = fmt + " "+worker.formatMessagePL(num, I18nConstants.FHIRPATH_LOCATION, location); + fmt = fmt + " "+worker.formatMessagePlural(num, I18nConstants.FHIRPATH_LOCATION, location); } if (holder != null) { return new PathEngineException(fmt, holder.getStart(), holder.toString()); @@ -2496,13 +2488,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "+"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "+"); } if (!left.get(0).isPrimitive()) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "+", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "+"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "+"); } 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()); @@ -2583,13 +2575,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "*"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "*"); } if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "*", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "*"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "*"); } if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "*", right.get(0).fhirType()); @@ -2622,13 +2614,13 @@ public class FHIRPathEngine { private List opConcatenate(List left, List right, ExpressionNode expr) throws PathEngineException { if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "&"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "&"); } if (left.size() > 0 && !left.get(0).hasType(FHIR_TYPES_STRING)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "&", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "&"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "&"); } if (right.size() > 0 && !right.get(0).hasType(FHIR_TYPES_STRING)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "&", right.get(0).fhirType()); @@ -2755,13 +2747,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "-"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "-"); } if (!left.get(0).isPrimitive() && !left.get(0).hasType("Quantity")) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "-", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "-"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "-"); } 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()); @@ -2794,13 +2786,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "/"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "/"); } if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "/", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "/"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "/"); } if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "/", right.get(0).fhirType()); @@ -2840,13 +2832,13 @@ public class FHIRPathEngine { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "div"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "div"); } if (!left.get(0).isPrimitive() && !(left.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "div", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "div"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "div"); } if (!right.get(0).isPrimitive() && !(right.get(0) instanceof Quantity)) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "div", right.get(0).fhirType()); @@ -2880,13 +2872,13 @@ public class FHIRPathEngine { if (left.size() == 0 || right.size() == 0) { return new ArrayList(); } if (left.size() > 1) { - throw makeExceptionPL(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE_PLURAL, "mod"); + throw makeExceptionPlural(left.size(), expr, I18nConstants.FHIRPATH_LEFT_VALUE, "mod"); } if (!left.get(0).isPrimitive()) { throw makeException(expr, I18nConstants.FHIRPATH_LEFT_VALUE_WRONG_TYPE, "mod", left.get(0).fhirType()); } if (right.size() > 1) { - throw makeExceptionPL(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE_PLURAL, "mod"); + throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "mod"); } if (!right.get(0).isPrimitive()) { throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "mod", right.get(0).fhirType()); @@ -3621,7 +3613,7 @@ public class FHIRPathEngine { private List funcSqrt(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "sqrt", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "sqrt", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3641,7 +3633,7 @@ public class FHIRPathEngine { private List funcAbs(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "abs", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "abs", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3664,7 +3656,7 @@ public class FHIRPathEngine { private List funcCeiling(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ceiling", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "ceiling", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3682,7 +3674,7 @@ public class FHIRPathEngine { private List funcFloor(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "floor", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "floor", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3705,7 +3697,7 @@ public class FHIRPathEngine { return new ArrayList(); } if (focus.size() > 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "exp", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "exp", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3726,7 +3718,7 @@ public class FHIRPathEngine { private List funcLn(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "ln", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "ln", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3746,7 +3738,7 @@ public class FHIRPathEngine { private List funcLog(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "log", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "log", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3774,7 +3766,7 @@ public class FHIRPathEngine { private List funcPower(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "power", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "power", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3798,7 +3790,7 @@ public class FHIRPathEngine { private List funcTruncate(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "truncate", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "truncate", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3816,7 +3808,7 @@ public class FHIRPathEngine { private List funcLowBoundary(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "lowBoundary", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "lowBoundary", focus.size()); } int precision = 0; if (expr.getParameters().size() > 0) { @@ -3846,7 +3838,7 @@ public class FHIRPathEngine { private List funcHighBoundary(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "highBoundary", focus.size()); } int precision = 0; if (expr.getParameters().size() > 0) { @@ -3876,7 +3868,7 @@ public class FHIRPathEngine { private List funcPrecision(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "highBoundary", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "highBoundary", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -3894,7 +3886,7 @@ public class FHIRPathEngine { private List funcRound(ExecutionContext context, List focus, ExpressionNode expr) { if (focus.size() != 1) { - throw makeExceptionPL(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS_PLURAL, "round", focus.size()); + throw makeExceptionPlural(focus.size(), expr, I18nConstants.FHIRPATH_FOCUS, "round", focus.size()); } Base base = focus.get(0); List result = new ArrayList(); @@ -5804,13 +5796,13 @@ public class FHIRPathEngine { throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE, element.getElement().getId()); } 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, element.getElement().getId()); } if (!element.getTypes().get(0).hasTarget()) { 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) { - 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, element.getElement().getId()); } sd = worker.fetchResource(StructureDefinition.class, element.getTypes().get(0).getTargetProfile().get(0).getValue()); if (sd == null) { @@ -5907,10 +5899,10 @@ public class FHIRPathEngine { throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_NOTYPE, ed.getElement().getId()); } 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, ed.getElement().getId()); } 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, ed.getElement().getId()); } if (ed.getTypes().get(0).hasProfile()) { return worker.fetchResource(StructureDefinition.class, ed.getTypes().get(0).getProfile().get(0).getValue()); diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index daa5803cb..c13532568 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -80,6 +80,12 @@ true + + com.ibm.icu + icu4j + 72.1 + + org.junit.jupiter diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java index a92dfd3fa..9bf45896d 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java @@ -1,5 +1,7 @@ package org.hl7.fhir.utilities.i18n; +import com.ibm.icu.text.PluralRules; + import java.text.MessageFormat; import java.util.Locale; import java.util.Objects; @@ -12,8 +14,11 @@ import java.util.ResourceBundle; */ public abstract class I18nBase { + public static final String PLURAL_SUFFIX = "PLURAL"; + public static final String KEY_DELIMITER = "_"; private Locale locale; private ResourceBundle i18nMessages; + private PluralRules pluralRules; private boolean warnAboutMissingMessages = true; public Locale getLocale() { @@ -38,6 +43,12 @@ public abstract class I18nBase { } } + private void checkPluralRulesAreLoaded() { + if (pluralRules == null) { + setPluralRules(getLocale()); + } + } + /** * Checks the loaded {@link ResourceBundle} to see if the passed in message exists with the current loaded {@link Locale}. * If no {@link Locale} is currently loaded, it will load the {@link Locale} (default {@link Locale#US} is none is @@ -63,13 +74,14 @@ public abstract class I18nBase { * @return The formatted, internationalized, {@link String} */ public String formatMessage(String theMessage, Object... theMessageArguments) { - if (theMessage.endsWith("_PLURAL")) { - throw new Error("I18n error: Plural Message called in non-plural mode"); - } - return formatMessageP(theMessage, theMessageArguments); + return formatMessageForLocale(theMessage, theMessageArguments); } - - private String formatMessageP(String theMessage, Object... theMessageArguments) { + + protected String getPluralKey(Integer number, String baseKey) { + return baseKey + KEY_DELIMITER + pluralRules.select(number); + } + + private String formatMessageForLocale(String theMessage, Object... theMessageArguments) { String message = theMessage; if (messageExistsForLocale(theMessage, (theMessageArguments != null && theMessageArguments.length > 0))) { if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) { @@ -80,16 +92,31 @@ public abstract class I18nBase { } return message; } - public String formatMessagePL(Integer plural, String theMessage, Object... theMessageArguments) { - if (!theMessage.endsWith("_PLURAL")) { - throw new Error("I18n error: Non-plural Message called in plural mode"); - } + + /** + * Formats the message with locale correct pluralization using the passed in + * message arguments. + * + * In the message properties files, each plural specific message will have a + * key consisting of a root key and a suffix denoting the plurality rule (_one + * for singular, _other for multiple in English, for example). Suffixes are + * provided by th ICU4J library from unicode.org + * + * @param plural The number that indicates the plurality of the phrase + * @param theMessage the root key of the phrase. + * @param theMessageArguments Placeholder arguments, if needed. + * @return The formatted, internationalized, {@link String} + */ + public String formatMessagePlural(Integer plural, String theMessage, Object... theMessageArguments) { + Object[] args = new Object[theMessageArguments.length+1]; args[0] = plural; for (int i = 0; i < theMessageArguments.length; i++) { args[i+1] = theMessageArguments[i]; } - return formatMessageP(theMessage, args); + checkPluralRulesAreLoaded(); + String pluralKey = getPluralKey(plural, theMessage); + return formatMessageForLocale(pluralKey, args); } /** @@ -100,6 +127,10 @@ public abstract class I18nBase { i18nMessages = ResourceBundle.getBundle("Messages", locale); } + public void setPluralRules(Locale locale) { + pluralRules = PluralRules.forLocale(locale); + } + public boolean isWarnAboutMissingMessages() { return warnAboutMissingMessages; } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java index 53bc9e2a7..7421ae8fa 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java @@ -28,13 +28,13 @@ public class I18nConstants { public static final String BUNDLE_BUNDLE_ENTRY_FULLURL_REQUIRED = "BUNDLE_BUNDLE_ENTRY_FULLURL_REQUIRED"; public static final String BUNDLE_BUNDLE_ENTRY_NOPROFILE_EXPL = "Bundle_BUNDLE_Entry_NoProfile_EXPL"; public static final String BUNDLE_BUNDLE_ENTRY_NOPROFILE_TYPE = "Bundle_BUNDLE_Entry_NoProfile_TYPE"; - public static final String BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_PLURAL = "BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_PLURAL"; + public static final String BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES = "BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES"; public static final String BUNDLE_BUNDLE_ENTRY_NOTFOUND = "Bundle_BUNDLE_Entry_NotFound"; public static final String BUNDLE_BUNDLE_ENTRY_ORPHAN = "Bundle_BUNDLE_Entry_Orphan"; public static final String BUNDLE_BUNDLE_ENTRY_REVERSE = "BUNDLE_BUNDLE_ENTRY_REVERSE"; public static final String BUNDLE_BUNDLE_ENTRY_TYPE = "Bundle_BUNDLE_Entry_Type"; public static final String BUNDLE_BUNDLE_ENTRY_TYPE2 = "Bundle_BUNDLE_Entry_Type2"; - public static final String BUNDLE_BUNDLE_ENTRY_TYPE3_PLURAL = "Bundle_BUNDLE_Entry_Type3_PLURAL"; + public static final String BUNDLE_BUNDLE_ENTRY_TYPE3 = "Bundle_BUNDLE_Entry_Type3"; public static final String BUNDLE_BUNDLE_FULLURL_MISSING = "Bundle_BUNDLE_FullUrl_Missing"; public static final String BUNDLE_BUNDLE_FULLURL_NEEDVERSION = "Bundle_BUNDLE_FullUrl_NeedVersion"; public static final String BUNDLE_BUNDLE_MULTIPLEMATCHES = "Bundle_BUNDLE_MultipleMatches"; @@ -57,8 +57,7 @@ public class I18nConstants { public static final String CODE_FOUND_IN_EXPANSION_HOWEVER_ = "Code_found_in_expansion_however_"; public static final String CODING_HAS_NO_SYSTEM__CANNOT_VALIDATE = "Coding_has_no_system__cannot_validate"; public static final String CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_ = "Contained_resource_does_not_appear_to_be_a_FHIR_resource_unknown_name_"; - public static final String COULD_NOT_MATCH_ANY_DISCRIMINATORS__FOR_SLICE__IN_PROFILE___NONE_OF_THE_DISCRIMINATOR__HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS_PLURAL = "Could_not_match_any_discriminators__for_slice__in_profile___None_of_the_discriminator__have_fixed_value_binding_or_existence_assertions_PLURAL"; - public static final String COULD_NOT_MATCH_DISCRIMINATOR__FOR_SLICE__IN_PROFILE___THE_DISCRIMINATOR__DOES_NOT_HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS = "Could_not_match_discriminator__for_slice__in_profile___the_discriminator__does_not_have_fixed_value_binding_or_existence_assertions"; + public static final String Could_not_match_discriminator_for_slice_in_profile = "Could_not_match_discriminator_for_slice_in_profile"; public static final String DEFINED_IN_THE_PROFILE = "defined_in_the_profile"; public static final String DELIMITED_VERSIONS_HAVE_EXACT_MATCH_FOR_DELIMITER____VS_ = "Delimited_versions_have_exact_match_for_delimiter____vs_"; public static final String DERIVED_PROFILE__HAS_NO_DERIVATION_VALUE_AND_SO_CANT_BE_PROCESSED = "Derived_profile__has_no_derivation_value_and_so_cant_be_processed"; @@ -69,10 +68,10 @@ public class I18nConstants { public static final String DIFFERENTIAL_DOES_NOT_HAVE_A_SLICE__B_OF_____IN_PROFILE_ = "Differential_does_not_have_a_slice__b_of_____in_profile_"; public static final String DIFFERENTIAL_WALKS_INTO____BUT_THE_BASE_DOES_NOT_AND_THERE_IS_NOT_A_SINGLE_FIXED_TYPE_THE_TYPE_IS__THIS_IS_NOT_HANDLED_YET = "Differential_walks_into____but_the_base_does_not_and_there_is_not_a_single_fixed_type_The_type_is__This_is_not_handled_yet"; public static final String DISCRIMINATOR__IS_BASED_ON_ELEMENT_EXISTENCE_BUT_SLICE__NEITHER_SETS_MIN1_OR_MAX0 = "Discriminator__is_based_on_element_existence_but_slice__neither_sets_min1_or_max0"; - public static final String DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_MULTIPLE_TYPES_PLURAL = "Discriminator__is_based_on_type_but_slice__in__has_multiple_types_PLURAL"; + public static final String DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_MULTIPLE_TYPES = "Discriminator__is_based_on_type_but_slice__in__has_multiple_types"; public static final String DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES = "Discriminator__is_based_on_type_but_slice__in__has_no_types"; public static final String DISCRIMINATOR_BAD_PATH = "DISCRIMINATOR_BAD_PATH"; - public static final String DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF_PLURAL = "Display_Name_for__should_be_one_of__instead_of_PLURAL"; + public static final String DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF = "Display_Name_for__should_be_one_of__instead_of"; public static final String DOCUMENT = "documentmsg"; public static final String DOCUMENT_DATE_REQUIRED = "Bundle_Document_Date_Missing"; public static final String DOCUMENT_DATE_REQUIRED_HTML = "Bundle_Document_Date_Missing_html"; @@ -144,20 +143,20 @@ public class I18nConstants { public static final String FHIRPATH_DISCRIMINATOR_BAD_SYNTAX_GROUP = "FHIRPATH_DISCRIMINATOR_BAD_SYNTAX_GROUP"; public static final String FHIRPATH_DISCRIMINATOR_CANT_FIND = "FHIRPATH_DISCRIMINATOR_CANT_FIND"; public static final String FHIRPATH_DISCRIMINATOR_CANT_FIND_EXTENSION = "FHIRPATH_DISCRIMINATOR_CANT_FIND_EXTENSION"; - public static final String FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_PLURAL = "FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_PLURAL"; - public static final String FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_PLURAL = "FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_PLURAL"; + public static final String FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES = "FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES"; + public static final String FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES = "FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES"; public static final String FHIRPATH_DISCRIMINATOR_NAME_ALREADY_SLICED = "FHIRPATH_DISCRIMINATOR_NAME_ALREADY_SLICED"; public static final String FHIRPATH_DISCRIMINATOR_NOTYPE = "FHIRPATH_DISCRIMINATOR_NOTYPE"; public static final String FHIRPATH_DISCRIMINATOR_NO_CODE = "FHIRPATH_DISCRIMINATOR_NO_CODE"; - public static final String FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_PLURAL = "FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_PLURAL"; + public static final String FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES = "FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES"; public static final String FHIRPATH_DISCRIMINATOR_RESOLVE_NOT_REFERENCE = "FHIRPATH_DISCRIMINATOR_RESOLVE_NOT_REFERENCE"; public static final String FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE = "FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE"; public static final String FHIRPATH_DISCRIMINATOR_THIS_CANNOT_FIND = "FHIRPATH_DISCRIMINATOR_THIS_CANNOT_FIND"; // public static final String FHIRPATH_DISCRIMINATOR_TYPE_MULTIPLE = "FHIRPATH_DISCRIMINATOR_TYPE_MULTIPLE"; public static final String FHIRPATH_DISCRIMINATOR_TYPE_NONE = "FHIRPATH_DISCRIMINATOR_TYPE_NONE"; - public static final String FHIRPATH_FOCUS_PLURAL = "FHIRPATH_FOCUS_PLURAL"; + public static final String FHIRPATH_FOCUS = "FHIRPATH_FOCUS"; public static final String FHIRPATH_HO_HOST_SERVICES = "FHIRPATH_HO_HOST_SERVICES"; - public static final String FHIRPATH_LEFT_VALUE_PLURAL = "FHIRPATH_LEFT_VALUE_PLURAL"; + public static final String FHIRPATH_LEFT_VALUE = "FHIRPATH_LEFT_VALUE"; public static final String FHIRPATH_LEFT_VALUE_WRONG_TYPE = "FHIRPATH_LEFT_VALUE_WRONG_TYPE"; public static final String FHIRPATH_LOCATION = "FHIRPATH_LOCATION"; public static final String FHIRPATH_NOT_IMPLEMENTED = "FHIRPATH_NOT_IMPLEMENTED"; @@ -170,8 +169,8 @@ public class I18nConstants { public static final String FHIRPATH_PRIMITIVE_ONLY = "FHIRPATH_PRIMITIVE_ONLY"; public static final String FHIRPATH_REFERENCE_ONLY = "FHIRPATH_ORDERED_ONLY"; public static final String FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND = "FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND"; - public static final String FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_PLURAL = "FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_PLURAL"; - public static final String FHIRPATH_RIGHT_VALUE_PLURAL = "FHIRPATH_RIGHT_VALUE_PLURAL"; + public static final String FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET = "FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET"; + public static final String FHIRPATH_RIGHT_VALUE = "FHIRPATH_RIGHT_VALUE"; public static final String FHIRPATH_RIGHT_VALUE_WRONG_TYPE = "FHIRPATH_RIGHT_VALUE_WRONG_TYPE"; public static final String FHIRPATH_STRING_ORD_ONLY = "FHIRPATH_STRING_ORD_ONLY"; public static final String FHIRPATH_STRING_SING_ONLY = "FHIRPATH_STRING_SING_ONLY"; @@ -247,7 +246,7 @@ public class I18nConstants { public static final String MEASURE_M_LIB_UNKNOWN = "MEASURE_M_LIB_UNKNOWN"; public static final String MEASURE_M_NO_GROUPS = "MEASURE_M_NO_GROUPS"; public static final String META_RES_SECURITY_DUPLICATE = "Meta_RES_Security_Duplicate"; - public static final String MULTIPLE_LOGICAL_MODELS_PLURAL = "MULTIPLE_LOGICAL_MODELS_PLURAL"; + public static final String MULTIPLE_LOGICAL_MODELS = "MULTIPLE_LOGICAL_MODELS"; public static final String MUSTSUPPORT_VAL_MUSTSUPPORT = "MustSupport_VAL_MustSupport"; public static final String NAMED_ITEMS_ARE_OUT_OF_ORDER_IN_THE_SLICE = "Named_items_are_out_of_order_in_the_slice"; public static final String NEEDS_A_SNAPSHOT = "needs_a_snapshot"; @@ -288,7 +287,7 @@ public class I18nConstants { public static final String PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__ = "Problem_processing_expression__in_profile__path__"; public static final String PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE_WITH_A_PROFILE__IN_PROFILE_ = "Profile_based_discriminators_must_have_a_type_with_a_profile__in_profile_"; public static final String PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE__IN_PROFILE_ = "Profile_based_discriminators_must_have_a_type__in_profile_"; - public static final String PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_ONLY_ONE_TYPE__IN_PROFILE_PLURAL = "Profile_based_discriminators_must_have_only_one_type__in_profile_PLURAL"; + public static final String PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_ONLY_ONE_TYPE__IN_PROFILE = "Profile_based_discriminators_must_have_only_one_type__in_profile"; public static final String PROFILE_EXT_NOT_HERE = "Profile_EXT_Not_Here"; public static final String PROFILE_VAL_MISSINGELEMENT = "Profile_VAL_MissingElement"; public static final String PROFILE_VAL_NOTALLOWED = "Profile_VAL_NotAllowed"; @@ -323,13 +322,12 @@ public class I18nConstants { public static final String QUESTIONNAIRE_QR_ITEM_NOTIME = "Questionnaire_QR_Item_NoTime"; public static final String QUESTIONNAIRE_QR_ITEM_NOTYPE = "Questionnaire_QR_Item_NoType"; public static final String QUESTIONNAIRE_QR_ITEM_ONLYONEA = "Questionnaire_QR_Item_OnlyOneA"; - public static final String QUESTIONNAIRE_QR_ITEM_ONLYONEI_PLURAL = "Questionnaire_QR_Item_OnlyOneI_PLURAL"; + public static final String QUESTIONNAIRE_QR_ITEM_ONLYONEI = "Questionnaire_QR_Item_OnlyOneI"; public static final String QUESTIONNAIRE_QR_ITEM_ORDER = "Questionnaire_QR_Item_Order"; public static final String QUESTIONNAIRE_QR_ITEM_STRINGNOOPTIONS = "Questionnaire_QR_Item_StringNoOptions"; public static final String QUESTIONNAIRE_QR_ITEM_TEXT = "Questionnaire_QR_Item_Text"; public static final String QUESTIONNAIRE_QR_ITEM_TIMENOOPTIONS = "Questionnaire_QR_Item_TimeNoOptions"; public static final String QUESTIONNAIRE_QR_ITEM_WRONGTYPE = "Questionnaire_QR_Item_WrongType"; - public static final String QUESTIONNAIRE_QR_ITEM_WRONGTYPE_PLURAL = "Questionnaire_QR_Item_WrongType_PLURAL"; public static final String QUESTIONNAIRE_QR_Q_NONE = "Questionnaire_QR_Q_None"; public static final String QUESTIONNAIRE_QR_Q_NOTFOUND = "Questionnaire_QR_Q_NotFound"; public static final String QUESTIONNAIRE_Q_ENABLEWHEN_AFTER = "Questionnaire_Q_EnableWhen_After"; @@ -605,11 +603,11 @@ public class I18nConstants { public static final String VALIDATION_VAL_ILLEGAL_TYPE_CONSTRAINT = "VALIDATION_VAL_ILLEGAL_TYPE_CONSTRAINT"; public static final String VALIDATION_VAL_NOTYPE = "Validation_VAL_NoType"; public static final String VALIDATION_VAL_PROFILE_MATCHMULTIPLE = "Validation_VAL_Profile_MatchMultiple"; - public static final String VALIDATION_VAL_PROFILE_MAXIMUM_PLURAL = "Validation_VAL_Profile_Maximum_PLURAL"; - public static final String VALIDATION_VAL_PROFILE_MINIMUM_PLURAL = "Validation_VAL_Profile_Minimum_PLURAL"; - public static final String VALIDATION_VAL_PROFILE_MULTIPLEMATCHES_PLURAL = "Validation_VAL_Profile_MultipleMatches_PLURAL"; - public static final String VALIDATION_VAL_PROFILE_NOCHECKMAX_PLURAL = "Validation_VAL_Profile_NoCheckMax_PLURAL"; - public static final String VALIDATION_VAL_PROFILE_NOCHECKMIN_PLURAL = "Validation_VAL_Profile_NoCheckMin_PLURAL"; + public static final String VALIDATION_VAL_PROFILE_MAXIMUM = "Validation_VAL_Profile_Maximum"; + public static final String VALIDATION_VAL_PROFILE_MINIMUM = "Validation_VAL_Profile_Minimum"; + public static final String VALIDATION_VAL_PROFILE_MULTIPLEMATCHES = "Validation_VAL_Profile_MultipleMatches"; + public static final String VALIDATION_VAL_PROFILE_NOCHECKMAX = "Validation_VAL_Profile_NoCheckMax"; + public static final String VALIDATION_VAL_PROFILE_NOCHECKMIN = "Validation_VAL_Profile_NoCheckMin"; public static final String VALIDATION_VAL_PROFILE_NODEFINITION = "Validation_VAL_Profile_NoDefinition"; public static final String VALIDATION_VAL_PROFILE_NOMATCH = "Validation_VAL_Profile_NoMatch"; public static final String VALIDATION_VAL_PROFILE_NOSNAPSHOT = "Validation_VAL_Profile_NoSnapshot"; @@ -661,7 +659,7 @@ public class I18nConstants { public static final String WRONG_TYPE_FOR_RESOURCE = "Wrong_type_for_resource"; public static final String XHTML_URL_EMPTY = "XHTML_URL_EMPTY"; public static final String XHTML_URL_INVALID = "XHTML_URL_INVALID"; - public static final String XHTML_URL_INVALID_CHARS_PLURAL = "XHTML_URL_INVALID_CHARS_PLURAL"; + public static final String XHTML_URL_INVALID_CHARS = "XHTML_URL_INVALID_CHARS"; public static final String XHTML_URL_DATA_NO_DATA = "XHTML_URL_DATA_NO_DATA"; public static final String XHTML_URL_DATA_DATA_INVALID_COMMA = "XHTML_URL_DATA_DATA_INVALID_COMMA"; public static final String XHTML_URL_DATA_DATA_INVALID = "XHTML_URL_DATA_DATA_INVALID"; diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index e0c2a4d59..163618287 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -16,7 +16,8 @@ Bundle_BUNDLE_Entry_Orphan = Entry {0} isn''t reachable by traversing from first BUNDLE_BUNDLE_ENTRY_REVERSE = Entry {0} isn''t reachable by traversing forwards from first Bundle entry, and isn''t a resource type that is typically used that way - check this is not missed somewhere Bundle_BUNDLE_Entry_Type = The type ''{0}'' is not valid - no resources allowed here (allowed = {1}) Bundle_BUNDLE_Entry_Type2 = The type ''{0}'' is not valid - must be {1} (allowed = {2}) -Bundle_BUNDLE_Entry_Type3_PLURAL = The type ''{1}'' is not valid - must be one of {0} types: {2} +Bundle_BUNDLE_Entry_Type3_one = The type ''{1}'' is not valid - must be of type {2} +Bundle_BUNDLE_Entry_Type3_other = The type ''{1}'' is not valid - must be one of {0} types: {2} Bundle_BUNDLE_FullUrl_Missing = Relative Reference appears inside Bundle whose entry is missing a fullUrl Bundle_BUNDLE_FullUrl_NeedVersion = Entries matching fullURL {0} should declare meta/versionId because there are version-specific references Bundle_BUNDLE_MultipleMatches = Multiple matches in bundle for reference {0} @@ -94,13 +95,15 @@ Questionnaire_QR_Item_NotEnabled = Item has answer (2), even though it is not en Questionnaire_QR_Item_NotEnabled2 = Item has answer, even though it is not enabled (item id = ''{0}'') Questionnaire_QR_Item_NotFound = LinkId ''{0}'' not found in questionnaire Questionnaire_QR_Item_OnlyOneA = Only one response answer item with this linkId allowed -Questionnaire_QR_Item_OnlyOneI_PLURAL = Only one response item with the linkId {1} allowed - found {0} items +#The following error cannot occur for a single item. _one case left intentionally blank. +Questionnaire_QR_Item_OnlyOneI_one = +Questionnaire_QR_Item_OnlyOneI_other = Only one response item with the linkId {1} allowed - found {0} items Questionnaire_QR_Item_Order = Structural Error: items are out of order Questionnaire_QR_Item_StringNoOptions = Cannot validate string answer option because no option list is provided Questionnaire_QR_Item_Text = If text exists, it must match the questionnaire definition for linkId {0} Questionnaire_QR_Item_TimeNoOptions = Cannot validate time answer option because no option list is provided -Questionnaire_QR_Item_WrongType = Answer value must be of type {0} -Questionnaire_QR_Item_WrongType_PLURAL = Answer value must be one of the {0} types {1} +Questionnaire_QR_Item_WrongType_one = Answer value must be of the type {1} +Questionnaire_QR_Item_WrongType_other = Answer value must be one of the {0} types {1} Questionnaire_QR_Q_None = No questionnaire is identified, so no validation can be performed against the base questionnaire Questionnaire_QR_Q_NotFound = The questionnaire ''{0}'' could not be resolved, so no validation can be performed against the base questionnaire Questionnaire_Q_EnableWhen_After = The target of this enableWhen rule ({0}) comes after the question itself @@ -221,12 +224,17 @@ Validation_BUNDLE_Message = The first entry in a message must be a MessageHeader Validation_VAL_Content_Unknown = Unrecognised Content {0} Validation_VAL_NoType = Unknown type {0} Validation_VAL_Profile_MatchMultiple = Profile {0}, Element matches more than one slice - {1}, {2} -// for the next 4 messages, the available parameters are: 0: profile url, 1: ed.path, 2: ed.id, 3: ed.sliceName, 4: ed.label, 5: element.path, 6: ed.min and optionally 7: actual count -Validation_VAL_Profile_Maximum_PLURAL = {3}: max allowed = {7}, but found {0} (from {1}) -Validation_VAL_Profile_Minimum_PLURAL = {3}: minimum required = {7}, but only found {0} (from {1}) -Validation_VAL_Profile_NoCheckMax_PLURAL = {3}: Found {0} matches, but unable to check max allowed ({2}) due to lack of slicing validation (from {1}) -Validation_VAL_Profile_NoCheckMin_PLURAL = {3}: Found {0} matches, but unable to check minimum required ({2}) due to lack of slicing validation (from {1}) -Validation_VAL_Profile_MultipleMatches_PLURAL = Found multiple matching profiles among {0} choices: {1} +## for the next 4 messages, the available parameters are: 0: profile url, 1: ed.path, 2: ed.id, 3: ed.sliceName, 4: ed.label, 5: element.path, 6: ed.min and optionally 7: actual count +Validation_VAL_Profile_Maximum_one = {3}: max allowed = {7}, but found {0} (from {1}) +Validation_VAL_Profile_Maximum_other = {3}: max allowed = {7}, but found {0} (from {1}) +Validation_VAL_Profile_Minimum_one = {3}: minimum required = {7}, but only found {0} (from {1}) +Validation_VAL_Profile_Minimum_other = {3}: minimum required = {7}, but only found {0} (from {1}) +Validation_VAL_Profile_NoCheckMax_one = {3}: Found {0} match, but unable to check max allowed ({2}) due to lack of slicing validation (from {1}) +Validation_VAL_Profile_NoCheckMax_other = {3}: Found {0} matches, but unable to check max allowed ({2}) due to lack of slicing validation (from {1}) +Validation_VAL_Profile_NoCheckMin_one = {3}: Found {0} match, but unable to check minimum required ({2}) due to lack of slicing validation (from {1}) +Validation_VAL_Profile_NoCheckMin_other = {3}: Found {0} matches, but unable to check minimum required ({2}) due to lack of slicing validation (from {1}) +Validation_VAL_Profile_MultipleMatches_one = Found multiple matching profiles among {0} choice: {1} +Validation_VAL_Profile_MultipleMatches_other = Found multiple matching profiles among {0} choices: {1} Validation_VAL_Profile_NoDefinition = No definition found for resource type ''{0}'' Validation_VAL_Profile_NoMatch = Unable to find a match for the specified profile among choices: {0} Validation_VAL_Profile_NoSnapshot = StructureDefinition {0} has no snapshot - validation is against the snapshot, so it must be provided @@ -265,14 +273,18 @@ Unsupported_CodeableConcept_pattern__using_text__for_discriminator_for_slice_ = Unsupported_Identifier_pattern__extensions_are_not_allowed__for_discriminator_for_slice_ = Unsupported Identifier pattern - extensions are not allowed - for discriminator ({0}) for slice {1} Unsupported_fixed_pattern_type_for_discriminator_for_slice__ = Unsupported fixed pattern type for discriminator ({0}) for slice {1}: {2} Problem_evaluating_slicing_expression_for_element_in_profile__path__fhirPath___ = Problem evaluating slicing expression for element in profile {0} path {1} (fhirPath = {2}): {3} -Could_not_match_discriminator__for_slice__in_profile___the_discriminator__does_not_have_fixed_value_binding_or_existence_assertions = Could not match discriminator ({0}) for slice {1} in profile {2} - the discriminator {3} does not have fixed value, binding or existence assertions -Could_not_match_any_discriminators__for_slice__in_profile___None_of_the_discriminator__have_fixed_value_binding_or_existence_assertions_PLURAL = Could not match any discriminators ({1}) for slice {2} in profile {3} - None of the {0} discriminators {4} have fixed value, binding or existence assertions +Could_not_match_discriminator_for_slice_in_profile_one = Could not match discriminator ({0}) for slice {1} in profile {2} - the discriminator {3} does not have fixed value, binding or existence assertions +Could_not_match_discriminator_for_slice_in_profile_other = Could not match any discriminators ({1}) for slice {2} in profile {3} - None of the {0} discriminators {4} have fixed value, binding or existence assertions Discriminator__is_based_on_element_existence_but_slice__neither_sets_min1_or_max0 = Discriminator ({0}) is based on element existence, but slice {1} neither sets min>=1 or max=0 Profile_based_discriminators_must_have_a_type_with_a_profile__in_profile_ = Profile based discriminators must have a type with a profile ({0} in profile {1}) -Profile_based_discriminators_must_have_only_one_type__in_profile_PLURAL = Profile based discriminators must have only one type ({1} in profile {2}) but found {0} types +#The following error cannot occur for a single item. _one case left intentionally blank. +Profile_based_discriminators_must_have_only_one_type__in_profile_one = +Profile_based_discriminators_must_have_only_one_type__in_profile_other = Profile based discriminators must have only one type ({1} in profile {2}) but found {0} types Profile_based_discriminators_must_have_a_type__in_profile_ = Profile based discriminators must have a type ({0} in profile {1}) Discriminator__is_based_on_type_but_slice__in__has_no_types = Discriminator ({0}) is based on type, but slice {1} in {2} has no types -Discriminator__is_based_on_type_but_slice__in__has_multiple_types_PLURAL = Discriminator ({1}) is based on type, but slice {2} in {3} has {0} types: {4} +#The following error cannot occur for a single item. _one case left intentionally blank. +Discriminator__is_based_on_type_but_slice__in__has_multiple_types_one = +Discriminator__is_based_on_type_but_slice__in__has_multiple_types_other = Discriminator ({1}) is based on type, but slice {2} in {3} has {0} types: {4} Found__items_for__resolving_discriminator__from_ = Found {0} items for {1} resolving discriminator {2} from {3} Unable_to_find__resolving_discriminator__from_ = Unable to find {0} resolving discriminator {1} from {2} Unable_to_find_resource__at__resolving_discriminator__from_ = Unable to find resource {0} at {1} resolving discriminator {2} from {3} @@ -441,7 +453,8 @@ Version_mismatch_The_context_has_version__loaded_and_the_new_content_being_loade Error_reading__from_package__ = Error reading {0} from package {1}#{2}: {3} Error_parsing_ = Error parsing {0}:{1} Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__ = Unable to connect to terminology server. Use parameter ''-tx n/a'' to run without using terminology services to validate LOINC, SNOMED, ICD-X etc. Error = {0} -Display_Name_for__should_be_one_of__instead_of_PLURAL = Display Name for {1}#{2} should be one of {0} choices from ''{3}'', not ''{4}'' +Display_Name_for__should_be_one_of__instead_of_one = Display Name for {1}#{2} should be ''{3}'', not ''{4}'' +Display_Name_for__should_be_one_of__instead_of_other = Display Name for {1}#{2} should be one of {0} choices from ''{3}'', not ''{4}'' Unknown_Code__in_ = Unknown Code {0} in {1} UNKNOWN_CODE__IN_FRAGMENT = Unknown Code {0} in {1} - note that the code system is labelled as a fragment, so the code may be valid in some other fragment Code_found_in_expansion_however_ = Code found in expansion, however: {0} @@ -508,7 +521,8 @@ MEASURE_M_CRITERIA_CQL_NO_ELM = Error in {0}: No compiled version of CQL found MEASURE_M_CRITERIA_CQL_ELM_NOT_VALID = = Error in {0}: Compiled version of CQL is not valid MEASURE_M_CRITERIA_CQL_NOT_FOUND = The function {1} does not exist in the library {0} XHTML_URL_EMPTY = URL is empty -XHTML_URL_INVALID_CHARS_PLURAL = URL contains {0} Invalid Characters ({1}) +XHTML_URL_INVALID_CHARS_one = URL contains Invalid Character ({1}) +XHTML_URL_INVALID_CHARS_other = URL contains {0} Invalid Characters ({1}) TERMINOLOGY_TX_SYSTEM_HTTPS = The system URL ''{0}'' wrongly starts with https: not http: CODESYSTEM_CS_NO_VS_NOTCOMPLETE = Review the All Codes Value Set - incomplete CodeSystems generally should not have an all codes value set specified TYPE_SPECIFIC_CHECKS_DT_IDENTIFIER_IETF_SYSTEM_VALUE = if identifier.system is ''urn:ietf:rfc:3986'', then the identifier.value must be a full URI (e.g. start with a scheme) @@ -560,9 +574,13 @@ FHIRPATH_UNKNOWN_NAME = Error evaluating FHIRPath expression: The name {0} is no FHIRPATH_UNKNOWN_CONSTANT = Error evaluating FHIRPath expression: Invalid FHIR Constant {0} FHIRPATH_CANNOT_USE = Error evaluating FHIRPath expression: Cannot use {0} in this context because {1} FHIRPATH_CANT_COMPARE = Error evaluating FHIRPath expression: Unable to compare values of type {0} and {1} -FHIRPATH_LEFT_VALUE_PLURAL = Error evaluating FHIRPath expression: left operand to {1} can only have 1 value, but has {0} values +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_LEFT_VALUE_one = +FHIRPATH_LEFT_VALUE_other = Error evaluating FHIRPath expression: left operand to {1} can only have 1 value, but has {0} values FHIRPATH_LEFT_VALUE_WRONG_TYPE = Error evaluating FHIRPath expression: left operand to {0} has the wrong type {1} -FHIRPATH_RIGHT_VALUE_PLURAL = Error evaluating FHIRPath expression: right operand to {1} can only have 1 value, but has {0} values +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_RIGHT_VALUE_one = +FHIRPATH_RIGHT_VALUE_other = Error evaluating FHIRPath expression: right operand to {1} can only have 1 value, but has {0} values FHIRPATH_RIGHT_VALUE_WRONG_TYPE = Error evaluating FHIRPath expression: right operand to {0} has the wrong type {1} FHIRPATH_OP_INCOMPATIBLE = Error evaluating FHIRPath expression {0}: left and right operand have incompatible or illegal types ({1}, {2}) FHIRPATH_HO_HOST_SERVICES = Internal Error evaluating FHIRPath expression: No host services are provided ({0}) @@ -580,9 +598,13 @@ FHIRPATH_NO_TYPE = Error evaluating FHIRPath expression: The type ''{0}'' is unk FHIRPATH_DISCRIMINATOR_NAME_ALREADY_SLICED = Error in discriminator at {0}: found a sliced element while resolving the fixed value for one of the slices FHIRPATH_DISCRIMINATOR_THIS_CANNOT_FIND = Problem with use of resolve() - profile {0} on {1} could not be resolved FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE = illegal use of resolve() in discriminator - no type on element {0} -FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_PLURAL = Illegal use of resolve() in discriminator - {0} possible types on {1} (can only be one) +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_one = +FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_other = Illegal use of resolve() in discriminator - {0} possible types on {1} (can only be one) FHIRPATH_DISCRIMINATOR_RESOLVE_NOT_REFERENCE = illegal use of resolve() in discriminator - type on {0} is not Reference {1} -FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_PLURAL = illegal use of resolve() in discriminator - {0} possible target type profiles on {1} (can only be one) +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_one = +FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_other = illegal use of resolve() in discriminator - {0} possible target type profiles on {1} (can only be one) FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND = Problem with use of resolve() - profile {0} on {1} could not be resolved FHIRPATH_DISCRIMINATOR_TYPE_NONE = illegal use of ofType() in discriminator - no type on element {0} FHIRPATH_DISCRIMINATOR_TYPE_MULTIPLE = illegal use of ofType() in discriminator - Multiple possible types on {0} @@ -593,8 +615,12 @@ FHIRPATH_DISCRIMINATOR_BAD_SYNTAX_CONST = illegal expression syntax in discrimin FHIRPATH_DISCRIMINATOR_CANT_FIND = Unable to resolve discriminator in definitions: {0} in profile {1} on element {2}, looking in profile {3} FHIRPATH_DISCRIMINATOR_CANT_FIND_EXTENSION = Unable to resolve discriminator {0} on {2} found in the definitions because the extension {1} wasn''t found in the profile {3} FHIRPATH_DISCRIMINATOR_NOTYPE = Error in discriminator at {0}: no children, no type -FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_PLURAL = Error in discriminator at {1}: no children, {0} types -FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_PLURAL = Error in discriminator at {1}: no children, {0} type profiles +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_one = +FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_other = Error in discriminator at {1}: no children, {0} types +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_one = +FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_other = Error in discriminator at {1}: no children, {0} type profiles FHIRPATH_UNABLE_BOOLEAN = Unable to evaluate as a boolean: {0} XHTML_XHTML_DOCTYPE_ILLEGAL = Malformed XHTML: Found a DocType declaration, and these are not allowed (XXE security vulnerability protection) PACKAGE_VERSION_MISMATCH = FHIR Version mismatch in package {0}: version is {2} but must be {1} (path: {3}) @@ -604,7 +630,9 @@ SD_MUST_HAVE_DERIVATION = StructureDefinition {0} must have a derivation, since VALIDATION_VAL_PROFILE_OTHER_VERSION = Profile is for a different version of FHIR ({0}) so has been ignored VALIDATION_VAL_PROFILE_THIS_VERSION_OK = Profile for this version of FHIR - all OK VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = Profile is for this version of FHIR, but is an invalid type {0} -BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_PLURAL = {0} profiles found for {1} resource. More than one is not supported at this time. (Type {2}: {3}) +#The following error cannot occur for a single item. _one case left intentionally blank. +BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_one = +BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_other = {0} profiles found for {1} resource. More than one is not supported at this time. (Type {2}: {3}) RENDER_BUNDLE_HEADER_ROOT = Bundle {0} of type {1} RENDER_BUNDLE_HEADER_ENTRY = Entry {0} RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - Full URL = {1} @@ -636,7 +664,9 @@ FHIRPATH_BAD_DATE = Unable to parse Date {0} FHIRPATH_NUMERICAL_ONLY = Error evaluating FHIRPath expression: The function {0} can only be used on integer, decimal or Quantity but found {1} FHIRPATH_DECIMAL_ONLY = Error evaluating FHIRPath expression: The function {0} can only be used on a decimal but found {1} FHIRPATH_CONTINUOUS_ONLY= Error evaluating FHIRPath expression: The function {0} can only be used on a decimal or date type but found {1} -FHIRPATH_FOCUS_PLURAL = Error evaluating FHIRPath expression: focus for {0} can only have one value, but has {0} values +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_FOCUS_one = +FHIRPATH_FOCUS_other = Error evaluating FHIRPath expression: focus for {0} can only have one value, but has {0} values REFERENCE_REF_SUSPICIOUS = The syntax of the reference ''{0}'' looks incorrect, and it should be checked TYPE_SPECIFIC_CHECKS_DT_QTY_NO_ANNOTATIONS = UCUM Codes that contain human readable annotations like {0} can be misleading. Best Practice is not to use annotations in the UCUM code, and rather to make sure that Quantity.unit is correctly human readable XHTML_XHTML_ELEMENT_ILLEGAL_IN_PARA = Illegal element name inside in a paragraph in the XHTML (''{0}'') @@ -752,7 +782,9 @@ TYPE_SPECIFIER_ABSTRACT_TYPE = The Type specifier {1} specified an abstract typ TYPE_SPECIFIER_NM_ILLEGAL_TYPE = No Type specifier matched, and the underlying type {0} is not valid TYPE_SPECIFIER_NM_ABSTRACT_TYPE = No Type specifier matched, and the underlying type {0} is not abstract ELEMENT_CANNOT_BE_NULL = The element is not allowed to be 'null' -MULTIPLE_LOGICAL_MODELS_PLURAL={0} Logical Models found in supplied profiles, so unable to parse logical model (can only be one, found {1}) +#The following error cannot occur for a single item. _one case left intentionally blank. +MULTIPLE_LOGICAL_MODELS_one= +MULTIPLE_LOGICAL_MODELS_other={0} Logical Models found in supplied profiles, so unable to parse logical model (can only be one, found {1}) UNRECOGNISED_PROPERTY_TYPE = Invalid JSON type {0} for the element {1}; valid types = {2} UNRECOGNISED_PROPERTY_TYPE_WRONG = Invalid type {2} for the element {1}; valid types = {3}, JSON type = {0} SD_TYPE_MISSING = No type found diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties b/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties index f24aa27cc..d60e26dfd 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties @@ -15,7 +15,9 @@ Bundle_BUNDLE_Entry_NotFound="{0}" konnte nicht in bundle ({1}) gefunden werden Bundle_BUNDLE_Entry_Orphan=Entry {0} ist nicht durch Traversierung, vom ersten Bundle-Entry ausgehend, erreichbar Bundle_BUNDLE_Entry_Type=Der type "{0}" ist nicht g\u00fcltig - hier sind keine Ressourcen erlaubt Bundle_BUNDLE_Entry_Type2=Der type "{0}" ist nicht g\u00fcltig - muss {1} sein -Bundle_BUNDLE_Entry_Type3_PLURAL=Der type "{1}" ist nicht g\u00fcltig - muss einer von {2} sein +#REPARIERE MICH PLURAL +Bundle_BUNDLE_Entry_Type3_one=Der type "{1}" ist nicht g\u00fcltig - muss einer von {2} sein +Bundle_BUNDLE_Entry_Type3_other=Der type "{1}" ist nicht g\u00fcltig - muss einer von {2} sein Bundle_BUNDLE_FullUrl_Missing=Es besteht eine relative Reference innerhalb des Bundle, dessen Eintrag eine fullUrl fehlt Bundle_BUNDLE_FullUrl_NeedVersion=Eintr\u00e4ge, die mit fullURL {0} \u00fcbereinstimmen, sollten meta/versionId deklarieren, da versionsspezifische Referenzen vorhanden sind. Bundle_BUNDLE_MultipleMatches=Mehrere \u00dcbereinstimmungen im Bundle f\u00fcr reference {0} @@ -88,13 +90,15 @@ Questionnaire_QR_Item_NotEnabled=Item hat Antwort (2), auch wenn es nicht aktivi Questionnaire_QR_Item_NotEnabled2=Item besitzt eine answer, auch wenn es nicht aktiviert ist (Element-ID = "{0}") Questionnaire_QR_Item_NotFound=LinkId "{0}" im questionnaire nicht gefunden Questionnaire_QR_Item_OnlyOneA=Nur ein Antwortelement mit dieser LinkId zul\u00e4ssig -Questionnaire_QR_Item_OnlyOneI_PLURAL=Nur ein Antwortelement mit dieser LinkId erlaubt - {1} +#The following error cannot occur for a single item. _one case left intentionally blank. +Questionnaire_QR_Item_OnlyOneI_one= +Questionnaire_QR_Item_OnlyOneI_other=Nur ein Antwortelement mit dieser LinkId erlaubt - {1} Questionnaire_QR_Item_Order=Struktureller Fehler: Elemente in falscher Reihenfolge Questionnaire_QR_Item_StringNoOptions=String answer option kann nicht validiert werden, da keine Optionsliste bereitgestellt wird Questionnaire_QR_Item_Text=Wenn Text vorhanden ist, muss er mit der Fragebogen-Definition f\u00fcr linkId {0} \u00fcbereinstimmen. Questionnaire_QR_Item_TimeNoOptions=Kann die time answer option nicht validieren, weil keine Optionsliste zur Verf\u00fcgung steht -Questionnaire_QR_Item_WrongType=Answer value muss vom Typ {0} sein. -Questionnaire_QR_Item_WrongType_PLURAL=Answer value muss einer der Typen {1} sein +Questionnaire_QR_Item_WrongType_one=Answer value muss vom Typ {0} sein. +Questionnaire_QR_Item_WrongType_other=Answer value muss einer der Typen {1} sein Questionnaire_QR_Q_None=Es konnte kein passendes questionnaire identifiziert werden, so dass keine Validierung gegen den Basisfragebogen durchgef\u00fchrt werden kann. Questionnaire_QR_Q_NotFound=Der Fragebogen "{0}" konnte nicht gefunden werden, so dass keine Validierung gegen den Basisfragebogen durchgef\u00fchrt werden kann. Questionnaire_Q_EnableWhen_After=Das Ziel dieser enableWhen-Regel ({0}) kommt nach der Frage selbst @@ -208,11 +212,21 @@ Validation_BUNDLE_Message=Der erste Eintrag in einer Nachricht muss ein MessageH Validation_VAL_Content_Unknown=Unerkannter Inhalt {0} Validation_VAL_NoType=Unbekannter Typ {0} Validation_VAL_Profile_MatchMultiple=Profil {0}, Element stimmt mit mehr als einem Slice \u00fcberein - {1}, {2} -Validation_VAL_Profile_Maximum_PLURAL={3}: maximal erlaubt = {7}, aber gefunden {0} -Validation_VAL_Profile_Minimum_PLURAL={3}: mindestens erforderlich = {7}, aber nur gefunden {0} -Validation_VAL_Profile_MultipleMatches_PLURAL=Es wurden mehrere passende Profile unter den Auswahlm\u00f6glichkeiten gefunden: {1} -Validation_VAL_Profile_NoCheckMax_PLURAL={1}: Kann die maximal zul\u00e4ssige Anzahl ({1}) aufgrund fehlender Slicing-Validierung nicht \u00fcberpr\u00fcfen. -Validation_VAL_Profile_NoCheckMin_PLURAL={1}": Kann das erforderliche Minimum ({1}) aufgrund fehlender Slicing-Validierung nicht \u00fcberpr\u00fcfen +#REPARIERE MICH PLURAL +Validation_VAL_Profile_Maximum_one={3}: maximal erlaubt = {7}, aber gefunden {0} +Validation_VAL_Profile_Maximum_other={3}: maximal erlaubt = {7}, aber gefunden {0} +#REPARIERE MICH PLURAL +Validation_VAL_Profile_Minimum_one={3}: mindestens erforderlich = {7}, aber nur gefunden {0} +Validation_VAL_Profile_Minimum_other={3}: mindestens erforderlich = {7}, aber nur gefunden {0} +#REPARIERE MICH PLURAL +Validation_VAL_Profile_MultipleMatches_one=Es wurden mehrere passende Profile unter den Auswahlm\u00f6glichkeiten gefunden: {1} +Validation_VAL_Profile_MultipleMatches_other=Es wurden mehrere passende Profile unter den Auswahlm\u00f6glichkeiten gefunden: {1} +#REPARIERE MICH PLURAL +Validation_VAL_Profile_NoCheckMax_one={1}: Kann die maximal zul\u00e4ssige Anzahl ({1}) aufgrund fehlender Slicing-Validierung nicht \u00fcberpr\u00fcfen. +Validation_VAL_Profile_NoCheckMax_other={1}: Kann die maximal zul\u00e4ssige Anzahl ({1}) aufgrund fehlender Slicing-Validierung nicht \u00fcberpr\u00fcfen. +#REPARIERE MICH PLURAL +Validation_VAL_Profile_NoCheckMin_one={1}: Kann das erforderliche Minimum ({1}) aufgrund fehlender Slicing-Validierung nicht \u00fcberpr\u00fcfen +Validation_VAL_Profile_NoCheckMin_other={1}: Kann das erforderliche Minimum ({1}) aufgrund fehlender Slicing-Validierung nicht \u00fcberpr\u00fcfen Validation_VAL_Profile_NoDefinition=Keine Definition f\u00fcr Ressourcentyp "{0}" gefunden Validation_VAL_Profile_NoMatch=Es ist nicht m\u00f6glich, ein passendes Profil unter den Kandidaten zu finden: {0} Validation_VAL_Profile_NoSnapshot=StructureDefinition hat keinen Snapshot - die Validierung erfolgt gegen den Snapshot, daher muss dieser bereitgestellt werden @@ -246,14 +260,18 @@ Unsupported_CodeableConcept_pattern__using_text__for_discriminator_for_slice_=Ni Unsupported_Identifier_pattern__extensions_are_not_allowed__for_discriminator_for_slice_=Nicht unterst\u00fctztes Identifier Pattern - Extensions sind nicht erlaubt - f\u00fcr Diskriminator({0}) f\u00fcr Slice {1} Unsupported_fixed_pattern_type_for_discriminator_for_slice__=Nicht unterst\u00fctzter fixed Pattern Type f\u00fcr Diskriminator({0}) f\u00fcr Slice {1}: {2} Problem_evaluating_slicing_expression_for_element_in_profile__path__fhirPath___=Problem bei der Auswertung des Slicing-Ausdrucks f\u00fcr Element im Profil {0} Pfad {1} (fhirPfad = {2}): {3} -Could_not_match_discriminator__for_slice__in_profile___the_discriminator__does_not_have_fixed_value_binding_or_existence_assertions=Konnte nicht mit dem Diskriminator ({0}) f\u00fcr Slice {1} in Profil {2} \u00fcbereinstimmen - der Diskriminator {3} hat keinen fixed Value, kein Binding oder existence assertions -Could_not_match_any_discriminators__for_slice__in_profile___None_of_the_discriminator__have_fixed_value_binding_or_existence_assertions_PLURAL=Konnte keinen Diskriminator ({1}) f\u00fcr Slice {2} im Profil {3} zuordnen - Keiner der Diskriminatoren {4} hat einen fixed value, eine Binding oder existence assertions +Could_not_match_discriminator_for_slice_in_profile_one=Konnte nicht mit dem Diskriminator ({0}) f\u00fcr Slice {1} in Profil {2} \u00fcbereinstimmen - der Diskriminator {3} hat keinen fixed Value, kein Binding oder existence assertions +Could_not_match_discriminator_for_slice_in_profile_other=Konnte keinen Diskriminator ({1}) f\u00fcr Slice {2} im Profil {3} zuordnen - Keiner der Diskriminatoren {4} hat einen fixed value, eine Binding oder existence assertions Discriminator__is_based_on_element_existence_but_slice__neither_sets_min1_or_max0=Der Diskriminator ({0}) basiert auf der Existenz von Elementen, aber Slice {1} setzt weder min>=1 noch max=0 Profile_based_discriminators_must_have_a_type_with_a_profile__in_profile_=Profilbasierte Diskriminatoren m\u00fcssen einen Typ mit einem Profil ({0} im Profil {1}) haben. -Profile_based_discriminators_must_have_only_one_type__in_profile_PLURAL=Profilbasierte Diskriminatoren d\u00fcrfen nur einen Typ ({1} im Profil {2}) haben. +#The following error cannot occur for a single item. _one case left intentionally blank. +#Profile_based_discriminators_must_have_only_one_type__in_profile_one= +Profile_based_discriminators_must_have_only_one_type__in_profile_other=Profilbasierte Diskriminatoren d\u00fcrfen nur einen Typ ({1} im Profil {2}) haben. Profile_based_discriminators_must_have_a_type__in_profile_=Profilbasierte Diskriminatoren m\u00fcssen einen Typ ({0} im Profil {1}) haben. Discriminator__is_based_on_type_but_slice__in__has_no_types=Der Diskriminator ({0}) basiert auf dem Typ, aber das Slice {1} in {2} hat keine Typen -Discriminator__is_based_on_type_but_slice__in__has_multiple_types_PLURAL=Der Diskriminator ({1}) basiert auf dem Typ, aber das Slice {2} in {3} hat mehrere Typen: {4} +#The following error cannot occur for a single item. _one case left intentionally blank. +#Discriminator__is_based_on_type_but_slice__in__has_multiple_types_one= +Discriminator__is_based_on_type_but_slice__in__has_multiple_types_other=Der Diskriminator ({1}) basiert auf dem Typ, aber das Slice {2} in {3} hat mehrere Typen: {4} Found__items_for__resolving_discriminator__from_={0} Elemente f\u00fcr {1} gefunden welche mit Diskriminators {2} von {3} \u00fcbereinstimmen Unable_to_find__resolving_discriminator__from_=Kann keinen {0} aufl\u00f6senden Diskriminator {1} von {2} finden Unable_to_find_resource__at__resolving_discriminator__from_=Ressource {0} bei {1} nicht auffindbar, Diskriminator {2} von {3} @@ -416,7 +434,9 @@ Version_mismatch_The_context_has_version__loaded_and_the_new_content_being_loade Error_reading__from_package__=Fehler beim Lesen {0} aus dem Paket {1}#{2}: {3} Error_parsing_=Fehler beim Parsen {0}:{1} Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__=Keine Verbindung zum Terminologieserver m\u00f6glich. Verwenden Sie den Parameter ''-tx n/a'' um ohne Verwendung von Terminologiediensten zu laufen welche LOINC, SNOMED, ICD-X usw. zu validieren. Fehler = {0} -Display_Name_for__should_be_one_of__instead_of_PLURAL=Der Displayname f\u00fcr {1}#{2} sollte einer von ''{3}'' anstelle von ''{4}'' sein. +#REPARIERE MICH PLURAL +Display_Name_for__should_be_one_of__instead_of_one=Der Displayname f\u00fcr {1}#{2} sollte einer von ''{3}'' anstelle von ''{4}'' sein. +Display_Name_for__should_be_one_of__instead_of_other=Der Displayname f\u00fcr {1}#{2} sollte einer von ''{3}'' anstelle von ''{4}'' sein. Unknown_Code__in_=Unbekannter Code {0} in {1} Code_found_in_expansion_however_=Code in der Erweiterung gefunden, jedoch: {0} None_of_the_provided_codes_are_in_the_value_set_=Keiner der bereitgestellten Codes ist im ValueSet {0} @@ -432,3 +452,43 @@ Unable_to_resolve_system__no_value_set=System nicht aufl\u00f6sbar - kein ValueS This_base_property_must_be_an_Array_not_a_=Diese Basis Property muss ein Array sein, nicht ein {0} This_property_must_be_an_Array_not_a_=Diese Eigenschaft muss ein Array sein, nicht ein {0} documentmsg = (document) +#REPARIERE MICH PLURAL +#XHTML_URL_INVALID_CHARS_one = +#XHTML_URL_INVALID_CHARS_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_one = +#BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#FHIRPATH_LEFT_VALUE_one = +#FHIRPATH_LEFT_VALUE_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#FHIRPATH_RIGHT_VALUE_one = +#FHIRPATH_RIGHT_VALUE_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_one = +#FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_one = +#FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_one = +#FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_one = +#FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#FHIRPATH_FOCUS_one = +#FHIRPATH_FOCUS_other = +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPARIERE MICH PLURAL +#MULTIPLE_LOGICAL_MODELS_one= +#MULTIPLE_LOGICAL_MODELS_other= + diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties b/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties index 9f3236fb6..f5cf24034 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties @@ -13,7 +13,9 @@ Bundle_BUNDLE_Entry_NotFound = Kan ''{0}'' niet vinden in de bundle ({1}) Bundle_BUNDLE_Entry_Orphan = Entry {0} is niet bereikbaar via een referentie vanuit de eerste Bundle entry Bundle_BUNDLE_Entry_Type = Het type ''{0}'' is niet geldig - hier zijn resources toegestaan (toegestaan = {1}) Bundle_BUNDLE_Entry_Type2 = Het type ''{0}'' is niet geldig - moet zijn {1} (toegestaan = {2}) -Bundle_BUNDLE_Entry_Type3_PLURAL = The type ''{1}'' is niet geldig - moet een zijn van {2} +#REPAREER MIJ PLURAL +Bundle_BUNDLE_Entry_Type3_one = The type ''{1}'' is niet geldig - moet een zijn van {2} +Bundle_BUNDLE_Entry_Type3_other = The type ''{1}'' is niet geldig - moet een zijn van {2} Bundle_BUNDLE_FullUrl_Missing = Relatieve reference in Bundle waarvan de entry een fullUrl mist Bundle_BUNDLE_FullUrl_NeedVersion = Entries die overeenkomen met fullURL {0} moeten meta/versionId bevatten omdat er versie-specifieke references zijn Bundle_BUNDLE_MultipleMatches = Meerdere overeenkomsten in Bundle voor reference {0} @@ -89,13 +91,15 @@ Questionnaire_QR_Item_NotEnabled = Item heeft een antwoord (2), terwijl deze nie Questionnaire_QR_Item_NotEnabled2 = Item heeft een antwoord, terwijl deze niet actief is (item id = ''{0}'') Questionnaire_QR_Item_NotFound = LinkId ''{0}'' niet gevonden in questionnaire Questionnaire_QR_Item_OnlyOneA = Er is slechts een antwoorditem toegestaan bij dit linkId -Questionnaire_QR_Item_OnlyOneI_PLURAL = Er is slechts een item toegestaan bij dit linkId - {1} +#The following error cannot occur for a single item. _one case left intentionally blank. +Questionnaire_QR_Item_OnlyOneI_one = +Questionnaire_QR_Item_OnlyOneI_other = Er is slechts een item toegestaan bij dit linkId - {1} Questionnaire_QR_Item_Order = Structuurfout: items staan niet in de juiste volgorde Questionnaire_QR_Item_StringNoOptions = Kan string-antwoord niet valideren omdat er geen optielijst is gespecificeerd Questionnaire_QR_Item_Text = Als text bestaat, dan moet dit een questionnaire-definitie bevatten voor linkId {0} Questionnaire_QR_Item_TimeNoOptions = Kan tijd-antwoord niet valideren omdat er geen optielijst is gespecificeerd -Questionnaire_QR_Item_WrongType = Antwoord moet type {0} hebben -Questionnaire_QR_Item_WrongType_PLURAL = Antwoord moet een van de types {1} hebben +Questionnaire_QR_Item_WrongType_one=Antwoord moet type {0} hebben +Questionnaire_QR_Item_WrongType_other=Antwoord moet een van de types {1} hebben Questionnaire_QR_Q_None = Er is geen questionnaire gedentificeerd, dus validatie tegen de questionnaire is niet mogelijk Questionnaire_QR_Q_NotFound = De questionnaire ''{0}'' is niet gevonden, dus validatie tegen de questionnaire is niet mogelijk Questionnaire_Q_EnableWhen_After = Het doel van deze enableWhen regel ({0}) komt pas na deze vraag @@ -213,11 +217,21 @@ Validation_VAL_Content_Unknown = Niet-herkende content {0} Validation_VAL_NoType = Onbekend type {0} Validation_VAL_Profile_MatchMultiple = Profiel {0}, element komt overeen met meer dan een slice - {1}, {2} # for the next 4 messages, the available parameters are: 0: profile url, 1: ed.path, 2: ed.id, 3: ed.sliceName, 4: ed.label, 5: element.path, 6: ed.min and optionally 7: actual count -Validation_VAL_Profile_Maximum_PLURAL = {3}: max toegestaan = {7}, maar gevonden {0} (uit {1}) -Validation_VAL_Profile_Minimum_PLURAL = {3}: minimum vereist = {7}, maar gevonden {0} (uit {1}) -Validation_VAL_Profile_NoCheckMax_PLURAL = {3}: Kan max toegestaan niet controleren ({2}) vanwege missende slicing-validatie (uit {1}) -Validation_VAL_Profile_NoCheckMin_PLURAL = {3}: Kan min toegestaan niet controleren ({2}) vanwege missende slicing-validatie (uit {1}) -Validation_VAL_Profile_MultipleMatches_PLURAL = Meerdere overeenkomende profielen gevonden in de opties: {1} +#REPAREER MIJ PLURAL +Validation_VAL_Profile_Maximum_one = {3}: max toegestaan = {7}, maar gevonden {0} (uit {1}) +Validation_VAL_Profile_Maximum_other = {3}: max toegestaan = {7}, maar gevonden {0} (uit {1}) +#REPAREER MIJ PLURAL +Validation_VAL_Profile_Minimum_one = {3}: minimum vereist = {7}, maar gevonden {0} (uit {1}) +Validation_VAL_Profile_Minimum_other = {3}: minimum vereist = {7}, maar gevonden {0} (uit {1}) +#REPAREER MIJ PLURAL +Validation_VAL_Profile_NoCheckMax_one = {3}: Kan max toegestaan niet controleren ({2}) vanwege missende slicing-validatie (uit {1}) +Validation_VAL_Profile_NoCheckMax_other = {3}: Kan max toegestaan niet controleren ({2}) vanwege missende slicing-validatie (uit {1}) +#REPAREER MIJ PLURAL +Validation_VAL_Profile_NoCheckMin_one = {3}: Kan min toegestaan niet controleren ({2}) vanwege missende slicing-validatie (uit {1}) +Validation_VAL_Profile_NoCheckMin_other = {3}: Kan min toegestaan niet controleren ({2}) vanwege missende slicing-validatie (uit {1}) +#REPAREER MIJ PLURAL +Validation_VAL_Profile_MultipleMatches_one = Meerdere overeenkomende profielen gevonden in de opties: {1} +Validation_VAL_Profile_MultipleMatches_other = Meerdere overeenkomende profielen gevonden in de opties: {1} Validation_VAL_Profile_NoDefinition = Geen definitie gevonden voor resourcetype ''{0}'' Validation_VAL_Profile_NoMatch = Kan geen overeenkomstig profiel vinden in de opties: {0} Validation_VAL_Profile_NoSnapshot = StructureDefinition heeft geen snapshot - validatie is tegen de snapshot, dus deze is verplicht @@ -230,6 +244,7 @@ Validation_VAL_Profile_Unknown = Profiel-referentie ''{0}'' is niet gecontrolee VALIDATION_VAL_PROFILE_UNKNOWN_NOT_POLICY = Profiel-referentie ''{0}'' is niet gecontroleerd omdat deze onbekend is en de validator ingesteld is om onbekende profielen niet op te zoeken VALIDATION_VAL_PROFILE_UNKNOWN_ERROR = Profiel-referentie ''{0}'' is niet gecontroleerd omdat deze onbekend is en ophalen ervan resulteerde in een fout {1} Validation_VAL_Profile_WrongType = Gespecificeerde profieltype was ''{0}'', maar gevonden type ''{1}'' +Validation_VAL_Profile_WrongType = Gespecificeerde profieltype is ''{0}'', maar gevonden type is ''{1}'' Validation_VAL_Unknown_Profile = Onbekend profiel {0} XHTML_XHTML_Attribute_Illegal = Illegaal attribuut in de XHTML (''{0}'' op ''{1}'') XHTML_XHTML_Element_Illegal = Illegaal element in de XHTML (''{0}'') @@ -255,14 +270,18 @@ Unsupported_CodeableConcept_pattern__using_text__for_discriminator_for_slice_ = Unsupported_Identifier_pattern__extensions_are_not_allowed__for_discriminator_for_slice_ = Niet-ondersteund Identifier patroon - extensies niet toegestaan - voor discriminator ({0}) voor slice {1} Unsupported_fixed_pattern_type_for_discriminator_for_slice__ = Niet-ondersteund vast patroontype voor discriminator ({0}) voor slice {1}: {2} Problem_evaluating_slicing_expression_for_element_in_profile__path__fhirPath___ = Probleem bij controle van slicing-expressie voor element in profiel {0} pad {1} (fhirPath = {2}): {3} -Could_not_match_discriminator__for_slice__in_profile___the_discriminator__does_not_have_fixed_value_binding_or_existence_assertions = Kan geen overeenkomende discriminator ({0}) bepalen voor slice {1} in profiel {2} - de discriminator {3} heeft geen vaste waarde, binding of aanwezigheidverplichtingen -Could_not_match_any_discriminators__for_slice__in_profile___None_of_the_discriminator__have_fixed_value_binding_or_existence_assertions_PLURAL = Kan geen overeenkomende discriminators ({1}) bepalen voor slice {2} in profiel {3} - Geen van de discriminators {4} hebben een vaste waarde, binding of aanwezigheidverplichtingen +Could_not_match_discriminator_for_slice_in_profile_one = Kan geen overeenkomende discriminator ({0}) bepalen voor slice {1} in profiel {2} - de discriminator {3} heeft geen vaste waarde, binding of aanwezigheidverplichtingen +Could_not_match_discriminator_for_slice_in_profile_other = Kan geen overeenkomende discriminators ({1}) bepalen voor slice {2} in profiel {3} - Geen van de discriminators {4} hebben een vaste waarde, binding of aanwezigheidverplichtingen Discriminator__is_based_on_element_existence_but_slice__neither_sets_min1_or_max0 = Discriminator ({0}) is gebaseerd op elementaanwezigheid, maar slice {1} heeft geen min>=1 of max=0 Profile_based_discriminators_must_have_a_type_with_a_profile__in_profile_ = Profiel-gebaseerde discriminators moeten een type hebben met een profiel ({0} in profiel {1}) -Profile_based_discriminators_must_have_only_one_type__in_profile_PLURAL = Profiel-gebaseerde discriminators moeten slechts een type bevatten ({1} in profile {2}) +#The following error cannot occur for a single item. _one case left intentionally blank. +Profile_based_discriminators_must_have_only_one_type__in_profile_one = +Profile_based_discriminators_must_have_only_one_type__in_profile_other = Profiel-gebaseerde discriminators moeten slechts een type bevatten ({1} in profile {2}) Profile_based_discriminators_must_have_a_type__in_profile_ = Profiel-gebaseerde discriminators moeten een type hebben ({0} in profile {1}) Discriminator__is_based_on_type_but_slice__in__has_no_types = Discriminator ({0}) is gebaseerd op type, maar slice {1} in {2} heeft geen typen -Discriminator__is_based_on_type_but_slice__in__has_multiple_types_PLURAL = Discriminator ({1}) is gebaseerd op type, maar slice {2} in {3} heeft meerdere typen: {4} +#The following error cannot occur for a single item. _one case left intentionally blank. +Discriminator__is_based_on_type_but_slice__in__has_multiple_types_one = +Discriminator__is_based_on_type_but_slice__in__has_multiple_types_other = Discriminator ({1}) is gebaseerd op type, maar slice {2} in {3} heeft meerdere typen: {4} Found__items_for__resolving_discriminator__from_ = {0} items gevonden voor {1} bij controle van discriminator {2} van {3} Unable_to_find__resolving_discriminator__from_ = Kan {0} niet vinden bij controle van discriminator {1} van {2} Unable_to_find_resource__at__resolving_discriminator__from_ = Kan resource {0} niet vinden in {1} bij controle van discriminator {2} van {3} @@ -373,6 +392,7 @@ This_property_must_be_an_object_not_ = Deze property moet een object zijn, geen This_property_must_be_an_simple_value_not_ = Deze property moet een eenvoudige waarde zijn, geen {0} ({1} bij {2}) This_property_must_be__not_ = Deze property {2} moet {0} zijn, geen {1} (bij {3}) This_property_must_be_an_Array_not_ = De property {1} moet een JSON Array zijn, geen {0} (bij {2}) +This_property_must_be_an_Array_not_ = Deze property moet een Array zijn, geen {0} Unrecognised_property_ = Niet-herkende property ''@{0}'' Object_must_have_some_content = Object moet inhoud hebben Error_parsing_JSON_ = Fout bij verwerken JSON: {0} @@ -425,7 +445,9 @@ Version_mismatch_The_context_has_version__loaded_and_the_new_content_being_loade Error_reading__from_package__ = Fout bij lezen {0} uit package {1}#{2}: {3} Error_parsing_ = Fout bij verwerken {0}:{1} Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__ = Kan niet verbinden met terminologieserver. Gebruik parameter ''-tx n/a'' om te starten zonder terminologieservices voor validatie van LOINC, SNOMED, ICD-X etc. Fout = {0} -Display_Name_for__should_be_one_of__instead_of_PLURAL = Weergavenaam voor {1}#{2} zou een van ''{3}'' moeten zijn in plaats van ''{4}'' +#REPAREER MIJ PLURAL +Display_Name_for__should_be_one_of__instead_of_one = Weergavenaam voor {1}#{2} zou een van ''{3}'' moeten zijn in plaats van ''{4}'' +Display_Name_for__should_be_one_of__instead_of_other = Weergavenaam voor {1}#{2} zou een van ''{3}'' moeten zijn in plaats van ''{4}'' Unknown_Code__in_ = Onbekende code {0} in {1} UNKNOWN_CODE__IN_FRAGMENT = Onbekende code {0} in {1} - merk op dat het codesysteem is gemarkeerd als fragment, waardoor mogelijk geldig is in een ander fragment Code_found_in_expansion_however_ = Code gevonden in expansion, echter: {0} @@ -440,7 +462,6 @@ Unable_to_resolve_system__value_set_has_no_includes_or_expansion = Kan system ni Unable_to_resolve_system__value_set_has_excludes = Kan system niet vinden - waardelijst heeft excludes Unable_to_resolve_system__no_value_set = Kan system niet vinden - geen waardelijst This_base_property_must_be_an_Array_not_ = Deze basis-property moet een Array zijn, geen {0} -This_property_must_be_an_Array_not_ = Deze property moet een Array zijn, geen {0} documentmsg = (document) xml_attr_value_invalid = Het XML attribuut {0} bevat een onjuist teken xml_encoding_invalid = De XML encoding is onjuist (moet UTF-8 zijn) @@ -490,7 +511,9 @@ MEASURE_M_CRITERIA_CQL_NO_ELM = Fout in {0}: Geen gecompileerde versie van CQL g MEASURE_M_CRITERIA_CQL_ELM_NOT_VALID = = Fout in {0}: Gecompileerde versie van CQL is niet geldig MEASURE_M_CRITERIA_CQL_NOT_FOUND = De functie {1} bestaat niet in de bibliotheek {0} XHTML_URL_EMPTY = URL is leeg -XHTML_URL_INVALID_CHARS_PLURAL = URL bevat ongeldige tekens ({1}) +#REPAREER MIJ PLURAL +XHTML_URL_INVALID_CHARS_one = URL bevat ongeldige tekens ({1}) +XHTML_URL_INVALID_CHARS_other = URL bevat ongeldige tekens ({1}) TERMINOLOGY_TX_SYSTEM_HTTPS = De system URL ''{0}'' begint onterecht met https: in plaats van http: CODESYSTEM_CS_NO_VS_NOTCOMPLETE = Review de ''alle codes'' ValueSet - incomplete CodeSystems moeten generiek geen waardelijst voor ''alle codes'' specificeren TYPE_SPECIFIC_CHECKS_DT_IDENTIFIER_IETF_SYSTEM_VALUE = als identifier.system ''urn:ietf:rfc:3986'' is, dan moet de identifier.value een volledige URI zijn (dus beginnen met een scheme) @@ -503,7 +526,6 @@ TYPE_SPECIFIC_CHECKS_DT_ATT_TOO_LONG = Attachment grootte is {0} bytes, wat grot TYPE_SPECIFIC_CHECKS_DT_ATT_NO_CONTENT = Attachments bevatten data en/of url, of ZOUDEN contentType en/of language MOETEN bevatten TYPE_SPECIFIC_CHECKS_DT_BASE64_TOO_LONG = Base64 grootte is {0} bytes, wat groter is dan de ingestelde grenswaarde van {1} bytes TYPE_SPECIFIC_CHECKS_DT_DECIMAL_CHARS = {0} decimalen gevonden wat groter is dan de ingestelde grenswaarde van {1} cijfers -Validation_VAL_Profile_WrongType = Gespecificeerde profieltype is ''{0}'', maar gevonden type is ''{1}'' Validation_VAL_Profile_WrongType2 = Type komt niet overeen bij verwerken van profiel {0} bij pad {1}: Het elementtype is {4}, maar het profiel {3} is voor een ander type {2} VALIDATION_VAL_ILLEGAL_TYPE_CONSTRAINT = Ongeldige inperking in profiel {0} bij pad {1} - kan type {2} niet inperken ten opzichte van basistypen {3} EXTENSION_EXT_CONTEXT_WRONG_XVER = De extensie {0} uit FHIR-versie {3} is niet toegestaan om te gebruiken op deze plaats (toegestaan = {1}; dit element is [{2}; dit is een waarschuwing aangezien context kan worden gewijzigd in FHIR-versies) @@ -539,9 +561,13 @@ FHIRPATH_UNKNOWN_NAME = Fout bij evalueren FHIRPath expressie: De naam {0} is ni FHIRPATH_UNKNOWN_CONSTANT = Fout bij evalueren FHIRPath expressie: Ongeldige FHIR constante {0} FHIRPATH_CANNOT_USE = Fout bij evalueren FHIRPath expressie: Kan {0} niet gebruiken in deze context omdat {1} FHIRPATH_CANT_COMPARE = Fout bij evalueren FHIRPath expressie: Kan geen waarden vergelijken van type {0} en {1} -FHIRPATH_LEFT_VALUE_PLURAL = Fout bij evalueren FHIRPath expressie: linker operandus van {1} heeft meer dan een waarde +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_LEFT_VALUE_one = +FHIRPATH_LEFT_VALUE_other = Fout bij evalueren FHIRPath expressie: linker operandus van {1} heeft meer dan een waarde FHIRPATH_LEFT_VALUE_WRONG_TYPE = Fout bij evalueren FHIRPath expressie: linker operandus van {0} heeft het verkeerde type {1} -FHIRPATH_RIGHT_VALUE_PLURAL = Fout bij evalueren FHIRPath expressie: rechter operandus van {1} heeft meer dan een waarde +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_RIGHT_VALUE_one = +FHIRPATH_RIGHT_VALUE_other = Fout bij evalueren FHIRPath expressie: rechter operandus van {1} heeft meer dan een waarde FHIRPATH_RIGHT_VALUE_WRONG_TYPE = Fout bij evalueren FHIRPath expressie: rechter operandus van {0} heeft het verkeerde type {1} FHIRPATH_OP_INCOMPATIBLE = Fout bij evalueren FHIRPath expressie {0}: linker en rechter operandus hebben incompatibele of ongeldige typen ({1}, {2}) FHIRPATH_HO_HOST_SERVICES = Interne fout bij evalueren FHIRPath expressie: er zijn geen host services gespecificeerd ({0}) @@ -558,9 +584,13 @@ FHIRPATH_NO_TYPE = Fout bij evalueren FHIRPath expressie: Het type ''{0}'' is on FHIRPATH_DISCRIMINATOR_NAME_ALREADY_SLICED = Fout in discriminator bij {0}: sliced element gevonden bij opzoeken van de vaste waarde voor een van de slices FHIRPATH_DISCRIMINATOR_THIS_CANNOT_FIND = Probleem in gebruik van resolve() - profiel {0} op {1} is niet gevonden FHIRPATH_DISCRIMINATOR_RESOLVE_NO_TYPE = onjuist gebruik van resolve() in discriminator - geen type op element {0} -FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES = onjuist gebruik van resolve() in discriminator - Meerdere mogelijke typen op {0} +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_one = +FHIRPATH_DISCRIMINATOR_RESOLVE_MULTIPLE_TYPES_other = onjuist gebruik van resolve() in discriminator - Meerdere mogelijke typen op {0} FHIRPATH_DISCRIMINATOR_RESOLVE_NOT_REFERENCE = onjuist gebruik van resolve() in discriminator - Type op {0} is niet Reference {1} -FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_PLURAL = onjuist gebruik van resolve() in discriminator - Meerdere mogelijke doelprofielen op {1} +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_one = +FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET_other = onjuist gebruik van resolve() in discriminator - Meerdere mogelijke doelprofielen op {1} FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND = Probleem met gebruik van resolve() - profiel {0} op {1} is niet gevonden FHIRPATH_DISCRIMINATOR_TYPE_NONE = onjuist gebruik van ofType() in discriminator - geen type op element {0} FHIRPATH_DISCRIMINATOR_TYPE_MULTIPLE = onjuist gebruik van ofType() in discriminator - Meerdere mogelijke typen op {0} @@ -570,8 +600,12 @@ FHIRPATH_DISCRIMINATOR_BAD_SYNTAX_GROUP = onjuiste expressiesyntax in discrimina FHIRPATH_DISCRIMINATOR_BAD_SYNTAX_CONST = onjuiste expressiesyntax in discriminator (const) FHIRPATH_DISCRIMINATOR_CANT_FIND = Kan discriminator niet vinden in definities: {0} FHIRPATH_DISCRIMINATOR_NOTYPE = Fout in discriminator bij {0}: geen onderliggende elementen, geen type -FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_PLURAL = Fout in discriminator bij {1}: geen onderliggende elementen, meerdere typen -FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_PLURAL = Fout in discriminator bij {1}: geen onderliggende elementen, meerdere typeprofielen +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_one = +FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES_other = Fout in discriminator bij {1}: geen onderliggende elementen, meerdere typen +#The following error cannot occur for a single item. _one case left intentionally blank. +FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_one = +FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES_other = Fout in discriminator bij {1}: geen onderliggende elementen, meerdere typeprofielen FHIRPATH_UNABLE_BOOLEAN = Kan niet verwerken als een boolean: {0} XHTML_XHTML_DOCTYPE_ILLEGAL = Misvormde XHTML: DocType declaratie gevonden en deze zijn niet toegestaan (bescherming tegen XXE veiligheidsrisico) PACKAGE_VERSION_MISMATCH = FHIR-versie incorrect in package {0}: versie is {2} moet moet zijn {1} (pad: {3}) @@ -581,7 +615,9 @@ SD_MUST_HAVE_DERIVATION = StructureDefinition {0} moet een derivation bevatten, VALIDATION_VAL_PROFILE_OTHER_VERSION = Profiel is voor een andere versie van FHIR ({0}) dus wordt genegeerd VALIDATION_VAL_PROFILE_THIS_VERSION_OK = Profiel voor deze versie van FHIR - alles in orde VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = Profiel is voor deze versie van FHIR, maar heeft een onjuist type {0} -BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_PLURAL = Meerdere profielen gevonden voor contained resource. Dit wordt momenteel niet ondersteund. (Type {2}: {3}) +#The following error cannot occur for a single item. _one case left intentionally blank. +#BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_one = +BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_other = Meerdere profielen gevonden voor contained resource. Dit wordt momenteel niet ondersteund. (Type {2}: {3}) RENDER_BUNDLE_HEADER_ROOT = Bundle {0} van type {1} RENDER_BUNDLE_HEADER_ENTRY = Entry {0} RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - Full URL = {1} @@ -608,7 +644,9 @@ TERMINOLOGY_TX_SYSTEM_WRONG_BUILD = De codesysteemverwijzing {0} is incorrect - FHIRPATH_BAD_DATE = Kan Date {0} niet verwerken FHIRPATH_NUMERICAL_ONLY = Fout bij evalueren FHIRPath expressie: De functie {0} kan alleen worden gebruikt met integer, decimal of Quantity maar gevonden {1} FHIRPATH_DECIMAL_ONLY = Fout bij evalueren FHIRPath expressie: De functie {0} kan alleen worden gebruikt met decimal maar gevonden {1} -FHIRPATH_FOCUS_PLURAL = Fout bij evalueren FHIRPath expressie: focus voor {1} heeft meer dan een waarde +#The following error cannot occur for a single item. _one case left intentionally blank. +#FHIRPATH_FOCUS_one = +FHIRPATH_FOCUS_other = Fout bij evalueren FHIRPath expressie: focus voor {1} heeft meer dan een waarde REFERENCE_REF_SUSPICIOUS = De syntax van de reference ''{0}'' oogt incorrect en moeten worden gecontroleerd TYPE_SPECIFIC_CHECKS_DT_QTY_NO_ANNOTATIONS = UCUM-codes met menselijk leesbare annotaties zoals {0} kunnen misleidend zijn. Aanbevolen is om geen annotaties in de UCUM-code te gebruiken en in plaats daarvan te zorgen dat Quantity.unit goed leesbaar is XHTML_XHTML_ELEMENT_ILLEGAL_IN_PARA = Ongeldige elementnaam binnen een paragraph in de XHTML (''{0}'') @@ -654,3 +692,7 @@ BUNDLE_SEARCH_ENTRY_WRONG_RESOURCE_TYPE_OUTCOME = Dit is geen OperationOutcome ( BUNDLE_SEARCH_ENTRY_WRONG_RESOURCE_TYPE_NO_MODE = Dit is geen overeenkomstig resourcetype voor de opgegeven zoekactie (is een search.mode nodig?) ({0} verwacht {1}) BUNDLE_SEARCH_NO_MODE = SearchSet bundles zouden search.mode op de entries moeten hebben INV_FAILED = Regel {0} mislukt +#The following error cannot occur for a single item. _one case left intentionally blank. +#REPAREER MIJ PLURAL +#MULTIPLE_LOGICAL_MODELS_one= +#MULTIPLE_LOGICAL_MODELS_other= diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/i18n/I18nBaseTest.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/i18n/I18nBaseTest.java index 989b6cd5a..28c861a94 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/i18n/I18nBaseTest.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/i18n/I18nBaseTest.java @@ -1,6 +1,8 @@ package org.hl7.fhir.utilities.i18n; +import com.ibm.icu.text.PluralRules; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -12,6 +14,11 @@ import java.nio.charset.StandardCharsets; import java.text.MessageFormat; import java.util.*; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + class I18nBaseTest { public static final String BAD_STRING_ARG = "THIS_DOES_NOT_EXIST"; @@ -40,6 +47,37 @@ class I18nBaseTest { Assertions.assertEquals(form.format(testArgs), result); } + @Test + @DisplayName("Test pluralization works without initializing Locale.") + void testFormatMessagePluralWithoutInitLocale() { + I18nTestClass testClass = new I18nTestClass(); + + //Answer value must be of the type {1} + String resultOne = testClass.formatMessagePlural(1, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE); + assertThat(resultOne, containsString("be of the type")); + + //Answer value must be one of the {0} types {1} + String resultMany = testClass.formatMessagePlural(3, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE); + assertThat(resultMany, containsString("one of the 3 types ")); + + } + + @Test + @DisplayName("Test pluralization works with initializing Locale.") + void testFormatMessagePluralWithInitLocale() { + I18nTestClass testClass = new I18nTestClass(); + + testClass.setLocale(Locale.GERMAN); + //Answer value muss vom Typ {0} sein. + String resultOne = testClass.formatMessagePlural(1, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE); + assertThat(resultOne, containsString("muss vom Typ")); + + //Answer value muss einer der Typen {1} sein + String resultMany = testClass.formatMessagePlural(3, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE); + assertThat(resultMany, containsString("einer der Typen ")); + + } + @Test @DisplayName("Assert no string modification is done when no match is found.") void testFormatMessageForNonExistentMessage() { @@ -68,7 +106,7 @@ class I18nBaseTest { String line; while ((line = reader.readLine()) != null) { // System.out.println("Searching for umlauts -> " + line); - Assertions.assertFalse(stringContainsItemFromList(line, UMLAUTS)); + assertFalse(stringContainsItemFromList(line, UMLAUTS)); } } catch (IOException e) { e.printStackTrace(); @@ -80,4 +118,6 @@ class I18nBaseTest { public static boolean stringContainsItemFromList(String inputStr, String[] items) { return Arrays.stream(items).anyMatch(inputStr::contains); } + + } \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/i18n/ICU4JTests.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/i18n/ICU4JTests.java new file mode 100644 index 000000000..86e63815f --- /dev/null +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/i18n/ICU4JTests.java @@ -0,0 +1,52 @@ +package org.hl7.fhir.utilities.i18n; + +import com.ibm.icu.text.PluralRules; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Locale; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ICU4JTests { + + static final String[] EN_KEYWORDS = { + PluralRules.KEYWORD_ONE, + PluralRules.KEYWORD_OTHER + }; + + @Test + void getEnLocalePlurals() { + final Set keywords = getPluralKeywords(Locale.ENGLISH); + assertEquals(keywords, new HashSet(Arrays.asList(EN_KEYWORDS))); + } + + static final String[] DE_KEYWORDS = { + PluralRules.KEYWORD_ONE, + PluralRules.KEYWORD_OTHER + }; + + @Test + void getDeLocalePlurals() { + final Set keywords = getPluralKeywords(Locale.GERMAN); + assertEquals(keywords, new HashSet(Arrays.asList(DE_KEYWORDS))); + } + + static final String[] NL_KEYWORDS = { + PluralRules.KEYWORD_ONE, + PluralRules.KEYWORD_OTHER + }; + + @Test + void getNlLocalePlurals() { + final Set keywords = getPluralKeywords(Locale.forLanguageTag("nl")); + assertEquals(keywords, new HashSet(Arrays.asList(NL_KEYWORDS))); + } + + private static Set getPluralKeywords(Locale locale) { + final PluralRules pluralRules = PluralRules.forLocale(locale); + return pluralRules.getKeywords(); + } +} diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java index 595098f77..219de93a7 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java @@ -320,9 +320,9 @@ public class BaseValidator implements IValidationContextResourceLoader { return thePass; } - protected boolean hintPL(List errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { + protected boolean hintPlural(List errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { 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); } return thePass; @@ -387,9 +387,9 @@ public class BaseValidator implements IValidationContextResourceLoader { return thePass; } - protected boolean rulePL(List errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { + protected boolean rulePlural(List errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { 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); } return thePass; @@ -454,9 +454,9 @@ public class BaseValidator implements IValidationContextResourceLoader { return thePass; } - protected boolean rulePL(List errors, IssueType type, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { + protected boolean rulePlural(List errors, IssueType type, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) { 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); } return thePass; @@ -530,9 +530,9 @@ public class BaseValidator implements IValidationContextResourceLoader { } - protected boolean warningPL(List errors, IssueType type, int line, int col, String path, boolean thePass, int num, String msg, Object... theMessageArguments) { + protected boolean warningPlural(List errors, IssueType type, int line, int col, String path, boolean thePass, int num, String msg, Object... theMessageArguments) { if (!thePass && doingWarnings()) { - String nmsg = context.formatMessagePL(num, msg, theMessageArguments); + String nmsg = context.formatMessagePlural(num, msg, theMessageArguments); IssueSeverity severity = IssueSeverity.WARNING; addValidationMessage(errors, type, line, col, path, nmsg, severity, msg); } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java index b1691f39b..ae5712a02 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java @@ -669,7 +669,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } if (logicals.size() > 0) { - if (rulePL(errors, IssueType.BUSINESSRULE, "Configuration", logicals.size() == 1, logicals.size(), I18nConstants.MULTIPLE_LOGICAL_MODELS_PLURAL, ResourceUtilities.listUrls(logicals))) { + if (rulePlural(errors, IssueType.BUSINESSRULE, "Configuration", logicals.size() == 1, logicals.size(), I18nConstants.MULTIPLE_LOGICAL_MODELS, ResourceUtilities.listUrls(logicals))) { parser.setLogical(logicals.get(0)); } } @@ -2871,7 +2871,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (invalidChars.isEmpty()) { return null; } else { - return context.formatMessagePL(c, I18nConstants.XHTML_URL_INVALID_CHARS_PLURAL, invalidChars.toString()); + return context.formatMessagePlural(c, I18nConstants.XHTML_URL_INVALID_CHARS, invalidChars.toString()); } } } @@ -4289,7 +4289,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())); } } 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, discriminator, ed.getId(), profile.getUrl(), criteriaElement.typeSummary())); } else 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()) { @@ -4302,7 +4302,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())); } 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, criteriaElement.getId(), profile.getUrl())); } List list = discriminator.endsWith(".resolve()") || discriminator.equals("resolve()") ? criteriaElement.getType().get(0).getTargetProfile() : criteriaElement.getType().get(0).getProfile(); if (list.size() == 0) { @@ -4340,10 +4340,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat anyFound = true; } if (!anyFound) { - if (slicer.getSlicing().getDiscriminator().size() > 1) - throw new DefinitionException(context.formatMessagePL(slicer.getSlicing().getDiscriminator().size(), I18nConstants.COULD_NOT_MATCH_ANY_DISCRIMINATORS__FOR_SLICE__IN_PROFILE___NONE_OF_THE_DISCRIMINATOR__HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS_PLURAL, discriminators, ed.getId(), profile.getUrl(), discriminators)); - else - throw new DefinitionException(context.formatMessage(I18nConstants.COULD_NOT_MATCH_DISCRIMINATOR__FOR_SLICE__IN_PROFILE___THE_DISCRIMINATOR__DOES_NOT_HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS, discriminators, ed.getId(), profile.getUrl(), discriminators)); + throw new DefinitionException(context.formatMessagePlural(slicer.getSlicing().getDiscriminator().size(), I18nConstants.Could_not_match_discriminator_for_slice_in_profile, discriminators, ed.getId(), profile.getUrl(), discriminators)); } try { @@ -5145,8 +5142,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat for (CanonicalType u : typeForResource.getProfile()) { b.append(u.asStringValue()); } - ok = rulePL(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), - false, typeForResource.getProfile().size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_PLURAL, special.toHuman(), typeForResource.getCode(), b.toString()) && ok; + ok = rulePlural(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), + false, typeForResource.getProfile().size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES, special.toHuman(), typeForResource.getCode(), b.toString()) && ok; } } } else { @@ -5162,8 +5159,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat false, I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE2, resourceName, types.get(0)) && ok; } else { - ok = rulePL(errors, IssueType.INFORMATIONAL, element.line(), element.col(), stack.getLiteralPath(), - false, types.size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE3_PLURAL, resourceName, types) && ok; + ok = rulePlural(errors, IssueType.INFORMATIONAL, element.line(), element.col(), stack.getLiteralPath(), + false, types.size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE3, resourceName, types) && ok; } } } @@ -5572,7 +5569,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } } 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, ResourceUtilities.listStrings(goodProfiles.keySet())); for (String m : goodProfiles.keySet()) { p = this.context.fetchResource(StructureDefinition.class, m); for (ValidationMessage message : goodProfiles.get(m)) { @@ -5711,18 +5708,18 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } if (ed.getMin() > 0) { if (problematicPaths.contains(ed.getPath())) - hintPL(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMIN_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin())); + hintPlural(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMIN, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin())); else { if (count < ed.getMin()) { - ok = rulePL(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MINIMUM_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin())) && ok; + ok = rulePlural(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MINIMUM, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin())) && ok; } } } if (ed.hasMax() && !ed.getMax().equals("*")) { if (problematicPaths.contains(ed.getPath())) - hintPL(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMAX_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax()); + hintPlural(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMAX, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax()); else if (count > Integer.parseInt(ed.getMax())) { - ok = rulePL(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MAXIMUM_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax(), Integer.toString(count)) && ok; + ok = rulePlural(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MAXIMUM, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax(), Integer.toString(count)) && ok; } } } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java index ed8290035..b398dd030 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java @@ -402,7 +402,7 @@ public class QuestionnaireValidator extends BaseValidator { private boolean validateQuestionnaireResponseItem(ValidatorHostContext hostcontext, QuestionnaireWithContext qsrc, QuestionnaireItemComponent qItem, List errors, List elements, NodeStack stack, boolean inProgress, Element questionnaireResponseRoot, QStack qstack) { boolean ok = true; if (elements.size() > 1) { - ok = rulePL(errors, IssueType.INVALID, elements.get(1).getElement().line(), elements.get(1).getElement().col(), stack.getLiteralPath(), qItem.getRepeats(), elements.size(), I18nConstants.QUESTIONNAIRE_QR_ITEM_ONLYONEI_PLURAL, qItem.getLinkId()) && ok; + ok = rulePlural(errors, IssueType.INVALID, elements.get(1).getElement().line(), elements.get(1).getElement().col(), stack.getLiteralPath(), qItem.getRepeats(), elements.size(), I18nConstants.QUESTIONNAIRE_QR_ITEM_ONLYONEI, qItem.getLinkId()) && ok; } for (ElementWithIndex element : elements) { NodeStack ns = stack.push(element.getElement(), element.getIndex(), null, null); @@ -518,10 +518,8 @@ public class QuestionnaireValidator extends BaseValidator { if (values.get(0).getName().equals("value" + Utilities.capitalize(s))) return (s); } - if (types.length == 1) - ok.see(rule(errors, IssueType.STRUCTURE, values.get(0).line(), values.get(0).col(), ns.getLiteralPath(), false, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE, types[0])); - else - ok.see(rulePL(errors, IssueType.STRUCTURE, values.get(0).line(), values.get(0).col(), ns.getLiteralPath(), false, types.length, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE_PLURAL, l.toString())); + + ok.see(rulePlural(errors, IssueType.STRUCTURE, values.get(0).line(), values.get(0).col(), ns.getLiteralPath(), false, types.length, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE, l.toString())); } return null; } diff --git a/pom.xml b/pom.xml index 8f3ebe38b..cd8eb3fc5 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 5.4.0 - 1.1.122 + 1.1.123-SNAPSHOT 5.7.1 1.8.2 3.0.0-M5