Ejemplo n.º 1
0
        /// <summary>
        /// 病人药品处方信息列表
        /// </summary>
        /// <param name="openid">用户标识</param>
        /// <param name="values">返回信息</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_DrugPrescriptionInforList(string patientid, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int ret = -1;

            values = new ArrayList();

            try
            {
                bool _flag = false;

                string findText = _builder.GetDrugPrescriptionInforListSql(patientid, out _flag, out msg);
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, findText);

                if (!_flag)
                {
                    ret = 10;
                    return(ret);
                }

                dr = DbHelperOra.ExecuteReader(findText, connection);

                while (dr.Read())
                {
                    Patientmedication ri = new Patientmedication();

                    ri.cflsh = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    ri.ksbm  = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    ri.ksmc  = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                    ri.ysbm  = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                    ri.ysxm  = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                    ri.brid  = !dr.IsDBNull(5) ? dr.GetString(5) : "";
                    ri.kfrq  = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                    ri.sfrq  = !dr.IsDBNull(7) ? dr.GetString(7) : "";
                    ri.zjje  = !dr.IsDBNull(8) ? Convert.ToString(dr.GetDouble(8)) : " ";
                    ri.lxmc  = !dr.IsDBNull(9) ? dr.GetString(9) : "";
                    values.Add(ri);
                }
                if (values.Count > 0)
                {
                    msg = "找到病人信息";
                    ret = 00;
                }
                else
                {
                    msg    = "医院端未找到,请核对信息后重试";
                    values = null;
                    ret    = 10;
                }
                dr.Close();

                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg = GetExceptionInfo(ex);
                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }