Ejemplo n.º 1
0
        public LoadCentralLabResponse GetCentralLab(int chcId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var centralLab = _webMasterService.RetrieveCentralLabbyCHC(chcId);

                _logger.LogInformation($"Received central lab master data by chc {centralLab}");
                return(centralLab.Count == 0 ?
                       new LoadCentralLabResponse {
                    Status = "true", Message = "No record found", CentalLab = new List <LoadCentralLab>()
                }
                    : new LoadCentralLabResponse {
                    Status = "true", Message = string.Empty, CentalLab = centralLab
                });
            }
            catch (Exception e)
            {
                _logger.LogError($"Error in receiving central lab master data by chc {e.StackTrace}");
                return(new LoadCentralLabResponse {
                    Status = "false", Message = e.Message, CentalLab = null
                });
            }
        }