Example #1
0
        public async Task <IActionResult> Load()
        {
            var emr = _emrManagerService.GetDefault();

            LoadMtsExtracts request = new LoadMtsExtracts()
            {
                LoadMtsFromEmrCommand = new LoadMtsFromEmrCommand()
                {
                    Extracts         = emr.Extracts.Where(x => x.DocketId == "MTS").ToList(),
                    DatabaseProtocol = emr.DatabaseProtocols.FirstOrDefault()
                }
            };

            string version = GetType().Assembly.GetName().Version.ToString();
            await _mediator.Publish(new ExtractLoaded("MetricService", version));

            var result = await _mediator.Send(request.LoadMtsFromEmrCommand, HttpContext.RequestAborted);

            await _mediator.Send(new InitAppVerCheck());

            await _mediator.Send(new PerformCheck(emr.Id, CheckStage.PreSend, version));

            return(Ok(result));
        }
Example #2
0
        public IActionResult GetDefault()
        {
            try
            {
                var emrSystem = _emrManagerService.GetDefault();

                if (null == emrSystem)
                {
                    return(NotFound());
                }

                return(Ok(emrSystem));
            }
            catch (Exception e)
            {
                var msg = $"Error loading {nameof(EmrSystem)}(s)";
                Log.Error(msg);
                Log.Error($"{e}");
                return(StatusCode(500, msg));
            }
        }
        public async Task <IActionResult> LiveUpdate()
        {
            try
            {
                var emr = _emrManagerService.GetDefault();

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

                var result = await _mediator.Send(new InitAppVerCheck());

                if (result.IsSuccess)
                {
                    await _mediator.Send(new PerformSingleCheck(emr.Id, CheckStage.PreSend, version, new Guid("d05864e8-678a-11eb-ae93-0242ac130002")));
                }
            }
            catch (Exception e)
            {
                Log.Warning(e.Message);
            }

            return(Ok());
        }