mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-01 17:09:08 +00:00
Remove all _PLURAL labels from constants
This commit is contained in:
parent
183f9ecfd2
commit
11c369ea09
@ -386,7 +386,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ValidationResult(IssueSeverity.WARNING, context.formatMessagePlural(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) {
|
||||
|
@ -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.formatMessagePlural(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) {
|
||||
|
@ -34,7 +34,7 @@ public class I18nConstants {
|
||||
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";
|
||||
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";
|
||||
@ -68,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";
|
||||
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";
|
||||
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";
|
||||
@ -287,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";
|
||||
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";
|
||||
@ -322,12 +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";
|
||||
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_PLURAL = "Questionnaire_QR_Item_WrongType";
|
||||
public static final String QUESTIONNAIRE_QR_ITEM_WRONGTYPE = "Questionnaire_QR_Item_WrongType";
|
||||
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";
|
||||
@ -603,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";
|
||||
public static final String VALIDATION_VAL_PROFILE_MINIMUM_PLURAL = "Validation_VAL_Profile_Minimum";
|
||||
public static final String VALIDATION_VAL_PROFILE_MULTIPLEMATCHES_PLURAL = "Validation_VAL_Profile_MultipleMatches";
|
||||
public static final String VALIDATION_VAL_PROFILE_NOCHECKMAX_PLURAL = "Validation_VAL_Profile_NoCheckMax";
|
||||
public static final String VALIDATION_VAL_PROFILE_NOCHECKMIN_PLURAL = "Validation_VAL_Profile_NoCheckMin";
|
||||
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";
|
||||
|
@ -96,7 +96,7 @@ Questionnaire_QR_Item_NotEnabled2 = Item has answer, even though it is not enabl
|
||||
Questionnaire_QR_Item_NotFound = LinkId ''{0}'' not found in questionnaire
|
||||
Questionnaire_QR_Item_OnlyOneA = Only one response answer item with this linkId allowed
|
||||
#The following error cannot occur for a single item. _one case left intentionally blank.
|
||||
#Questionnaire_QR_Item_OnlyOneI_one =
|
||||
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
|
||||
@ -278,12 +278,12 @@ Could_not_match_discriminator_for_slice_in_profile_other = Could not match any d
|
||||
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})
|
||||
#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_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
|
||||
#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_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}
|
||||
@ -631,7 +631,7 @@ VALIDATION_VAL_PROFILE_OTHER_VERSION = Profile is for a different version of FHI
|
||||
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}
|
||||
#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_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}
|
||||
|
@ -53,11 +53,11 @@ class I18nBaseTest {
|
||||
I18nTestClass testClass = new I18nTestClass();
|
||||
|
||||
//Answer value must be of the type {1}
|
||||
String resultOne = testClass.formatMessagePlural(1, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE_PLURAL);
|
||||
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_PLURAL);
|
||||
String resultMany = testClass.formatMessagePlural(3, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE);
|
||||
assertThat(resultMany, containsString("one of the 3 types "));
|
||||
|
||||
}
|
||||
@ -69,11 +69,11 @@ class I18nBaseTest {
|
||||
|
||||
testClass.setLocale(Locale.GERMAN);
|
||||
//Answer value muss vom Typ {0} sein.
|
||||
String resultOne = testClass.formatMessagePlural(1, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE_PLURAL);
|
||||
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_PLURAL);
|
||||
String resultMany = testClass.formatMessagePlural(3, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE);
|
||||
assertThat(resultMany, containsString("einer der Typen "));
|
||||
|
||||
}
|
||||
|
@ -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.formatMessagePlural(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.formatMessagePlural(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<CanonicalType> list = discriminator.endsWith(".resolve()") || discriminator.equals("resolve()") ? criteriaElement.getType().get(0).getTargetProfile() : criteriaElement.getType().get(0).getProfile();
|
||||
if (list.size() == 0) {
|
||||
@ -5160,7 +5160,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||
|
||||
} else {
|
||||
ok = rulePlural(errors, IssueType.INFORMATIONAL, element.line(), element.col(), stack.getLiteralPath(),
|
||||
false, types.size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE3_PLURAL, resourceName, types) && ok;
|
||||
false, types.size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE3, resourceName, types) && ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5569,7 +5569,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warningPlural(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)) {
|
||||
@ -5708,18 +5708,18 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||
}
|
||||
if (ed.getMin() > 0) {
|
||||
if (problematicPaths.contains(ed.getPath()))
|
||||
hintPlural(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 = rulePlural(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()))
|
||||
hintPlural(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 = rulePlural(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ public class QuestionnaireValidator extends BaseValidator {
|
||||
private boolean validateQuestionnaireResponseItem(ValidatorHostContext hostcontext, QuestionnaireWithContext qsrc, QuestionnaireItemComponent qItem, List<ValidationMessage> errors, List<ElementWithIndex> elements, NodeStack stack, boolean inProgress, Element questionnaireResponseRoot, QStack qstack) {
|
||||
boolean ok = true;
|
||||
if (elements.size() > 1) {
|
||||
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_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);
|
||||
@ -519,7 +519,7 @@ public class QuestionnaireValidator extends BaseValidator {
|
||||
return (s);
|
||||
}
|
||||
|
||||
ok.see(rulePlural(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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user