Beispiel #1
0
 private object[] GetInfo(Neusoft.HISFC.Models.HealthRecord.Baby info)
 {
     try
     {
         object[] s = new object[14];
         s[0]  = info.InpatientNo; //住院流水号
         s[1]  = info.HappenNum;   //婴儿序号
         s[2]  = info.SexCode;     //性别   M 男性 F女性
         s[3]  = info.BirthEnd;    //妊辰结果 0 活产 1 死产 2  死胎
         s[4]  = info.Weight;      //  体重
         s[5]  = info.BabyState;   // 转归  0 死亡  1 转科 2 出院
         s[6]  = info.Breath;      //呼吸  0 自然 1 I度窒息 2 II度窒息
         s[7]  = info.InfectNum;   // 感染次数
         s[8]  = info.Infect.ID;   //感染代码
         s[9]  = info.Infect.Name; //感染名称
         s[10] = info.SalvNum;     // 抢救次数
         s[11] = info.SuccNum;     // 成功次数
         s[12] = info.BirthMod;    //生产方式
         s[13] = info.OperInfo.ID; //记录人
         return(s);
     }
     catch (Exception ex)
     {
         this.Err = ex.Message;
         return(null);
     }
 }
Beispiel #2
0
        /// <summary>
        ///插入某条记录
        ///[email protected]
        /// </summary>
        /// <param name="info"></param>
        /// <returns>失败返回 -1 成功返回 1</returns>
        public int Insert(Neusoft.HISFC.Models.HealthRecord.Baby info)
        {
            string strSql = "";

            if (this.Sql.GetSql("Case.CBaby.Insert", ref strSql) == -1)
            {
                return(-1);
            }
            try
            {
                info.HappenNum   = GetMaxHappenNum(info.InpatientNo);
                info.OperInfo.ID = this.Operator.ID;
                object[] mm = GetInfo(info);
                if (mm == null)
                {
                    this.Err = "业务层从实体中获取字符数组出错";
                    return(-1);
                }
                strSql = string.Format(strSql, mm);
            }
            catch (Exception ee)
            {
                this.Err = ee.Message;
                return(-1);
            }
            return(this.ExecNoQuery(strSql));
        }
 /// <summary>
 /// 将实体中的值赋值到row中
 /// </summary>
 /// <param name="row">传入的row</param>
 /// <param name="info">传入的实体</param>
 private void SetRow(DataRow row, Neusoft.HISFC.Models.HealthRecord.Baby info)
 {
     row["性别"]       = this.SexTypeHelper.GetName(info.SexCode);
     row["分娩结果"]     = this.BirthEndTypeHelper.GetName(info.BirthEnd);
     row["体重"]       = info.Weight;
     row["转归"]       = this.BabyStateTypeHelper.GetName(info.BabyState);
     row["呼吸"]       = this.BreathTypeHelper.GetName(info.Breath);
     row["院内感染次"]    = info.InfectNum;
     row["医院感染名称"]   = info.Infect.Name;
     row["ICD-10编码"] = info.Infect.ID;
     row["抢救次数"]     = info.SalvNum;
     row["抢救成功次数"]   = info.SuccNum;
     row["序号"]       = info.HappenNum;
 }
Beispiel #4
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns>成功返回 1 失败返回 -1 </returns>
        public int Delete(Neusoft.HISFC.Models.HealthRecord.Baby info)
        {
            string strSql = "";

            if (this.Sql.GetSql("Case.CBaby.Delete", ref strSql) == -1)
            {
                return(-1);
            }
            try
            {
                //格式化字符串
                strSql = string.Format(strSql, info.InpatientNo, info.HappenNum);
            }
            catch (Exception ee)
            {
                this.Err = ee.Message;
                return(-1);
            }
            return(this.ExecNoQuery(strSql));
        }
