当前位置: 首页>>代码示例>>C#>>正文


C# List.Add方法代码示例

本文整理汇总了C#中Hl7.Fhir.Model.List.Add方法的典型用法代码示例。如果您正苦于以下问题:C# List.Add方法的具体用法?C# List.Add怎么用?C# List.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hl7.Fhir.Model.List的用法示例。


在下文中一共展示了List.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessEncounters

        private static void ProcessEncounters(List<TimelineEntry> timeline, Bundle matchingEncounters)
        {
            foreach (var encounter in matchingEncounters.Entries.Select(x => (ResourceEntry<Encounter>)x))
            {
                DateTimeOffset? startTime;
                DateTimeOffset? endTime;

                if (encounter.Resource.Hospitalization != null)
                {
                    startTime = DateTimeOffset.Parse(encounter.Resource.Hospitalization.Period.Start);
                    endTime = DateTimeOffset.Parse(encounter.Resource.Hospitalization.Period.End);
                }
                else
                {
                    startTime = encounter.Published;
                    endTime = encounter.Published;
                }

                timeline.Add(new TimelineEntry
                {
                    StartTime = startTime,
                    EndTime = endTime,
                    TypeOfEntry = TimelineEntryType.Encounter,
                    Summary = encounter.Resource.Reason.ToString()
                });
            }
        }
开发者ID:nagyistoce,项目名称:PatientTimelineFhir,代码行数:27,代码来源:TimelineBuilder.cs

示例2: ResourceFilter

        internal static IMongoQuery ResourceFilter(string resourceType)
        {
            var queries = new List<IMongoQuery>();
            queries.Add(M.Query.EQ(InternalField.LEVEL, 0));
            queries.Add(M.Query.EQ(InternalField.RESOURCE, resourceType));

            return M.Query.And(queries);
        }
开发者ID:TonyAbell,项目名称:spark,代码行数:8,代码来源:CriteriaMongoExtensions.cs

示例3: SetBundleType

        public static void SetBundleType(this Bundle bundle, BundleType type)
        {
            List<Tag> result = new List<Tag>(bundle.Tags.Exclude(new Tag[] { MESSAGE_TAG, DOCUMENT_TAG }));

            if (type == BundleType.Document)
                result.Add(DOCUMENT_TAG);
            else if (type == BundleType.Message)
                result.Add(MESSAGE_TAG);

            bundle.Tags = result;
        }
开发者ID:ranjancse26,项目名称:fhir-net-api,代码行数:11,代码来源:TagListExtensions.cs

示例4: Validate

        public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            var result = new List<ValidationResult>();
            result.AddRange(base.Validate(validationContext));

            if (When == null)
                result.Add(new ValidationResult("A DeletedEntry must have a non-null deletion time (When)"));

            if (!result.Any()) result.Add(ValidationResult.Success);

            return result;
        }
开发者ID:nagyistoce,项目名称:kevinpeterson-fhir,代码行数:12,代码来源:DeletedEntry.cs

示例5: ToExpression

        public static Expression ToExpression(this Quantity quantity)
        {
            quantity = System.Canonical(quantity);
            string searchable = quantity.LeftSearchableString();

            var values = new List<ValueExpression>();
            values.Add(new IndexValue("system", new StringValue(UCUM.Uri.ToString())));
            values.Add(new IndexValue("value", new NumberValue(quantity.Value.ToDecimal())));
            values.Add(new IndexValue("decimals", new StringValue(searchable)));
            values.Add(new IndexValue("unit", new StringValue(quantity.Metric.ToString())));

            return new CompositeValue(values);
        }
开发者ID:Condeti,项目名称:spark,代码行数:13,代码来源:QuantityExtensions.cs

示例6: Validate

        public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            var result = new List<ValidationResult>();
            result.AddRange(base.Validate(validationContext));

            if (Content == null)
                result.Add(new ValidationResult("Entry must contain (possibly 0-length) data in Content element"));

            if (ContentType == null)
                result.Add(new ValidationResult("Entry must contain a ContentType"));

            return result;
        }
开发者ID:nagyistoce,项目名称:kevinpeterson-fhir,代码行数:13,代码来源:Binary.cs

示例7: Validate

        public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            var result = new List<ValidationResult>(base.Validate(validationContext));

            if (this.Contained != null)
            {
                if (!Contained.OfType<DomainResource>().All(dr => dr.Text == null))
                    result.Add(new ValidationResult("Resource has contained resources with narrative"));

                if(!Contained.OfType<DomainResource>().All(cr => cr.Contained == null || !cr.Contained.Any()))
                    result.Add(new ValidationResult("Resource has contained resources with nested contained resources"));
            }

            return result;
        }
开发者ID:rootdeveloper,项目名称:fhir-svn,代码行数:15,代码来源:DomainResource.cs

