Exemplo n.º 1
0
 public JsonResult GetPatientEMRTextAll()
 {
     try
     {
         var fileName  = _config.GetValue <string>("GlobalSetting:BatchExcelPath");
         var visitList = BatchTaskHandler.ReadVisitExcel(fileName);
         int count     = 0;
         _logger.LogError($"批量导入开始");
         foreach (var r in visitList)
         {
             _logger.LogError($":第{count}条记录");
             try
             {
                 r.VisitId = _rdrDataRepository.GetVisitIdByNumber(r.VisitNumber);
                 r.EMR     = _rdrDataRepository.GetFullEmrAll(r.VisitId);
                 r.Done    = "yes";
             }
             catch (Exception ex)
             {
                 _logger.LogError($":第{count}条记录,发生错误:" + ex.ToString());
                 r.Done = "no";
             }
             count++;
         }
         BatchTaskHandler.UpdateVisitEMRExcel(fileName, visitList);
         _logger.LogError($"批量导入结束");
         return(Json(new { success = true, data = "成功", }));
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, msg = ex.ToString() }));
     }
 }
Exemplo n.º 2
0
        public JsonResult CombineExcelDatabaseEram()
        {
            try
            {
                var fileName = _config.GetValue <string>("GlobalSetting:BatchExcelPath");
                BatchTaskHandler.CombineExcelHPO(fileName);

                return(Json(new { success = true, data = "成功", }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, msg = ex.ToString() }));
            }
        }
Exemplo n.º 3
0
 public JsonResult GetPatientHPOResultList()
 {
     try
     {
         var fileName  = _config.GetValue <string>("GlobalSetting:BatchExcelPath");
         var visitList = BatchTaskHandler.ReadVisitExcel(fileName);
         int count     = 0;
         _logger.LogError($"批量导入开始");
         foreach (var r in visitList)
         {
             _logger.LogError($":第{count}条记录");
             try
             {
                 r.VisitId = _rdrDataRepository.GetVisitIdByNumber(r.VisitNumber);
                 var patientEMRDetail = _rdrDataRepository.GetEmrForNLP(r.VisitId);
                 patientEMRDetail = HttpUtility.UrlEncode(patientEMRDetail);
                 var hpoList = _nLPSystemRepository.GetNlpHPOResultBatch(patientEMRDetail);
                 if (hpoList != null && hpoList.Any())
                 {
                     r.NlpHpoListStr = string.Join(",", hpoList.Select(x => x.HPOId).ToList());
                 }
                 var examHpo = _rdrDataRepository.GetExamHPOResultBatch(r.VisitId);
                 if (examHpo != null && examHpo.Any())
                 {
                     r.ExamHpoListStr = string.Join(",", examHpo.Select(x => x.HPOId).ToList());
                 }
                 r.Done = "yes";
             }
             catch (Exception ex)
             {
                 _logger.LogError($":第{count}条记录,发生错误:" + ex.ToString());
                 r.Done = "no";
             }
             count++;
         }
         BatchTaskHandler.UpdateVisitExcel(fileName, visitList);
         _logger.LogError($"批量导入结束");
         return(Json(new { success = true, data = "成功", }));
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, msg = ex.ToString() }));
     }
 }