Example #1
0
        // GET: /PatientInfo/

        //首页-基本信息和tab
        //public ActionResult Index(string UserId)
        //{
        //    //UserId = "P4444";
        //    _PatientId = UserId;
        //    ServiceReference.PatientBasicInfo zn = _ServicesSoapClient.GetPatBasicInfo(UserId);  //获取基本信息

        //    PatientBasicInfoViewModel ei = new PatientBasicInfoViewModel();
        //    ei.PatientBasicInfo.UserId = zn.UserId;
        //    ei.PatientBasicInfo.UserName = zn.UserName;
        //    ei.PatientBasicInfo.Gender = zn.Gender;
        //    ei.PatientBasicInfo.Age = Convert.ToInt32(zn.Age);
        //    ei.PatientBasicInfo.BloodType = zn.BloodType;
        //    ei.PatientBasicInfo.Module = zn.Module;
        //    ei.PatientBasicInfo.AlertNumber = _ServicesSoapClient.GetUntreatedAlertAmount(UserId);   //获取警报数

        //    //CDMIS.Models.PatientBasicInfo zz = new CDMIS.Models.PatientBasicInfo();
        //    //ei.UserId= zn.UserId;
        //    //ei.UserName=zn.UserName;
        //    //ei.Gender=zn.Gender;
        //    //ei.Age=zn.Age;
        //    //ei.BloodType=zn.BloodType;
        //    //ei.Module=zn.Module;
        //    //ei.AlertNumber=_ServicesSoapClient.GetUntreatedAlertAmount(UserId);
        //    return View(ei);
        //}

        //public ActionResult PatientBasicInfo()
        //{
        //    //UserId = "P4444";
        //    var user = Session["CurrentUser"] as UserAndRole;
        //    _PatientId = user.UserId;
        //    ServiceReference.PatientBasicInfo zn = _ServicesSoapClient.GetPatBasicInfo(_PatientId);  //获取基本信息

        //    PatientBasicInfoViewModel ei = new PatientBasicInfoViewModel();
        //    ei.PatientBasicInfo.UserId = zn.UserId;
        //    ei.PatientBasicInfo.UserName = zn.UserName;
        //    ei.PatientBasicInfo.Gender = zn.GenderText;
        //    ei.PatientBasicInfo.Age = Convert.ToInt32(zn.Age);
        //    ei.PatientBasicInfo.BloodType = zn.BloodTypeText;
        //    ei.PatientBasicInfo.Module = zn.Module;
        //    ei.PatientBasicInfo.AlertNumber = _ServicesSoapClient.GetUntreatedAlertAmount(_PatientId);   //获取警报数

        //    //CDMIS.Models.PatientBasicInfo zz = new CDMIS.Models.PatientBasicInfo();
        //    //ei.UserId= zn.UserId;
        //    //ei.UserName=zn.UserName;
        //    //ei.Gender=zn.Gender;
        //    //ei.Age=zn.Age;
        //    //ei.BloodType=zn.BloodType;
        //    //ei.Module=zn.Module;
        //    //ei.AlertNumber=_ServicesSoapClient.GetUntreatedAlertAmount(UserId);
        //    return View(ei);
        //}

        #region 详细信息
        //个人信息(不可编辑)
        public ActionResult PatientDetailInfo(string UserId, string Category)
        {
            //UserId = "P4444";
            if (UserId == null)
            {
                var user = Session["CurrentUser"] as UserAndRole;
                UserId = user.UserId;
            }
            PatientDetailInfoViewModel pbiModel = new PatientDetailInfoViewModel();

            pbiModel.UserId = UserId;
            List <ModuleInfo> ModuleInfo  = new List <Models.ModuleInfo>();
            DataSet           ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(UserId);

            foreach (DataTable item in ModulesInfo.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    if (Convert.ToInt32(row[0].ToString().Substring(1)) < 4)
                    {
                        ModuleInfo NewLine = new Models.ModuleInfo();
                        NewLine.Category   = row[0].ToString();
                        NewLine.ModuleName = row[1].ToString();
                        ModuleInfo.Add(NewLine);
                    }
                }
            }
            pbiModel.ModuleBoughtInfo = ModuleInfo;
            pbiModel.ModuleDetailList = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, UserId, Category);
            return(View(pbiModel));
        }
Example #2
0
        //个人信息(不可编辑)
        public ActionResult PatientDetailInfo(string PatientId, string Category)
        {
            //PatientId = "P4444";
            if (PatientId == null)
            {
                PatientId = Session["PatientId"] as String;
            }
            else
            {
                Session["PatientId"] = PatientId;
            }
            PatientDetailInfoViewModel pbiModel = new PatientDetailInfoViewModel();

            pbiModel.UserId = PatientId;
            List <ModuleInfo> ModuleInfo  = new List <Models.ModuleInfo>();
            DataSet           ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(PatientId);

            foreach (DataTable item in ModulesInfo.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    ModuleInfo NewLine = new Models.ModuleInfo();
                    NewLine.Category   = row[0].ToString();
                    NewLine.ModuleName = row[1].ToString();
                    ModuleInfo.Add(NewLine);
                }
            }
            pbiModel.ModuleBoughtInfo = ModuleInfo;
            pbiModel.ModuleDetailList = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, PatientId, Category);
            return(View(pbiModel));
        }
        /// <summary>
        /// Method to check whether the ViewLicense command can be executed.
        /// </summary>
        /// <returns><c>true</c> if the command can be executed; otherwise <c>false</c></returns>
        private bool OnViewLicenseCanExecute(Models.ModuleInfo moduleInfo)
        {
            if (moduleInfo == null)
            {
                return(false);
            }

            return(!string.IsNullOrWhiteSpace(moduleInfo.LicenseUrl));
        }
