public Bundle CreateBundle(Snapshot snapshot, int start, int count) { Bundle bundle = new Bundle(); bundle.Type = snapshot.Type; bundle.Total = snapshot.Count; bundle.Id = UriHelper.CreateUuid().ToString(); IList<string> keys = snapshot.Keys.Skip(start).Take(count).ToList(); IList<Interaction> interactions = store.Get(keys, snapshot.SortBy).ToList(); transfer.Externalize(interactions); bundle.Append(interactions); Include(bundle, snapshot.Includes); BuildLinks(bundle, snapshot, start, count); return bundle; }
public static FhirResponse WithBundle(IEnumerable<Interaction> interactions, Uri serviceBase) { Bundle bundle = new Bundle(); bundle.Append(interactions); return WithBundle(bundle, serviceBase); }
public Bundle CreateBundle(Snapshot snapshot, int? start = null) { Bundle bundle = new Bundle(); bundle.Type = snapshot.Type; bundle.Total = snapshot.Count; bundle.Id = UriHelper.CreateUuid().ToString(); IEnumerable<string> keysInBundle = snapshot.Keys; if (start.HasValue) { keysInBundle = keysInBundle.Skip(start.Value); } IList<string> keys = keysInBundle.Take(snapshot.CountParam??DEFAULT_PAGE_SIZE).ToList(); IList<Interaction> interactions = fhirStore.Get(keys, snapshot.SortBy).ToList(); IList<Interaction> included = GetIncludesRecursiveFor(interactions, snapshot.Includes); interactions.Append(included); transfer.Externalize(interactions); bundle.Append(interactions); BuildLinks(bundle, snapshot, start); return bundle; }