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 cc8576f70..8016e14bb 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 @@ -53,6 +53,7 @@ POSSIBILITY OF SUCH DAMAGE. import java.text.MessageFormat; import java.util.List; +import java.util.MissingResourceException; import java.util.ResourceBundle; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.dstu3.model.Resource; @@ -150,8 +151,13 @@ public class BaseValidator { String message; if (theMessageArguments != null && theMessageArguments.length > 0) { message = MessageFormat.format(messages.getString(theMessage), theMessageArguments); - } else { - message = theMessage; + } else { + try { + message = messages.getString(theMessage); + } catch (MissingResourceException e) { + // non-internationalized String + message = theMessage; + } } return message; } 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 76cb6f88e..493b66b69 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 @@ -1818,7 +1818,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat warning(errors, IssueType.INVALID, e.line(), e.col(), path, yearIsValid(e.primitiveValue()), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_DATETIME_REASONABLE, e.primitiveValue()); rule(errors, IssueType.INVALID, e.line(), e.col(), path, e.primitiveValue() - .matches("([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)?)?)?"), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_DATETIME_VALID); + .matches("([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)?)?)?"), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_DATETIME_VALID, e.primitiveValue()); rule(errors, IssueType.INVALID, e.line(), e.col(), path, !hasTime(e.primitiveValue()) || hasTimeZone(e.primitiveValue()), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_DATETIME_TZ); rule(errors, IssueType.INVALID, e.line(), e.col(), path, !context.hasMaxLength() || context.getMaxLength() == 0 || e.primitiveValue().length() <= context.getMaxLength(), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_LENGTH, context.getMaxLength()); try { diff --git a/org.hl7.fhir.validation/src/main/resources/Messages.properties b/org.hl7.fhir.validation/src/main/resources/Messages.properties index 66b32adce..293880d47 100644 --- a/org.hl7.fhir.validation/src/main/resources/Messages.properties +++ b/org.hl7.fhir.validation/src/main/resources/Messages.properties @@ -166,7 +166,6 @@ Terminology_TX_ValueSet_NotFound2 = ValueSet {0} not found by validator Type_Specific_Checks_DT_Base64_Valid = The value '{0}' is not a valid Base64 value Type_Specific_Checks_DT_Boolean_Value = boolean values must be 'true' or 'false' Type_Specific_Checks_DT_Code_WS = The code '{0}' is not valid (whitespace rules) -Type_Specific_Checks_DT_DateTIme_Valid = Not a valid date time Type_Specific_Checks_DT_DateTime_Reasonable = The value '{0}' is outside the range of reasonable years - check for data entry error Type_Specific_Checks_DT_DateTime_Regex = The instant '{0}' is not valid (by regex) Type_Specific_Checks_DT_DateTime_TZ = if a date has a time, it must have a timezone diff --git a/org.hl7.fhir.validation/src/main/resources/Messages_de_DE.properties b/org.hl7.fhir.validation/src/main/resources/Messages_de_DE.properties index 66b32adce..293880d47 100644 --- a/org.hl7.fhir.validation/src/main/resources/Messages_de_DE.properties +++ b/org.hl7.fhir.validation/src/main/resources/Messages_de_DE.properties @@ -166,7 +166,6 @@ Terminology_TX_ValueSet_NotFound2 = ValueSet {0} not found by validator Type_Specific_Checks_DT_Base64_Valid = The value '{0}' is not a valid Base64 value Type_Specific_Checks_DT_Boolean_Value = boolean values must be 'true' or 'false' Type_Specific_Checks_DT_Code_WS = The code '{0}' is not valid (whitespace rules) -Type_Specific_Checks_DT_DateTIme_Valid = Not a valid date time Type_Specific_Checks_DT_DateTime_Reasonable = The value '{0}' is outside the range of reasonable years - check for data entry error Type_Specific_Checks_DT_DateTime_Regex = The instant '{0}' is not valid (by regex) Type_Specific_Checks_DT_DateTime_TZ = if a date has a time, it must have a timezone