| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -111,283 +111,6 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        #region hide
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// 医生诊台生成小结
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <param name="input"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //[HttpPost("api/app/diagnosisfunction/getdiagnosisresult")]
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //public async Task<List<GetDiagnosisResultDto>> GetDiagnosisResultAsync(GetDiagnosisResultRequestDto input)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //{
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    var reslist = new List<GetDiagnosisResultDto>();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    var registerAsbitems = from a in await _registerAsbitemRepository.GetListAsync()
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                           join b in await _asbitemRepository.GetListAsync() on a.AsbitemId equals b.Id into bb
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                           from ab in bb.DefaultIfEmpty()
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                           where a.PatientRegisterId == input.PatientRegisterId
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                           select ab;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    foreach (var item in registerAsbitems)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        if (item.IsDiagnosisFunction == 'Y' && !string.IsNullOrEmpty(item.DiagnosisFunction))
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            if (item.DisplayName == "身高体重")
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                var res = await GetDiagnosisResultInAsbitemHeightAsync(input, item.DiagnosisFunction, item.IsContinueProcess);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                if (res.Count > 0)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                    reslist.AddRange(res);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    return reslist;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //}
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /////  组合函数 身高体重 生成
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <param name="input"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <param name="DiagnosisFunction">诊断函数</param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <param name="IsContinueProcess">处理完是否继续执行项目的诊断函数</param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ///// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //private async Task<List<GetDiagnosisResultDto>> GetDiagnosisResultInAsbitemHeightAsync(GetDiagnosisResultRequestDto input, string DiagnosisFunction, char IsContinueProcess)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //{
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    var reslist = new List<GetDiagnosisResultDto>();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    if (input.Items.Count > 0)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        var itemList = await _itemRepository.GetListAsync();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        string DiagnosisFunctionCode = DiagnosisFunction;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        foreach (var item in input.Items)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            if (item.ItemId != null)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                var itement = itemList.Where(m => m.Id == item.ItemId).FirstOrDefault();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                if (itement != null)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                    DiagnosisFunctionCode = DiagnosisFunctionCode.Replace($"[{itement.DisplayName}]", item.Result);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        ////拼接动态代码
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //string code = @"
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //          using System;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //          namespace Shentun.Peis
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //          {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //              public class DiagnosisResultInAsbitemHeight
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //              {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //                  public string AutoDiagnosisResultInAsbitemHeight()
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //                  {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //                     var msg="""";"
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //                         + DiagnosisFunctionCode + @"
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //                     return msg;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //                  }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //              }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //          }";
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        //拼接动态代码
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        string code = @"
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                      public class DiagnosisResultInAsbitemHeight
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                      {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                          public string AutoDiagnosisResultInAsbitemHeight()
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                          {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                             var msg="""";"
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                                 + DiagnosisFunctionCode + @"
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                             return msg;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                          }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                      }";
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        CompileHelper compileHelper = new CompileHelper();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        var assembly = compileHelper.GenerateAssemblyFromCode(code, Assembly.Load(new AssemblyName("System.Runtime")), typeof(object).Assembly);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        if (assembly != null)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            // 反射获取程序集中 的类
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            Type type = assembly.GetType("DiagnosisResultInAsbitemHeight");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            // 创建该类的实例
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            object obj = Activator.CreateInstance(type);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            var msg = type.InvokeMember("AutoDiagnosisResultInAsbitemHeight",
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                   BindingFlags.Default | BindingFlags.InvokeMethod,
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                   null,
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                   obj,
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                   null);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            if (!string.IsNullOrEmpty(msg.ToString()))
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            {
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //                reslist.Add(new GetDiagnosisResultDto { DiagnosisResult = msg.ToString() });
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //            }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //        }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    }
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //    return reslist;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //}
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        #endregion
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 医生诊台生成小结
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="input"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        [HttpPost("api/app/diagnosisfunction/getdiagnosisresult")] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        [RemoteService(false)] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        public async Task<OkObjectResult> GetDiagnosisResultAsync(GetDiagnosisResultRequestDto input) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new Exception("禁止使用"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var reslist = new List<GetDiagnosisResult_Detail>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var suggestionlist = new List<GetDiagnosisSuggestion_Detail>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // await GetCalculationFunctionAsync(input);    //取消计算函数计算
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //根据检查单ID查询
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var query = (from a in await _registerCheckRepository.GetQueryableAsync() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         join b in await _registerAsbitemRepository.GetQueryableAsync() on a.Id equals b.RegisterCheckId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         join c in await _registerCheckItemRepository.GetQueryableAsync() on a.Id equals c.RegisterCheckId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         join d in await _asbitemRepository.GetQueryableAsync() on b.AsbitemId equals d.Id | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         join e in (await _itemRepository.GetQueryableAsync()).Include(x => x.ReferenceRanges) on c.ItemId equals e.Id | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         join f in await _patientRegisterRepository.GetQueryableAsync() on b.PatientRegisterId equals f.Id | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         where a.Id == input.RegisterCheckId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         select new { a, b, c, d, e, f }).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<string> diagnosisTrips = new List<string>(); //异常提示
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (query.Count() > 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //组合项目数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //  var asbitem_Data = query.GroupBy(g => g.b.Id).Select(s=>new )
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                var asbitem_Group = query.GroupBy(g => g.b.Id); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //正常是一个,合并过项目可能存在多个
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                foreach (var item in asbitem_Group) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    var asbitem_data = item.Select(s => s.d).FirstOrDefault();  //组合项目信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    var item_datas = item.Select(s => s.e).ToList(); //项目信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    var patientRegister_data = item.Select(s => s.f).FirstOrDefault(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    //是否开启组合项目诊断函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (asbitem_data.IsDiagnosisFunction == 'Y' && !string.IsNullOrEmpty(asbitem_data.DiagnosisFunction)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        var res = await GetDiagnosisResultInAsbitemAsync(input, asbitem_data, item_datas, patientRegister_data, diagnosisTrips); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (res.Count > 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            reslist.AddRange(res); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        //查找项目诊断函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        var itemResult = await GetDiagnosisResultInItemAsync(input, item_datas, patientRegister_data, diagnosisTrips); //执行项目诊断函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (itemResult.Any()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            reslist.AddRange(itemResult); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (!reslist.Any()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        //未生成小结,继续根据参考范围生成
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        foreach (var item_data in item_datas) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            if (item_data.IsProduceSummary == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                string itemResult_Request = input.Items.Where(m => m.ItemId == item_data.Id).FirstOrDefault()?.Result;   //项目结果
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                string referenceRangesResult = await GetDiagnosisResultInReferenceRangesAsync(item_data, itemResult_Request, patientRegister_data, diagnosisTrips); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                if (!string.IsNullOrEmpty(referenceRangesResult)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    if (item_data.IsNameIntoSummary == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                        referenceRangesResult = item_data.DisplayName + referenceRangesResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    reslist.Add(new GetDiagnosisResult_Detail { DiagnosisResult = referenceRangesResult }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //无结果  加未见异常
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!reslist.Any()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                reslist.Add(new GetDiagnosisResult_Detail { DiagnosisResult = "未见异常" }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //小结内容去重
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                reslist = reslist.Where((x, i) => reslist.FindIndex(z => z.DiagnosisResult == x.DiagnosisResult) == i).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //生成建议
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                var suggestion_query = from a in await _suggestionRepository.GetQueryableAsync() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                       join b in await _diagnosisRepository.GetQueryableAsync() on a.DiagnosisId equals b.Id | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                       where reslist.Select(s => s.DiagnosisResult).Contains(b.DisplayName) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                       select a; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (suggestion_query.Count() > 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    suggestionlist = suggestion_query.Select(s => new GetDiagnosisSuggestion_Detail | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        DiagnosisSuggestion = s.SuggestionContent | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    }).ToList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            string diagnosisTrip = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (diagnosisTrips.Any()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                diagnosisTrip = string.Join(",", diagnosisTrips.Distinct().ToList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var resdto = new GetDiagnosisResultDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                DiagnosisResultDetails = reslist, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                DiagnosisSuggestionDetails = suggestionlist, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!string.IsNullOrEmpty(diagnosisTrip)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return new OkObjectResult(CustomerReturnValue.CreateInstance(0, diagnosisTrip, resdto)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return new OkObjectResult(CustomerReturnValue.CreateInstance(1, "Success", resdto)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 生成小结
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -539,26 +262,12 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            #region 处理危急值函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var isCritical = await GetPatientRegisterIsCriticalAsync(doctorCheckDiagnosisInput, resultDto); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var isFollowUp = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //随访
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                isFollowUp = await GetPatientRegisterIsFollowUpAsync(doctorCheckDiagnosisInput, resultDto); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                isFollowUp = true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<GetCriticalResultDto> criticalResultDtoList = new List<GetCriticalResultDto>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var isCritical = await GetPatientRegisterIsCriticalAsync(doctorCheckDiagnosisInput, resultDto, criticalResultDtoList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var isFollowUp = await GetPatientRegisterIsFollowUpAsync(doctorCheckDiagnosisInput, resultDto, criticalResultDtoList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            await HandCriticalResult(criticalResultDtoList, query[0].patientRegister.Id); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isCritical || isFollowUp) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //await CreateFollowUpAsync(query.First().patientRegister.Id);  //标记危急值 生成随访记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                await _followUpAppService.CreateAsync(new PatientRegisterIdInputDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    PatientRegisterId = query.First().patientRegister.Id | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            #endregion
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return resultDto; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1095,44 +804,6 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        #endregion
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 执行组合项目 诊断函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="input"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="asbitem_data"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="item_datas"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="patientRegister_data"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="diagnosisTrips"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task<List<GetDiagnosisResult_Detail>> GetDiagnosisResultInAsbitemAsync(GetDiagnosisResultRequestDto input, Asbitem asbitem_data, List<Item> item_datas, PatientRegister patientRegister_data, List<string> diagnosisTrips) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var reslist = new List<GetDiagnosisResult_Detail>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (input.Items.Count > 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //执行函数 返回结果
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                string DiagnosisFunctionResult_Asbitem = GetCodeResult(input, asbitem_data.DiagnosisFunction, item_datas); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (!string.IsNullOrEmpty(DiagnosisFunctionResult_Asbitem)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    reslist.Add(new GetDiagnosisResult_Detail | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        DiagnosisResult = DiagnosisFunctionResult_Asbitem | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //是否继续执行项目诊断函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (asbitem_data.IsContinueProcess == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    var itemResult = await GetDiagnosisResultInItemAsync(input, item_datas, patientRegister_data, diagnosisTrips); //执行项目诊断函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (itemResult.Any()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        reslist.AddRange(itemResult); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return reslist; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1582,14 +1253,16 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="doctorCheckDiagnosisInput"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="resultDto"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        public async Task<bool> GetPatientRegisterIsCriticalAsync( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            DoctorCheckDiagnosisInput doctorCheckDiagnosisInput, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            GetDiagnosisResultDto resultDto) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            GetDiagnosisResultDto resultDto, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<GetCriticalResultDto> criticalResultDtoList) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var isCritical = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = await GetAsbitemCriticalFunction(doctorCheckDiagnosisInput); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = GetAsbitemCriticalFunction(doctorCheckDiagnosisInput, criticalResultDtoList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1599,7 +1272,7 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var criticalFollowValueList = await _criticalFollowValueRepository.GetListAsync(m => m.CriticalFollowValueFlag == CriticalFollowValueFlag.Critical); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //检索项目函数+关键字
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = await GetItemCriticalFunction(doctorCheckDiagnosisInput, criticalFollowValueList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = GetItemCriticalFunction(doctorCheckDiagnosisInput, criticalFollowValueList, criticalResultDtoList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1627,14 +1300,16 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="doctorCheckDiagnosisInput"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="resultDto"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        public async Task<bool> GetPatientRegisterIsFollowUpAsync( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            DoctorCheckDiagnosisInput doctorCheckDiagnosisInput, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            GetDiagnosisResultDto resultDto) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            GetDiagnosisResultDto resultDto, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					             List<GetCriticalResultDto> criticalResultDtoList) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var isCritical = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = await GetAsbitemFollowUpFunction(doctorCheckDiagnosisInput); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = GetAsbitemFollowUpFunction(doctorCheckDiagnosisInput, criticalResultDtoList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1644,7 +1319,7 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var criticalFollowValueList = await _criticalFollowValueRepository.GetListAsync(m => m.CriticalFollowValueFlag == CriticalFollowValueFlag.FollowUp); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //检索项目函数+关键字
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = await GetItemFollowUpFunction(doctorCheckDiagnosisInput, criticalFollowValueList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            isCritical = GetItemFollowUpFunction(doctorCheckDiagnosisInput, criticalFollowValueList, criticalResultDtoList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1666,8 +1341,9 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 组合项目危急值函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="doctorCheckDiagnosisInput"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task<bool> GetAsbitemCriticalFunction(DoctorCheckDiagnosisInput doctorCheckDiagnosisInput) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private bool GetAsbitemCriticalFunction(DoctorCheckDiagnosisInput doctorCheckDiagnosisInput, List<GetCriticalResultDto> criticalResultDtoList) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bool isCritical = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var patientAsbitemDiagnosisInput = new PatientAsbitemDiagnosisInput() | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1695,9 +1371,14 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    isCritical = diagnosisBuilder.GetAsbitemCriticalResult(patientAsbitemDiagnosisInput, asbitem.DiagnosisFunction); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        await CreateRegisterCheckCritical(asbitem.RegisterCheckId, 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckCriticalResult(criticalResultDtoList, asbitem.RegisterCheckId, 'Y', 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        //await CreateRegisterCheckCritical(asbitem.RegisterCheckId, 'Y', "");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckCriticalResult(criticalResultDtoList, asbitem.RegisterCheckId, 'N', null, ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1709,10 +1390,12 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="doctorCheckDiagnosisInput"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalFollowValueList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task<bool> GetItemCriticalFunction( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private bool GetItemCriticalFunction( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            DoctorCheckDiagnosisInput doctorCheckDiagnosisInput, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<CriticalFollowValue> criticalFollowValueList | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<CriticalFollowValue> criticalFollowValueList, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<GetCriticalResultDto> criticalResultDtoList | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bool isCritical = false; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1746,9 +1429,15 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, 'Y', 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        //await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'Y', "");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, 'N', null, ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1763,9 +1452,14 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        isCritical = _registerCheckItemManager.GetNumberResultIsCritical(item.Result, referenceRange.CriticalRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, 'Y', 'Y', referenceRange.CriticalRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            //await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'Y', "");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, 'N', null, ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                #endregion
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1783,9 +1477,14 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (isCritical) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'Y', isCriticalFollowValue.DisplayName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, 'Y', 'Y', isCriticalFollowValue.DisplayName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    //await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'Y', isCriticalFollowValue.DisplayName);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, 'N', null, ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1797,8 +1496,9 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 组合项目随访函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="doctorCheckDiagnosisInput"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task<bool> GetAsbitemFollowUpFunction(DoctorCheckDiagnosisInput doctorCheckDiagnosisInput) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private bool GetAsbitemFollowUpFunction(DoctorCheckDiagnosisInput doctorCheckDiagnosisInput, List<GetCriticalResultDto> criticalResultDtoList) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bool isFollowUp = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var patientAsbitemDiagnosisInput = new PatientAsbitemDiagnosisInput() | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1826,24 +1526,30 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    isFollowUp = diagnosisBuilder.GetAsbitemFollowUpResult(patientAsbitemDiagnosisInput, asbitem.DiagnosisFunction); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (isFollowUp) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        await CreateRegisterCheckCritical(asbitem.RegisterCheckId, 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckCriticalResult(criticalResultDtoList, asbitem.RegisterCheckId, null, 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        //await CreateRegisterCheckCritical(asbitem.RegisterCheckId, 'Y', "");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckCriticalResult(criticalResultDtoList, asbitem.RegisterCheckId, null, 'N', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return isFollowUp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 项目随访函数
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="doctorCheckDiagnosisInput"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalFollowValueList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task<bool> GetItemFollowUpFunction( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private bool GetItemFollowUpFunction( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            DoctorCheckDiagnosisInput doctorCheckDiagnosisInput, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<CriticalFollowValue> criticalFollowValueList | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<CriticalFollowValue> criticalFollowValueList, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<GetCriticalResultDto> criticalResultDtoList | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bool isFollowUp = false; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1877,9 +1583,14 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (isFollowUp) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'N', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, null, 'Y', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        // await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'N', "");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, null, 'N', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1895,9 +1606,14 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        isFollowUp = _registerCheckItemManager.GetNumberResultIsFollow(item.Result, referenceRange.FollowUpRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (isFollowUp) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'N', referenceRange.FollowUpRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, null, 'Y', referenceRange.FollowUpRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            //await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'N', referenceRange.FollowUpRangeValue);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, null, 'N', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                #endregion
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1912,9 +1628,14 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (isFollowUp) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'N', isCriticalFollowValue.DisplayName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, null, 'Y', isCriticalFollowValue.DisplayName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    // await CreateRegisterCheckItemCritical(item.RegisterCheckId, item.ItemId, 'N', isCriticalFollowValue.DisplayName);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    UpdateRegisterCheckItemCriticalResult(criticalResultDtoList, item.RegisterCheckId, item.ItemId, null, 'N', ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1948,9 +1669,10 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="registerCheckId"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="itemId"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isCriticalValue"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isFollowUp"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="CriticalRangeValue"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task CreateRegisterCheckItemCritical(Guid registerCheckId, Guid itemId, char isCriticalValue, string CriticalRangeValue) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task CreateRegisterCheckItemCritical(Guid registerCheckId, Guid itemId, char? isCriticalValue, char? isFollowUp, string CriticalRangeValue) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var registerCheckItemEnt = await _registerCheckItemRepository.FirstOrDefaultAsync(m => m.RegisterCheckId == registerCheckId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && m.ItemId == itemId); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1963,16 +1685,18 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckItemEnt.CriticalValueCreatorId = _currentUser.Id; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckItemEnt.CriticalValueCreationTime = DateTime.Now; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (isFollowUp == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckItemEnt.FollowUpCreatorId = _currentUser.Id; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckItemEnt.FollowUpCreationTime = DateTime.Now; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckItemEnt.IsCriticalValueAudit = 'N'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckItemEnt.IsReview = 'N'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckItemEnt.IsFollowUp = 'Y'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //registerCheckItemEnt.IsCriticalValueAudit = 'N';
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //registerCheckItemEnt.IsReview = 'N';
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckItemEnt.IsFollowUp = isFollowUp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                await _registerCheckItemRepository.UpdateAsync(registerCheckItemEnt); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            await CreateRegisterCheckCritical(registerCheckId, isCriticalValue, CriticalRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1980,9 +1704,10 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="registerCheckId"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isCriticalValue"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isFollowUp"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="CriticalRangeValue"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task CreateRegisterCheckCritical(Guid registerCheckId, char isCriticalValue, string CriticalRangeValue) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task CreateRegisterCheckCritical(Guid registerCheckId, char? isCriticalValue, char? isFollowUp, string CriticalRangeValue) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var registerCheckEnt = await _registerCheckRepository.FirstOrDefaultAsync(m => m.Id == registerCheckId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (registerCheckEnt != null) | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1995,15 +1720,194 @@ namespace Shentun.Peis.DiagnosisFunctions | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckEnt.CriticalValueCreationTime = DateTime.Now; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckEnt.IsCriticalValue = isCriticalValue; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (isFollowUp == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckEnt.FollowUpCreatorId = _currentUser.Id; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    registerCheckEnt.FollowUpCreationTime = DateTime.Now; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckEnt.IsCriticalValueAudit = 'N'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckEnt.IsReview = 'N'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckEnt.IsFollowUp = 'Y'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //registerCheckEnt.IsCriticalValueAudit = 'N';
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //registerCheckEnt.IsReview = 'N';
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                registerCheckEnt.IsFollowUp = isFollowUp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                await _registerCheckRepository.UpdateAsync(registerCheckEnt); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 临时更新危急值状态  registerCheck
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="registerCheckId"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isCritical"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isFollowUp"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalRangeValue"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private void UpdateRegisterCheckCriticalResult(List<GetCriticalResultDto> criticalResultDtoList, Guid registerCheckId, char? isCritical, char? isFollowUp, string criticalRangeValue) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (criticalResultDtoList.Where(m => m.RegisterCheckId == registerCheckId).Count() == 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                criticalResultDtoList.Add(new GetCriticalResultDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    RegisterCheckId = registerCheckId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                foreach (var criticalResultDto in criticalResultDtoList) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (criticalResultDto.RegisterCheckId == registerCheckId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (isCritical != null && criticalResultDto.IsCritical != 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            criticalResultDto.IsCritical = isCritical; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (isFollowUp != null && criticalResultDto.IsFollowUp != 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            criticalResultDto.IsFollowUp = isFollowUp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (!string.IsNullOrWhiteSpace(criticalRangeValue)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            criticalResultDto.CriticalRangeValue = criticalRangeValue; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 临时更新危急值状态  registerCheckItem
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="registerCheckId"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="itemId"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isCritical"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="isFollowUp"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalRangeValue"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private void UpdateRegisterCheckItemCriticalResult(List<GetCriticalResultDto> criticalResultDtoList, Guid registerCheckId, Guid itemId, char? isCritical, char? isFollowUp, string criticalRangeValue) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //先增加registerCheck
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (criticalResultDtoList.Where(m => m.RegisterCheckId == registerCheckId).Count() == 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                criticalResultDtoList.Add(new GetCriticalResultDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    RegisterCheckId = registerCheckId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            foreach (var criticalResultDto in criticalResultDtoList) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (criticalResultDto.RegisterCheckId == registerCheckId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (criticalResultDto.ItemDetails.Where(m => m.ItemId == itemId).Count() == 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        var itemCriticalResultDto = new GetItemCriticalResultDto(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        itemCriticalResultDto.RegisterCheckId = registerCheckId; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        itemCriticalResultDto.ItemId = itemId; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (isFollowUp != null && itemCriticalResultDto.IsFollowUp != 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            itemCriticalResultDto.IsFollowUp = isFollowUp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (isCritical != null && itemCriticalResultDto.IsCritical != 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            itemCriticalResultDto.IsCritical = isCritical; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (!string.IsNullOrWhiteSpace(criticalRangeValue)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            itemCriticalResultDto.CriticalRangeValue = criticalRangeValue; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        criticalResultDto.ItemDetails.Add(itemCriticalResultDto); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        foreach (var itemCriticalResultDto in criticalResultDto.ItemDetails) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            if (itemCriticalResultDto.ItemId == itemId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                itemCriticalResultDto.RegisterCheckId = registerCheckId; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                itemCriticalResultDto.ItemId = itemId; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                if (isFollowUp != null && itemCriticalResultDto.IsFollowUp != 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    itemCriticalResultDto.IsFollowUp = isFollowUp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                if (isCritical != null && itemCriticalResultDto.IsCritical != 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    itemCriticalResultDto.IsCritical = isCritical; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                if (!string.IsNullOrWhiteSpace(criticalRangeValue)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                    itemCriticalResultDto.CriticalRangeValue = criticalRangeValue; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// 处理危急值记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// </summary>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="criticalResultDtoList"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <param name="patientRegisterId"></param>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /// <returns></returns>
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        private async Task HandCriticalResult(List<GetCriticalResultDto> criticalResultDtoList, Guid patientRegisterId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bool isCreateFollowUp = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            foreach (var criticalResultDto in criticalResultDtoList) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                foreach (var itemCriticalResultDto in criticalResultDto.ItemDetails) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (itemCriticalResultDto.IsCritical == 'Y' || itemCriticalResultDto.IsFollowUp == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        isCreateFollowUp = true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (itemCriticalResultDto.IsCritical == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            criticalResultDto.IsCritical = itemCriticalResultDto.IsCritical; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (itemCriticalResultDto.IsFollowUp == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            criticalResultDto.IsFollowUp = itemCriticalResultDto.IsFollowUp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    await CreateRegisterCheckItemCritical(itemCriticalResultDto.RegisterCheckId, itemCriticalResultDto.ItemId, itemCriticalResultDto.IsCritical, itemCriticalResultDto.IsFollowUp, itemCriticalResultDto.CriticalRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (criticalResultDto.IsCritical == 'Y' || criticalResultDto.IsFollowUp == 'Y') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    isCreateFollowUp = true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                     | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                await CreateRegisterCheckCritical(criticalResultDto.RegisterCheckId, criticalResultDto.IsCritical, criticalResultDto.IsFollowUp, criticalResultDto.CriticalRangeValue); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (isCreateFollowUp) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //增加随访主表记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                await _followUpAppService.CreateAsync(new PatientRegisterIdInputDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    PatientRegisterId = patientRegisterId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            else | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                  | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //删除随访表记录
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                await _followUpAppService.DeleteByPatientRegisterId(new PatientRegisterIdInputDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    PatientRegisterId = patientRegisterId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        #endregion
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |