예제 #1
0
        /// <summary>
        /// 根据床号查询病人信息
        /// </summary>
        /// <param name="bednum"></param>
        /// <returns></returns>
        public PatientInfo GetPatientInfoBybednum(int bednum)
        {
            string sql = "select PatientName,PatientAge,PatientGender,Patientstarttime,PatientDepartment," +
                         "PatientNum from AdditionalPatients where PatientBednum=" + bednum.ToString() + " and UseFlag=0";
            SQLiteDataReader objReader      = SQLiteHelper.GetReader(sql);
            PatientInfo      objPatientInfo = null;

            try
            {
                if (objReader.Read())
                {
                    objPatientInfo = new PatientInfo()
                    {
                        PatientBednum     = Convert.ToInt16(bednum) > 256 ? "#" + (Convert.ToInt16(bednum) - 256).ToString() : Convert.ToInt16(bednum).ToString(),
                        PatientName       = objReader["PatientName"].ToString(),
                        PatientAge        = (objReader["PatientAge"]).ToString(),
                        PatientGender     = objReader["PatientGender"].ToString(),
                        PatientDepartment = objReader["PatientDepartment"].ToString(),
                        PatientNum        = objReader["PatientNum"].ToString(),
                        Patientstarttime  = Convert.ToDateTime(objReader["Patientstarttime"])
                    };
                }
            }
            catch (Exception ex)
            {
                SQLiteHelper.WriteLog(" public PatientInfo GetPatientInfoBybednum(int bednum)", ex.Message);
                objPatientInfo = new PatientInfo();
                objPatientInfo.PatientBednum    = bednum.ToString();
                objPatientInfo.Patientstarttime = Convert.ToDateTime(objReader["Patientstarttime"]);
            }
            objReader.Close();
            return(objPatientInfo);
        }
        /// <summary>
        /// 根据床号查询所有的记录
        /// </summary>
        /// <param name="bednum"></param>
        /// <returns></returns>
        public List <PatientBodyInfo> GetPatientInfoByBednum(int bednum, int userflag, string stime, string etime)
        {
            string sql = "select PatientBodyInfotime,BloodO2,Pluse,GetO2time,Flux,Model,Error,GetO2totaltime from PatientBodyInfo where PatientBednum=" + bednum.ToString() + " and UseFlag=" + userflag.ToString() + " and PatientBodyInfotime between  '{0}' and  '{1}'" + " ORDER BY PatientBodyInfotime DESC";

            sql = string.Format(sql, stime, etime);
            SQLiteDataReader       objReader = SQLiteHelper.GetReader(sql);
            List <PatientBodyInfo> list      = new List <PatientBodyInfo>();

            while (objReader.Read())
            {
                list.Add(new PatientBodyInfo()
                {
                    PatientBednum       = bednum,
                    BloodO2             = objReader["BloodO2"].ToString(),
                    Pluse               = objReader["Pluse"].ToString(),
                    GetO2time           = objReader["GetO2time"].ToString(),
                    Flux                = objReader["Flux"].ToString(),
                    Model               = objReader["Model"].ToString(),
                    Error               = objReader["Error"].ToString(),
                    GetO2totaltime      = objReader["GetO2totaltime"].ToString(),
                    PatientBodyInfotime = Convert.ToDateTime(objReader["PatientBodyInfotime"])
                });
            }
            objReader.Close();
            return(list);
        }
        public string GetUUID()
        {
            string           sql       = "select *from UUIDINFO";
            string           uuid      = "";
            SQLiteDataReader objReader = SQLiteHelper.GetReader(sql);

            while (objReader.Read())
            {
                uuid = objReader["UUID"].ToString();
            }
            return(uuid);
        }
        public ShowInfo GetShowInfo()
        {
            string           sql         = "select AllOrPart from ShowInfo where Flag=1";
            SQLiteDataReader objReader   = SQLiteHelper.GetReader(sql);
            ShowInfo         objShowInfo = null;

            if (objReader.Read())
            {
                objShowInfo = new ShowInfo()
                {
                    AllOrPart = Convert.ToInt32(objReader["AllOrPart"])
                };
            }
            objReader.Close();
            return(objShowInfo);
        }
