public HttpResponseMessage GetImplementationGuide( int implementationGuideId, [FromUri(Name = "_format")] string format = null, [FromUri(Name = "_summary")] fhir_stu3.Hl7.Fhir.Rest.SummaryType?summary = null) { var uri = HttpContext.Current != null && HttpContext.Current.Request != null ? HttpContext.Current.Request.Url : new Uri(AppSettings.DefaultBaseUrl); var implementationGuide = this.tdb.ImplementationGuides.Single(y => y.Id == implementationGuideId); SimpleSchema schema = SimplifiedSchemaContext.GetSimplifiedSchema(HttpContext.Current.Application, implementationGuide.ImplementationGuideType); ImplementationGuideExporter exporter = new ImplementationGuideExporter(this.tdb, schema, uri.Scheme, uri.Authority); FhirImplementationGuide response = exporter.Convert(implementationGuide, summary); return(Shared.GetResponseMessage(this.Request, format, response)); }
public HttpResponseMessage CreateImplementationGuide( [FromBody] FhirImplementationGuide fhirImplementationGuide, [FromUri(Name = "_format")] string format = null) { ImplementationGuide ig = this.tdb.ImplementationGuides.SingleOrDefault(y => y.Name.ToLower() == fhirImplementationGuide.Name.ToLower()); if (ig != null) { throw new Exception("The implementation guide already exists. Use PUT to update the implementation guide instead."); } ig = new ImplementationGuide() { Name = fhirImplementationGuide.Name }; throw new NotImplementedException(); }
public HttpResponseMessage UpdateImplementationGuide( [FromUri] int implementationGuideId, [FromBody] FhirImplementationGuide implementationGuide) { ImplementationGuide ig = this.tdb.ImplementationGuides.SingleOrDefault(y => y.Id == implementationGuideId); if (ig == null) { throw new Exception("The implementation guide does not exist"); } if (!CheckPoint.Instance.GrantEditImplementationGuide(ig.Id)) { throw new UnauthorizedAccessException("You do not have permissions to edit this implementation guide"); } throw new NotImplementedException(); }