Beispiel #5
0
        public ArrayList SelectInfo(string inpatientNo)
        {
            ArrayList List   = null;
            string    strSql = "";

            if (this.Sql.GetSql("Case.CBaby.SelectInfo", ref strSql) == -1)
            {
                return(null);
            }
            try
            {
                strSql = string.Format(strSql, inpatientNo);
                //查询
                this.ExecQuery(strSql);
                Neusoft.HISFC.Models.HealthRecord.Baby info = null;
                List = new ArrayList();
                while (this.Reader.Read())
                {
                    info             = new Neusoft.HISFC.Models.HealthRecord.Baby();
                    info.InpatientNo = Reader[0].ToString();
                    info.HappenNum   = Neusoft.FrameWork.Function.NConvert.ToInt32(Reader[1]);
                    info.SexCode     = Reader[2].ToString();
                    info.BirthEnd    = Reader[3].ToString();
                    if (Reader[4] != DBNull.Value)
                    {
                        info.Weight = Convert.ToSingle(Reader[4]);
                    }
                    else
                    {
                        info.Weight = 0;
                    }
                    info.BabyState = Reader[5].ToString();
                    info.Breath    = Reader[6].ToString();
                    if (Reader[7] != DBNull.Value)
                    {
                        info.InfectNum = Convert.ToInt32(Reader[7].ToString());
                    }
                    info.Infect.ID   = Reader[8].ToString();
                    info.Infect.Name = Reader[9].ToString();
                    if (Reader[10] != DBNull.Value)
                    {
                        info.SalvNum = Convert.ToInt32(Reader[10].ToString());
                    }
                    if (Reader[11] != DBNull.Value)
                    {
                        info.SuccNum = Convert.ToInt32(Reader[11].ToString());
                    }
                    List.Add(info);
                    info = null;
                }
                this.Reader.Close();
            }
            catch (Exception ee)
            {
                this.Err = ee.Message;
                if (!this.Reader.IsClosed)
                {
                    this.Reader.Close();
                }
                List = null;
            }
            return(List);
        }
 /// <summary>
 /// 获取修改过的信息
 /// </summary>
 /// <returns></returns>
 private bool GetChangeInfo(DataTable tempTable, ArrayList list)
 {
     if (tempTable == null)
     {
         return(true);
     }
     try
     {
         Neusoft.HISFC.Models.HealthRecord.Baby info = null;
         foreach (DataRow row in tempTable.Rows)
         {
             info = new Neusoft.HISFC.Models.HealthRecord.Baby();
             //住院流水号
             info.InpatientNo = this.patientInfo.ID;
             if (row["性别"] != DBNull.Value)
             {
                 info.SexCode = this.SexTypeHelper.GetID(row["性别"].ToString());
             }
             if (row["分娩结果"] != DBNull.Value)
             {
                 info.BirthEnd = this.BirthEndTypeHelper.GetID(row["分娩结果"].ToString());
             }
             if (row["体重"] != DBNull.Value)
             {
                 info.Weight = Neusoft.FrameWork.Function.NConvert.ToInt32(row["体重"].ToString());
             }
             if (row["转归"] != DBNull.Value)
             {
                 string sss = this.BabyStateTypeHelper.GetID(row["转归"].ToString());
                 info.BabyState = this.BabyStateTypeHelper.GetID(row["转归"].ToString());
             }
             if (row["呼吸"] != DBNull.Value)
             {
                 info.Breath = this.BreathTypeHelper.GetID(row["呼吸"].ToString());
             }
             if (row["院内感染次"] != DBNull.Value)
             {
                 info.InfectNum = Neusoft.FrameWork.Function.NConvert.ToInt32(row["院内感染次"].ToString());
             }
             if (row["医院感染名称"] != DBNull.Value)
             {
                 info.Infect.Name = row["医院感染名称"].ToString();
             }
             if (row["ICD-10编码"] != DBNull.Value)
             {
                 info.Infect.ID = row["ICD-10编码"].ToString();
             }
             if (row["抢救次数"] != DBNull.Value)
             {
                 info.SalvNum = Neusoft.FrameWork.Function.NConvert.ToInt32(row["抢救次数"].ToString());
             }
             if (row["抢救成功次数"] != DBNull.Value)
             {
                 info.SuccNum = Neusoft.FrameWork.Function.NConvert.ToInt32(row["抢救成功次数"].ToString());
             }
             if (row["序号"] != DBNull.Value)
             {
                 info.HappenNum = Neusoft.FrameWork.Function.NConvert.ToInt32(row["序号"].ToString());
             }
             list.Add(info);
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return(false);
     }
 }