예제 #5
0
        /// <summary>
        /// 获取设置信息
        /// </summary>
        /// <param name="bednum"></param>
        /// <returns></returns>
        public SetInfo GetSetInfo(int bednum)
        {
            string           sql        = "select IsEnable from SetInfo where PatientBednum=" + bednum;
            SQLiteDataReader objReader  = SQLiteHelper.GetReader(sql);
            SetInfo          objSetInfo = null;

            if (objReader.Read())
            {
                objSetInfo = new SetInfo()
                {
                    IsEnable = Convert.ToInt32(objReader["IsEnable"])
                };
            }
            objReader.Close();
            return(objSetInfo);
        }
예제 #6
0
        /// <summary>
        /// 获取额外床位list
        /// </summary>
        /// <returns></returns>
        public List <PatientInfo> Getadditionalbednumandname()
        {
            string             sql       = "select PatientName,PatientBednum from AdditionalPatients where UseFlag=0 ORDER BY PatientBednum ASC ";
            SQLiteDataReader   objReader = SQLiteHelper.GetReader(sql);
            List <PatientInfo> list      = new List <PatientInfo>();

            while (objReader.Read())
            {
                list.Add(new PatientInfo()
                {
                    PatientName   = objReader["PatientName"].ToString(),
                    PatientBednum = (objReader["PatientBednum"]).ToString(),
                });
            }
            objReader.Close();
            return(list);
        }
예제 #7
0
        /// <summary>
        /// 查询医院信息
        /// </summary>
        /// <returns></returns>
        public HospitalInfo GetHospitalInfo()
        {
            string           sql             = "select HospitalName,Department from HospitalInfo where Flag=1";
            SQLiteDataReader objReader       = SQLiteHelper.GetReader(sql);
            HospitalInfo     objHospitalInfo = null;

            if (objReader.Read())
            {
                objHospitalInfo = new HospitalInfo()
                {
                    HospitalName = objReader["HospitalName"].ToString(),
                    Department   = objReader["Department"].ToString()
                };
            }
            objReader.Close();
            return(objHospitalInfo);
        }
예제 #8
0
        /// 获取上次设置的床位信息
        /// </summary>
        /// <param name="Bedflag"></param>
        /// <returns></returns>
        public BedConfigInfo GetBedInfoByBedflag(int Bedflag)
        {
            string sql = "select Bedcount,Bedrows from BedConfig where Bedflag={0}";

            sql = string.Format(sql, Bedflag);
            SQLiteDataReader objReader        = SQLiteHelper.GetReader(sql);
            BedConfigInfo    objBedConfigInfo = null;

            if (objReader.Read())
            {
                objBedConfigInfo = new BedConfigInfo()
                {
                    Bedcount = Convert.ToInt32(objReader["Bedcount"]),
                    Bedrows  = Convert.ToInt32(objReader["Bedrows"])
                };
            }
            objReader.Close();
            return(objBedConfigInfo);
        }
        /// <summary>
        /// 根据姓名精确查询
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public List <PatientInfo> GetPatientInfoByPatientname(string name, int useflag)
        {
            string sql = "select PatientBednum,Patientstarttime,Patientendtime,PatientNum from Patients where PatientName='{0}' and UseFlag='{1}'";

            sql = string.Format(sql, name, useflag);
            SQLiteDataReader   objReader = SQLiteHelper.GetReader(sql);
            List <PatientInfo> list      = new List <PatientInfo>();

            if (useflag == 1)
            {
                while (objReader.Read())
                {
                    list.Add(new PatientInfo()
                    {
                        PatientName      = name,
                        PatientBednum    = (objReader["PatientBednum"]).ToString(),
                        PatientNum       = objReader["PatientNum"].ToString(),
                        Patientstarttime = Convert.ToDateTime(objReader["Patientstarttime"]),
                        Patientendtime   = Convert.ToDateTime(objReader["Patientendtime"])
                    });
                }
            }
            else
            {
                while (objReader.Read())
                {
                    list.Add(new PatientInfo()
                    {
                        PatientName      = name,
                        PatientBednum    = (objReader["PatientBednum"]).ToString(),
                        PatientNum       = objReader["PatientNum"].ToString(),
                        Patientstarttime = Convert.ToDateTime(objReader["Patientstarttime"]),
                    });
                }
            }

            objReader.Close();
            return(list);
        }