Example #4
0
        public ActionResult PatientDetailInfo(PatientDetailInfoViewModel model)
        {
            var               user        = Session["CurrentUser"] as UserAndRole;
            string            Category    = Request.Form["ModuleDetailList[0].CategoryCode"];
            List <ModuleInfo> ModuleInfo  = new List <Models.ModuleInfo>();
            DataSet           ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(model.UserId);

            foreach (DataTable item in ModulesInfo.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    ModuleInfo NewLine = new Models.ModuleInfo();
                    NewLine.Category   = row[0].ToString();
                    NewLine.ModuleName = row[1].ToString();
                    ModuleInfo.Add(NewLine);
                }
            }
            model.ModuleBoughtInfo = ModuleInfo;
            List <PatientDetailInfo> ItemInfo = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, model.UserId, Category);
            bool flag = false;

            foreach (PatientDetailInfo Row in ItemInfo)
            {
                if ((Row.ItemCode != "InvalidFlag") && (Row.ItemCode != "Doctor"))
                {
                    string CategoryCode = "M";                        //主键
                    string Value        = Request.Form[Row.ItemCode]; //只更改了Value
                    if (Row.ControlType != "7")
                    {
                        flag = _ServicesSoapClient.SetPatBasicInfoDetail(model.UserId, CategoryCode, Row.ItemCode, Row.ItemSeq, Value, Row.Description, Row.ItemSeq, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                    }
                    if (flag == false)
                    {
                        break;
                    }
                }
            }
            model.ModuleDetailList = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, model.UserId, Category);
            return(View(model));
        }
 /// <summary>
 /// Method to invoke when the ViewLicense command is executed.
 /// </summary>
 private void OnViewLicenseExecute(Models.ModuleInfo moduleInfo)
 {
     _processService.StartProcess(moduleInfo.LicenseUrl);
 }