示例8: GetAllPatients

        public IEnumerable<Patient> GetAllPatients()
        {
            var patients = new List<Patient>();

            var patientsExist = true;
            var i = 1;

            while (patientsExist)
            {
                try
                {
                    var patient = _client.Read<Patient>(i.ToString());

                    patients.Add(patient.Resource);

                    i++;
                }
                catch (FhirOperationException)
                {
                    patientsExist = false;
                }
            }

            return patients;
        }
开发者ID:nagyistoce,项目名称:PatientTimelineFhir,代码行数:25,代码来源:PatientManager.cs

示例9: ParseCategoryHeader

        public static ICollection<Tag> ParseCategoryHeader(string value)
        {
            if (String.IsNullOrEmpty(value)) return new List<Tag>();

            var result = new List<Tag>();

            var categories = value.SplitNotInQuotes(',').Where(s => !String.IsNullOrEmpty(s));

            foreach (var category in categories)
            {
                var values = category.SplitNotInQuotes(';').Where(s => !String.IsNullOrEmpty(s));

                if (values.Count() >= 1)
                {
                    var term = values.First();

                    var pars = values.Skip(1).Select( v =>
                        { 
                            var vsplit = v.Split('=');
                            var item1 = vsplit[0].Trim();
                            var item2 = vsplit.Length > 1 ? vsplit[1].Trim() : null;
                            return new Tuple<string,string>(item1,item2);
                        });

                    var scheme = new Uri(pars.Where(t => t.Item1 == "scheme").Select(t => t.Item2.Trim('\"')).FirstOrDefault(), UriKind.RelativeOrAbsolute);
                    var label = pars.Where(t => t.Item1 == "label").Select(t => t.Item2.Trim('\"')).FirstOrDefault();
                       
                    result.Add(new Tag(term,scheme,label));
                }
            }

            return result;
        }
开发者ID:ranjancse26,项目名称:fhir-net-api,代码行数:33,代码来源:HttpUtil.cs

示例10: Validate

        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            var result = new List<ValidationResult>();

            if (String.IsNullOrWhiteSpace(Title))
                result.Add(new ValidationResult("Feed must contain a title"));

            if (!UriHasValue(Id))
                result.Add(new ValidationResult("Feed must have an id"));
            else
                if (!Id.IsAbsoluteUri)
                    result.Add(new ValidationResult("Feed id must be an absolute URI"));

            if (LastUpdated == null)
                result.Add(new ValidationResult("Feed must have a updated date"));

            if (Links.SearchLink != null)
                result.Add(new ValidationResult("Links with rel='search' can only be used on feed entries"));

            bool feedHasAuthor = !String.IsNullOrEmpty(this.AuthorName);

            if (Entries != null)
            {
                foreach (var entry in Entries.Where(e => e != null))
                {
                    if (!feedHasAuthor && entry is ResourceEntry && String.IsNullOrEmpty(((ResourceEntry)entry).AuthorName))
                        result.Add(new ValidationResult("Bundle's author and Entry author cannot both be empty"));

                    Validator.TryValidateObject(entry, ValidationContextFactory.Create(entry, null), result, true);
                }
            }

            return result;
        }
开发者ID:nagyistoce,项目名称:kevinpeterson-fhir,代码行数:34,代码来源:Bundle.cs

示例11: NonUcumIndexedExpression

        public static Expression NonUcumIndexedExpression(this FM.Quantity quantity)
        {
            var values = new List<ValueExpression>();
            if (quantity.System != null)
                values.Add(new IndexValue("system", new StringValue(quantity.System)));

            if (quantity.Unit != null)
                values.Add(new IndexValue("unit", new StringValue(quantity.Unit)));

            if (quantity.Value.HasValue)
                values.Add(new IndexValue("value", new NumberValue(quantity.Value.Value)));

            if (values.Any())
                return new CompositeValue(values);

            return null;
        }
开发者ID:Condeti,项目名称:spark,代码行数:17,代码来源:QuantityExtensions.cs

示例12: ParametersToQuery

 private IMongoQuery ParametersToQuery(IEnumerable<IParameter> parameters)
 {
     List<IMongoQuery> queries = new List<IMongoQuery>();
     queries.Add(M.Query.EQ(InternalField.LEVEL, 0)); // geindexeerde contained documents overslaan
     IEnumerable<IMongoQuery> q = parameters.Select(p => ParameterToQuery(p));
     queries.AddRange(q);
     return M.Query.And(queries);
 }
开发者ID:TonyAbell,项目名称:spark,代码行数:8,代码来源:MongoSearcher.cs

