Пример #1
0
 public JsonResult GetPatientEMRDetail(string patientVisitIds)
 {
     try
     {
         _logRepository.Add("获取患者电子病历文本", "", $"patientVisitIds:{patientVisitIds}");
         var data = _rdrDataRepository.GetEmrForNLP(patientVisitIds);
         return(Json(new { success = true, data }));
     }
     catch (Exception ex)
     {
         _logger.LogError("获取患者电子病历文本:" + ex.ToString());
         return(Json(new { success = false, msg = ex.ToString() }));
     }
 }
Пример #2
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() }));
     }
 }