Example #6
0
        public ActionResult ModuleProfile(BasicProfileViewModel model, FormCollection formCollection)
        {
            if (ModelState.IsValid)
            {
                var user = Session["CurrentUser"] as UserAndRole;
                string DoctorId = user.UserId;
                //string DoctorName = user.UserName;
                //操作标识符   页面所有操作只做一次判断
                bool flag = true;

                string UserId = model.Patient.UserId;
                string UserName = model.Patient.UserName;
                string CategoryCode = "";
                DataSet ItemInfoSet = new DataSet();
                CategoryCode = Request.Form["ModuleDetailList[0].CategoryCode"];
                List<PatientDetailInfo> ItemInfo = new List<PatientDetailInfo>();
                if (CategoryCode != null)
                {
                    ItemInfoSet = _ServicesSoapClient.GetItemInfoByPIdAndModule(UserId, CategoryCode);
                    foreach (DataTable Item in ItemInfoSet.Tables)
                    {
                        foreach (DataRow Row in Item.Rows)
                        {
                            if (Row[3].ToString() != "InvalidFlag" && Row[3].ToString() != "Patient" && Row[3].ToString() != "Doctor")
                            {
                                PatientDetailInfo NewLine = new PatientDetailInfo
                                {
                                    ItemCode = Row[3].ToString(),
                                    OptionCategory = Row[12].ToString()
                                };
                                ItemInfo.Add(NewLine);
                            }
                        }
                    }
                }
                List<ModuleInfo> ModuleInfo = new List<Models.ModuleInfo>();
                DataSet ModulesInfo = new DataSet();
                if (user.Role == "Doctor")
                {
                    ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(UserId);
                    foreach (DataTable item in ModulesInfo.Tables)
                    {
                        foreach (DataRow row in item.Rows)
                        {
                            ModuleInfo NewLine = new Models.ModuleInfo();
                            NewLine.Category = row[0].ToString();
                            NewLine.ModuleName = row[1].ToString();
                            ModuleInfo.Add(NewLine);
                        }
                    }
                }
                else
                {
                    HttpClient client = new HttpClient();
                    client.BaseAddress = new Uri("http://121.43.107.106:9000/");
                    HttpResponseMessage response = client.GetAsync("Api/v1/Users/HModulesByID?PatientId=" + UserId + "&DoctorId=" + DoctorId).Result;
                    if (response.IsSuccessStatusCode)
                    {
                        if (response.Content.ReadAsStringAsync().Result != "[]")
                        {
                            string[] Modules = response.Content.ReadAsStringAsync().Result.Split(new string[] { "},{", "[{\"", "\"}]" }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (string Module in Modules)
                            {
                                string[] Detail = Module.Split(new string[] { "\",\"", "\":\"" }, StringSplitOptions.RemoveEmptyEntries);
                                ModuleInfo NewLine = new Models.ModuleInfo();
                                NewLine.Category = Detail[1].Substring(1);
                                NewLine.ModuleName = Detail[3];
                                ModuleInfo.Add(NewLine);
                            }
                        }
                    }
                }
                model.ModuleBoughtInfo = ModuleInfo;
                ModuleInfo = new List<Models.ModuleInfo>();
                if (user.Role == "Doctor")
                {
                    ModulesInfo = _ServicesSoapClient.GetModulesUnBoughtByPId(UserId);
                }
                else
                {
                    ModulesInfo = _ServicesSoapClient.GetModuleList();
                }
                DataSet DoctorModule = _ServicesSoapClient.GetDoctorModuleList(DoctorId);
                List<string> DoctorModules = new List<string>();
                foreach (DataRow item in DoctorModule.Tables[0].Rows)
                {
                    DoctorModules.Add(item[0].ToString());
                }
                foreach (DataTable item in ModulesInfo.Tables)
                {
                    foreach (DataRow row in item.Rows)
                    {
                        if ((user.Role == "Doctor" && DoctorModules.IndexOf(row[0].ToString()) != -1) || (user.Role == "HealthCoach" && row[0].ToString() != "M4" && row[0].ToString() != "M5" && model.ModuleBoughtInfo.Find(delegate(ModuleInfo x) { return x.Category == row[0].ToString(); }) == null))
                        {
                            ModuleInfo NewLine = new Models.ModuleInfo();
                            NewLine.Category = row[0].ToString();
                            NewLine.ModuleName = row[1].ToString();
                            ModuleInfo.Add(NewLine);
                        }
                    }
                }
                model.ModuleUnBoughtInfo = ModuleInfo;
                //#region 从病人详细信息表中加载模块关注信息
                //DataSet ItemInfoBoughtds = _ServicesSoapClient.GetPatBasicInfoDtlList(UserId);
                //List<List<PatientDetailInfo>> ItemInfoBought = new List<List<PatientDetailInfo>>();
                //ArrayList modulesBoughtCode = new ArrayList();
                //ArrayList modulesBoughtName = new ArrayList();

                //if (ItemInfoBoughtds != null)
                //{
                //    foreach (DataTable datatable in ItemInfoBoughtds.Tables)
                //    {
                //        List<PatientDetailInfo> items = new List<PatientDetailInfo>();
                //        foreach (DataRow row in datatable.Rows)
                //        {
                //            if (row[3].ToString() != "InvalidFlag")
                //            {
                //                PatientDetailInfo item = new PatientDetailInfo
                //                {
                //                    //PatientId = row[0].ToString(),
                //                    CategoryCode = row[1].ToString(),
                //                    CategoryName = row[2].ToString(),
                //                    ItemCode = row[3].ToString(),
                //                    ItemName = row[4].ToString(),
                //                    ParentCode = row[5].ToString(),
                //                    //ControlType = row[11].ToString(),
                //                    // OptionCategory = row[12].ToString(),
                //                    //OptionSelected = row[0].ToString(),
                //                    //OptionList = row[0],
                //                    //ItemSeq = Convert.ToInt32(row[6]),
                //                    Value = row[7].ToString(),
                //                    Content = row[8].ToString(),
                //                    //Description = row[9].ToString()
                //                };
                //                items.Add(item);
                //            }
                //        }
                //        modulesBoughtCode.Add(items[0].CategoryCode);
                //        modulesBoughtName.Add(items[0].CategoryName);
                //        ItemInfoBought.Add(items);
                //    }
                //}
                //model.PatientDetailInfo = ItemInfoBought;
                //#endregion

                //#region 从字典表中加载模块信息
                ////修改:只加载医生负责的模块&患者购买的模块
                ////DataTable Moduledt = _ServicesSoapClient.GetModuleList().Tables[0];
                //DataTable Moduledt = _ServicesSoapClient.GetDoctorModuleList(DoctorId).Tables[0];

                ////ArrayList moduleUnBought = new ArrayList();
                //int indicator = 0;
                //foreach (DataRow dr in Moduledt.Rows)
                //{
                //    //string dictCode = dr["Code"].ToString();
                //    //string dictName = dr["Name"].ToString();
                //    string dictCode = dr["CategoryCode"].ToString();
                //    string dictName = dr["CategoryName"].ToString();
                //    foreach (string modulesBt in modulesBoughtCode)
                //    {
                //        if (modulesBt == dictCode)
                //        {
                //            indicator = 1;                    //已购买
                //            break;
                //        }
                //    }
                //    if (indicator == 0)    //未购买
                //    {
                //        //mubt.CategoryCode = dictCode;
                //        //mubt.CategoryName = dictName;
                //        //model.moduleUnBought.Add(mubt);
                //        model.moduleUnBoughtCode.Add(dictCode);
                //        model.moduleUnBoughtName.Add(dictName);
                //        //indicator = 1;
                //    }
                //    else
                //    {
                //        indicator = 0;
                //    }
                //}

                ////string code = "";
                //DataTable dt = new DataTable();
                ////ArrayList selectedModule = new ArrayList();
                ////ViewBag.SelectedModule = selectedModule;
                ////foreach (DataRow dr in Moduledt.Rows)
                //foreach (string mubt in model.moduleUnBoughtCode)
                //{
                //    List<InfoItem> list = new List<InfoItem>();
                //    //code = mubt.CategoryCode;
                //    dt = _ServicesSoapClient.GetMstInfoItemByCategoryCode(mubt).Tables[0];
                //    foreach (DataRow InfoItemDr in dt.Rows)
                //    {
                //        InfoItem item = new InfoItem();
                //        item.Code = InfoItemDr["Code"].ToString();
                //        item.Name = InfoItemDr["Name"].ToString();
                //        item.ParentCode = InfoItemDr["ParentCode"].ToString();
                //        item.SortNo = Convert.ToInt32(InfoItemDr["SortNo"]);
                //        item.GroupHeaderFlag = Convert.ToInt32(InfoItemDr["GroupHeaderFlag"]);
                //        item.ControlType = InfoItemDr["ControlType"].ToString();
                //        item.OptionCategory = InfoItemDr["OptionCategory"].ToString();
                //        list.Add(item);

                //    }
                //    model.InfoItemList.Add(list);
                //}
                //#endregion

                string Patient = UserId;
                string ItemCode = "";
                int ItemSeq = 1;
                string Value = "";
                string Description = "";
                int SortNo = 1;
                string OptionCategory = "";

                #region 插入购买的模块关注详细信息
                int j = 0;
                if (CategoryCode != null)
                {
                    //是否购买
                    ModuleInfo ModuleFind = model.ModuleBoughtInfo.Find(delegate(ModuleInfo x)
                    {
                        return x.Category == CategoryCode;
                    });
                    if (ModuleFind == null)
                    {
                        //插入 医生详细信息表 负责患者信息
                        if (user.Role == "Doctor")
                        {
                            flag = _ServicesSoapClient.SetPsDoctorDetailOnPat(DoctorId, CategoryCode, UserId, Description, 0, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                        }
                        else
                        {
                            flag = _ServicesSoapClient.SetPsDoctorDetailOnPat(DoctorId, "H" + CategoryCode, UserId, Description, 0, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                        }
                        model.ModuleBoughtInfo.Add(new ModuleInfo
                        {
                            Category = CategoryCode,
                            ModuleName = model.ModuleUnBoughtInfo.Find(delegate(ModuleInfo x)
                            {
                                return x.Category == CategoryCode;
                            }).ModuleName
                        });
                        model.ModuleUnBoughtInfo.Remove(model.ModuleUnBoughtInfo.Find(delegate(ModuleInfo x)
                        {
                            return x.Category == CategoryCode;
                        }));
                    }
                    if (user.Role == "Doctor")
                    {
                        flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, CategoryCode, "InvalidFlag", ItemSeq, "0", Description, SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                        //插入 患者详细信息表 负责医生信息
                        flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, CategoryCode, "Doctor", ItemSeq, DoctorId, "", SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                    }
                    else
                    {
                        flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, "H" + CategoryCode, "InvalidFlag", ItemSeq, "0", Description, SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                        //插入 患者详细信息表 负责医生信息
                        flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, "H" + CategoryCode, "Doctor", ItemSeq, DoctorId, "", SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                    }

                    for (j = 0; j < ItemInfo.Count; j++)
                    {
                        ItemCode = ItemInfo[j].ItemCode;
                        OptionCategory = ItemInfo[j].OptionCategory;
                        Value = Request.Form[ItemInfo[j].ItemCode];

                        //插入患者详细信息表中的模块关注详细信息
                        if (OptionCategory != "Cm.MstHypertensionDrug" && OptionCategory != "Cm.MstDiabetesDrug" && OptionCategory != "Cm.MstLipidDrug" && OptionCategory != "Cm.MstUricAcidReductionDrug")
                        {
                            flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, "M", ItemCode, ItemSeq, Value, Description, SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                        }
                        //string[] Array = Value.Split(',');
                        //if (Value ==null)
                        //{
                        //插入患者详细信息表中的模块关注详细信息
                        //flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, CategoryCode, ItemCode, ItemSeq, Value, Description, SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);

                        //}
                        //else
                        //{
                        //string[] values = Value.Split(',');
                        //int vLength = values.Length;
                        //if (vLength > 1)
                        //{

                        //for (int vnum = 0; vnum < vLength; vnum++)
                        //{
                        //插入患者详细信息表中的模块关注详细信息
                        //flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, CategoryCode, ItemCode, ItemSeq, values[vnum].ToString(), Description, SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                        //SortNo++;
                        //ItemSeq++;
                        //}
                        //}
                        //else
                        //{
                        //插入患者详细信息表中的模块关注详细信息
                        // flag = _ServicesSoapClient.SetBasicInfoDetail(Patient, CategoryCode, ItemCode, ItemSeq, Value, Description, SortNo, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                        //}
                        //}
                    }
                }
                #endregion
                if (CategoryCode != "")
                {
                    ItemInfo = new List<PatientDetailInfo>();
                    ItemInfoSet = _ServicesSoapClient.GetItemInfoByPIdAndModule(UserId, CategoryCode);
                    bool InvalidFlag = false;
                    foreach (DataTable item in ItemInfoSet.Tables)
                    {
                        foreach (DataRow row in item.Rows)
                        {
                            if (row[3].ToString() != "InvalidFlag" && row[3].ToString() != "Patient")
                            {
                                if (row[3].ToString() == "Doctor")
                                {
                                    PatientDetailInfo NewLine = new PatientDetailInfo()
                                    {
                                        CategoryCode = row[1].ToString(),
                                        CategoryName = row[2].ToString(),
                                        ItemCode = row[3].ToString(),
                                        ItemName = row[4].ToString(),
                                        ParentCode = row[5].ToString(),
                                        ItemSeq = Convert.ToInt32(row[6]),
                                        Value = row[7].ToString(),
                                        Content = _ServicesSoapClient.GetUserName(row[7].ToString())
                                    };
                                    if (user.Role == "HealthCoach")
                                    {
                                        HttpClient client = new HttpClient();
                                        client.BaseAddress = new Uri("http://121.43.107.106:9000/");
                                        HttpResponseMessage response = client.GetAsync("Api/v1/Users/BasicDtlValue?UserId=" + UserId + "&CategoryCode=H" + CategoryCode + "&ItemCode=Doctor&ItemSeq=1").Result;
                                        if (response.IsSuccessStatusCode)
                                        {
                                            NewLine.Value = response.Content.ReadAsStringAsync().Result.Split(new string[] { "{", ":", "}", "\"" }, StringSplitOptions.RemoveEmptyEntries)[1];
                                        }
                                    }
                                    if (NewLine.Value == DoctorId)
                                    {
                                        NewLine.EditDeleteFlag = "true";
                                    }
                                    else
                                    {
                                        NewLine.EditDeleteFlag = "false";
                                    }
                                    ItemInfo.Add(NewLine);
                                }
                                else
                                {
                                    PatientDetailInfo NewLine = new PatientDetailInfo()
                                    {
                                        ItemCode = row[3].ToString(),
                                        ItemName = row[4].ToString(),
                                        ParentCode = row[5].ToString(),
                                        ControlType = row[11].ToString(),
                                        OptionCategory = row[12].ToString(),
                                        ItemSeq = Convert.ToInt32(row[6]),
                                        Value = row[7].ToString(),
                                        Content = row[8].ToString(),
                                        GroupHeaderFlag = Convert.ToInt32(row[13])
                                    };
                                    if (NewLine.ControlType != "7")
                                        NewLine.OptionList = GetTypeList(NewLine.OptionCategory, NewLine.Value);  //通过yesornoh和value,结合字典表,生成有值的下拉框
                                    ItemInfo.Add(NewLine);
                                }
                            }
                            else
                            {
                                if (row[3].ToString() == "InvalidFlag")
                                {
                                    if (user.Role == "HealthCoach")
                                    {
                                        HttpClient client = new HttpClient();
                                        client.BaseAddress = new Uri("http://121.43.107.106:9000/");
                                        HttpResponseMessage response = client.GetAsync("Api/v1/Users/BasicDtlValue?UserId=" + UserId + "&CategoryCode=H" + CategoryCode + "&ItemCode=InvalidFlag&ItemSeq=1").Result;
                                        if (response.IsSuccessStatusCode)
                                        {
                                            InvalidFlag = (response.Content.ReadAsStringAsync().Result.Split(new string[] { "{", ":", "}", "\"" }, StringSplitOptions.RemoveEmptyEntries)[1] == "0");
                                        }
                                    }
                                    else
                                        InvalidFlag = (row[7].ToString() != "");
                                }
                            }
                        }
                    }
                    model.ModuleDetailList = ItemInfo;
                    model.InvalidFlag = InvalidFlag;
                }
            }
            return View(model);
        }
Example #7
0
        public ActionResult ModuleProfile(string PatientId, string Category)
        {
            var user = Session["CurrentUser"] as UserAndRole;
            string DoctorId = user.UserId;

            BasicProfileViewModel model = new BasicProfileViewModel();

            model.Patient.UserId = PatientId;

            //加载患者基本信息
            model.Patient = GetPatientBasicInfo(PatientId);

            #region 修改说明
            //1 获取患者已购买的模块
            //2 获取患者未购买的模块
            //3 之前已购买和未购买是分别调用Ps和Cm表的方法做的,现在可以都调用Ps表中的方法,获取问卷信息
            //4 不同模块的问卷分别加载,不要一次性加载,这样可以不用在前端做不同模块信息的同步,用JsonResult实现
            //5 把模块信息相关的三个页面用同一种方式实现,方便以后的维护
            //6 高血压和糖尿病模块的问卷只有二级标题,心衰模块还有三级标题以及显示控制的条目,需要再做修改
            #endregion

            List<ModuleInfo> ModuleInfo = new List<Models.ModuleInfo>();
            DataSet ModulesInfo = new DataSet();
            if (user.Role == "Doctor")
            {
                ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(PatientId);
                foreach (DataTable item in ModulesInfo.Tables)
                {
                    foreach (DataRow row in item.Rows)
                    {
                        ModuleInfo NewLine = new Models.ModuleInfo();
                        NewLine.Category = row[0].ToString();
                        NewLine.ModuleName = row[1].ToString();
                        ModuleInfo.Add(NewLine);
                    }
                }
            }
            else
            {
                HttpClient client = new HttpClient();
                client.BaseAddress = new Uri("http://121.43.107.106:9000/");
                HttpResponseMessage response = client.GetAsync("Api/v1/Users/HModulesByID?PatientId=" + PatientId + "&DoctorId=" + DoctorId).Result;
                if (response.IsSuccessStatusCode)
                {
                    if (response.Content.ReadAsStringAsync().Result != "[]")
                    {
                        string[] Modules = response.Content.ReadAsStringAsync().Result.Split(new string[] { "},{", "[{\"", "\"}]" }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (string Module in Modules)
                        {
                            string[] Detail = Module.Split(new string[] { "\",\"", "\":\"" }, StringSplitOptions.RemoveEmptyEntries);
                            ModuleInfo NewLine = new Models.ModuleInfo();
                            NewLine.Category = Detail[1].Substring(1);
                            NewLine.ModuleName = Detail[3];
                            ModuleInfo.Add(NewLine);
                        }
                    }
                }
            }
            model.ModuleBoughtInfo = ModuleInfo;
            ModuleInfo = new List<Models.ModuleInfo>();
            if (user.Role == "Doctor")
            {
                ModulesInfo = _ServicesSoapClient.GetModulesUnBoughtByPId(PatientId);
            }
            else
            {
                ModulesInfo = _ServicesSoapClient.GetModuleList();
            }
            DataSet DoctorModule = _ServicesSoapClient.GetDoctorModuleList(DoctorId);
            List<string> DoctorModules = new List<string>();
            foreach (DataRow item in DoctorModule.Tables[0].Rows)
            {
                DoctorModules.Add(item[0].ToString());
            }
            foreach (DataTable item in ModulesInfo.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    if ((user.Role == "Doctor" && DoctorModules.IndexOf(row[0].ToString()) != -1) || (user.Role == "HealthCoach" && row[0].ToString() != "M4" && row[0].ToString() != "M5" && model.ModuleBoughtInfo.Find(delegate(ModuleInfo x){return x.Category == row[0].ToString();}) == null))
                    {
                        ModuleInfo NewLine = new Models.ModuleInfo();
                        NewLine.Category = row[0].ToString();
                        NewLine.ModuleName = row[1].ToString();
                        ModuleInfo.Add(NewLine);
                    }
                }
            }
            model.ModuleUnBoughtInfo = ModuleInfo;
            List<PatientDetailInfo> ItemInfo = new List<PatientDetailInfo>();
            DataSet ItemInfoSet = _ServicesSoapClient.GetItemInfoByPIdAndModule(PatientId, Category);
            bool InvalidFlag = false;
            foreach (DataTable item in ItemInfoSet.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    if (row[3].ToString() != "InvalidFlag" && row[3].ToString() != "Patient")
                    {
                        if (row[3].ToString() == "Doctor")
                        {
                            PatientDetailInfo NewLine = new PatientDetailInfo()
                            {
                                CategoryCode = row[1].ToString(),
                                CategoryName = row[2].ToString(),
                                ItemCode = row[3].ToString(),
                                ItemName = row[4].ToString(),
                                ParentCode = row[5].ToString(),
                                ItemSeq = Convert.ToInt32(row[6]),
                                Value = row[7].ToString(),
                                Content = _ServicesSoapClient.GetUserName(row[7].ToString())
                            };
                            if (user.Role == "HealthCoach")
                            {
                                HttpClient client = new HttpClient();
                                client.BaseAddress = new Uri("http://121.43.107.106:9000/");
                                HttpResponseMessage response = client.GetAsync("Api/v1/Users/BasicDtlValue?UserId=" + PatientId + "&CategoryCode=H" + Category + "&ItemCode=Doctor&ItemSeq=1").Result;
                                if (response.IsSuccessStatusCode)
                                {
                                    NewLine.Value = response.Content.ReadAsStringAsync().Result.Split(new string[] { "{", ":", "}", "\"" }, StringSplitOptions.RemoveEmptyEntries)[1];
                                }
                            }
                            if (NewLine.Value == DoctorId)
                            {
                                NewLine.EditDeleteFlag = "true";
                            }
                            else
                            {
                                NewLine.EditDeleteFlag = "false";
                            }
                            ItemInfo.Add(NewLine);
                        }
                        else
                        {
                            PatientDetailInfo NewLine = new PatientDetailInfo()
                            {
                                ItemCode = row[3].ToString(),
                                ItemName = row[4].ToString(),
                                ParentCode = row[5].ToString(),
                                ControlType = row[11].ToString(),
                                OptionCategory = row[12].ToString(),
                                ItemSeq = Convert.ToInt32(row[6]),
                                Value = row[7].ToString(),
                                Content = row[8].ToString(),
                                GroupHeaderFlag = Convert.ToInt32(row[13])
                            };
                            if (NewLine.ControlType != "7")
                                NewLine.OptionList = GetTypeList(NewLine.OptionCategory, NewLine.Value);  //通过yesornoh和value,结合字典表,生成有值的下拉框
                            ItemInfo.Add(NewLine);
                        }
                    }
                    else
                    {
                        if (row[3].ToString() == "InvalidFlag")
                        {
                            if (user.Role == "HealthCoach")
                            {
                                HttpClient client = new HttpClient();
                                client.BaseAddress = new Uri("http://121.43.107.106:9000/");
                                HttpResponseMessage response = client.GetAsync("Api/v1/Users/BasicDtlValue?UserId=" + PatientId + "&CategoryCode=H" + Category + "&ItemCode=InvalidFlag&ItemSeq=1").Result;
                                if (response.IsSuccessStatusCode)
                                {
                                    InvalidFlag = (response.Content.ReadAsStringAsync().Result.Split(new string[] { "{", ":", "}", "\"" }, StringSplitOptions.RemoveEmptyEntries)[1] == "0");
                                }
                            }
                            else
                                InvalidFlag = (row[7].ToString() != "");
                        }
                    }
                }
            }

            model.ModuleDetailList = ItemInfo;
            model.InvalidFlag = InvalidFlag;
            //#region 从病人详细信息表中加载模块关注详细信息
            //DataSet ItemInfoBoughtds = _ServicesSoapClient.GetPatBasicInfoDtlList(PatientId);
            //List<List<PatientDetailInfo>> ItemInfoBought = new List<List<PatientDetailInfo>>();
            //ArrayList modulesBoughtCode = new ArrayList();
            //ArrayList modulesBoughtName = new ArrayList();

            //if (ItemInfoBoughtds!=null)
            //{
            //    foreach (DataTable datatable in ItemInfoBoughtds.Tables)
            //    {
            //        List<PatientDetailInfo> items = new List<PatientDetailInfo>();

            //        foreach (DataRow row in datatable.Rows)
            //        {
            //            if (row[3].ToString() != "InvalidFlag" && row[3].ToString() != "Patient")
            //            {
            //                if (row[3].ToString() == "Doctor")
            //                {
            //                    PatientDetailInfo item = new PatientDetailInfo()
            //                    {
            //                        //PatientId = row[0].ToString(),
            //                        CategoryCode = row[1].ToString(),
            //                        CategoryName = row[2].ToString(),
            //                        ItemCode = row[3].ToString(),
            //                        ItemName = row[4].ToString(),
            //                        ParentCode = row[5].ToString(),
            //                        //ControlType = row[11].ToString(),
            //                        // OptionCategory = row[12].ToString(),
            //                        //OptionSelected = row[0].ToString(),
            //                        //OptionList = row[0],
            //                        ItemSeq = Convert.ToInt32(row[6]),
            //                        Value = row[7].ToString(),
            //                        //Content = row[9].ToString()
            //                        Content = _ServicesSoapClient.GetUserName(row[7].ToString())
            //                        //Description = row[9].ToString()
            //                    };

            //                    if (item.Value == DoctorId)
            //                    {
            //                        item.EditDeleteFlag = "true";
            //                    }
            //                    else
            //                    {
            //                        item.EditDeleteFlag = "false";
            //                    }
            //                    items.Add(item);
            //                }
            //                else
            //                {
            //                    PatientDetailInfo item = new PatientDetailInfo()
            //                    {
            //                        //PatientId = row[0].ToString(),
            //                        CategoryCode = row[1].ToString(),
            //                        CategoryName = row[2].ToString(),
            //                        ItemCode = row[3].ToString(),
            //                        ItemName = row[4].ToString(),
            //                        ParentCode = row[5].ToString(),
            //                        ControlType = row[11].ToString(),
            //                        OptionCategory = row[12].ToString(),
            //                        //OptionSelected = row[0].ToString(),
            //                        //OptionList = row[0],
            //                        ItemSeq = Convert.ToInt32(row[6]),
            //                        Value = row[7].ToString(),
            //                        Content = row[8].ToString()
            //                        //Description = row[9].ToString()
            //                    };
            //                    item.OptionList = GetTypeList(item.OptionCategory, item.Value);  //通过yesornoh和value,结合字典表,生成有值的下拉框
            //                    items.Add(item);
            //                }
            //            }
            //        }
            //        modulesBoughtCode.Add(items[0].CategoryCode);
            //        modulesBoughtName.Add(items[0].CategoryName);
            //        ItemInfoBought.Add(items);
            //    }
            //}
            //model.PatientDetailInfo = ItemInfoBought;
            //#endregion
            return View(model);
        }
Example #8
0
        /// <summary>
        /// Method to invoke when the ViewLicense command is executed.
        /// </summary>
        private void OnViewLicenseExecute(Models.ModuleInfo moduleInfo)
        {
            var processService = GetService <IProcessService>();

            processService.StartProcess(moduleInfo.LicenseUrl);
        }
Example #9
0
        // GET: /PatientInfo/

        //首页-基本信息和tab
        //public ActionResult Index(string UserId)
        //{
        //    //UserId = "P4444";
        //    _PatientId = UserId;
        //    ServiceReference.PatientBasicInfo zn = _ServicesSoapClient.GetPatBasicInfo(UserId);  //获取基本信息

        //    PatientBasicInfoViewModel ei = new PatientBasicInfoViewModel();
        //    ei.PatientBasicInfo.UserId = zn.UserId;
        //    ei.PatientBasicInfo.UserName = zn.UserName;
        //    ei.PatientBasicInfo.Gender = zn.Gender;
        //    ei.PatientBasicInfo.Age = Convert.ToInt32(zn.Age);
        //    ei.PatientBasicInfo.BloodType = zn.BloodType;
        //    ei.PatientBasicInfo.Module = zn.Module;
        //    ei.PatientBasicInfo.AlertNumber = _ServicesSoapClient.GetUntreatedAlertAmount(UserId);   //获取警报数

        //    //CDMIS.Models.PatientBasicInfo zz = new CDMIS.Models.PatientBasicInfo();
        //    //ei.UserId= zn.UserId;
        //    //ei.UserName=zn.UserName;
        //    //ei.Gender=zn.Gender;
        //    //ei.Age=zn.Age;
        //    //ei.BloodType=zn.BloodType;
        //    //ei.Module=zn.Module;
        //    //ei.AlertNumber=_ServicesSoapClient.GetUntreatedAlertAmount(UserId);
        //    return View(ei);
        //}

        //public ActionResult PatientBasicInfo()
        //{
        //    //UserId = "P4444";
        //    var user = Session["CurrentUser"] as UserAndRole;
        //    _PatientId = user.UserId;
        //    ServiceReference.PatientBasicInfo zn = _ServicesSoapClient.GetPatBasicInfo(_PatientId);  //获取基本信息

        //    PatientBasicInfoViewModel ei = new PatientBasicInfoViewModel();
        //    ei.PatientBasicInfo.UserId = zn.UserId;
        //    ei.PatientBasicInfo.UserName = zn.UserName;
        //    ei.PatientBasicInfo.Gender = zn.GenderText;
        //    ei.PatientBasicInfo.Age = Convert.ToInt32(zn.Age);
        //    ei.PatientBasicInfo.BloodType = zn.BloodTypeText;
        //    ei.PatientBasicInfo.Module = zn.Module;
        //    ei.PatientBasicInfo.AlertNumber = _ServicesSoapClient.GetUntreatedAlertAmount(_PatientId);   //获取警报数

        //    //CDMIS.Models.PatientBasicInfo zz = new CDMIS.Models.PatientBasicInfo();
        //    //ei.UserId= zn.UserId;
        //    //ei.UserName=zn.UserName;
        //    //ei.Gender=zn.Gender;
        //    //ei.Age=zn.Age;
        //    //ei.BloodType=zn.BloodType;
        //    //ei.Module=zn.Module;
        //    //ei.AlertNumber=_ServicesSoapClient.GetUntreatedAlertAmount(UserId);
        //    return View(ei);
        //}

        #region 详细信息
        //个人信息(不可编辑)
        public ActionResult PatientDetailInfo(string UserId, string Category)
        {
            //UserId = "P4444";
            if (UserId == null)
            {
                var user = Session["CurrentUser"] as UserAndRole;
                UserId = user.UserId;
            }
            PatientDetailInfoViewModel pbiModel = new PatientDetailInfoViewModel();
            pbiModel.UserId = UserId;
            List<ModuleInfo> ModuleInfo = new List<Models.ModuleInfo>();
            DataSet ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(UserId);
            foreach (DataTable item in ModulesInfo.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    if (Convert.ToInt32(row[0].ToString().Substring(1)) < 4)
                    {
                        ModuleInfo NewLine = new Models.ModuleInfo();
                        NewLine.Category = row[0].ToString();
                        NewLine.ModuleName = row[1].ToString();
                        ModuleInfo.Add(NewLine);
                    }
                }
            }
            pbiModel.ModuleBoughtInfo = ModuleInfo;
            pbiModel.ModuleDetailList = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, UserId, Category);
            return View(pbiModel);
        }
