/// <summary>
 /// number 可以是empiid 或者身份证号
 /// </summary>
 /// <param name="number"></param>
 /// <returns></returns>
 public JsonResult SearchPatientData(string number, string numberType)
 {
     try
     {
         _logRepository.Add("查询患者就诊记录", "", $"number:{number},numberType:{numberType}");
         var patientOverview = _rdrDataRepository.GetPatientOverview(number, numberType);
         if (patientOverview.Any())
         {
             number = patientOverview.FirstOrDefault().EMPINumber;
         }
         var patientVisitList = _rdrDataRepository.GetPatientVisitList(number);
         return(Json(new { success = true, patientOverview, patientVisitList, total = patientVisitList.Count }));
     }
     catch (Exception ex)
     {
         _logger.LogError("查询患者就诊记录:" + ex.ToString());
         return(Json(new { success = false, msg = ex.ToString() }));
     }
 }
Beispiel #2
0
        public JsonResult GetRareDiseaseByNumber(string number, string numberType, string nlpEngine, string analyzeEngine, string database, string appName)
        {
            try
            {
                var request = new RareDiseaseRequestModel();
                request.Number             = number;
                request.NumberType         = numberType;
                request.NlpEngine          = nlpEngine;
                request.RareAnalyzeEngine  = analyzeEngine;
                request.RareDataBaseEngine = database;
                request.AppName            = appName;
                var ipAddress = HttpContext.Connection.RemoteIpAddress;
                request.IPAddress = ipAddress.ToString();
                if (request.NumberType == "card")
                {
                    var patientOverview = _rdrDataRepository.GetPatientOverview(request.Number, request.NumberType);
                    if (patientOverview.Any())
                    {
                        request.Number = patientOverview.FirstOrDefault().EMPINumber;
                    }
                }
                var patientVisitList = _rdrDataRepository.GetPatientVisitList(request.Number);

                var patientVisitIds = string.Join(",", patientVisitList.Select(x => x.VisitId));
                var emrDetail       = string.Join(",", patientVisitList.Select(x => x.DiagDesc));
                var hpoList         = _nLPSystemRepository.GetPatientHPOResult(request.NlpEngine, emrDetail, patientVisitIds);
                var rareDiseaseList = _nLPSystemRepository.GetPatientRareDiseaseResult(hpoList, request.RareAnalyzeEngine, request.RareDataBaseEngine);
                _logRepository.Add(appName + ":调用接口 GetRareDiseaseByNumber", "API", $"输入参数:{JsonConvert.SerializeObject(request)} 返回数据:{JsonConvert.SerializeObject(rareDiseaseList)}");

                return(Json(new { result = "ok", Response = rareDiseaseList }));
            }
            catch (Exception ex)
            {
                _logger.LogError("API GetRareDiseaseByNumber:" + ex.ToString());
                return(Json(new { result = "ok", Response = new { errorCode = "500", errorText = ex.ToString() } }));
            }
        }