예제 #10
0
        public List <PatientSaveData> GetPatientInfoByBednum()
        {
            string                 sql       = "select Time,Mode,Bloodo2,Pluse,Flow,Error,GetO2Time,GetO2AllTime from PatientSaveData";
            SQLiteDataReader       objReader = SQLiteHelper.GetReader(sql);
            List <PatientSaveData> list      = new List <PatientSaveData>();

            while (objReader.Read())
            {
                list.Add(new PatientSaveData()
                {
                    BloodO2             = objReader["Bloodo2"].ToString(),
                    Pluse               = objReader["Pluse"].ToString(),
                    GetO2time           = objReader["GetO2Time"].ToString(),
                    Flux                = objReader["Flow"].ToString(),
                    Model               = objReader["Mode"].ToString(),
                    Error               = objReader["Error"].ToString(),
                    GetO2totaltime      = objReader["GetO2AllTime"].ToString(),
                    PatientBodyInfotime = Convert.ToDateTime(objReader["Time"])
                });
            }
            objReader.Close();
            return(list);
        }
        public List <PatientBodyInfo> GetPatientInfoByBednumNowDESC(int bednum, int userflag)
        {
            string                 sql       = "select DISTINCT PatientBodyInfotime,BloodO2,Pluse,GetO2time,Flux,Model,Error,GetO2totaltime from PatientBodyInfo where PatientBednum=" + bednum.ToString() + " and UseFlag=" + userflag.ToString() + " group  by  PatientBodyInfotime " + " ORDER BY PatientBodyInfotime DESC";
            SQLiteDataReader       objReader = SQLiteHelper.GetReader(sql);
            List <PatientBodyInfo> list      = new List <PatientBodyInfo>();

            while (objReader.Read())
            {
                list.Add(new PatientBodyInfo()
                {
                    BloodO2             = objReader["BloodO2"].ToString(),
                    Pluse               = objReader["Pluse"].ToString(),
                    GetO2time           = objReader["GetO2time"].ToString(),
                    Flux                = objReader["Flux"].ToString(),
                    Model               = objReader["Model"].ToString(),
                    Error               = objReader["Error"].ToString(),
                    GetO2totaltime      = objReader["GetO2totaltime"].ToString(),
                    PatientBodyInfotime = Convert.ToDateTime(objReader["PatientBodyInfotime"])
                });
            }
            objReader.Close();
            return(list);
        }
예제 #12
0
        public List <PatientInfo> GetPatientInfoByBednum(int bednum, int useflag)
        {
            string             sql       = "select PatientName,Patientstarttime,Patientendtime,PatientNum from AdditionalPatients where PatientBednum=" + bednum.ToString() + " and UseFlag=" + useflag.ToString();
            SQLiteDataReader   objReader = SQLiteHelper.GetReader(sql);
            List <PatientInfo> list      = new List <PatientInfo>();

            if (useflag == 1)
            {
                while (objReader.Read())
                {
                    list.Add(new PatientInfo()
                    {
                        PatientName      = objReader["PatientName"].ToString(),
                        PatientBednum    = Convert.ToInt16(bednum) > 256 ? "#" + (Convert.ToInt16(bednum) - 256).ToString() : Convert.ToInt16(bednum).ToString(),
                        PatientNum       = objReader["PatientNum"].ToString(),
                        Patientstarttime = Convert.ToDateTime(objReader["Patientstarttime"]),
                        Patientendtime   = Convert.ToDateTime(objReader["Patientendtime"])
                    });
                }
            }
            else
            {
                while (objReader.Read())
                {
                    list.Add(new PatientInfo()
                    {
                        PatientName      = objReader["PatientName"].ToString(),
                        PatientBednum    = Convert.ToInt16(bednum) > 256 ? "#" + (Convert.ToInt16(bednum) - 256).ToString() : Convert.ToInt16(bednum).ToString(),
                        PatientNum       = objReader["PatientNum"].ToString(),
                        Patientstarttime = Convert.ToDateTime(objReader["Patientstarttime"]),
                    });
                }
            }

            objReader.Close();
            return(list);
        }