public ActionResult ClinicalInfo(ClinicalInfoProfileViewModel model, FormCollection formCollection)
        {
            var user = Session["CurrentUser"] as UserAndRole;
            bool flag = false;
            string VisitType = Request.Form["VisitType"];

            string UserId = model.UserId;
            string VisitId = "";
            int SortNo = 1;
            string HospitalCode = model.ClinicalInfo.HospitalCode;
            string Department = model.ClinicalInfo.DepartmentCode;
            string Doctor = model.ClinicalInfo.Doctor;

            switch (VisitType)
            {
                case "1":                    //门诊
                    VisitId = _ServicesSoapClient.GetNoByNumberingType(8);
                    DateTime ClinicDate = model.ClinicalInfo.AdmissionDate;
                    flag = _ServicesSoapClient.SetOutPatientInfo(UserId, VisitId, ClinicDate, HospitalCode, Department, Doctor, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                    break;
                case "2":                 //急诊
                    VisitId = _ServicesSoapClient.GetNoByNumberingType(9);
                    DateTime EmergencyDate = model.ClinicalInfo.AdmissionDate;
                    flag = _ServicesSoapClient.SetOutPatientInfo(UserId, VisitId, EmergencyDate, HospitalCode, Department, Doctor, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                    break;
                case "3":                  //住院
                    VisitId = _ServicesSoapClient.GetNoByNumberingType(5);
                    DateTime AdmissionDate = model.ClinicalInfo.AdmissionDate;
                    DateTime DischargeDate = new DateTime();

                    if (Request.Form["DischargeDate"] == "")
                    {
                        DischargeDate = Convert.ToDateTime("9999/01/01 0:00:00");
                    }
                    else
                    {
                        DischargeDate = Convert.ToDateTime(Request.Form["DischargeDate"]);
                    }
                    flag = _ServicesSoapClient.SetInPatientInfo(UserId, VisitId, SortNo, AdmissionDate, DischargeDate, HospitalCode, Department, Doctor, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                    break;
                case "4":
                    string VisitId_SortNo_AdmissionDate = model.ClinicalInfo.VisitIdSelected;
                    VisitId = VisitId_SortNo_AdmissionDate.Split('_')[0];
                    SortNo = Convert.ToInt32(VisitId_SortNo_AdmissionDate.Split('_')[1]);
                    DateTime LastAdmissionDate = Convert.ToDateTime(VisitId_SortNo_AdmissionDate.Split('_')[2]);
                    DateTime TransforDate = model.ClinicalInfo.AdmissionDate;

                    //更新转科之前那条住院记录的出院日期为转科日期   不管转科之前的记录的出院日期是否已经填写,都重新写成转科日期
                    flag = _ServicesSoapClient.SetInPatientInfo(UserId, VisitId, SortNo, LastAdmissionDate, TransforDate, HospitalCode, Department, Doctor, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);

                    SortNo = SortNo + 1;
                    DateTime DischargeOutDate = new DateTime();
                    if (Request.Form["DischargeDate"] == "")
                    {
                        DischargeOutDate = Convert.ToDateTime("9999/01/01 0:00:00");
                    }
                    else
                    {
                        DischargeOutDate = Convert.ToDateTime(Request.Form["DischargeDate"]);
                    }
                    flag = _ServicesSoapClient.SetInPatientInfo(UserId, VisitId, SortNo, TransforDate, DischargeOutDate, HospitalCode, Department, Doctor, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                    break;
            }
            if (flag == true)
            {
                return RedirectToAction("ClinicalInfo", "DoctorHome", new { UserId = UserId });
            }
            else
            {
                return View(model);
            }
        }
        public ActionResult ClinicalInfo(string UserId)
        {
            var user = Session["CurrentUser"] as UserAndRole;
            string DoctorId = user.UserId;

            ClinicalInfoProfileViewModel ClinicalInfoModel = new ClinicalInfoProfileViewModel();
            ClinicalInfoModel.UserId = UserId;

            //加载患者基本信息
            //ClinicalInfoModel.PatientBasicInfo = GetPatientBasicInfo(UserId);

            //加载患者就诊信息
            ClinicalInfoModel.InPatientList = GetInPatientList(UserId, DoctorId);
            ClinicalInfoModel.OutPatientList = GetOutPatientList(UserId, DoctorId);
            ClinicalInfoModel.ClinicalInfoList = GetInPatientInfoList(UserId);

            return View(ClinicalInfoModel);
        }