コード例 #1
0
        //获得非体征数据
        public DataCollection GetDailyDataPoints(string name)
        {
            if (name.Equals("DATEOFSURVEY")) return null;//日期数据单独处理

            //根据首页序号获得这个人的信息add by ywk 2013年4月26日10:24:43
            DataTable dtPatInfo = GetPatData(CurrentPat.ToString());
            string status = string.Empty;//存储这个人的真正的状态
            if (dtPatInfo != null && dtPatInfo.Rows.Count > 0)
            {
                status = dtPatInfo.Rows[0]["STATUS"].ToString();
            }

            DataCollection list = new DataCollection();
            list.FieldName = name;

            if (ConfigInfo.editable == 1 && name.Equals("DAYSAFTERSURGERY"))
            {
                DateTime CunrrentTime = m_firstDateOfCunrrentPage;
                for (int i = 0; i < 7; i++)
                {
                    if (CunrrentTime.AddDays(i) < DateTime.Now)
                    {
                        if (!string.IsNullOrEmpty(outdate) && DateTime.Parse(DateTime.Parse(outdate).ToString("yyyy-MM-dd")) < CunrrentTime.AddDays(i) && (status == "1503" || status == "1502"))
                        {
                            break;
                        }
                        DataPoint dp = new DataPoint();
                        dp.value = SetDaysAfterSurgery((CunrrentTime.AddDays(i)).ToString("yyyy-MM-dd"), CurrentPat.ToString()); //值
                        dp.date = CunrrentTime.AddDays(i).ToString("yyyy-MM-dd");
                        dp.temperatureType = 0;
                        list.Add(dp);
                    }
                }
            }
            else if (ConfigInfo.editDays == 1 && name.Equals("DAYOFHOSPITAL"))
            {
                int inhospital = int.Parse(SetDayInHospital(m_firstDateOfCunrrentPage.ToString("yyyy-MM-dd")));
                DateTime CunrrentTime = m_firstDateOfCunrrentPage;
                for (int i = 0; i < 7; i++)
                {
                    if (CunrrentTime.AddDays(i) < DateTime.Now)
                    {
                        //如果这个病人没有出院,出院是根据状态进行判断的,这样画会出问题的
                        //edit by ywk 2013年4月26日10:19:22
                        if (!string.IsNullOrEmpty(outdate) && DateTime.Parse(DateTime.Parse(outdate).ToString("yyyy-MM-dd")) < CunrrentTime.AddDays(i)
                            && (status == "1503" || status == "1502"))
                        {
                            break;
                        }
                        DataPoint dp = new DataPoint();
                        dp.value = (inhospital + i).ToString(); //值
                        dp.date = CunrrentTime.AddDays(i).ToString("yyyy-MM-dd");
                        dp.temperatureType = 0;
                        list.Add(dp);
                    }
                }
            }
            else
            {
                foreach (DataRow row in allSurgeryData.Rows)
                {
                    DataPoint dp = new DataPoint();
                    if (row[name].ToString() == "") continue;
                    dp.value = row[name].ToString(); //值
                    dp.date = row["DATEOFSURVEY"].ToString();
                    dp.timeslot = row["TIMESLOT"].ToString(); ;
                    dp.temperatureType = 0;

                    list.Add(dp);
                }
            }

            return list;
        }
コード例 #2
0
        /// <summary>
        /// 获取状态集合
        /// Modify by xlb 2013-06-09
        /// </summary>
        /// <param name="startdate"></param>
        /// <param name="enddate"></param>
        /// <param name="NOOFINPAT"></param>
        /// <returns></returns>
        public DataCollection GetPatStates(DateTime startdate, DateTime enddate, string NOOFINPAT)
        {
            DataTable dt = GetPatStatesByDateDiv(startdate, enddate, NOOFINPAT);
            #region Add by xlb 2013-06-09 如果当前病人不存在入院状态则自动插入
            DataTable dataTable = GetAllPatStatusByNoofinpat(NOOFINPAT);//病人所有的状态
            bool IsNeedInsertInHos = false;//用于判断是否需要插入入院状态的开关false表示不需要插入true表示需要插入
            if (dataTable != null && dataTable.Rows.Count > 0)
            {
                foreach (DataRow item in dataTable.Rows)
                {
                    if (item["id"].ToString().Trim().Equals(ConfigInfo.InHospitalCode))
                    {//存在入院记录则终止遍历
                        IsNeedInsertInHos = false;
                        break;
                    }
                    else
                    {
                        IsNeedInsertInHos = true;//遍历不到则打开开关
                        continue;
                    }
                }
            }
            else//集合为空且显示入院状态则插入入院记录
            {
                if (ConfigInfo.isInHospital)
                {
                    InsertHosStatus(NOOFINPAT, m_InTime.Substring(0, 16), ConfigInfo.InHospitalCode);
                }
            }
            if (IsNeedInsertInHos)//true且显示入院状态则插入入院状态
            {
                if (ConfigInfo.isInHospital)
                {
                    //有入科时间,而且病人状态表中维护了值就进行更新
                    if (CheckIsExsitInwardDate(NOOFINPAT) && CheckISExistStatus(NOOFINPAT, ConfigInfo.InHospitalCode))//存在入科时间而且状态表里也有
                    {
                        UpdateInHosStatus(NOOFINPAT, m_InTime.Substring(0, 16), ConfigInfo.InHospitalCode);

                    }
                    else
                    {
                        InsertHosStatus(NOOFINPAT, m_InTime.Substring(0, 16), ConfigInfo.InHospitalCode);
                    }
                }
            }

            dt = GetPatStatesByDateDiv(startdate, enddate, NOOFINPAT);
            #endregion
            DataCollection list = new DataCollection();
            list.FieldName = "";
            foreach (DataRow row in dt.Rows)
            {
                DataPoint dp = new DataPoint();
                dp.value = row["name"].ToString(); //值
                dp.date = row["DOTIME"].ToString();
                dp.timeslot = "";
                list.Add(dp);
            }
            if (ConfigInfo.isInHospital)
            {
                if (DateTime.Parse(startdate.ToString("yyyy-MM-dd")) == DateTime.Parse(DateTime.Parse(m_InTime).ToString("yyyy-MM-dd")))
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        bool isContainsHospital = false;
                        foreach (DataRow item in dt.Rows)
                        {
                            if (item["ID"].ToString().Trim().Equals(ConfigInfo.InHospitalCode))
                            {
                                isContainsHospital = true;
                                break;
                            }
                        }
                        if (!isContainsHospital)
                        {
                            DataPoint dp = new DataPoint();
                            dp.value = ConfigInfo.ShowStatus;//Add by xlb 2013-06-09
                            dp.date = m_InTime;
                            dp.timeslot = "";
                            list.Add(dp);
                        }
                    }
                    else
                    {
                        DataPoint dp = new DataPoint();
                        dp.value = ConfigInfo.ShowStatus;
                        dp.date = m_InTime;
                        dp.timeslot = "";
                        list.Add(dp);
                    }
                }
            }
            return list;
        }