Exemplo n.º 1
0
        public async Task <IActionResult> SendManifest([FromBody] CombinedSendManifestDto packageDto)
        {
            if (!packageDto.IsValid())
            {
                return(BadRequest());
            }

            string version = GetType().Assembly.GetName().Version.ToString();

            await _mediator.Publish(new ExtractSent("CareTreatment", version));

            try
            {
                if (!packageDto.SendMpi)
                {
                    var result = await _dwhSendService.SendManifestAsync(packageDto.DwhPackage, _version);

                    return(Ok(result));
                }

                var mpiTask = await _cbsSendService.SendManifestAsync(packageDto.MpiPackage, _version);

                var dwhTask = await _dwhSendService.SendManifestAsync(packageDto.DwhPackage, _version);

                return(Ok());
            }
            catch (Exception e)
            {
                var msg = $"Error sending  Manifest {e.Message}";
                Log.Error(e, msg);
                return(StatusCode(500, msg));
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> SendManifest([FromBody] CombinedSendManifestDto packageDto)
        {
            if (!packageDto.IsValid())
            {
                return(BadRequest());
            }
            try
            {
                if (!packageDto.SendMpi)
                {
                    var result = await _dwhSendService.SendManifestAsync(packageDto.DwhPackage);

                    return(Ok(result));
                }
                var mpiTask = _cbsSendService.SendManifestAsync(packageDto.MpiPackage);
                var dwhTask = await _dwhSendService.SendManifestAsync(packageDto.DwhPackage);

                return(Ok());
            }
            catch (Exception e)
            {
                var msg = $"Error sending  Manifest {e.Message}";
                Log.Error(e, msg);
                return(StatusCode(500, msg));
            }
        }
Exemplo n.º 3
0
        public void should_Send_Manifest()
        {
            var sendTo = new SendManifestPackageDTO(_registry);

            var responses = _dwhSendService.SendManifestAsync(sendTo, _bag).Result;

            Assert.NotNull(responses);
            Assert.False(responses.Select(x => x.IsValid()).Any(x => false));
            foreach (var sendManifestResponse in responses)
            {
                Console.WriteLine(sendManifestResponse);
            }
        }
Exemplo n.º 4
0
        public async Task <IActionResult> SendManifest([FromBody] SendManifestPackageDTO packageDTO)
        {
            if (!packageDTO.IsValid())
            {
                return(BadRequest());
            }
            try
            {
                await _dwhSendService.SendManifestAsync(packageDTO);

                return(Ok());
            }
            catch (Exception e)
            {
                var msg = $"Error sending  Manifest {e.Message}";
                Log.Error(e, msg);
                return(StatusCode(500, msg));
            }
        }