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


C# Resource.GetCollectionName方法代码示例

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


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

示例1: importResource

        private void importResource(string filename, Resource resource)
        {
            Match match = Regex.Match(filename, @"\w+\(([^\)]+)\)\..*");

			string id = null;

            if (match.Success)
                id = match.Groups[1].Value;

            if (id == null) id = Guid.NewGuid().ToString();

            System.Console.Out.WriteLine(filename + " is a single resource with id " + id);

            ResourceEntry newEntry = ResourceEntry.Create(resource);

            string collection = resource.GetCollectionName();
            
            // klopt het dat hier een hl7.org uri voor moet?
            Uri identity = ResourceIdentity.Build(new Uri("http://hl7.org/fhir") ,collection, id);

            newEntry.Resource = resource;
            newEntry.AuthorName = "(imported from file)";
            newEntry.Id = identity;


            identity = ResourceIdentity.Build(new Uri("http://hl7.org/fhir"), collection, id, "1");
            // identity.VersionId = "1";

            newEntry.Links.SelfLink = identity;

            newEntry.LastUpdated = File.GetLastWriteTimeUtc(filename);
            newEntry.Published = File.GetCreationTimeUtc(filename);
            newEntry.Title = String.Format("{0} with id {1}", collection, id);

            add(newEntry);
        }
开发者ID:TonyAbell,项目名称:spark,代码行数:36,代码来源:ExampleImporter.cs

示例2: WriteMetaData

        public void WriteMetaData(ResourceEntry entry, int level, Resource resource)
        {
            if (level == 0)
            {
                Write(InternalField.ID, container_id);

                string selflink = entry.Links.SelfLink.ToString();
                Write(InternalField.SELFLINK, selflink);

                var resloc = new ResourceIdentity(container_id);
                Write(InternalField.JUSTID, resloc.Id);

                /*
                    //For testing purposes:
                    string term = resloc.Id;
                    List<Tag> tags = new List<Tag>() { new Tag(term, "http://tags.hl7.org", "labello"+term) } ;
                    tags.ForEach(Collect);
                /* */

                if (entry.Tags != null)
                {
                    entry.Tags.ToList().ForEach(Collect);
                }

            }
            else
            {

                string id = resource.Id;
                Write(InternalField.ID, container_id + "#" + id);
            }

            string category = resource.GetCollectionName();
                //ModelInfo.GetResourceNameForType(resource.GetType()).ToLower();
            Write(InternalField.RESOURCE, category);
            Write(InternalField.LEVEL, level);
        }
开发者ID:Ravenheart,项目名称:spark,代码行数:37,代码来源:Document.cs

示例3: importResource

        private void importResource(string filename, Resource resource)
        {
            System.Console.Out.WriteLine(filename + " is a single resource form filename: " + filename);

            ResourceEntry newEntry = ResourceEntry.Create(resource);
            newEntry.Resource = resource;
            newEntry.AuthorName = "(imported from file)";

            Match match = Regex.Match(filename, @"\w+\(([^\)]+)\)\..*");
            string name = match.Groups[1].Value;
            string id = (match.Success) ? match.Groups[1].Value : null;
            string collection = resource.GetCollectionName();

            if (id != null)
            {
                Uri identity = ResourceIdentity.Build(hl7base, collection, id);
                newEntry.Id = identity;
                newEntry.Title = String.Format("{0} with id {1}", collection, id) ;
            }
            else
            {
                newEntry.Title = String.Format("{0} from file {1}", collection, filename);
            }

            //identity = ResourceIdentity.Build(new Uri("http://hl7.org/fhir"), collection, id, "1");
            // identity.VersionId = "1";

            //newEntry.Links.SelfLink = identity;

            //newEntry.LastUpdated = File.GetLastWriteTimeUtc(filename);
            newEntry.Published = File.GetCreationTimeUtc(filename);

            add(newEntry);
        }
开发者ID:Ravenheart,项目名称:spark,代码行数:34,代码来源:ExampleImporter.cs


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