Example #10
0
 public ActionResult PatientDetailInfo(PatientDetailInfoViewModel model)
 {
     var user = Session["CurrentUser"] as UserAndRole;
     string Category = Request.Form["ModuleDetailList[0].CategoryCode"];
     List<ModuleInfo> ModuleInfo = new List<Models.ModuleInfo>();
     DataSet ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(model.UserId);
     foreach (DataTable item in ModulesInfo.Tables)
     {
         foreach (DataRow row in item.Rows)
         {
             ModuleInfo NewLine = new Models.ModuleInfo();
             NewLine.Category = row[0].ToString();
             NewLine.ModuleName = row[1].ToString();
             ModuleInfo.Add(NewLine);
         }
     }
     model.ModuleBoughtInfo = ModuleInfo;
     List<PatientDetailInfo> ItemInfo = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, model.UserId, Category);
     bool flag = false;
     foreach (PatientDetailInfo Row in ItemInfo)
     {
         if ((Row.ItemCode != "InvalidFlag") && (Row.ItemCode != "Doctor"))
         {
             string CategoryCode = "M";  //主键
             string Value = Request.Form[Row.ItemCode];   //只更改了Value
             if (Row.ControlType != "7")
             {
                 flag = _ServicesSoapClient.SetPatBasicInfoDetail(model.UserId, CategoryCode, Row.ItemCode, Row.ItemSeq, Value, Row.Description, Row.ItemSeq, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
             }
             if (flag == false)
             {
                 break;
             }
         }
     }
     model.ModuleDetailList = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, model.UserId, Category);
     return View(model);
 }
