示例#1
0
 internal protected BaseBucket(ElementDefinition definition)
 {
     Name        = definition.Path + (definition.Name != null ? $":{definition.Name}" : null);
     Cardinality = Cardinality.FromElementDefinition(definition);
     Path        = definition.Path;
 }
示例#2
0
        public virtual OperationOutcome Validate(Validator validator, IElementNavigator errorLocation)
        {
            var outcome = new OperationOutcome();

            if (!Cardinality.InRange(Members.Count))
            {
                OperationOutcome.IssueComponent issue = validator.Trace(outcome, $"Instance count for '{Name}' is {Members.Count}, which is not within the specified cardinality of {Cardinality.ToString()}",
                                                                        Issue.CONTENT_INCORRECT_OCCURRENCE, errorLocation);
                if (issue != null)
                {
                    // the location in the structure definition (this will match to the discriminator when checking slicing)
                    // issue.LocationElement.Add(new FhirString(Path));
                    issue.SetAnnotation(new SlicePathAnnotation(Path));
                }
            }
            return(outcome);
        }
示例#3
0
        public virtual OperationOutcome Validate(Validator validator, IElementNavigator errorLocation)
        {
            var outcome = new OperationOutcome();

            if (!Cardinality.InRange(Members.Count))
            {
                validator.Trace(outcome, $"Instance count for '{Name}' is {Members.Count}, which is not within the specified cardinality of {Cardinality.ToString()}",
                                Issue.CONTENT_INCORRECT_OCCURRENCE, errorLocation);
            }

            return(outcome);
        }