Exemple #1
0
        public FhirResponse Update(string type, string id, Resource resource)
        {
            string versionid = Request.IfMatchVersionId();
            Key    key       = Key.Create(type, id, versionid);

            return(service.Update(key, resource));
        }
Exemple #2
0
        public FhirResponse Update(string type, string id, Resource resource)
        {
            //string xml = FhirSerializer.SerializeResourceToXml(resource);
            // DSTU2: tags
            //entry.Tags = Request.GetFhirTags(); // todo: move to model binder?
            string versionid = Request.IfMatchVersionId();
            Key    key       = Key.Create(type, id, versionid);

            return(service.Update(key, resource));
        }
Exemple #3
0
        public HttpResponseMessage Upsert(string type, string id, ResourceEntry entry)
        {
            entry.Tags = Request.GetFhirTags(); // todo: move to model binder?

            if (service.Exists(type, id))
            {
                ResourceEntry newEntry = service.Update(entry, type, id);
                return(Request.StatusResponse(newEntry, HttpStatusCode.OK));
            }
            else
            {
                ResourceEntry newEntry = service.Create(entry, type, id);
                return(Request.StatusResponse(newEntry, HttpStatusCode.Created));
            }
        }