public static CapabilityStatement AddAllCoreResources(
            this CapabilityStatement capabilityStatement,
            bool readhistory,
            bool updatecreate,
            CapabilityStatement.ResourceVersionPolicy versioning)
        {
            foreach (var resource in ModelInfo.SupportedResources)
            {
                capabilityStatement.AddSingleResourceComponent(resource, readhistory, updatecreate, versioning);
            }

            return(capabilityStatement);
        }
        public static CapabilityStatement AddSingleResourceComponent(
            this CapabilityStatement capabilityStatement,
            string resourcetype,
            bool readhistory,
            bool updatecreate,
            CapabilityStatement.ResourceVersionPolicy versioning,
            Canonical profile = null)
        {
            var resource = new CapabilityStatement.ResourceComponent
            {
                Type         = Hacky.GetResourceTypeForResourceName(resourcetype),
                Profile      = profile,
                ReadHistory  = readhistory,
                UpdateCreate = updatecreate,
                Versioning   = versioning
            };

            capabilityStatement.Server().Resource.Add(resource);
            return(capabilityStatement);
        }
        public static CapabilityStatement AddUsedResources(this CapabilityStatement capabilityStatement,
                                                           IEnumerable <IFhirService> services, bool readhistory, bool updatecreate,
                                                           CapabilityStatement.ResourceVersionPolicy versioning)
        {
            //   var totalAvailableResources = new List<string>();
            //foreach (var service in services)
            //{
            //    var resourcesService = service;
            //    if (resourcesService != null)
            //    {
            //        totalAvailableResources.AddRange(resourcesService.GetSupportedResources());
            //    }
            //}

            //foreach (var resource in totalAvailableResources)
            //{
            //    capabilityStatement.AddSingleResourceComponent(resource, readhistory, updatecreate, versioning);
            //}
            return(capabilityStatement);
        }
        public static CapabilityStatement AddSingleResourceComponent(this CapabilityStatement conformance, String resourcetype, Boolean readhistory, Boolean updatecreate, CapabilityStatement.ResourceVersionPolicy versioning, ResourceReference profile = null)
        {
            var resource = new CapabilityStatement.ResourceComponent();

            resource.Type         = Hacky.GetResourceTypeForResourceName(resourcetype);
            resource.Profile      = profile;
            resource.ReadHistory  = readhistory;
            resource.UpdateCreate = updatecreate;
            resource.Versioning   = versioning;
            conformance.Server().Resource.Add(resource);
            return(conformance);
        }
 public static CapabilityStatement AddMultipleResourceComponents(this CapabilityStatement conformance, List <String> resourcetypes, Boolean readhistory, Boolean updatecreate, CapabilityStatement.ResourceVersionPolicy versioning)
 {
     foreach (var type in resourcetypes)
     {
         AddSingleResourceComponent(conformance, type, readhistory, updatecreate, versioning);
     }
     return(conformance);
 }
        public static CapabilityStatement AddSingleResourceComponent(this CapabilityStatement capabilityStatement, string resourcetype, bool readhistory, bool updatecreate, CapabilityStatement.ResourceVersionPolicy versioning, ResourceReference profile = null)
        {
            var resource = new CapabilityStatement.ResourceComponent
            {
                Type         = (ResourceType)Enum.Parse(typeof(ResourceType), resourcetype, true),
                Profile      = profile,
                ReadHistory  = readhistory,
                UpdateCreate = updatecreate,
                Versioning   = versioning
            };

            capabilityStatement.Server().Resource.Add(resource);
            return(capabilityStatement);
        }