本文整理汇总了C#中Hl7.Fhir.Model.List类的典型用法代码示例。如果您正苦于以下问题:C# List类的具体用法?C# List怎么用?C# List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
List类属于Hl7.Fhir.Model命名空间,在下文中一共展示了List类的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()
});
}
}
示例2: Import
public Import(ILocalhost localhost, IGenerator generator)
{
this.localhost = localhost;
this.generator = generator;
mapper = new Mapper<Key, Key>();
interactions = new List<Interaction>();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例7: SearchParams
public SearchParams()
{
Include = new List<string>();
RevInclude = new List<string>();
Sort = new List<Tuple<string, SortOrder>>();
Parameters = new List<Tuple<string, string>>();
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}