Beispiel #1
0
        public IResourceServiceOutcome OperationGetResourceInstanceWithParameters(string BaseRequestUri, HttpRequestMessage Request, string ResourceName, string operation, string FhirId)
        {
            using (DbContextTransaction Transaction = IUnitOfWork.BeginTransaction())
            {
                try
                {
                    IRequestServiceRootValidate.Validate(BaseRequestUri);
                    IRequestMeta RequestMeta = IRequestMetaFactory.CreateRequestMeta().Set(Request);
                    IFhirResourceInstanceOperationService FhirResourceInstanceOperationService = IFhirResourceInstanceOperationServiceFactory.CreateFhirResourceInstanceOperationService();
                    IResourceServiceOutcome ResourceServiceOutcome = FhirResourceInstanceOperationService.ProcessGet(ResourceName, FhirId, operation, RequestMeta);
                    ResourceServiceOutcome.SummaryType = RequestMeta.SearchParameterGeneric.SummaryType;
                    if (ResourceServiceOutcome.SuccessfulTransaction)
                    {
                        Transaction.Commit();
                    }
                    else
                    {
                        Transaction.Rollback();
                    }

                    return(ResourceServiceOutcome);
                }
                catch (Exception Exec)
                {
                    Transaction.Rollback();
                    ILog.Error(Exec, $"PyroService.ResourceInstanceOperationWithParameters, Request: {Request.RequestUri.OriginalString}");
                    throw new PyroException(System.Net.HttpStatusCode.InternalServerError,
                                            Common.Tools.FhirOperationOutcomeSupport.Create(OperationOutcome.IssueSeverity.Error, OperationOutcome.IssueType.Exception, Exec.Message), Exec.Message);
                }
            }
        }
Beispiel #2
0
 public SetCompartmentDefinitionTaskProcessor(ILog ILog,
                                              IUnitOfWork IUnitOfWork,
                                              IRequestMetaFactory IRequestMetaFactory,
                                              IResourceServices IResourceServices,
                                              IFhirTaskTool IFhirTaskTool,
                                              Common.PyroHealthFhirResource.CodeSystems.IPyroFhirServer IPyroFhirServerCodeSystem,
                                              Common.PyroHealthFhirResource.ICompartmentDefinition ICompartmentDefinition,
                                              IFhirResourceInstanceOperationService IFhirResourceInstanceOperationService)
 {
     this.ILog                                  = ILog;
     this.IUnitOfWork                           = IUnitOfWork;
     this.IRequestMetaFactory                   = IRequestMetaFactory;
     this.IResourceServices                     = IResourceServices;
     this.IFhirTaskTool                         = IFhirTaskTool;
     this.IPyroFhirServerCodeSystem             = IPyroFhirServerCodeSystem;
     this.ICompartmentDefinition                = ICompartmentDefinition;
     this.IFhirResourceInstanceOperationService = IFhirResourceInstanceOperationService;
 }