Example #11
0
 //个人信息(不可编辑)
 public ActionResult PatientDetailInfo(string PatientId, string Category)
 {
     //PatientId = "P4444";
     if (PatientId == null)
     {
         PatientId = Session["PatientId"] as String;
     }
     else
     {
         Session["PatientId"] = PatientId;
     }
     PatientDetailInfoViewModel pbiModel = new PatientDetailInfoViewModel();
     pbiModel.UserId = PatientId;
     List<ModuleInfo> ModuleInfo = new List<Models.ModuleInfo>();
     DataSet ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(PatientId);
     foreach (DataTable item in ModulesInfo.Tables)
     {
         foreach (DataRow row in item.Rows)
         {
             ModuleInfo NewLine = new Models.ModuleInfo();
             NewLine.Category = row[0].ToString();
             NewLine.ModuleName = row[1].ToString();
             ModuleInfo.Add(NewLine);
         }
     }
     pbiModel.ModuleBoughtInfo = ModuleInfo;
     pbiModel.ModuleDetailList = PDCHPFunctions.GetPatientDetailInfo(_ServicesSoapClient, PatientId, Category);
     return View(pbiModel);
 }
Example #12
0
        public ActionResult ModuleProfile(string PatientId, string Category)
        {
            var user = Session["CurrentUser"] as UserAndRole;
            string DoctorId = user.UserId;

            BasicProfileViewModel model = new BasicProfileViewModel();

            model.Patient.UserId = PatientId;

            //加载患者基本信息
            model.Patient = GetPatientBasicInfo(PatientId);

            #region 修改说明
            //1 获取患者已购买的模块
            //2 获取患者未购买的模块
            //3 之前已购买和未购买是分别调用Ps和Cm表的方法做的,现在可以都调用Ps表中的方法,获取问卷信息
            //4 不同模块的问卷分别加载,不要一次性加载,这样可以不用在前端做不同模块信息的同步,用JsonResult实现
            //5 把模块信息相关的三个页面用同一种方式实现,方便以后的维护
            //6 高血压和糖尿病模块的问卷只有二级标题,心衰模块还有三级标题以及显示控制的条目,需要再做修改
            #endregion

            List<ModuleInfo> ModuleInfo = new List<Models.ModuleInfo>();
            DataSet ModulesInfo = _ServicesSoapClient.GetModulesBoughtByPId(PatientId);
            foreach (DataTable item in ModulesInfo.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    ModuleInfo NewLine = new Models.ModuleInfo();
                    NewLine.Category = row[0].ToString();
                    NewLine.ModuleName = row[1].ToString();
                    ModuleInfo.Add(NewLine);
                }
            }
            model.ModuleBoughtInfo = ModuleInfo;
            ModuleInfo = new List<Models.ModuleInfo>();
            ModulesInfo = _ServicesSoapClient.GetModulesUnBoughtByPId(PatientId);
            DataSet DoctorModule = _ServicesSoapClient.GetDoctorModuleList(DoctorId);
            List<string> DoctorModules = new List<string>();
            foreach (DataRow item in DoctorModule.Tables[0].Rows)
            {
                DoctorModules.Add(item[0].ToString());
            }
            foreach (DataTable item in ModulesInfo.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    if (DoctorModules.IndexOf(row[0].ToString()) != -1)
                    {
                        ModuleInfo NewLine = new Models.ModuleInfo();
                        NewLine.Category = row[0].ToString();
                        NewLine.ModuleName = row[1].ToString();
                        ModuleInfo.Add(NewLine);
                    }
                }
            }
            model.ModuleUnBoughtInfo = ModuleInfo;
            List<PatientDetailInfo> ItemInfo = new List<PatientDetailInfo>();
            DataSet ItemInfoSet = _ServicesSoapClient.GetItemInfoByPIdAndModule(PatientId, Category);
            bool InvalidFlag = false;
            foreach (DataTable item in ItemInfoSet.Tables)
            {
                foreach (DataRow row in item.Rows)
                {
                    if (row[3].ToString() != "InvalidFlag" && row[3].ToString() != "Patient")
                    {
                        if (row[3].ToString() == "Doctor")
                        {
                            PatientDetailInfo NewLine = new PatientDetailInfo()
                            {
                                CategoryCode = row[1].ToString(),
                                CategoryName = row[2].ToString(),
                                ItemCode = row[3].ToString(),
                                ItemName = row[4].ToString(),
                                ParentCode = row[5].ToString(),
                                ItemSeq = Convert.ToInt32(row[6]),
                                Value = row[7].ToString(),
                                Content = _ServicesSoapClient.GetUserName(row[7].ToString())
                            };
                            if (NewLine.Value == DoctorId)
                            {
                                NewLine.EditDeleteFlag = "true";
                            }
                            else
                            {
                                NewLine.EditDeleteFlag = "false";
                            }
                            ItemInfo.Add(NewLine);
                        }
                        else
                        {
                            PatientDetailInfo NewLine = new PatientDetailInfo()
                            {
                                ItemCode = row[3].ToString(),
                                ItemName = row[4].ToString(),
                                ParentCode = row[5].ToString(),
                                ControlType = row[11].ToString(),
                                OptionCategory = row[12].ToString(),
                                ItemSeq = Convert.ToInt32(row[6]),
                                Value = row[7].ToString(),
                                Content = row[8].ToString(),
                                GroupHeaderFlag = Convert.ToInt32(row[13])
                            };
                            if (NewLine.ControlType != "7")
                                NewLine.OptionList = GetTypeList(NewLine.OptionCategory, NewLine.Value);  //通过yesornoh和value,结合字典表,生成有值的下拉框
                            ItemInfo.Add(NewLine);
                        }
                    }
                    else
                    {
                        if (row[3].ToString() == "InvalidFlag")
                            InvalidFlag = (row[7].ToString() != "");
                    }
                }
            }

            model.ModuleDetailList = ItemInfo;
            model.InvalidFlag = InvalidFlag;
            //#region 从病人详细信息表中加载模块关注详细信息
            //DataSet ItemInfoBoughtds = _ServicesSoapClient.GetPatBasicInfoDtlList(PatientId);
            //List<List<PatientDetailInfo>> ItemInfoBought = new List<List<PatientDetailInfo>>();
            //ArrayList modulesBoughtCode = new ArrayList();
            //ArrayList modulesBoughtName = new ArrayList();

            //if (ItemInfoBoughtds!=null)
            //{
            //    foreach (DataTable datatable in ItemInfoBoughtds.Tables)
            //    {
            //        List<PatientDetailInfo> items = new List<PatientDetailInfo>();

            //        foreach (DataRow row in datatable.Rows)
            //        {
            //            if (row[3].ToString() != "InvalidFlag" && row[3].ToString() != "Patient")
            //            {
            //                if (row[3].ToString() == "Doctor")
            //                {
            //                    PatientDetailInfo item = new PatientDetailInfo()
            //                    {
            //                        //PatientId = row[0].ToString(),
            //                        CategoryCode = row[1].ToString(),
            //                        CategoryName = row[2].ToString(),
            //                        ItemCode = row[3].ToString(),
            //                        ItemName = row[4].ToString(),
            //                        ParentCode = row[5].ToString(),
            //                        //ControlType = row[11].ToString(),
            //                        // OptionCategory = row[12].ToString(),
            //                        //OptionSelected = row[0].ToString(),
            //                        //OptionList = row[0],
            //                        ItemSeq = Convert.ToInt32(row[6]),
            //                        Value = row[7].ToString(),
            //                        //Content = row[9].ToString()
            //                        Content = _ServicesSoapClient.GetUserName(row[7].ToString())
            //                        //Description = row[9].ToString()
            //                    };

            //                    if (item.Value == DoctorId)
            //                    {
            //                        item.EditDeleteFlag = "true";
            //                    }
            //                    else
            //                    {
            //                        item.EditDeleteFlag = "false";
            //                    }
            //                    items.Add(item);
            //                }
            //                else
            //                {
            //                    PatientDetailInfo item = new PatientDetailInfo()
            //                    {
            //                        //PatientId = row[0].ToString(),
            //                        CategoryCode = row[1].ToString(),
            //                        CategoryName = row[2].ToString(),
            //                        ItemCode = row[3].ToString(),
            //                        ItemName = row[4].ToString(),
            //                        ParentCode = row[5].ToString(),
            //                        ControlType = row[11].ToString(),
            //                        OptionCategory = row[12].ToString(),
            //                        //OptionSelected = row[0].ToString(),
            //                        //OptionList = row[0],
            //                        ItemSeq = Convert.ToInt32(row[6]),
            //                        Value = row[7].ToString(),
            //                        Content = row[8].ToString()
            //                        //Description = row[9].ToString()
            //                    };
            //                    item.OptionList = GetTypeList(item.OptionCategory, item.Value);  //通过yesornoh和value,结合字典表,生成有值的下拉框
            //                    items.Add(item);
            //                }
            //            }
            //        }
            //        modulesBoughtCode.Add(items[0].CategoryCode);
            //        modulesBoughtName.Add(items[0].CategoryName);
            //        ItemInfoBought.Add(items);
            //    }
            //}
            //model.PatientDetailInfo = ItemInfoBought;
            //#endregion
            return View(model);
        }