Exemple #1
0
 /// <summary>
 /// 根据病种组合ID获取病种字符串
 /// 注:name1(icd1),name2(icd2), ......
 /// </summary>
 /// <auth>Yanqiao.Cai</auth>
 /// <date>2013-01-06</date>
 /// <param name="groupid">病种组合ID</param>
 /// <returns></returns>
 public static string GetDiseaseStringByGroupID(int groupid)
 {
     try
     {
         //根据组合ID查找ICD集合
         List <string> diseaseIDs = GetDiseaseIDsByGroupID(groupid);
         if (null == diseaseIDs || diseaseIDs.Count() == 0)
         {
             return(string.Empty);
         }
         //将ICD集合拼接成SQL查询的ICD字符串
         string idStr = string.Empty;
         foreach (string diseaseID in diseaseIDs)
         {
             string newID = diseaseID;
             if (diseaseID.Contains("'"))
             {
                 newID = diseaseID.Replace("'", "");
             }
             idStr += "'" + newID + "',";
         }
         if (!string.IsNullOrEmpty(idStr))
         {
             idStr = idStr.Substring(0, idStr.Length - 1);
         }
         //查询病种集合
         DataTable dt = DS_SqlService.GetDiseasesByICDs(idStr);
         if (null == dt || dt.Rows.Count == 0)
         {
             return(string.Empty);
         }
         //将病种集合拼接成所需要格式的字符串
         string content = string.Empty;
         foreach (DataRow drow in dt.Rows)
         {
             content += drow["NAME"].ToString() + "(" + drow["ICD"].ToString() + "),";
         }
         if (!string.IsNullOrEmpty(content))
         {
             content = content.Substring(0, content.Length - 1);
         }
         return(content);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #2
0
        /// <summary>
        /// 根据用户ID获取权限内的病种数据集
        /// </summary>
        /// <auth>Yanqiao.Cai</auth>
        /// <date>2013-01-06</date>
        /// <param name="userID">用户ID</param>
        /// <returns></returns>
        public static DataTable GetDiagResourceByUserID(string userID)
        {
            try
            {
                if (string.IsNullOrEmpty(userID))
                {
                    return(new DataTable());
                }

                DataTable groupDt    = GetDiseaseGroupsByUserID(userID);
                string    diseaseIDs = string.Empty;
                if (null == groupDt || groupDt.Rows.Count == 0)
                {
                    return(new DataTable());
                }
                foreach (DataRow drow in groupDt.Rows)
                {
                    string        icds    = null == drow["diseaseids"] ? "" : drow["diseaseids"].ToString();
                    List <string> icdList = icds.Split('$').ToList();
                    if (null == icdList || icdList.Count() == 0)
                    {
                        continue;
                    }
                    foreach (string str in icdList)
                    {
                        diseaseIDs += "'" + str + "',";
                    }
                }
                if (!string.IsNullOrEmpty(diseaseIDs))
                {
                    diseaseIDs = diseaseIDs.Substring(0, diseaseIDs.Length - 1);
                }
                if (string.IsNullOrEmpty(diseaseIDs))
                {
                    new DataTable();
                }
                return(DS_SqlService.GetDiseasesByICDs(diseaseIDs));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }