public static Conformance AddOperationDefintion(this Conformance conformance, IEnumerable <IFhirService> services) { var operationComponents = new List <Conformance.OperationComponent>(); foreach (var service in services) { var queryService = service; var operationDefintion = queryService?.GetOperationDefinition(); if (!string.IsNullOrEmpty(operationDefintion?.Url)) { operationComponents.Add(new Conformance.OperationComponent { Name = operationDefintion.Name, Definition = new ResourceReference { Reference = operationDefintion.Url } }); } } if (operationComponents.Count > 0) { conformance.Server().Operation.AddRange(operationComponents); } return(conformance); }
public static void AddOperation(this Conformance conformance, String name, ResourceReference definition) { var operation = new Conformance.OperationComponent(); operation.Name = name; operation.Definition = definition; conformance.Server().Operation.Add(operation); }
public static Conformance AddSingleResourceComponent(this Conformance conformance, String resourcetype, Boolean readhistory, Boolean updatecreate, Conformance.ResourceVersionPolicy versioning, ResourceReference profile = null) { var resource = new Conformance.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 Conformance AddSingleResourceComponent(this Conformance conformance, string resourcetype, bool readhistory, bool updatecreate, Conformance.ResourceVersionPolicy versioning, ResourceReference profile = null) { var resource = new Conformance.ResourceComponent { Type = (ResourceType)Enum.Parse(typeof(ResourceType), resourcetype, true), Profile = profile, ReadHistory = readhistory, UpdateCreate = updatecreate, Versioning = versioning }; conformance.Server().Resource.Add(resource); return(conformance); }