public ServerFhirResponse Update(string type, Resource resource, string id = null)
        {
            string versionid = FhirHttpUtil.IfMatchVersionId(HttpContext.Request);
            Key    key       = Key.Create(type, id, versionid);

            if (key.HasResourceId())
            {
                return(fhirService.Update(key, resource));
            }
            else
            {
                SearchParams searchparams = SearchParams.FromUriParamList(HttpHeaderUtil.TupledParameters(HttpContext.Request));
                return(fhirService.ConditionalUpdate(key, resource, searchparams));
            }
        }
Esempio n. 2
0
        public FhirResponse Update(string type, Resource resource, string id = null)
        {
            string versionid = Request.IfMatchVersionId();
            Key    key       = Key.Create(type, id, versionid);

            if (key.HasResourceId())
            {
                return(_fhirService.Update(key, resource));
            }
            else
            {
                return(_fhirService.ConditionalUpdate(key, resource,
                                                      SearchParams.FromUriParamList(Request.TupledParameters())));
            }
        }
Esempio n. 3
0
        public ActionResult <FhirResponse> Update(string type, Resource resource, string id = null)
        {
            string versionId = Request.GetTypedHeaders().IfMatch?.FirstOrDefault()?.Tag.Buffer;
            Key    key       = Key.Create(type, id, versionId);

            if (key.HasResourceId())
            {
                Request.TransferResourceIdIfRawBinary(resource, id);

                return(new ActionResult <FhirResponse>(_fhirService.Update(key, resource)));
            }
            else
            {
                return(new ActionResult <FhirResponse>(_fhirService.ConditionalUpdate(key, resource,
                                                                                      SearchParams.FromUriParamList(Request.TupledParameters()))));
            }
        }