示例13: genProfile

        private void genProfile(List<Row> rows, Profile profile, bool extensionsOnly)
        {
            if (!extensionsOnly)
            {
                var r = new  Row();
                rows.Add(r);
                r.setIcon("icon_profile.png");
                r.getCells().Add(new  Cell(null, null, profile.Name, null, null));
                r.getCells().Add(new  Cell());
                r.getCells().Add(new  Cell(null, null, "Profile", null, null));
                r.getCells().Add(new  Cell(null, null, profile.Description, null, null));

                foreach (var s in profile.Structure)
                {
                    var re = new  Row();
                    r.getSubRows().Add(re);
                    re.setIcon("icon_resource.png");
                    re.getCells().Add(new  Cell(null, null, s.Name, null, null));
                    re.getCells().Add(new  Cell(null, null, "", null, null));
                    re.getCells().Add(new  Cell(null, null, s.Type, null, null));

                    re.getCells().Add(new  Cell(null, null, s.Element[0].Definition.Short, null, null));     // DSTU1
                    //re.getCells().Add(new  Cell(null, null, s.Base, null, null));       // DSTU2
                }
            }

            if (profile.ExtensionDefn.Any() || extensionsOnly)
            {
                var re = new  Row();
                rows.Add(re);
                re.setIcon("icon_profile.png");
                re.getCells().Add(new  Cell(null, null, "Extensions", null, null));
                re.getCells().Add(new  Cell());
                re.getCells().Add(new  Cell());

                re.getCells().Add(new  Cell(null, null, "Extensions defined by this profile", null, null)); // DSTU1
                //re.getCells().Add(new  Cell(null, null, "Extensions defined by the URL \"" + profile.Url + "\"", null, null)); // DSTU2

                foreach (var ext in profile.ExtensionDefn)
                {
                    genExtension(re.getSubRows(), ext, true);
                }
            }

        }
开发者ID:alexandru360,项目名称:fhir-net-api,代码行数:45,代码来源:ProfileTableGenerator.cs

示例14: Validate

        public virtual IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            var result = new List<ValidationResult>();

            if (Id != null && !Id.IsAbsoluteUri)
                result.Add(FhirValidator.BuildResult(validationContext, "Entry id must be an absolute URI"));

            if (Bundle.UriHasValue(SelfLink) && !SelfLink.IsAbsoluteUri)
                result.Add(FhirValidator.BuildResult(validationContext, "Entry selflink must be an absolute URI"));

            if (Links.FirstLink != null || Links.LastLink != null || Links.PreviousLink != null || Links.NextLink != null)
                result.Add(FhirValidator.BuildResult(validationContext, "Paging links can only be used on feeds, not entries"));

            if (Tags != null && validationContext.ValidateRecursively())
                FhirValidator.TryValidate(Tags,result,true);

            return result;
        }
开发者ID:jamesagnew,项目名称:fhir-net-api,代码行数:18,代码来源:BundleEntry.cs

示例15: GetMembers

        public IEnumerable<Tuple<string, IFhirReader>> GetMembers()
        {
            if (_current is XElement)
            {
                var rootElem = (XElement)_current;
                var result = new List<Tuple<string, IFhirReader>>();

                // First, any attributes
                foreach(var attr in rootElem.Attributes()) //.Where(xattr => xattr.Name.LocalName != "xmlns"))
                {
                    if (attr.Name == XName.Get("xmlns", "")) continue;      // skip xmlns declarations
                    if (attr.Name == XName.Get("{http://www.w3.org/2000/xmlns/}xsi") && !SerializationConfig.EnforceNoXsiAttributesOnRoot ) continue;   // skip xmlns:xsi declaration
                    if (attr.Name == XName.Get("{http://www.w3.org/2001/XMLSchema-instance}schemaLocation") && !SerializationConfig.EnforceNoXsiAttributesOnRoot) continue;     // skip schemaLocation

                    if (attr.Name.NamespaceName == "")
                        result.Add(Tuple.Create(attr.Name.LocalName, (IFhirReader)new XmlDomFhirReader(attr)));
                    else
                        throw Error.Format("Encountered unsupported attribute {0}", this, attr.Name);
                }
                
                foreach(var node in rootElem.Nodes())
                {
                    if(node is XText)
                    {
                        // A nested text node (the content attribute of a Binary)
                        result.Add(Tuple.Create(SerializationConfig.BINARY_CONTENT_MEMBER_NAME, (IFhirReader)new XmlDomFhirReader(node)));
                    }
                    else if(node is XElement)
                    {
                        var elem = (XElement)node;
                        
                        // All normal elements
                        if(elem.Name.NamespaceName == SerializationUtil.FHIRNS)
                            result.Add(Tuple.Create(elem.Name.LocalName, (IFhirReader)new XmlDomFhirReader(elem)));

                        // The special xhtml div element
                        else if(elem.Name == XHTMLDIV)
                            result.Add(Tuple.Create(XHTMLDIV.LocalName,
                                (IFhirReader)new XmlDomFhirReader(buildDivXText(elem))));

                        else
                            throw Error.Format("Encountered element '{0}' from unsupported namespace '{1}'", this, elem.Name.LocalName, elem.Name.NamespaceName);
                    }
                    else if(node is XComment)
                    {
                        // nothing
                    }
                    else
                        throw Error.Format("Encountered unexpected element member of type {0}", this, node.GetType().Name);
                }

                return result;
            }
            else
                throw Error.Format("Cannot get members: reader not at an element", this);
            
        }
开发者ID:ranjancse26,项目名称:fhir-net-api,代码行数:57,代码来源:XmlDomFhirReader.cs


注:本文中的Hl7.Fhir.Model.List.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。