本文整理汇总了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);
}
示例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);
}
示例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);
}