コード例 #1
0
ファイル: MongoFhirStore.cs プロジェクト: schellack/spark
 private static void AddMetaData(BsonDocument document, BundleEntry entry)
 {
     document[Field.VERSIONID]   = entry.Links.SelfLink.ToString();
     document[Field.ENTRYTYPE]   = entry.TypeName();
     document[Field.COLLECTION]  = entry.GetResourceTypeName();
     document[Field.VERSIONDATE] = GetVersionDate(entry) ?? DateTime.UtcNow;
 }
コード例 #2
0
ファイル: KeyExtensions.cs プロジェクト: schellack/spark
        public static bool HasValidLocalKey(BundleEntry entry)
        {
            string type = entry.GetResourceTypeName();
            Uri    id   = entry.Id;

            return(Key.IsValidLocalKey(id, type));
        }
コード例 #3
0
        private static bool requiresVersionAwareUpdate(BundleEntry entry)
        {
            // todo: question: Should this not be implemented somewhere else? (metadata?) /mh
            // answer: move to Config file.
            string collection = entry.GetResourceTypeName();

            return(collection == "Organization");
        }
コード例 #4
0
        private Uri internalizeKey(BundleEntry entry)
        {
            Uri key = entry.Id;

            if (Key.IsCID(key))
            {
                string type = entry.GetResourceTypeName();
                string _id  = generator.NextKey(type);
                return(ResourceIdentity.Build(type, _id).OperationPath);
            }
            else if (Key.IsHttpScheme(key))
            {
                AssertKeyAllowed(key);
                return(key.GetOperationpath());
            }
            else
            {
                throw new SparkException((HttpStatusCode)422, "Id is not a http location or a CID: " + key.ToString());
            }
        }