//局部刷新
        public ActionResult LabTestInfoDetail(string UserId, string VisitId, string SortNo, string LabItemType, string LabItemCode, string operationFlag)
        {
            var user = Session["CurrentUser"] as UserAndRole;
            string DoctorId = user.UserId;

            LabTestProfileViewModel model = new LabTestProfileViewModel();
            model.UserId = UserId;
            model.VisitId = VisitId;
            LabTestInfo labTestInfo = new Models.LabTestInfo();
            //labTestInfo.SortNo = Convert.ToInt32(SortNo);
            labTestInfo.SortNo = SortNo;

            labTestInfo.LabItemType = LabItemType;
            labTestInfo.LabItemCode = LabItemCode;
            model.LabTestInfo = labTestInfo;

            if (operationFlag == "1")
            {
                ViewBag.operationFlag = "true";
            }
            if (operationFlag == "0")
            {
                ViewBag.operationFlag = "false";
            }

            GetLabTestInfoDetailList(ref model, DoctorId);

            //model.LabSubItemList = GetLabTestSubItemNameList(LabItemCode);
            model.LabSubItemList = GetLabTestSubItemNameList();
            return PartialView("_LabTestInfoDetail", model);
        }
 //加载化验信息
 public LabTestProfileViewModel GetLabTestInfoList(ref LabTestProfileViewModel model, string DoctorId)
 {
     string UserId = model.UserId;
     string VisitId = model.VisitId;
     DataSet LabTestListds = _ServicesSoapClient.GetLabTestList(UserId, VisitId);
     if (LabTestListds != null)
     {
         if (LabTestListds.Tables.Count != 0)
         {
             DataTable LabTestListdt = LabTestListds.Tables[0];
             List<LabTestInfo> list = new List<LabTestInfo>();
             string max = "0";
             foreach (DataRow dr in LabTestListdt.Rows)
             {
                 LabTestInfo item = new LabTestInfo();
                 item.SortNo = dr["SortNo"].ToString();
                 item.LabItemType = dr["LabItemType"].ToString();
                 item.LabItemTypeName = dr["LabItemTypeName"].ToString();
                 item.LabItemCode = dr["LabItemCode"].ToString();
                 item.LabItemName = dr["LabItemName"].ToString();
                 item.ExamDate = dr["LabTestDate"].ToString();
                 item.StatusCode = dr["StatusCode"].ToString();
                 item.Status = dr["Status"].ToString();
                 item.ReportDate = dr["ReportDate"].ToString();
                 item.Creator = dr["Creator"].ToString();
                 if (item.Creator == DoctorId)
                 {
                     item.IsAllowed = true;
                 }
                 else
                 {
                     item.IsAllowed = false;
                 }
                 list.Add(item);
                 max = dr["SortNo"].ToString();
             }
             model.LabTestList = list;
             model.MaxSortNo = max;
         }
     }
     return model;
 }
        //局部刷新
        public ActionResult LabTestInfo(string UserId, string VisitId)
        {
            var user = Session["CurrentUser"] as UserAndRole;
            string DoctorId = user.UserId;

            LabTestProfileViewModel LabTestInfoModel = new LabTestProfileViewModel();
            LabTestInfoModel.UserId = UserId;
            LabTestInfoModel.VisitId = VisitId;

            GetLabTestInfoList(ref LabTestInfoModel, DoctorId);
            ViewBag.MaxSortNo = LabTestInfoModel.MaxSortNo;
            //LabTestInfoModel.ClinicalInfoList = GetClinicalInfoList(UserId);

            return PartialView("_LabTestInfo", LabTestInfoModel);
        }
        //加载化验参数列表
        public LabTestProfileViewModel GetLabTestInfoDetailList(ref LabTestProfileViewModel model, string DoctorId)
        {
            string UserId = model.UserId;
            string VisitId = model.VisitId;
            string SortNo = model.LabTestInfo.SortNo;
            string LabItemType = model.LabTestInfo.LabItemType;
            string LabItemCode = model.LabTestInfo.LabItemCode;
            //string Code = LabItemType + "**" + LabItemCode;

            DataSet labTestDtlDs = _ServicesSoapClient.GetLabTestDtlList(UserId, VisitId, SortNo);
            if (labTestDtlDs != null)
            {
                if (labTestDtlDs.Tables.Count != 0)
                {
                    DataTable labTestDtlDt = labTestDtlDs.Tables[0];
                    List<DetailInfo> list = new List<DetailInfo>();
                    //int max = 0;
                    foreach (DataRow dr in labTestDtlDt.Rows)
                    {
                        DetailInfo detailInfo = new DetailInfo();
                        detailInfo.Code = dr["Code"].ToString();
                        detailInfo.ItemName = dr["Name"].ToString();
                        detailInfo.Value = dr["Value"].ToString();
                        detailInfo.IsAbnormalCode = Convert.ToInt32(dr["IsAbnormalCode"]);
                        detailInfo.IsAbnormal = dr["IsAbnormal"].ToString();
                        detailInfo.UnitCode = dr["UnitCode"].ToString();
                        detailInfo.Unit = dr["Unit"].ToString();
                        detailInfo.Creator = dr["Creator"].ToString();
                        if (detailInfo.Creator == DoctorId)
                        {
                            detailInfo.IsAllowed = true;
                        }
                        else
                        {
                            detailInfo.IsAllowed = false;
                        }
                        list.Add(detailInfo);
                    }
                    model.LabTestInfo.Detail = list;
                }
            }
            return model;
        }