本文整理汇总了C#中Hl7.Fhir.Model.List类的典型用法代码示例。如果您正苦于以下问题:C# List类的具体用法?C# List怎么用?C# List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
List类属于Hl7.Fhir.Model命名空间,在下文中一共展示了List类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: Import
public Import(ILocalhost localhost, IGenerator generator)
{
this.localhost = localhost;
this.generator = generator;
mapper = new Mapper<Key, Key>();
interactions = new List<Interaction>();
}
开发者ID:raysearchlabs,项目名称:spark,代码行数:7,代码来源:Import.cs
示例3: 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
示例4: 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:peterswallow,项目名称:fhir-net-api,代码行数:33,代码来源:HttpUtil.cs
示例5: UpdateTagsOnUpdate
public void UpdateTagsOnUpdate()
{
if (original == null) TestResult.Skipped();
// Update one tag, add another
var tags = new List<Tag>() {
new Tag(NUTAG, Tag.FHIRTAGNS, "readTagTest2"),
new Tag(OTHERTAG, Tag.FHIRTAGNS, "dummy") };
HttpTests.AssertSuccess(client, () => latest = client.Fetch<Patient>(original.Id));
latest.Tags = tags;
HttpTests.AssertSuccess(client, () => client.Update<Patient>(latest));
var read = client.Fetch<Patient>(latest.Id);
if (read.Tags == null)
TestResult.Fail("fetch after update did not return any tags");
if (read.Tags.Count() != 2)
TestResult.Fail(String.Format("Wrong number of tags after update: {0}, expected 2", read.Tags.Count()));
var nutags = read.Tags.FindByTerm(NUTAG,Tag.FHIRTAGNS);
if (nutags.Count() != 1 || nutags.First().Label != "readTagTest2")
TestResult.Fail("update did not replace value in tag");
var othertags = read.Tags.FindByTerm(OTHERTAG,Tag.FHIRTAGNS);
if(othertags.Count() != 1 || othertags.First().Label != "dummy")
TestResult.Fail("update failed to add new tag");
latest = read;
}
开发者ID:nagyistoce,项目名称:furore-sprinkler,代码行数:31,代码来源:TagTest.cs
示例6: TestTagsOnCreateAndRead
public void TestTagsOnCreateAndRead()
{
var tags = new List<Tag>() { new Tag(NUTAG, Tag.FHIRTAGNS, "readTagTest") };
HttpTests.AssertSuccess(client, () => latest = client.Create<Patient>(DemoData.GetDemoPatient(),tags));
if(latest.Tags == null)
TestResult.Fail("create did not return any tags");
var nutags = latest.Tags.FindByTerm(NUTAG, Tag.FHIRTAGNS);
if (nutags.Count() != 1 || nutags.First().Label != "readTagTest")
TestResult.Fail("create did not return specified tag");
var read = client.Fetch<Patient>(latest.Id);
if (read.Tags == null)
TestResult.Fail("read did not return any tags");
nutags = latest.Tags.FindByTerm(NUTAG, Tag.FHIRTAGNS);
if (nutags.Count() != 1 || nutags.First().Label != "readTagTest")
TestResult.Fail("read did not return specified tag");
var vread = client.Fetch<Patient>(latest.SelfLink);
if (vread.Tags == null)
TestResult.Fail("vread did not return any tags");
nutags = latest.Tags.FindByTerm(NUTAG, Tag.FHIRTAGNS);
if (nutags.Count() != 1 || nutags.First().Label != "readTagTest")
TestResult.Fail("vread did not return specified tag");
original = latest;
}
开发者ID:nagyistoce,项目名称:furore-sprinkler,代码行数:29,代码来源:TagTest.cs
示例7: SearchParams
public SearchParams()
{
Include = new List<string>();
RevInclude = new List<string>();
Sort = new List<Tuple<string, SortOrder>>();
Parameters = new List<Tuple<string, string>>();
}
开发者ID:alexandru360,项目名称:fhir-net-api,代码行数:7,代码来源:SearchParams.cs
示例8: 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
示例9: AddHistoryKeys
public static void AddHistoryKeys(this IGenerator generator, List<Interaction> interactions)
{
// PERF: this needs a performance improvement.
foreach (Interaction interaction in interactions)
{
interaction.Key = generator.NextHistoryKey(interaction.Key);
}
}
开发者ID:Condeti,项目名称:spark,代码行数:8,代码来源:GeneratorKeyExtensions.cs
示例10: CustomModelInfo
static CustomModelInfo()
{
searchParameters = new List<SearchParamDefinition>
{
new SearchParamDefinition() { Resource = "Practitioner", Name = "roleid", Description = @"Search by role identifier extension", Type = SearchParamType.Token, Path = new string[] { @"Practitioner.practitionerRole.Extension[url=http://hl7.no/fhir/StructureDefinition/practitonerRole-identifier].ValueIdentifier" } }
};
// searchParameters.AddRange(ModelInfo.SearchParameters);
}
开发者ID:Condeti,项目名称:spark,代码行数:8,代码来源:CustomModelInfo.cs
示例11: AddMultipleResourceComponents
public static Conformance AddMultipleResourceComponents(this Conformance conformance, List<String> resourcetypes, Boolean readhistory, Boolean updatecreate, Conformance.ResourceVersionPolicy versioning)
{
foreach (var type in resourcetypes)
{
AddSingleResourceComponent(conformance, type, readhistory, updatecreate, versioning);
}
return conformance;
}
开发者ID:Condeti,项目名称:spark,代码行数:8,代码来源:ConformanceBuilder.cs
示例12: Pager
public Pager(IFhirStore fhirStore, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer, List<ModelInfo.SearchParamDefinition> searchParameters)
{
this.fhirStore = fhirStore;
this.snapshotstore = snapshotstore;
this.localhost = localhost;
this.transfer = transfer;
this.searchParameters = searchParameters;
}
开发者ID:Condeti,项目名称:spark,代码行数:8,代码来源:Pager.cs
示例13: 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
示例14: 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
示例15: Validate
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var result = new List<ValidationResult>();
result.AddRange(base.Validate(validationContext));
if (!result.Any()) result.Add(ValidationResult.Success);
return result;
}
开发者ID:rootdeveloper,项目名称:fhir-dstu1,代码行数:9,代码来源:DeletedEntry.cs
示例16: 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
示例17: Validate
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var result = new List<ValidationResult>();
foreach (var tag in Category)
result.AddRange(tag.Validate(validationContext));
return result;
}
开发者ID:nagyistoce,项目名称:kevinpeterson-fhir,代码行数:9,代码来源:TagList.cs
示例18: GetPatientsByName
public IEnumerable<Patient> GetPatientsByName(string firstName, string lastName)
{
var searchParameters = new SearchParams();
searchParameters.Add("Given", firstName);
searchParameters.Add("Family", lastName);
var matches = new List<Patient>();
var result = _client.Search(searchParameters, ResourceType.Patient.ToString());
return result.Entry.Select(x => (Patient) x.Resource);
}
开发者ID:ninjabarman,项目名称:FHIR_Test_Client,代码行数:10,代码来源:PatientService.cs
示例19: Chain
public Chain(string path)
{
List<string> chain = SplitPath(path);
// Keep the typename separate.
var typeName = chain.First();
chain.RemoveAt(0);
segments = BuildSegments(typeName, chain);
}
开发者ID:Condeti,项目名称:spark,代码行数:10,代码来源:ElementQuery.cs
示例20: 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
注:本文中的Hl7.Fhir.Model.List类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论