Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public static FhirResponse WithBundle(IEnumerable<Interaction> interactions, Uri serviceBase)
 {
     Bundle bundle = new Bundle();
     bundle.Append(interactions);
     return WithBundle(bundle, serviceBase);
 }
Ejemplo n.º 3
0
        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;
        }