예제 #1
0
        public long m_lngAddNewMedicneTypeSet(System.Security.Principal.IPrincipal p_objPrincipal, clsMS_MedicineTypeSetVO p_objTypeVO)
        {
            if (p_objTypeVO == null || p_objTypeVO.m_strMedicineTypeIDArr == null)
            {
                return(-1);
            }

            long lngRes = 0;

            try
            {
                string strSQL = @"insert into t_ms_medicinetypeset
  (medicinetypesetid, medicinetypesetname, medicinetypeid_chr)
values
  (?, ?, ?)";

                string strGetMax = @"select max(medicinetypesetid)
  from t_ms_medicinetypeset";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                long lngEff = -1;

                if (p_objTypeVO.m_intMedicineTypeSetID <= 0)
                {
                    DataTable dtbValue = null;
                    lngRes = objHRPServ.lngGetDataTableWithoutParameters(strGetMax, ref dtbValue);
                    if (dtbValue == null || dtbValue.Rows.Count == 0)
                    {
                        p_objTypeVO.m_intMedicineTypeSetID = 1;
                    }
                    else
                    {
                        if (dtbValue.Rows[0][0] == DBNull.Value)
                        {
                            p_objTypeVO.m_intMedicineTypeSetID = 1;
                        }
                        else
                        {
                            p_objTypeVO.m_intMedicineTypeSetID = Convert.ToInt32(dtbValue.Rows[0][0]) + 1;
                        }
                    }
                }

                if (clsHRPTableService.bytDatabase_Selector != (byte)clsHRPTableService.enumDatabase_Selector.bytOracle)
                {
                    IDataParameter[] objDPArr = null;

                    for (int i = 0; i < p_objTypeVO.m_strMedicineTypeIDArr.Length; i++)
                    {
                        objHRPServ.CreateDatabaseParameter(3, out objDPArr);
                        objDPArr[0].Value = p_objTypeVO.m_intMedicineTypeSetID;
                        objDPArr[1].Value = p_objTypeVO.m_strMedicineTypeSetName;
                        objDPArr[2].Value = p_objTypeVO.m_strMedicineTypeIDArr[i];

                        lngRes = objHRPServ.lngExecuteParameterSQL(strSQL, ref lngEff, objDPArr);
                    }
                }
                else
                {
                    DbType[] dbTypes = new DbType[] { DbType.Int32, DbType.String, DbType.String };

                    object[][] objValues = new object[3][];

                    int intItemCount = p_objTypeVO.m_strMedicineTypeIDArr.Length;
                    for (int j = 0; j < objValues.Length; j++)
                    {
                        objValues[j] = new object[intItemCount];//初始化
                    }

                    for (int i = 0; i < intItemCount; i++)
                    {
                        objValues[0][i] = p_objTypeVO.m_intMedicineTypeSetID;
                        objValues[1][i] = p_objTypeVO.m_strMedicineTypeSetName;
                        objValues[2][i] = p_objTypeVO.m_strMedicineTypeIDArr[i];
                    }
                    lngRes = objHRPServ.m_lngSaveArrayWithParameters(strSQL, objValues, dbTypes);
                }
                p_objTypeVO = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
        public long m_lngStatistics(System.Security.Principal.IPrincipal p_objPrincipal, string p_strStorageID, DateTime p_dtmBegin, DateTime p_dtmEnd, string p_strVendorID, int p_intMedicineSetID, out DataTable p_dtbData)
        {
            p_dtbData = null;
            long lngRes = 0;

            try
            {
                string strVendorSQL = string.Empty;
                string strSetID     = string.Empty;
                if (!string.IsNullOrEmpty(p_strVendorID))
                {
                    strVendorSQL = @"
   and a.vendorid_chr = ? ";
                }
                if (p_intMedicineSetID > 0)
                {
                    strSetID = @"
   and ty.medicinetypesetid = ?";
                }

                string strSQL = @"select c.usercode_chr,c.vendorname_vchr,
       ty.medicinetypesetname medicinetypename_vchr,
       sum(b.callprice_int * b.amount) inmoney,
       sum(b.wholesaleprice_int * b.amount) wholesalemoney,
       sum(b.retailprice_int * b.amount) retailmoney
  from t_ms_instorage_detal b
 inner join t_ms_instorage a on a.seriesid_int = b.seriesid2_int
 inner join t_bse_medicine d on b.medicineid_chr = d.medicineid_chr
  inner join t_ms_medicinetypeset ty on ty.medicinetypeid_chr =
                                             d.medicinetypeid_chr
  left outer join t_bse_vendor c on a.vendorid_chr = c.vendorid_chr
 where a.formtype_int = 1 and b.status = 1
   and (a.state_int = 2 or a.state_int = 3)
   and a.exam_dat between ? and ?
   and a.storageid_chr = ? " + strVendorSQL + strSetID + @"
 group by ty.medicinetypesetname, a.vendorid_chr, c.vendorname_vchr,c.usercode_chr
 order by ty.medicinetypesetname, c.vendorname_vchr";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objDPArr   = null;
                if (string.IsNullOrEmpty(p_strVendorID))
                {
                    if (string.IsNullOrEmpty(strSetID))
                    {
                        objHRPServ.CreateDatabaseParameter(3, out objDPArr);
                        objDPArr[0].DbType = DbType.DateTime;
                        objDPArr[0].Value  = DateTime.Parse(p_dtmBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[1].DbType = DbType.DateTime;
                        objDPArr[1].Value  = DateTime.Parse(p_dtmEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[2].Value  = p_strStorageID;
                    }
                    else
                    {
                        objHRPServ.CreateDatabaseParameter(4, out objDPArr);
                        objDPArr[0].DbType = DbType.DateTime;
                        objDPArr[0].Value  = DateTime.Parse(p_dtmBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[1].DbType = DbType.DateTime;
                        objDPArr[1].Value  = DateTime.Parse(p_dtmEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[2].Value  = p_strStorageID;
                        objDPArr[3].Value  = p_intMedicineSetID;
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(strSetID))
                    {
                        objHRPServ.CreateDatabaseParameter(4, out objDPArr);
                        objDPArr[0].DbType = DbType.DateTime;
                        objDPArr[0].Value  = DateTime.Parse(p_dtmBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[1].DbType = DbType.DateTime;
                        objDPArr[1].Value  = DateTime.Parse(p_dtmEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[2].Value  = p_strStorageID;
                        objDPArr[3].Value  = p_strVendorID;
                    }
                    else
                    {
                        objHRPServ.CreateDatabaseParameter(5, out objDPArr);
                        objDPArr[0].DbType = DbType.DateTime;
                        objDPArr[0].Value  = DateTime.Parse(p_dtmBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[1].DbType = DbType.DateTime;
                        objDPArr[1].Value  = DateTime.Parse(p_dtmEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[2].Value  = p_strStorageID;
                        objDPArr[3].Value  = p_strVendorID;
                        objDPArr[4].Value  = p_intMedicineSetID;
                    }
                }

                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref p_dtbData, objDPArr);
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #3
0
        public long m_lngGetPrepayByRegID(string RegID, int Type, out DataTable dt)
        {
            long   lngRes = 0;
            string SQL    = "";

            if (Type == 1)
            {
                SQL = @"select a.prepayid_chr, a.patientid_chr, a.registerid_chr, a.liner_int,
                               a.paytype_int, a.cuycate_int, a.money_dec, a.prepayinv_vchr,
                               a.areaid_chr, a.des_vchr, a.creatorid_chr, a.create_dat, a.deactid_chr,
                               a.deactivate_dat, a.status_int, a.isclear_int, a.pressno_vchr,
                               a.uptype_int, a.balanceemp_chr, a.balance_dat, a.patientname_chr,
                               a.areaname_vchr, a.balanceflag_int, a.balanceid_vchr, a.confirmemp_chr,
                               a.chargeno_chr, a.originvono_vchr, a.origchargeno_chr, 
                               b.empno_chr as lastname_vchr, nvl(c.empno_chr, '') as confirmemp,  r.repprnbillno_vchr   
                          from t_opr_bih_prepay a,
                               t_bse_employee b,
                               t_bse_employee c,
                               t_opr_bih_billrepeatprint r             
                         where a.creatorid_chr = b.empid_chr(+) 
                           and a.confirmemp_chr = c.empid_chr(+) 
                           and a.prepayid_chr = r.billid_chr(+)
                           and a.registerid_chr = ? 
                        order by a.create_dat, a.prepayinv_vchr, a.paytype_int";
            }
            else
            {
                SQL = @"select ta.registerid_chr, ta.total, tb.prepayid_chr, tb.prepayinv_vchr, tb.balancetotal 
                          from 
                               (select a.registerid_chr, sum(nvl(a.money_dec,0)) as total 
                                  from t_opr_bih_prepay a
                                 where a.status_int = 1 
                                group by a.registerid_chr) ta,
                                (select a.prepayid_chr, a.registerid_chr, a.prepayinv_vchr, nvl(a.money_dec,0) as balancetotal 
                                  from t_opr_bih_prepay a
                                 where a.status_int = 1 
                                   and a.isclear_int = 0 
                                   and a.paytype_int = 1                                   
                                   and not exists (select 1
                                                   from t_opr_bih_prepay b 
                                                  where b.status_int = 1 
                                                    and b.isclear_int = 0 
                                                    and b.paytype_int = 2
                                                    and a.prepayinv_vchr = b.prepayinv_vchr)
                                   and not exists (select 1
                                                   from t_opr_bih_prepay b 
                                                  where b.status_int = 1 
                                                    and b.isclear_int = 0 
                                                    and b.paytype_int = 4
                                                    and a.prepayinv_vchr = b.originvono_vchr)
                                    union all
                                    select a.prepayid_chr, a.registerid_chr, a.prepayinv_vchr, nvl(a.money_dec,0) as balancetotal 
                                                                      from t_opr_bih_prepay a
                                                                     where a.status_int = 1 
                                                                       and a.isclear_int = 0 
                                                                       and a.paytype_int = 3 ) tb
                         where ta.registerid_chr = tb.registerid_chr(+)
                           and ta.registerid_chr = ?";
            }

            dt = new DataTable();

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                IDataParameter[]   ParamArr  = null;
                objHRPSvc.CreateDatabaseParameter(1, out ParamArr);
                //((OracleParameter)ParamArr[0]).OracleDbType = OracleDbType.Char;
                ParamArr[0].Value = RegID;
                lngRes            = objHRPSvc.lngGetDataTableWithParameters(SQL, ref dt, ParamArr);
                if (Type == 1 && dt != null && dt.Rows.Count > 0)
                {
                    #region  除多次重打记录
                    List <int> lstRowNo = new List <int>();
                    for (int i = dt.Rows.Count - 1; i >= 0; i--)
                    {
                        if (i < dt.Rows.Count - 1)
                        {
                            if (dt.Rows[i]["prepayid_chr"].ToString() == dt.Rows[i + 1]["prepayid_chr"].ToString())
                            {
                                lstRowNo.Add(i);
                            }
                        }
                    }
                    if (lstRowNo.Count > 0)
                    {
                        for (int i = dt.Rows.Count - 1; i >= 0; i--)
                        {
                            if (lstRowNo.IndexOf(i) >= 0)
                            {
                                dt.Rows.RemoveAt(i);
                            }
                        }
                    }
                    #endregion
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
예제 #4
0
        public long m_mthSelectAdjustData(int intDsOrMs, int p_intMakeFilm, DateTime strBegin, DateTime strEnd, string strMedicineType, string strMedicineid, out DataTable m_objTable)
        {
            long lngRes = -1;

            m_objTable = new DataTable();
            DataTable dt     = new DataTable();
            string    strSql = "";

            /// 000-全部
            if (intDsOrMs == 0)
            {
                #region 药房
                if (strMedicineType == "000")
                {
                    if (string.IsNullOrEmpty(strMedicineid))
                    {
                        strSql = @"select distinct b.medicinename_vch,
                                     b.medspec_vchr,
                                     decode(c.opchargeflg_int,0,b.opunit_vchr,
                                     1,b.ipunit_vchr) as opunit_vchr,
                                     c.productorid_chr,
                                     b.opnewretailprice_int newretailprice_int,
                                     decode(c.opchargeflg_int,0,b.opoldretailprice_int,
                                     1,b.ipoldretailprice_int) as opoldprice_int,
                                     decode(c.opchargeflg_int,0,b.opnewretailprice_int,
                                     1,b.ipnewretailprice_int) as opnewprice_int,
                                     a.examdate_dat adjustpricedate_dat,
                                     b.reason_vchr remark_vchr,
                                     c.medicineid_chr, c.assistcode_chr
                                from t_ds_adjustprice a,
                                     t_ds_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+)
                                 and (a.status_int=2 or a.status_int=3)
                                 and b.status_int=1
                                 and a.examdate_dat between ? and ?  order by b.medicinename_vch, c.medicineid_chr, a.examdate_dat desc";
                    }
                    else
                    {
                        strSql = @"select distinct b.medicinename_vch,
                                     b.medspec_vchr,
                                     decode(c.opchargeflg_int,0,b.opunit_vchr,
                                     1,b.ipunit_vchr) as opunit_vchr,
                                     c.productorid_chr,
                                     b.opnewretailprice_int newretailprice_int,
                                     decode(c.opchargeflg_int,0,b.opoldretailprice_int,
                                     1,b.ipoldretailprice_int) as opoldprice_int,
                                     decode(c.opchargeflg_int,0,b.opnewretailprice_int,
                                     1,b.ipnewretailprice_int) as opnewprice_int,
                                     a.examdate_dat adjustpricedate_dat,
                                     b.reason_vchr remark_vchr,
                                     c.medicineid_chr, c.assistcode_chr
                                from t_ds_adjustprice a,
                                     t_ds_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+)
                                 and (a.status_int=2 or a.status_int=3)
                                 and b.status_int=1
                                 and c.medicineid_chr=?
                                 and a.examdate_dat between ? and ?  order by b.medicinename_vch, c.medicineid_chr, a.examdate_dat desc";
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(strMedicineid))
                    {
                        strSql = @"select distinct b.medicinename_vch,
                                     b.medspec_vchr,
                                     decode(c.opchargeflg_int,0,b.opunit_vchr,
                                     1,b.ipunit_vchr) as opunit_vchr,
                                     c.productorid_chr,
                                     b.opnewretailprice_int newretailprice_int,
                                     decode(c.opchargeflg_int,0,b.opoldretailprice_int,
                                     1,b.ipoldretailprice_int) as opoldprice_int,
                                     decode(c.opchargeflg_int,0,b.opnewretailprice_int,
                                     1,b.ipnewretailprice_int) as opnewprice_int,
                                     a.examdate_dat adjustpricedate_dat,
                                     b.reason_vchr remark_vchr,
                                     c.medicineid_chr, c.assistcode_chr
                                from t_ds_adjustprice a,
                                     t_ds_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+)
                                 and (a.status_int=2 or a.status_int=3)
                                 and b.status_int=1
                                 and d.medicinetypeid_chr=?
                                 and a.examdate_dat between ? and ?  order by b.medicinename_vch, c.medicineid_chr, a.examdate_dat desc";
                    }
                    else
                    {
                        strSql = @"select distinct b.medicinename_vch,
                                     b.medspec_vchr,
                                     decode(c.opchargeflg_int,0,b.opunit_vchr,
                                     1,b.ipunit_vchr) as opunit_vchr,
                                     c.productorid_chr,
                                     b.opnewretailprice_int newretailprice_int,
                                     decode(c.opchargeflg_int,0,b.opoldretailprice_int,
                                     1,b.ipoldretailprice_int) as opoldprice_int,
                                     decode(c.opchargeflg_int,0,b.opnewretailprice_int,
                                     1,b.ipnewretailprice_int) as opnewprice_int,
                                     a.examdate_dat adjustpricedate_dat,
                                     b.reason_vchr remark_vchr,
                                     c.medicineid_chr, c.assistcode_chr
                                from t_ds_adjustprice a,
                                     t_ds_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+)
                                 and (a.status_int=2 or a.status_int=3)
                                 and b.status_int=1 and d.medicinetypeid_chr=?
                                 and c.medicineid_chr=?                                 
                                 and a.examdate_dat between ? and ?  order by b.medicinename_vch, c.medicineid_chr, a.examdate_dat desc";
                    }
                }
                #endregion
            }
            else
            {
                #region 药库
                if (strMedicineType == "000")
                {
                    if (string.IsNullOrEmpty(strMedicineid))
                    {
                        strSql = @"select distinct b.medicinename_vch,
       b.medspec_vchr,
       b.opunit_vchr,
       c.productorid_chr,
       b.newretailprice_int,
       round(b.newretailprice_int / c.packqty_dec, 4) opnewprice_int,
       a.adjustpricedate_dat,
       b.reason_vchr remark_vchr,
       c.medicineid_chr,
       b.oldretailprice_int opoldprice_int, c.assistcode_chr
                                from t_ms_adjustprice a,
                                     t_ms_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+)
                                 and a.adjustpricedate_dat between ? and ?
                             order by b.medicinename_vch, c.medicineid_chr, a.adjustpricedate_dat desc";
                    }
                    else
                    {
                        strSql = @"select distinct b.medicinename_vch,
       b.medspec_vchr,
       b.opunit_vchr,
       c.productorid_chr,
       b.newretailprice_int,
       round(b.newretailprice_int / c.packqty_dec, 4) opnewprice_int,
       a.adjustpricedate_dat,
       b.reason_vchr remark_vchr,
       c.medicineid_chr,
       b.oldretailprice_int opoldprice_int, c.assistcode_chr
                                from t_ms_adjustprice a,
                                     t_ms_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+) and b.medicineid_chr = ?
                                 and a.adjustpricedate_dat between ? and ?
                             order by b.medicinename_vch, c.medicineid_chr, a.adjustpricedate_dat desc";
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(strMedicineid))
                    {
                        strSql = @"select distinct b.medicinename_vch,
       b.medspec_vchr,
       b.opunit_vchr,
       c.productorid_chr,
       b.newretailprice_int,
       round(b.newretailprice_int / c.packqty_dec, 4) opnewprice_int,
       a.adjustpricedate_dat,
       b.reason_vchr remark_vchr,
       c.medicineid_chr,
       b.oldretailprice_int opoldprice_int, c.assistcode_chr
                                from t_ms_adjustprice a,
                                     t_ms_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+)
                                 and d.medicinetypeid_chr=?
                                 and a.adjustpricedate_dat between ? and ?
                             order by b.medicinename_vch, c.medicineid_chr, a.adjustpricedate_dat desc";
                    }
                    else
                    {
                        strSql = @"select distinct b.medicinename_vch,
       b.medspec_vchr,
       b.opunit_vchr,
       c.productorid_chr,
       b.newretailprice_int,
       round(b.newretailprice_int / c.packqty_dec, 4) opnewprice_int,
       a.adjustpricedate_dat,
       b.reason_vchr remark_vchr,
       c.medicineid_chr,
       b.oldretailprice_int opoldprice_int, c.assistcode_chr
                                from t_ms_adjustprice a,
                                     t_ms_adjustprice_detail b,
                                     t_bse_medicine c,
                                     t_aid_medicinetype d
                               where a.seriesid_int=b.seriesid2_int(+)
                                 and b.medicineid_chr=c.medicineid_chr(+)
                                 and c.medicinetypeid_chr=d.medicinetypeid_chr(+)
                                 and d.medicinetypeid_chr=? and b.medicineid_chr = ?
                                 and a.adjustpricedate_dat between ? and ? 
                             order by b.medicinename_vch, c.medicineid_chr, a.adjustpricedate_dat desc";
                    }
                }
                #endregion
            }
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();

                IDataParameter[] objDPArr = null;

                int n = 0;
                if (strMedicineType == "000")
                {
                    if (string.IsNullOrEmpty(strMedicineid))
                    {
                        objHRPSvc.CreateDatabaseParameter(2, out objDPArr);
                        objDPArr[n++].Value = Convert.ToDateTime(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[n++].Value = Convert.ToDateTime(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                    }
                    else
                    {
                        objHRPSvc.CreateDatabaseParameter(3, out objDPArr);
                        objDPArr[n++].Value = strMedicineid;
                        objDPArr[n++].Value = Convert.ToDateTime(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[n++].Value = Convert.ToDateTime(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(strMedicineid))
                    {
                        objHRPSvc.CreateDatabaseParameter(3, out objDPArr);
                        objDPArr[n++].Value = strMedicineType;
                        objDPArr[n++].Value = Convert.ToDateTime(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[n++].Value = Convert.ToDateTime(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                    }
                    else
                    {
                        objHRPSvc.CreateDatabaseParameter(4, out objDPArr);
                        objDPArr[n++].Value = strMedicineType;
                        objDPArr[n++].Value = strMedicineid;
                        objDPArr[n++].Value = Convert.ToDateTime(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                        objDPArr[n++].Value = Convert.ToDateTime(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                    }
                }

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSql, ref dt, objDPArr);
                if (p_intMakeFilm == 1 && dt != null && dt.Rows.Count > 0)//造影剂

                {
                    string    m_strFilter   = string.Empty;
                    DataTable m_dtbMakeFilm = new DataTable();
                    strSql = @"select a.medicineid_chr from t_aid_makefilmmedicine a";
                    lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSql, ref m_dtbMakeFilm);
                    if (m_dtbMakeFilm != null && m_dtbMakeFilm.Rows.Count > 0)
                    {
                        foreach (DataRow dr in m_dtbMakeFilm.Rows)
                        {
                            if (m_strFilter.Length == 0)
                            {
                                m_strFilter = "medicineid_chr = '" + dr["medicineid_chr"].ToString() + "'";
                            }
                            else
                            {
                                m_strFilter = m_strFilter + " or medicineid_chr = '" + dr["medicineid_chr"].ToString() + "'";
                            }
                        }

                        DataView dv = dt.DefaultView;
                        dv.RowFilter = m_strFilter;
                        dt           = dv.ToTable();
                    }
                    else
                    {
                        dt.Clear();
                    }
                }

                //lngRes = objHRPSvc.lngGetDataTableWithParameters(strSql, ref m_objTable, objDPArr);

                objHRPSvc.Dispose();

                if (dt != null && dt.Rows.Count > 0)
                {
                    DataView dv = new DataView(dt);
                    dv.Sort = "medicineid_chr desc";
                    dt      = dv.ToTable();

                    m_objTable.Columns.Add("medicinename_vch", typeof(String));
                    m_objTable.Columns.Add("medspec_vchr", typeof(String));
                    m_objTable.Columns.Add("opunit_vchr", typeof(String));
                    m_objTable.Columns.Add("productorid_chr", typeof(String));
                    m_objTable.Columns.Add("opoldprice_int", typeof(Double));
                    m_objTable.Columns.Add("newretailprice_int", typeof(Double));
                    m_objTable.Columns.Add("opnewprice_int", typeof(Double));
                    m_objTable.Columns.Add("adjustpricedate_dat", typeof(DateTime));
                    m_objTable.Columns.Add("enddate_dat", typeof(String));
                    m_objTable.Columns.Add("remark_vchr", typeof(String));
                    m_objTable.Columns.Add("assistcode_chr", typeof(string));

                    //int intIdRow = 1;
                    DataRow  dr         = null;
                    DataRow  drTemp1    = null;
                    DataRow  drTemp2    = null;
                    DateTime dTimeTemp  = new DateTime();
                    int      intIsFirst = 0;
                    int      iRowCount  = dt.Rows.Count;
                    m_objTable.BeginLoadData();
                    for (int i = 0; i < iRowCount; i++)
                    {
                        bool blnExists = false;
                        drTemp1 = dt.Rows[i];
                        dr      = m_objTable.NewRow();
                        double dbloldprice       = 0d;
                        double dblnewretailprice = 0d;
                        double dblnewprice       = 0d;

                        double.TryParse(Convert.ToString(drTemp1["opoldprice_int"]), out dbloldprice);
                        double.TryParse(Convert.ToString(drTemp1["newretailprice_int"]), out dblnewretailprice);
                        double.TryParse(Convert.ToString(drTemp1["opnewprice_int"]), out dblnewprice);

                        dr["medicinename_vch"]    = drTemp1["medicinename_vch"];
                        dr["medspec_vchr"]        = drTemp1["medspec_vchr"];
                        dr["opunit_vchr"]         = drTemp1["opunit_vchr"];
                        dr["productorid_chr"]     = drTemp1["productorid_chr"];
                        dr["opoldprice_int"]      = Convert.ToDouble(dbloldprice.ToString("0.0000"));
                        dr["newretailprice_int"]  = Convert.ToDouble(dblnewretailprice.ToString("0.0000"));
                        dr["opnewprice_int"]      = Convert.ToDouble(dblnewprice.ToString("0.0000"));
                        dr["adjustpricedate_dat"] = Convert.ToDateTime(Convert.ToDateTime(drTemp1["adjustpricedate_dat"]).ToString("yyyy-MM-dd HH:mm:ss"));
                        dr["assistcode_chr"]      = drTemp1["assistcode_chr"];
                        for (int j = i + 1; j < iRowCount;)
                        {
                            drTemp2 = dt.Rows[j];
                            if (drTemp1["medicineid_chr"].ToString().Trim() == drTemp2["medicineid_chr"].ToString().Trim())
                            {
                                blnExists = true;
                                //intIdRow++;
                            }
                            if (blnExists)
                            {
                                if (intIsFirst != 0)
                                {
                                    dr["enddate_dat"] = dTimeTemp.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
                                }
                                else
                                {
                                    dr["enddate_dat"] = "";
                                }
                                intIsFirst = 1;
                                dTimeTemp  = Convert.ToDateTime(dr["adjustpricedate_dat"].ToString());
                                break;
                            }
                            else
                            {
                                if (intIsFirst != 0)
                                {
                                    dr["enddate_dat"] = dTimeTemp.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
                                }
                                else
                                {
                                    dr["enddate_dat"] = "";
                                }
                                intIsFirst = 0;
                                dTimeTemp  = Convert.ToDateTime(dr["adjustpricedate_dat"].ToString());
                                break;
                            }
                        }

                        if (i == iRowCount - 1)
                        {
                            if (i == 0)
                            {
                                dr["enddate_dat"] = "";
                            }
                            else
                            {
                                dr["enddate_dat"] = dTimeTemp.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
                            }
                        }

                        dr["remark_vchr"] = drTemp1["remark_vchr"];
                        m_objTable.Rows.Add(dr.ItemArray);
                        //if (blnExists)
                        //{
                        //    m_objTable.Rows.Add(dr.ItemArray);
                        //}
                        //else
                        //{
                        //    m_objTable.Rows.Add(dr.ItemArray);
                        //}
                    }
                    m_objTable.EndLoadData();
                    m_objTable.AcceptChanges();
                    dr      = null;
                    drTemp1 = null;
                    drTemp2 = null;
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #5
0
        public long m_lngCheckHasUnCommitRecord(System.Security.Principal.IPrincipal p_objPrincipal, DateTime p_dtmBeginDate, DateTime p_dtmEndDate, string p_strStorageID, out string p_strHintText)
        {
            p_strHintText = string.Empty;
            long lngRes = 0;

            try
            {
                #region 入库表

                string strSQL = @"select t.seriesid_int, t.formtype_int
  from t_ds_instorage t, t_ds_instorage_detail d
 where t.makeorder_dat between ? and ?
   and t.status = 1
   and t.drugstoreid_chr = ?
   and t.seriesid_int = d.seriesid2_int
   and d.status = 1";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objDPArr   = null;
                objHRPServ.CreateDatabaseParameter(3, out objDPArr);
                objDPArr[0].DbType = DbType.DateTime;
                objDPArr[0].Value  = p_dtmBeginDate;
                objDPArr[1].DbType = DbType.DateTime;
                objDPArr[1].Value  = p_dtmEndDate;
                objDPArr[2].Value  = p_strStorageID;

                DataTable dtbValue = null;
                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtbValue, objDPArr);
                StringBuilder stbHint = new StringBuilder(100);
                if (dtbValue != null)
                {
                    if (dtbValue.Rows.Count > 0)
                    {
                        stbHint.Append(" 入库记录 ");
                    }
                }
                #endregion
                #region 出库表

                strSQL = @"select t.seriesid_int, t.formtype_int
  from t_ds_outstorage t,t_ds_outstorage_detail d
 where t.makeorder_dat between ? and ?
   and t.status_int = 1
   and t.drugstoreid_chr = ?
   and t.seriesid_int = d.seriesid2_int
   and d.status = 1";

                objHRPServ.CreateDatabaseParameter(3, out objDPArr);
                objDPArr[0].DbType = DbType.DateTime;
                objDPArr[0].Value  = p_dtmBeginDate;
                objDPArr[1].DbType = DbType.DateTime;
                objDPArr[1].Value  = p_dtmEndDate;
                objDPArr[2].Value  = p_strStorageID;
                dtbValue           = null;
                lngRes             = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtbValue, objDPArr);

                if (dtbValue != null)
                {
                    if (dtbValue.Rows.Count > 0)
                    {
                        stbHint.Append(" 出库记录 ");
                    }
                }
                #endregion

                //                #region 调价表

                //                strSQL = @"select count(t.seriesid_int)
                //  from t_ms_adjustprice t, t_ms_adjustprice_detail d
                // where t.adjustpricedate_dat between ? and ?
                //   and t.formstate_int = 1
                //   and t.storageid_chr = ?
                //   and t.seriesid_int = d.seriesid2_int
                //   and d.status_int = 1";

                //                objHRPServ.CreateDatabaseParameter(3, out objDPArr);
                //                objDPArr[0].DbType = DbType.DateTime;
                //                objDPArr[0].Value = p_dtmBeginDate;
                //                objDPArr[1].DbType = DbType.DateTime;
                //                objDPArr[1].Value = p_dtmEndDate;
                //                objDPArr[2].Value = p_strStorageID;

                //                dtbValue = null;
                //                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtbValue, objDPArr);

                //                if (dtbValue != null && dtbValue.Rows.Count == 1)
                //                {
                //                    int intCount = 0;
                //                    if (int.TryParse(dtbValue.Rows[0][0].ToString(), out intCount))
                //                    {
                //                        if (intCount > 0)
                //                        {
                //                            stbHint.Append(" 调价记录 ");
                //                        }
                //                    }
                //                }
                //                #endregion

                //                #region 盘点表

                //                strSQL = @"select count(t.seriesid_int)
                //  from t_ms_storagecheck t,t_ms_storagecheck_detail d
                // where t.checkdate_dat between ? and ?
                //   and t.status = 1
                //   and t.storageid_chr = ?
                //   and t.seriesid_int = d.seriesid2_int
                //   and d.status_int = 1";

                //                objHRPServ.CreateDatabaseParameter(3, out objDPArr);
                //                objDPArr[0].DbType = DbType.DateTime;
                //                objDPArr[0].Value = p_dtmBeginDate;
                //                objDPArr[1].DbType = DbType.DateTime;
                //                objDPArr[1].Value = p_dtmEndDate;
                //                objDPArr[2].Value = p_strStorageID;

                //                dtbValue = null;
                //                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtbValue, objDPArr);

                //                if (dtbValue != null && dtbValue.Rows.Count == 1)
                //                {
                //                    int intCount = 0;
                //                    if (int.TryParse(dtbValue.Rows[0][0].ToString(), out intCount))
                //                    {
                //                        if (intCount > 0)
                //                        {
                //                            stbHint.Append(" 盘点记录 ");
                //                        }
                //                    }
                //                }
                //                #endregion

                p_strHintText = stbHint.ToString();
                objHRPServ.Dispose();
                objHRPServ = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #6
0
        public long m_lngGetCheckItemDeviceCheckItem(System.Security.Principal.IPrincipal p_objPrincipal, string p_strDeviceModelID, out clsLisCheckItemDeviceCheckItem_VO[] p_objCheckItemDeviceCheckItem)
        {
            long lngRes = 0;

            p_objCheckItemDeviceCheckItem = null;

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsAdvis2120Svc", "m_lngGetCheckItemDeviceCheckItem");
            if (lngRes < 0)
            {
                return(-1);
            }
            DataTable dtbItem = null;
            string    strSQL  = @"select a.check_item_id_chr, a.modify_dat, a.operatorid_chr,
                                     a.device_check_item_id_chr, a.device_model_id_chr, a.groupid_chr,
                                     b.check_item_name_vchr, b.check_item_english_name_vchr,
                                     b.shortname_chr
                                from t_bse_lis_check_item_dev_item a, t_bse_lis_check_item b
                               where a.check_item_id_chr = b.check_item_id_chr";

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                if (p_strDeviceModelID != "")
                {
                    strSQL += " and trim(a.device_model_id_chr) = ?";
                    IDataParameter[] objParmaArr = null;
                    objHRPSvc.CreateDatabaseParameter(1, out objParmaArr);
                    objParmaArr[0].Value = p_strDeviceModelID;
                    lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbItem, objParmaArr);
                }
                else
                {
                    lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtbItem);
                }
                objHRPSvc.Dispose();
                if (lngRes > 0 && dtbItem != null)
                {
                    if (dtbItem.Rows.Count > 0)
                    {
                        p_objCheckItemDeviceCheckItem = new clsLisCheckItemDeviceCheckItem_VO[dtbItem.Rows.Count];
                        for (int i = 0; i < dtbItem.Rows.Count; i++)
                        {
                            p_objCheckItemDeviceCheckItem[i] = new clsLisCheckItemDeviceCheckItem_VO();
                            p_objCheckItemDeviceCheckItem[i].m_strCHECK_ITEM_ID_CHR        = dtbItem.Rows[i]["check_item_id_chr"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strDEVICE_CHECK_ITEM_ID_CHR = dtbItem.Rows[i]["device_check_item_id_chr"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strDEVICE_MODEL_ID_CHR      = dtbItem.Rows[i]["device_model_id_chr"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strGROUPID_CHR                  = dtbItem.Rows[i]["groupid_chr"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strMODIFY_DAT                   = dtbItem.Rows[i]["modify_dat"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strOPERATORID_CHR               = dtbItem.Rows[i]["operatorid_chr"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strCHECK_ITEM_NAME_VCHR         = dtbItem.Rows[i]["check_item_name_vchr"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strCHECK_ITEM_ENGLISH_NAME_VCHR = dtbItem.Rows[i]["check_item_english_name_vchr"].ToString().Trim();
                            p_objCheckItemDeviceCheckItem[i].m_strSHORTNAME_CHR                = dtbItem.Rows[i]["shortname_chr"].ToString().Trim();
                        }
                    }
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);//要在LogError方法中抛出异常。
            }
            return(lngRes);
        }
예제 #7
0
        public long m_lngGetCheckItemByCategoryID(System.Security.Principal.IPrincipal p_objPrincipal, string p_strCategoryID, out clsCheckItem_VO[] p_objResultArr)
        {
            long lngRes = 0;

            p_objResultArr = new clsCheckItem_VO[0];
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsAdvis2120Svc", "m_lngGetCheckItemByCategoryID");
            if (lngRes < 0)
            {
                return(-1);
            }

            lngRes = 0;
            string strSQL = @"select rptno_chr, pycode_chr, unit_chr, check_item_name_vchr,
                                     is_sex_related_chr, check_item_english_name_vchr, is_age_related_chr,
                                     is_sample_related_chr, formula_vchr, test_methods_vchr,
                                     clinic_meaning_vchr, check_item_id_chr, shortname_chr,
                                     is_qc_required_chr, resulttype_chr, ref_value_range_vchr, wbcode_chr,
                                     assist_code01_chr, assist_code02_chr, is_no_food_required_chr,
                                     is_physical_exam_required_chr, is_reservation_required_chr,
                                     sample_valid_time_dec, sample_valid_time_unit_chr, modify_dat,
                                     operatorid_chr, check_category_id_chr
                                from t_bse_lis_check_item";

            try
            {
                DataTable dtbResult = new DataTable();
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                if (p_strCategoryID.ToString().Trim() != "")
                {
                    strSQL += " where check_category_id_chr = ?";
                    IDataParameter[] objParamArr = null;
                    objHRPSvc.CreateDatabaseParameter(1, out objParamArr);
                    objParamArr[0].Value = p_strCategoryID;
                    lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objParamArr);
                }
                else
                {
                    lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtbResult);
                }
                objHRPSvc.Dispose();
                if (lngRes > 0 && dtbResult.Rows.Count > 0)
                {
                    p_objResultArr = new clsCheckItem_VO[dtbResult.Rows.Count];
                    for (int i1 = 0; i1 < p_objResultArr.Length; i1++)
                    {
                        p_objResultArr[i1] = new clsCheckItem_VO();
                        p_objResultArr[i1].m_strCheck_Item_ID             = dtbResult.Rows[i1]["check_item_id_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strRPTNO                     = dtbResult.Rows[i1]["rptno_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strPycode                    = dtbResult.Rows[i1]["pycode_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strUnit                      = dtbResult.Rows[i1]["unit_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strCheck_Item_Name           = dtbResult.Rows[i1]["check_item_name_vchr"].ToString().Trim();
                        p_objResultArr[i1].m_strIs_Sex_Related            = dtbResult.Rows[i1]["is_sex_related_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strCheck_Item_English_Name   = dtbResult.Rows[i1]["check_item_english_name_vchr"].ToString().Trim();
                        p_objResultArr[i1].m_strIs_Age_Related            = dtbResult.Rows[i1]["is_age_related_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strIs_Sample_Related         = dtbResult.Rows[i1]["is_sample_related_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strFormula                   = dtbResult.Rows[i1]["formula_vchr"].ToString().Trim();
                        p_objResultArr[i1].m_strTest_Method               = dtbResult.Rows[i1]["test_methods_vchr"].ToString().Trim();
                        p_objResultArr[i1].m_strClinic_meaning            = dtbResult.Rows[i1]["clinic_meaning_vchr"].ToString().Trim();
                        p_objResultArr[i1].m_strShortName                 = dtbResult.Rows[i1]["shortname_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strIs_Qc_Required            = dtbResult.Rows[i1]["is_qc_required_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strResultType                = dtbResult.Rows[i1]["resulttype_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strRef_Value_Range           = dtbResult.Rows[i1]["ref_value_range_vchr"].ToString().Trim();
                        p_objResultArr[i1].m_strWbcode                    = dtbResult.Rows[i1]["wbcode_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strAssist_Code01             = dtbResult.Rows[i1]["assist_code01_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strAssist_Code02             = dtbResult.Rows[i1]["assist_code02_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strIs_No_Food_Required       = dtbResult.Rows[i1]["is_no_food_required_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strIs_Physical_Exam_Required = dtbResult.Rows[i1]["is_physical_exam_required_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strIs_Reservation_Required   = dtbResult.Rows[i1]["is_reservation_required_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strSample_Valid_Time         = dtbResult.Rows[i1]["sample_valid_time_dec"].ToString().Trim();
                        p_objResultArr[i1].m_strSample_Valid_Time_Unit    = dtbResult.Rows[i1]["sample_valid_time_unit_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strModify_Dat                = dtbResult.Rows[i1]["modify_dat"].ToString().Trim();
                        p_objResultArr[i1].m_strOperator_ID               = dtbResult.Rows[i1]["operatorid_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strCheck_Category_ID         = dtbResult.Rows[i1]["check_category_id_chr"].ToString().Trim();
                    }
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #8
0
        public long m_lngGetDirectorSignWithEmployee(System.Security.Principal.IPrincipal p_objPrincipal,
                                                     int p_intFlag, string p_strEmployeeID, out DataTable p_objdt)
        {
            long lngRes = 0;

            p_objdt = null;
            clsHRPTableService objHRPServ = new clsHRPTableService();

            try
            {
                string strSql = "";

                switch (p_intFlag)
                {
                case 0:
                    strSql = @" select distinct t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
									from t_bse_employee t, t_bse_deptemp d
									where t.status_int = 1
                                    and (t.technicallevel_chr like '5%'or t.technicallevel_chr like '4%')
									and t.empid_chr = d.empid_chr
									and exists  (select   deptid_chr from t_bse_deptemp de  where   empid_chr=? and de.deptid_chr = d.deptid_chr)
									order by t.technicallevel_chr desc"                                    ;
                    break;

                case 10:
                    strSql = @" select distinct t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
									from t_bse_employee t, t_bse_deptemp d
									where t.status_int = 1
                                    and t.technicallevel_chr ='550'
									and t.empid_chr = d.empid_chr
									and exists  (select   deptid_chr from t_bse_deptemp de  where   empid_chr=? and de.deptid_chr = d.deptid_chr)
									order by t.technicallevel_chr desc"                                    ;
                    break;

                case 20:
                    strSql = @"     select  distinct t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
									from t_bse_employee t, t_bse_deptemp d
									where t.status_int = 1
                                    and t.technicallevel_chr ='450'
									and t.empid_chr = d.empid_chr
									and exists  (select   deptid_chr from t_bse_deptemp de  where   empid_chr=? and de.deptid_chr = d.deptid_chr)
									order by t.technicallevel_chr desc"                                    ;
                    break;
                }
                IDataParameter[] objDPArr = null;
                objHRPServ.CreateDatabaseParameter(1, out objDPArr);

                objDPArr[0].Value = p_strEmployeeID.Trim();

                DataTable dtResult = new DataTable();

                lngRes = objHRPServ.lngGetDataTableWithParameters(strSql, ref dtResult, objDPArr);
                if (lngRes > 0)
                {
                    p_objdt = dtResult;
                }
            }
            catch (Exception exp)
            {
                lngRes = 0;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(exp);
            }
            finally
            {
                //objHRPServer.Dispose();
            }

            return(lngRes);
        }
예제 #9
0
        public long m_lngGetSignBySequence(System.Security.Principal.IPrincipal p_objPrincipal, long p_lngSequence, out DataTable p_dtbValue)
        {
            //初始化
            long lngRes = 0;

            p_dtbValue = null;
            clsHRPTableService objHRPServ = new clsHRPTableService();

            try
            {
                //检查参数
                if (p_lngSequence == 0)
                {
                    return(-1);
                }
                //权限校验
                com.digitalwave.security.clsPrivilegeHandleService objPrivilege = new com.digitalwave.security.clsPrivilegeHandleService();
                long lngCheckRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "Signature_srv", "m_lngGetEmpByKey");
                //objPrivilege.Dispose();
                if (lngCheckRes <= 0)
                {
                    return(lngCheckRes);
                }

                string strSql = @"select t.empid_vchr,
									d.lastname_vchr,
									d.technicalrank_chr,
									d.empno_chr,
									d.psw_chr,
									d.digitalsign_dta,
									d.pycode_chr,
									d.status_int,
									d.technicallevel_chr,
									t.cagetory_vchr,
									t.formname_vchr,
									t.registerid_vchr
								from t_emr_signcollection t
								left outer join t_bse_employee d on t.empid_vchr = d.empid_chr
								where t.sign_int =? order by t.seq_int asc"                                ;


                //DataTable
                DataTable dtbValue = new DataTable();

                IDataParameter[] objDPArr = null;
                objHRPServ.CreateDatabaseParameter(1, out objDPArr);
                objDPArr[0].Value = p_lngSequence;

                //执行查询,填充结果到DataTable
                lngRes = objHRPServ.lngGetDataTableWithParameters(strSql, ref dtbValue, objDPArr);
                int intSignCount = dtbValue.Rows.Count;
                //从DataTable.Rows中获取结果
                if (lngRes > 0)
                {
                    p_dtbValue = dtbValue;
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            finally
            {
                //objHRPServ.Dispose();
            }
            //返回
            return(lngRes);
        }
예제 #10
0
        public long m_lngGetEmployeeSignWithDept(System.Security.Principal.IPrincipal p_objPrincipal,
                                                 int p_intFlag, string p_strDeptID, out DataTable p_objdt)
        {
            long lngRes = 0;

            p_objdt = null;
            if (string.IsNullOrEmpty(p_strDeptID))
            {
                return(-1);
            }
            clsHRPTableService objHRPServer = new clsHRPTableService();

            try
            {
                string strSql = "";

                switch (p_intFlag)
                {
                case 0:
                    strSql = @"select t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
									from t_bse_employee t, t_bse_deptemp d
									where t.status_int = 1
									and t.empid_chr = d.empid_chr
									and d.deptid_chr = ?
									order by t.technicallevel_chr desc"                                    ;

                    break;

                case 1:
                    strSql = @"select t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
									from t_bse_employee t, t_bse_deptemp d
									where t.status_int = 1
									and t.technicallevel_chr like '5%'
									and t.empid_chr = d.empid_chr
									and d.deptid_chr = ?
									order by t.technicallevel_chr desc"                                    ;
                    break;

                case 2:
                    strSql = @"select t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
									from t_bse_employee t, t_bse_deptemp d
									where t.status_int = 1
									and t.technicallevel_chr like '4%'
									and t.empid_chr = d.empid_chr
									and d.deptid_chr = ?
									order by t.technicallevel_chr desc"                                    ;
                    break;

                case 10:
                    strSql = @" select distinct t.empno_chr,
                                    t.lastname_vchr,
                                    t.technicalrank_chr,
                                    t.pycode_chr,
                                    t.empid_chr,
                                    t.psw_chr,
                                    t.digitalsign_dta,
                                    t.technicallevel_chr
                      from t_bse_employee t
                     where t.status_int = 1
                       and t.empid_chr in
                           (select d.empid_chr
                              from t_sys_emprolemap d
                             inner join (select roleid_chr, name_vchr, desc_vchr, deptid_chr
                                          from t_sys_role r
                                         where r.deptid_chr =?
                                           and r.name_vchr = '科主任') kk on d.roleid_chr = kk.roleid_chr)";
                    break;

                case 20:
                    strSql = @" select distinct t.empno_chr,
                                    t.lastname_vchr,
                                    t.technicalrank_chr,
                                    t.pycode_chr,
                                    t.empid_chr,
                                    t.psw_chr,
                                    t.digitalsign_dta,
                                    t.technicallevel_chr
                      from t_bse_employee t
                     where t.status_int = 1
                       and t.empid_chr in
                           (select d.empid_chr
                              from t_sys_emprolemap d
                             inner join (select roleid_chr, name_vchr, desc_vchr, deptid_chr
                                          from t_sys_role r
                                         where r.deptid_chr = ?
                                           and r.name_vchr = '护士长') kk on d.roleid_chr = kk.roleid_chr)";
                    break;
                }

                IDataParameter[] objDPArr = null;
                objHRPServer.CreateDatabaseParameter(1, out objDPArr);

                objDPArr[0].Value = p_strDeptID.Trim();

                lngRes = objHRPServer.lngGetDataTableWithParameters(strSql, ref p_objdt, objDPArr);
            }
            catch (Exception exp)
            {
                lngRes = 0;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(exp);
            }
            finally
            {
                //objHRPServer.Dispose();
            }

            return(lngRes);
        }
예제 #11
0
        public long m_lngGetEmployeeSignWithoutDept(System.Security.Principal.IPrincipal p_objPrincipal,
                                                    int p_intFlag, out DataTable p_objdt)
        {
            long lngRes = 0;

            p_objdt = null;
            clsHRPTableService objHRPServer = new clsHRPTableService();

            try
            {
                string strSql = "";

                switch (p_intFlag)
                {
                case 0:
                    strSql = @" select t.empno_chr,
												t.lastname_vchr,
												t.technicalrank_chr,
												t.pycode_chr,
												t.empid_chr,
												t.psw_chr,
												t.digitalsign_dta,
												t.technicallevel_chr
										from t_bse_employee t
										where t.status_int = 1
										order by t.technicallevel_chr desc"                                        ;

                    break;

                case 1:
                    strSql = @"select t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
								from t_bse_employee t
								where t.status_int = 1
								and t.technicallevel_chr like '5%'
								order by t.technicallevel_chr desc"                                ;
                    break;

                case 2:
                    strSql = @"select t.empno_chr,
										t.lastname_vchr,
										t.technicalrank_chr,
										t.pycode_chr,
										t.empid_chr,
										t.psw_chr,
										t.digitalsign_dta,
										t.technicallevel_chr
								from t_bse_employee t
								where t.status_int = 1
								and t.technicallevel_chr like '4%'
								order by t.technicallevel_chr desc"                                ;
                    break;
                }
                lngRes = objHRPServer.DoGetDataTable(strSql, ref p_objdt);
            }
            catch (Exception exp)
            {
                lngRes = 0;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(exp);
            }
            finally
            {
                //objHRPServer.Dispose();
            }
            return(lngRes);
        }
        public long m_lngGetDataByTimeIndetityOp(System.Security.Principal.IPrincipal p_objPrincipal,
                                                 out clsOutPatientTableInfo_VO[] p_objResultArr, string p_strdtmBegin, string p_strdtmEnd, string p_strPatientTypeId, string p_strEmployeeID)
        {
            long lngRes = 0;

            p_objResultArr = new clsOutPatientTableInfo_VO[0];

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsOutpatientChargeIdetityPrintSvc", "m_lngGetDataByTimeIndetityOp");
            if (lngRes < 0)
            {
                return(-1);
            }

            string strSQL = @"SELECT td.patientcardid_chr, ta.recorddate_dat, ta.patientname_chr, ta.invoiceno_vchr, ta.acctsum_mny, ta.sbsum_mny,
									 ta.totalsum_mny, te.lastname_vchr
										FROM t_opr_outpatientrecipeinv ta,  t_bse_employee te,   t_bse_patientpaytype tp, t_bse_patientcard td
										WHERE ta.balanceflag_int = 1
												AND ta.opremp_chr = te.empid_chr(+)
												AND ta.paytypeid_chr = tp.paytypeid_chr(+)
												AND ta.patientid_chr = td.patientid_chr (+)"                                                ;

            strSQL += "  AND ta.recorddate_dat BETWEEN to_date('" + p_strdtmBegin + " 00:00:00" + "','yyyy-mm-dd hh24:mi:ss')";
            strSQL += " AND to_date('" + p_strdtmEnd + " 23:59:59" + "','yyyy-mm-dd hh24:mi:ss')";

            if (p_strPatientTypeId != null)
            {
                strSQL += " AND ta.PAYTYPEID_CHR = '" + p_strPatientTypeId + "'";
            }

            if (p_strEmployeeID != null)
            {
                strSQL += " AND te.EMPID_CHR = '" + p_strEmployeeID + "'";
            }

            strSQL += " order by te.EMPID_CHR,ta.recorddate_dat,ta.INVOICENO_VCHR";
            try
            {
                DataTable dtbResult = new DataTable();
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtbResult);
                if (lngRes > 0 && dtbResult.Rows.Count > 0)
                {
                    p_objResultArr = new com.digitalwave.iCare.ValueObject.clsOutPatientTableInfo_VO[dtbResult.Rows.Count];
                    for (int i1 = 0; i1 < p_objResultArr.Length; i1++)
                    {
                        p_objResultArr[i1] = new com.digitalwave.iCare.ValueObject.clsOutPatientTableInfo_VO();
                        p_objResultArr[i1].m_strLastname_vchr  = dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString().Trim();
                        p_objResultArr[i1].m_strPatientCardId  = dtbResult.Rows[i1]["PATIENTCARDID_CHR"].ToString().Trim();
                        p_objResultArr[i1].m_strPatientName    = dtbResult.Rows[i1]["PATIENTNAME_CHR"].ToString().Trim();
                        p_objResultArr[i1].m_strRecordDataTime = Convert.ToDateTime(dtbResult.Rows[i1]["RECORDDATE_DAT"].ToString()).Date;
                        p_objResultArr[i1].m_strInvoiceNo      = dtbResult.Rows[i1]["INVOICENO_VCHR"].ToString();
                        p_objResultArr[i1].m_strTOTALSUM_MNY   = float.Parse(dtbResult.Rows[i1]["TOTALSUM_MNY"].ToString().Trim());
                        p_objResultArr[i1].m_strSBSUM_MNY      = float.Parse(dtbResult.Rows[i1]["SBSUM_MNY"].ToString().Trim());
                        p_objResultArr[i1].m_strACCTSUM_MNY    = float.Parse(dtbResult.Rows[i1]["ACCTSUM_MNY"].ToString().Trim());
                    }
                }
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #13
0
        public long m_lngFindAllSour(System.Security.Principal.IPrincipal p_objPrincipal, string SourType, out DataTable dtResult, string strWhere)
        {
            string strSQL = "select ''ID,''Name From dual";

            dtResult = new DataTable();
            long lngRes = 0;
            //权限类
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            //检查是否有使用些函数的权限
            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsChargeItemSvc", "m_GetGroupCat");
            if (lngRes < 0)            //没有使用的权限
            {
                return(-1);
            }
            if (SourType.IndexOf("检") > -1)
            {
                string strWhere1 = "";
                if (strWhere.IndexOf("ASSISTCODE_CHR") >= 0)
                {
                    strWhere  = strWhere.Replace("ASSISTCODE_CHR", "");
                    strWhere  = strWhere.Replace("where", "");
                    strWhere  = strWhere.Replace("like", "");
                    strWhere1 = " where APPLY_UNIT_ID_CHR like " + strWhere;
                }
                if (strWhere.IndexOf("MEDICINENAME_VCHR") >= 0)
                {
                    strWhere  = strWhere.Replace("MEDICINENAME_VCHR", "");
                    strWhere  = strWhere.Replace("like", "");
                    strWhere  = strWhere.Replace("where", "");
                    strWhere1 = " where APPLY_UNIT_NAME_VCHR like " + strWhere + "";
                }
                strSQL = "Select APPLY_UNIT_ID_CHR HelpCode,APPLY_UNIT_ID_CHR ID,APPLY_UNIT_NAME_VCHR Name From T_AID_LIS_APPLY_UNIT" + strWhere1 + "  order by APPLY_UNIT_ID_CHR";
            }
            else
            {
                strSQL = "Select ASSISTCODE_CHR HelpCode,medicineid_chr ID,medicinename_vchr Name From t_bse_medicine " + strWhere + " order by ASSISTCODE_CHR";
            }
//			switch (SourType.IndexOf("验")>-1)
//			{
//				case "2": //西药
//					strSQL="Select medicineid_chr ID,medicinename_vchr Name From t_bse_medicine ";
//					break;
//				case "1":
////					strSQL="Select MATERIALID_CHR ID,MATERIALNAME_VCHR Name From t_bse_material ";
//					break;
//				case "5"://检验
//					strSQL="Select APPLY_UNIT_ID_CHR ID,APPLY_UNIT_NAME_VCHR Name From T_AID_LIS_APPLY_UNIT ";
//					break;
//				default:
//					//					strSQL="Select ITEMID_CHR ID,ITEMNAME_VCHR Name From t_bse_chargeitem ";
//					strSQL="Select medicineid_chr ID,medicinename_vchr Name From t_bse_medicine ";
//					break;
//			}
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtResult);
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #14
0
        public long m_lngGetAppAndSampleInfo(int sampleStatus, string areaId,
                                             string beginDate, string endDate, string patientName,
                                             string patientCardId, string hosipitalNo, string bedNo, int p_intSampleBack, out clsLisApplMainVO[] p_objAppVOArr)
        {
            long lngRes = 0;

            p_objAppVOArr = null;

            #region SQL

            lngRes = 0;

            #region sql_OLD

            string sql1 = @"  select distinct t1.application_id_chr,
                                                t1.patientid_chr,
                                                t1.application_dat,
                                                t1.sex_chr,
                                                t1.patient_name_vchr,
                                                t1.patient_subno_chr,
                                                t1.age_chr,
                                                t1.patient_type_id_chr,
                                                t1.diagnose_vchr,
                                                t1.bedno_chr,
                                                t1.icdcode_chr,
                                                t1.patientcardid_chr,
                                                t1.application_form_no_chr,
                                                t1.modify_dat,
                                                t1.operator_id_chr,
                                                t1.appl_empid_chr,
                                                t1.appl_deptid_chr,
                                                t1.summary_vchr,
                                                t1.pstatus_int,
                                                t1.emergency_int,
                                                t1.special_int,
                                                t1.form_int,
                                                t1.patient_inhospitalno_chr,
                                                t1.sample_type_id_chr,
                                                t1.check_content_vchr,
                                                t1.sample_type_vchr,
                                                t1.oringin_dat,
                                                t1.charge_info_vchr,
                                                t1.printed_num,
                                                t2.report_group_id_chr,
                                                t2.status_int as report_status_int,
                                                t2.reportor_id_chr,
                                                t2.report_dat,
                                                t2.confirmer_id_chr,
                                                t2.confirm_dat,
                                                t2.summary_vchr as report_summary_vchr,
                                                t2.xml_summary_vchr as report_xml_sumary_vchr,
                                                t3.sample_id_chr,
                                                t3.barcode_vchr,
                                                t3.collector_id_chr,
                                                t3.samplestate_vchr,
                                                t3.sampling_date_dat,
                                                t3.check_date_dat,
                                                t3.acceptor_id_chr,
                                                t3.accept_dat,
                                                t3.checker_id_chr,
                                                decode(t3.status_int, null, 1, t3.status_int) as sample_status_int,
                                                t4.hasbarcode_int
                                           from t_opr_lis_application t1,
                                                t_opr_lis_app_report  t2,
                                                t_opr_lis_sample      t3,
                                                t_aid_lis_sampletype  t4
                                          where t1.application_id_chr = t2.application_id_chr
                                            and t1.application_id_chr = t3.application_id_chr(+)
                                            and t1.sample_type_id_chr = t4.sample_type_id_chr(+)
                                            and patient_type_id_chr = 1
                                            and pstatus_int = 2
                                            and form_int = 1
                                            and t1.pstatus_int >= 0
                                            and t2.status_int >= 0  ";
            #endregion

            string sql = @"select distinct t1.application_id_chr,
                t1.patientid_chr,
                t1.application_dat,
                t1.sex_chr,
                t1.patient_name_vchr,
                t1.patient_subno_chr,
                t1.age_chr,
                t1.patient_type_id_chr,
                t1.diagnose_vchr,
                t1.bedno_chr,
                t1.icdcode_chr,
                t1.patientcardid_chr,
                t1.application_form_no_chr,
                t1.modify_dat,
                t1.operator_id_chr,
                t1.appl_empid_chr,
                t1.appl_deptid_chr,
                t1.summary_vchr,
                t1.pstatus_int,
                t1.emergency_int,
                t1.special_int,
                t1.form_int,
                t1.patient_inhospitalno_chr,
                t1.sample_type_id_chr,
                t1.check_content_vchr,
                t1.sample_type_vchr,
                t1.oringin_dat,
                t1.charge_info_vchr,
                t1.printed_num,
                t3.sample_id_chr,
                t3.barcode_vchr,
                t3.collector_id_chr,
                t3.samplestate_vchr,
                t3.sampling_date_dat,
                t3.check_date_dat,
                t3.acceptor_id_chr,
                t3.accept_dat,
                t3.checker_id_chr,
                t3.issampleback,
                t3.sample_back_reason,
                decode(t3.status_int, null, 1, t3.status_int) as sample_status_int,
                t4.hasbarcode_int
  from t_opr_lis_application t1,
       t_opr_lis_sample      t3,
       t_aid_lis_sampletype  t4
 where t1.application_id_chr = t3.application_id_chr(+)
   and t1.sample_type_id_chr = t4.sample_type_id_chr(+)
   and t1.patient_type_id_chr = 1
   and t1.pstatus_int = 2
   and t1.form_int = 1
   and t1.pstatus_int >= 0
   and exists (select 1
          from t_opr_attachrelation a
         where a.attachid_vchr = t1.application_id_chr
           and a.status_int = 1)
 ";

            string strSQL_FromDateApp = " and application_dat >=to_date(?,'yyyy-mm-dd hh24:mi:ss') ";
            string strSQL_ToDateApp   = " and application_dat <= to_date(?,'yyyy-mm-dd hh24:mi:ss') ";
            string strSQL_AppDept     = " and trim(t1.appl_deptid_chr) = ? ";

            string strSQL_SampleSatus_NoSample         = " and t3.status_int is null ";
            string strSQL_SampleSatus_Sampled          = " and t3.status_int > 1 ";
            string strSQL_SampleSatus_Sampled_NoVerify = " and t3.status_int>1 and t3.status_int < 3  ";
            string strSQL_SampleSatus_All = " and (t3.status_int > 0 or t3.status_int is null) ";


            string strSQL_PatientName        = " and t1.patient_name_vchr like ? ";
            string strSQL_PatientCardID      = " and t1.patientcardid_chr = ? ";
            string strSQL_PatientHosipitalNO = " and trim(t1.patient_inhospitalno_chr) = ? ";
            string strSQL_PatientBedNo       = " and trim(t1.bedno_chr) = ? ";
            string strSQL_Accepted           = " and t3.status_int >= 3 ";
            string strSQL_SampleBack         = " and t3.issampleback = 1 ";
            string strSQL_NotSampleBack      = " and t3.issampleback = 0 ";

            #endregion

            ArrayList arlSQL  = new ArrayList();
            ArrayList arlParm = new ArrayList();

            #region 构造


            if (sampleStatus == 1)
            {
                arlSQL.Add(strSQL_SampleSatus_NoSample);
            }
            else if (sampleStatus == 2)
            {
                arlSQL.Add(strSQL_SampleSatus_Sampled);
            }
            else if (sampleStatus == 3)
            {
                arlSQL.Add(strSQL_SampleSatus_Sampled_NoVerify);
            }
            else if (sampleStatus == 4)
            {
                arlSQL.Add(strSQL_Accepted);
            }
            else if (sampleStatus == 0)
            {
                arlSQL.Add(strSQL_SampleSatus_All);
            }
            if (p_intSampleBack == 0)
            {
                arlSQL.Add(strSQL_NotSampleBack);
            }
            else if (p_intSampleBack == 1)
            {
                arlSQL.Add(strSQL_SampleBack);
            }

            if (beginDate != null && Microsoft.VisualBasic.Information.IsDate(beginDate.Trim()))
            {
                arlSQL.Add(strSQL_FromDateApp);
                DateTime dtStart = DateTime.Parse(beginDate);
                arlParm.Add(dtStart.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            if (endDate != null && Microsoft.VisualBasic.Information.IsDate(endDate.Trim()))
            {
                arlSQL.Add(strSQL_ToDateApp);
                DateTime dtEnd = DateTime.Parse(endDate);
                arlParm.Add(dtEnd.ToString("yyyy-MM-dd HH:mm:ss"));
            }

            if (areaId != null && areaId.ToString().Trim() != "")
            {
                arlSQL.Add(strSQL_AppDept);
                arlParm.Add(areaId.Trim());
            }

            if (patientName != null && patientName.ToString().Replace('%', ' ').Trim() != "")
            {
                arlSQL.Add(strSQL_PatientName);
                arlParm.Add(patientName.Trim());
            }

            if (patientCardId != null && patientCardId.ToString().Trim() != "")
            {
                arlSQL.Add(strSQL_PatientCardID);
                arlParm.Add(patientCardId.Trim());
            }

            if (areaId != null && areaId.ToString().Trim() != "" && hosipitalNo.Trim() != string.Empty)
            {
                arlSQL.Add(strSQL_PatientHosipitalNO);
                arlParm.Add(hosipitalNo.Trim());
            }
            if (areaId != null && areaId.ToString().Trim() != "" && bedNo.Trim() != string.Empty)
            {
                arlSQL.Add(strSQL_PatientBedNo);
                arlParm.Add(bedNo.Trim());
            }

            #endregion

            foreach (object obj in arlSQL)
            {
                sql += obj.ToString();
            }

            int intParmCount = 0;
            intParmCount = arlParm.Count;

            clsHRPTableService objHRPSvc = new clsHRPTableService();

            IDataParameter[] objDPArr = null;
            objHRPSvc.CreateDatabaseParameter(intParmCount, out objDPArr);

            for (int i = 0; i < intParmCount; i++)
            {
                objDPArr[i].Value = arlParm[i];
            }

            try
            {
                DataTable dtbResult = null;
                lngRes = 0;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(sql, ref dtbResult, objDPArr);
                objHRPSvc.Dispose();

                if (lngRes > 0 && dtbResult != null && dtbResult.Rows.Count > 0)
                {
                    ArrayList arlApp = new ArrayList();
                    for (int i = 0; i < dtbResult.Rows.Count; i++)
                    {
                        clsLisApplMainVO objMainVO = m_objConstructAppMainVO(dtbResult.Rows[i]);
                        if (dtbResult.Rows[i]["issampleback"].ToString().Trim() == "1")
                        {
                            objMainVO.m_strSample_Back_Reason = dtbResult.Rows[i]["sample_back_reason"].ToString().Trim();
                        }
                        arlApp.Add(objMainVO);
                    }
                    p_objAppVOArr = (clsLisApplMainVO[])arlApp.ToArray(typeof(clsLisApplMainVO));
                }
                else
                {
                    p_objAppVOArr = new clsLisApplMainVO[0];
                }
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
                p_objAppVOArr = new clsLisApplMainVO[0];
            }

            return(lngRes);
        }
예제 #15
0
        private long m_lngAddNewReportGroup(clsT_OPR_LIS_APP_REPORT_VO[] arrReports)
        {
            long   lngRes = 0;
            long   lngEff = 0;
            string strNow = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            #region === sql ===

            string strSQL = @"insert into t_opr_lis_app_report(    
                                                                   application_id_chr,
                                                                   report_group_id_chr,
                                                                   modify_dat,
                                                                   summary_vchr,
                                                                   operator_id_chr, 
                                                                   status_int,
                                                                   report_dat,
                                                                   reportor_id_chr, 
                                                                   confirm_dat,
                                                                   confirmer_id_chr,
                                                                   xml_summary_vchr, 
                                                                   annotation_vchr,
                                                                   xml_annotation_vchr
                                                             )
                                                     values  (     ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";

            #endregion

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                if (arrReports != null)
                {
                    for (int i = 0; i < arrReports.Length; i++)
                    {
                        if (arrReports[i] != null)
                        {
                            arrReports[i].m_strMODIFY_DAT = strNow;

                            IDataParameter[] objDPArr = null;
                            objHRPSvc.CreateDatabaseParameter(13, out objDPArr);

                            objDPArr[0].Value = arrReports[i].m_strAPPLICATION_ID_CHR;
                            objDPArr[1].Value = arrReports[i].m_strREPORT_GROUP_ID_CHR;
                            objDPArr[2].Value = DateTime.Parse(arrReports[i].m_strMODIFY_DAT);
                            objDPArr[3].Value = arrReports[i].m_strSUMMARY_VCHR;
                            objDPArr[4].Value = arrReports[i].m_strOPERATOR_ID_CHR;
                            objDPArr[5].Value = arrReports[i].m_intSTATUS_INT;
                            if (Microsoft.VisualBasic.Information.IsDate(arrReports[i].m_strREPORT_DAT))
                            {
                                objDPArr[6].Value = DateTime.Parse(arrReports[i].m_strREPORT_DAT);
                            }
                            else
                            {
                                arrReports[i].m_strREPORT_DAT = null;
                            }
                            objDPArr[7].Value = arrReports[i].m_strREPORTOR_ID_CHR;
                            if (Microsoft.VisualBasic.Information.IsDate(arrReports[i].m_strCONFIRM_DAT))
                            {
                                objDPArr[8].Value = DateTime.Parse(arrReports[i].m_strCONFIRM_DAT);
                            }
                            else
                            {
                                arrReports[i].m_strCONFIRM_DAT = null;
                            }
                            objDPArr[9].Value  = arrReports[i].m_strCONFIRMER_ID_CHR;
                            objDPArr[10].Value = arrReports[i].m_strXML_SUMMARY_VCHR;
                            objDPArr[11].Value = arrReports[i].m_strANNOTATION_VCHR;
                            objDPArr[12].Value = arrReports[i].m_strXML_ANNOTATION_VCHR;

                            lngRes = 0;
                            lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngEff, objDPArr);
                            if (lngRes < 0)
                            {
                                throw new Exception("保存报告单失败.");
                            }
                            objHRPSvc.Dispose();
                        }
                    }
                }
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
                throw objEx;
            }
            return(lngRes);
        }
예제 #16
0
        public long m_lngQueryPatientCheckContent(string p_strPatientCardID, string p_strFromDate, string p_strToDate, out string p_strCheckContent, out clsLisApplMainVO[] p_objApplMainArr)
        {
            long   lngRes = 0;
            string strSQL = null;

            p_strCheckContent = null;
            p_objApplMainArr  = null;
            clsHRPTableService objHRPSvc = null;

            try
            {
                strSQL = @"select a.application_id_chr,
                                   a.check_content_vchr,
                                   a.sample_type_id_chr,
                                   a.printed_num,
                                   c.sample_type_desc_vchr,
                                   d.barcode_vchr
                              from t_opr_lis_application a, t_aid_lis_sampletype c, t_opr_lis_sample d
                             where a.sample_type_id_chr = c.sample_type_id_chr(+)
                               and a.application_id_chr = d.application_id_chr
                               and a.patient_type_id_chr = '2'
                               and a.pstatus_int = 2
                               and a.patientcardid_chr = ?
                               and a.application_dat between to_date(?, 'yyyy-mm-dd hh24:mi:ss') and
                                   to_date(?, 'yyyy-mm-dd hh24:mi:ss')
                               and exists (select 1
                                      from t_opr_attachrelation b
                                     where a.application_id_chr = b.attachid_vchr
                                       and b.status_int = 1)
                            ";
                com.digitalwave.iCare.middletier.common.clsGetCurrentTime objSvc = new com.digitalwave.iCare.middletier.common.clsGetCurrentTime();
                DateTime dtTime = objSvc.m_mthGetCurrentDateTime();

                IDataParameter[] objDPArr = null;
                objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(3, out objDPArr);
                objDPArr[0].Value = p_strPatientCardID;
                objDPArr[1].Value = p_strFromDate;
                objDPArr[2].Value = p_strToDate;
                DataTable dtResult = null;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtResult, objDPArr);
                if (lngRes > 0 && dtResult != null && dtResult.Rows.Count > 0)
                {
                    DataRow drTemp = null;
                    List <clsLisApplMainVO> m_lstAppMain = new List <clsLisApplMainVO>();
                    clsLisApplMainVO        objTemp      = null;
                    for (int i = 0; i < dtResult.Rows.Count; i++)
                    {
                        drTemp                      = dtResult.Rows[i];
                        p_strCheckContent          += "[" + drTemp["check_content_vchr"].ToString().Trim() + " " + "样本:" + drTemp["sample_type_desc_vchr"].ToString().Trim() + "]" + ";" + "\r\n";
                        objTemp                     = new clsLisApplMainVO();
                        objTemp.m_strAPPLICATION_ID = drTemp["application_id_chr"].ToString().Trim();
                        objTemp.m_strSampleTypeID   = drTemp["sample_type_id_chr"].ToString().Trim();
                        objTemp.m_intReportPrint    = drTemp["printed_num"] != DBNull.Value ? Convert.ToInt32(drTemp["printed_num"].ToString().Trim()) : 0;
                        objTemp.m_strBarcode        = drTemp["barcode_vchr"].ToString();
                        m_lstAppMain.Add(objTemp);
                    }
                    if (m_lstAppMain.Count > 0)
                    {
                        p_objApplMainArr = m_lstAppMain.ToArray();
                    }
                }
                p_strFromDate = null;
                p_strToDate   = null;
                dtResult.Dispose();
                dtResult = null;
            }
            catch (Exception objEx)
            {
                clsLogText objLogger = new clsLogText();
                objLogger.LogDetailError(objEx, true);
            }
            finally
            {
                strSQL             = null;
                objHRPSvc          = null;
                p_strPatientCardID = null;
            }
            return(lngRes);
        }
예제 #17
0
        public long m_lngSetApplPrintedStatus(string[] arrApplicationId, bool isPrinted)
        {
            //            long lngRes=0;

            //            StringBuilder sb=new StringBuilder();
            //            int len= arrApplicationId.Length;

            //            for (int i = 0; i <len; i++)
            //            {
            //                if (i != len - 1)
            //                {
            //                    sb.Append(arrApplicationId[i] + " ,");
            //                }
            //                else
            //                {
            //                    sb.Append(arrApplicationId[i]);
            //                }
            //            }

            //            string sqlFormat = @"  update t_opr_lis_application
            //                                      set printed_num = {0}
            //                                    where pstatus_int = 2
            //                                      and application_id_chr in ( {1} ) ";

            //            clsHRPTableService dbSvc = new clsHRPTableService();

            //            try
            //            {
            //                lngRes = dbSvc.DoExcute(string.Format(sqlFormat, isPrinted ? "1" : "0", sb.ToString()));
            //            }
            //            catch (Exception ex)
            //            {
            //                lngRes = 0;
            //                new clsLogText().LogError(ex.Message);
            //            }

            //            return lngRes;

            long lngRes = 1;
            int  n      = -1;

            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
            try
            {
                n = 0;
                if (isPrinted)
                {
                    string strSQL = @"update t_opr_lis_application
   set printed_num = 1, printed_date = sysdate
 where pstatus_int > 0
   and application_id_chr = ?";

                    DbType[] dbTypes = new DbType[] {
                        DbType.String
                    };
                    object[][] objValues = new object[1][];
                    for (int j = 0; j < objValues.Length; j++)
                    {
                        objValues[j] = new object[arrApplicationId.Length];//初始化
                    }
                    for (int k1 = 0; k1 < arrApplicationId.Length; k1++)
                    {
                        n = -1;
                        objValues[++n][k1] = arrApplicationId[k1].Trim();
                    }
                    if (arrApplicationId.Length > 0)
                    {
                        lngRes = objHRPSvc.m_lngSaveArrayWithParameters(strSQL, objValues, dbTypes);
                    }


                    //                     strSQL = @"
                    //                            update t_opr_lis_application
                    //                                     set printed_num = 1
                    //                                     where pstatus_int = 2
                    //                                     and application_id_chr =? ";

                    //                    dbTypes = new DbType[] {
                    //                        DbType.String

                    //                        };
                    //                    objValues = new object[1][];
                    //                    for (int j = 0; j < objValues.Length; j++)
                    //                    {
                    //                        objValues[j] = new object[arrApplicationId.Length];//初始化
                    //                    }
                    //                    for (int k1 = 0; k1 < arrApplicationId.Length; k1++)
                    //                    {
                    //                        n = -1;
                    //                        objValues[++n][k1] = arrApplicationId[k1].Trim();
                    //                    }
                    //                    if (arrApplicationId.Length > 0)
                    //                    {
                    //                        lngRes = objHRPSvc.m_lngSaveArrayWithParameters(strSQL, objValues, dbTypes);
                    //                    }
                }
                else
                {
                    string strSQL = @"  
                            update t_opr_lis_application
                                     set PRINTED_DATE = null,printed_num = 0
                                     where pstatus_int = 2
                                     and application_id_chr =? ";

                    DbType[] dbTypes = new DbType[] {
                        DbType.String
                    };
                    object[][] objValues = new object[1][];
                    for (int j = 0; j < objValues.Length; j++)
                    {
                        objValues[j] = new object[arrApplicationId.Length];//初始化
                    }
                    for (int k1 = 0; k1 < arrApplicationId.Length; k1++)
                    {
                        n = -1;
                        objValues[++n][k1] = arrApplicationId[k1].Trim();
                    }
                    if (arrApplicationId.Length > 0)
                    {
                        lngRes = objHRPSvc.m_lngSaveArrayWithParameters(strSQL, objValues, dbTypes);
                    }
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #18
0
        public long m_lngGetCurrentDayInstoragenfo(System.Security.Principal.IPrincipal p_objPrincipal, string m_strBeginDate, string m_strEndDate, out DataTable m_dtInstorage)
        {
            m_dtInstorage = null;
            DataView dvTemp;
            long     lngRes = 0;

            try
            {/*decode (a.formtype_int,
              * 1, '药库出库单',
              * 2, '请领单',
              * 3, '病人退药',
              * 4, '药房借调',
              * 5, '药房盘盈'
              * ) as formtype_int,*/
                string strSQL =
                    @"select a.seriesid_int,
       a.indrugstoreid_vchr,
       b.deptname_vchr as medstorename_vchr,
       a.askid_vchr,
       a.outstorageid_vchr,
       a.drugstoreid_chr,
       a.comment_vchr,
       decode(a.status,
              0,
              '删除',
              1,
              '新制',
              2,
              '审核',
              3,
              '入帐',
              4,
              '退审') as status,
       formtype_int,a.status as status_int,
       a.typecode_vchr,
       a.borrowdept_chr,
       c.deptname_vchr,
       a.makeorder_dat,
       a.storageexamid_chr,
       d.lastname_vchr as storageexamname,
       a.drugstoreexamid_chr,
       e.lastname_vchr as drugstoreexamname_chr,
       a.inaccounterid_chr,
       f.lastname_vchr as inaccountername,
       a.makerid_chr,
       h.lastname_vchr as makername,
       i.typename_vchr,
       a.drugstoreexam_date,
       a.inaccount_dat,
       0 summoney
  from t_ds_instorage   a,
       t_bse_deptdesc   b,
       t_bse_deptdesc   c,
       t_bse_employee   d,
       t_bse_employee   e,
       t_bse_employee   f,
       t_bse_employee   h,
       t_aid_impexptype i
 where a.drugstoreid_chr = b.deptid_chr(+)
   and a.borrowdept_chr = c.deptid_chr(+)
   and a.storageexamid_chr = d.empid_chr(+)
   and a.drugstoreexamid_chr = e.empid_chr(+)
   and a.inaccounterid_chr = f.empid_chr(+)
   and a.makerid_chr = h.empid_chr(+)
   and a.typecode_vchr = i.typecode_vchr(+)
   and a.makeorder_dat between ? and ?";

                clsHRPTableService           objHRPServ   = new clsHRPTableService();
                System.Data.IDataParameter[] m_objParaArr = null;
                objHRPServ.CreateDatabaseParameter(2, out m_objParaArr);
                m_objParaArr[0].Value  = Convert.ToDateTime(m_strBeginDate + " 00:00:00");
                m_objParaArr[0].DbType = DbType.DateTime;
                m_objParaArr[1].Value  = Convert.ToDateTime(m_strEndDate + " 23:59:59");
                m_objParaArr[1].DbType = DbType.DateTime;
                lngRes           = objHRPServ.lngGetDataTableWithParameters(strSQL, ref m_dtInstorage, m_objParaArr);
                dvTemp           = m_dtInstorage.DefaultView;
                dvTemp.RowFilter = "status_int<>0 and status_int<>1 and formtype_int in (2,3,4,6)";//过滤非新制且无效的入库单
                m_dtInstorage    = dvTemp.ToTable();
                //新制的入库单不受时间的限制
                strSQL = @"select a.seriesid_int,
       a.indrugstoreid_vchr,
       b.deptname_vchr as medstorename_vchr,
       a.askid_vchr,
       a.outstorageid_vchr,
       a.drugstoreid_chr,
       a.comment_vchr,
       decode(a.status,
              0,
              '删除',
              1,
              '新制',
              2,
              '审核',
              3,
              '入帐',
              4,
              '退审') as status,
       formtype_int,a.status as status_int,
       a.typecode_vchr,
       a.borrowdept_chr,
       c.deptname_vchr,
       a.makeorder_dat,
       a.storageexamid_chr,
       d.lastname_vchr as storageexamname,
       a.drugstoreexamid_chr,
       e.lastname_vchr as drugstoreexamname_chr,
       a.inaccounterid_chr,
       f.lastname_vchr as inaccountername,
       a.makerid_chr,
       h.lastname_vchr as makername,
       i.typename_vchr,
       a.drugstoreexam_date,
       a.inaccount_dat,
       0 summoney
  from t_ds_instorage   a,
       t_bse_deptdesc   b,
       t_bse_deptdesc   c,
       t_bse_employee   d,
       t_bse_employee   e,
       t_bse_employee   f,
       t_bse_employee   h,
       t_aid_impexptype i
 where a.drugstoreid_chr = b.deptid_chr(+)
   and a.borrowdept_chr = c.deptid_chr(+)
   and a.storageexamid_chr = d.empid_chr(+)
   and a.drugstoreexamid_chr = e.empid_chr(+)
   and a.inaccounterid_chr = f.empid_chr(+)
   and a.makerid_chr = h.empid_chr(+)
   and a.typecode_vchr = i.typecode_vchr(+)
   and a.status=1";
                DataTable dtTemp = new DataTable();
                lngRes           = objHRPServ.lngGetDataTableWithoutParameters(strSQL, ref dtTemp);
                dvTemp           = dtTemp.DefaultView;
                dvTemp.RowFilter = "formtype_int in (2,3,4,6)";
                dtTemp           = dvTemp.ToTable();
                m_dtInstorage.Merge(dtTemp, true);         //合并入库单
                dvTemp        = m_dtInstorage.DefaultView; //进行按入库单据号排序
                dvTemp.Sort   = "indrugstoreid_vchr desc";
                m_dtInstorage = dvTemp.ToTable();

                foreach (DataRow dr in m_dtInstorage.Rows)
                {
                    if (Convert.ToString(dr["inaccount_dat"]).Substring(0, 4) == "0001")
                    {
                        dr["inaccount_dat"] = DBNull.Value;
                    }
                    if (Convert.ToString(dr["drugstoreexam_date"]).Substring(0, 4) == "0001")
                    {
                        dr["drugstoreexam_date"] = DBNull.Value;
                    }
                }
                objHRPServ.Dispose();
                objHRPServ = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #19
0
        public void m_mthContructResultVO(int p_intNum, List <clsAdvia2120ResultInf_VO> p_objResultList, out List <clsCheckResult_VO> p_objCheckResultVO, out List <clsT_OPR_LIS_APP_REPORT_VO> p_objRecordVOList, out List <string> p_strSampleIDArr, ref string p_strOriginDate)
        {
            p_objCheckResultVO = new List <clsCheckResult_VO>();
            p_objRecordVOList  = new List <clsT_OPR_LIS_APP_REPORT_VO>();
            p_strSampleIDArr   = new List <string>();
            p_strOriginDate    = DateTime.Now.ToString();
            if (p_objResultList.Count > 0)
            {
                #region 生成检验编号,并根据检验编号查出对应信息


                //根据酶标仪传入的样本号生成检验编号

                string strSQL1 = @"select a.application_id_chr, a.application_dat, a.application_form_no_chr,
                                          a.oringin_dat, b.sample_group_id_chr, a.modify_dat, b.sample_id_chr,
                                          c.check_item_id_chr, d.report_group_id_chr, e.check_item_name_vchr,
                                          e.check_item_name_vchr, e.check_item_english_name_vchr, e.unit_chr,
                                          f_getitemref_low (c.check_item_id_chr,
                                                            trim (a.age_chr),
                                                            trim (a.sex_chr),
                                                            'menses'
                                                           ) ref_min_val_vchr,
                                          f_getitemref_up (c.check_item_id_chr,
                                                           trim (a.age_chr),
                                                           trim (a.sex_chr),
                                                           'menses'
                                                          ) ref_max_val_vchr,
                                          f_getitemref_range (c.check_item_id_chr,
                                                              trim (a.age_chr),
                                                              trim (a.sex_chr),
                                                              'menses'
                                                             ) ref_value_range_vchr,
                                          f.device_check_item_id_chr, f.device_model_id_chr
                                    from t_opr_lis_application a,
                                         t_opr_lis_app_sample b,
                                         t_opr_lis_app_check_item c,
                                         t_opr_lis_app_report d,
                                         t_bse_lis_check_item e,
                                         t_bse_lis_check_item_dev_item f
                                    where a.application_id_chr = b.application_id_chr
                                      and a.application_id_chr = c.application_id_chr
                                      and a.application_id_chr = d.application_id_chr
                                      and a.application_id_chr = d.application_id_chr
                                      and a.application_form_no_chr in (";
                string strSQL2 = @")
                                      and a.pstatus_int > 0
                                      and c.check_item_id_chr = e.check_item_id_chr
                                      and d.status_int > 0
                                      and e.check_item_id_chr = f.check_item_id_chr(+)";


                clsHRPTableService           objHRPSvc   = new clsHRPTableService();
                DataTable                    dtResult    = new DataTable();
                System.Data.IDataParameter[] objParamArr = null;
                objHRPSvc.CreateDatabaseParameter(p_intNum, out objParamArr);
                System.Text.StringBuilder    sb  = new System.Text.StringBuilder();
                System.Collections.Hashtable has = new System.Collections.Hashtable();
                int n = 0;

                for (int i2 = 0; i2 < p_objResultList.Count; i2++)
                {
                    if (!has.ContainsKey(p_objResultList[i2].strCode))
                    {
                        has.Add(p_objResultList[i2].strCode, p_objResultList[i2].strCode);
                        sb.Append("?,");
                        objParamArr[n++].Value = p_objResultList[i2].strCode;                                  //参数
                    }
                }
                sb.Remove(sb.Length - 1, 1);
                string strSQL3 = sb.ToString();
                string strSQL  = strSQL1 + strSQL3 + strSQL2;                            //生成SQL语句
                objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtResult, objParamArr);
                DataView dv = new DataView(dtResult);
                has = new System.Collections.Hashtable();     //保存申请单下报告组的信息
                //<-----------------------------新增一个临时表 add in 11.28
                DataTable dtTmp = new DataTable();
                dtTmp.Columns.Add("application_id_chr");
                dtTmp.Columns.Add("check_item_id_chr");
                DataRow dr = null;
                //------------------------------------------->
                clsT_OPR_LIS_APP_REPORT_VO objReportTmp = null;

                #endregion

                clsCheckResult_VO objTemp = null;

                for (int i1 = 0; i1 < p_objResultList.Count; i1++)
                {
                    string strDeviceItemCode = ((p_objResultList[i1].m_strItemid.Length > 4) ? p_objResultList[i1].m_strItemid.Substring(0, 4) : p_objResultList[i1].m_strItemid);   //字符长度为4
                    dv.RowFilter = "application_form_no_chr = '" + p_objResultList[i1].strCode + "' and device_check_item_id_chr = '" + strDeviceItemCode + "' and device_model_id_chr = '" + p_objResultList[i1].strDeviceID + "'";
                    dv.Sort      = "application_dat desc";
                    if (dv.Count == 0)
                    {
                        p_objResultList.RemoveAt(i1);
                        i1--;
                        continue;
                    }

                    objTemp = new clsCheckResult_VO();
                    switch (p_objResultList[i1].intDataFormat)
                    {
                    case 1:
                        objTemp.intIsGraphResult   = 0;                                             //*  (-- *为必填)
                        objTemp.strGraphFormatName = null;
                        objTemp.m_byaGraph         = null;                                          //存放图像结果
                        objTemp.m_strResult        = p_objResultList[i1].num_value.ToString();
                        break;

                    case 0:
                        objTemp.intIsGraphResult   = 0;
                        objTemp.strGraphFormatName = null;
                        objTemp.m_byaGraph         = null;
                        objTemp.m_strResult        = p_objResultList[i1].chr_value;
                        break;

                    default:
                        objTemp.intIsGraphResult   = 1;
                        objTemp.strGraphFormatName = "lisb";
                        objTemp.m_byaGraph         = p_objResultList[i1].m_byaGraph;
                        objTemp.m_strResult        = null;
                        break;
                    }
                    objTemp.m_strModify_Dat             = DateTime.Now.ToString();                 //*
                    objTemp.m_strGroupID                = dv[0]["sample_group_id_chr"].ToString(); //检验组合编号(报告组)(*)
                    objTemp.m_strCheck_Item_ID          = dv[0]["check_item_id_chr"].ToString();   //检验项目编号(*)
                    objTemp.m_strSample_ID              = dv[0]["sample_id_chr"].ToString();       //样本联号:指样本中心的顺序编号(*)
                    objTemp.m_strUnit                   = dv[0]["unit_chr"].ToString();
                    objTemp.m_strDeviceID               = p_objResultList[i1].strDeviceID;
                    objTemp.m_strDevice_Check_Item_Name = p_objResultList[i1].strItemCode;   //检验仪器输出的检验结果的名称,或缩写。

                    objTemp.m_strRefrange = dv[0]["ref_value_range_vchr"].ToString();        //参考值范围

                    objTemp.m_strCheck_Item_Name = dv[0]["check_item_name_vchr"].ToString(); //检验项目名称

                    objTemp.m_strCheck_Item_English_Name = dv[0]["check_item_english_name_vchr"].ToString();
                    objTemp.m_strMin_Val        = dv[0]["ref_min_val_vchr"].ToString();
                    objTemp.m_strMax_Val        = dv[0]["ref_max_val_vchr"].ToString();
                    objTemp.m_strAbnormal_Flag  = null;
                    objTemp.m_strCheck_Dat      = p_objResultList[i1].strInputDate;
                    objTemp.m_strClinicApp      = null;
                    objTemp.m_strMemo           = null;
                    objTemp.m_strConfirm_Dat    = null;
                    objTemp.m_strPointliststr   = null;
                    objTemp.m_strSummary        = null;
                    objTemp.m_intStatus         = 1;                                        // 1-当前有效记录
                    objTemp.m_strChecker1       = null;
                    objTemp.m_strChecker2       = null;
                    objTemp.m_strConfirm_Person = null;
                    objTemp.m_strOperator_ID    = p_objResultList[i1].m_strOperator_ID;        //操作员工ID
                    objTemp.m_strCheck_DeptID   = null;
                    dr = dtTmp.NewRow();
                    dr["application_id_chr"] = dv[0]["application_id_chr"].ToString();
                    dr["check_item_id_chr"]  = dv[0]["check_item_id_chr"].ToString();
                    if (!has.ContainsKey(dv[0]["application_id_chr"].ToString()))
                    {
                        has.Add(dv[0]["application_id_chr"].ToString(), dv[0]["application_id_chr"].ToString());
                        objReportTmp = new clsT_OPR_LIS_APP_REPORT_VO();
                        objReportTmp.m_strREPORTOR_ID_CHR     = p_objResultList[i1].m_strOperator_ID;
                        objReportTmp.m_strSUMMARY_VCHR        = "";
                        objReportTmp.m_strXML_SUMMARY_VCHR    = "<r><D /><U /><S /></r>";
                        objReportTmp.m_strANNOTATION_VCHR     = "";
                        objReportTmp.m_strXML_ANNOTATION_VCHR = "<r><D /><U /><S /></r>";
                        objReportTmp.m_strREPORT_DAT          = DateTime.Now.ToString();
                        objReportTmp.m_intSTATUS_INT          = 1;
                        objReportTmp.m_strAPPLICATION_ID_CHR  = dv[0]["application_id_chr"].ToString();
                        objReportTmp.m_strCONFIRM_DAT         = null;
                        objReportTmp.m_strCONFIRMER_ID_CHR    = "";
                        objReportTmp.m_strOPERATOR_ID_CHR     = p_objResultList[i1].m_strOperator_ID;
                        objReportTmp.m_strREPORT_GROUP_ID_CHR = dv[0]["report_group_id_chr"].ToString();
                        p_strSampleIDArr.Add(dv[0]["sample_id_chr"].ToString());
                        if (DateTime.Parse(dv[0]["oringin_dat"].ToString()) < DateTime.Parse(p_strOriginDate))
                        {
                            p_strOriginDate = dv[0]["oringin_dat"].ToString();
                        }
                        p_objRecordVOList.Add(objReportTmp);
                    }
                    p_objCheckResultVO.Add(objTemp);
                    dtTmp.Rows.Add(dr);
                }
                //<-------------------------------------------------------------------------add in 11.29 插入没有结果的项目
                dtTmp.AcceptChanges();
                DataView dvTmp = new DataView(dtTmp);
                dv.RowFilter = "1=1";
                foreach (DataRowView objdv1 in dv)
                {
                    dvTmp.RowFilter = "application_id_chr = '" + objdv1["application_id_chr"].ToString() + "'";
                    if (dvTmp.Count > 0)
                    {
                        dvTmp.RowFilter = "application_id_chr = '" + objdv1["application_id_chr"].ToString() + "'and check_item_id_chr = '" + objdv1["check_item_id_chr"].ToString() + "'";
                        if (dvTmp.Count > 0)
                        {
                            continue;
                        }
                        else
                        {
                            objTemp = new clsCheckResult_VO();
                            objTemp.intIsGraphResult             = 0;
                            objTemp.strGraphFormatName           = null;
                            objTemp.m_byaGraph                   = null;
                            objTemp.m_strResult                  = null;
                            objTemp.m_strModify_Dat              = DateTime.Now.ToString();
                            objTemp.m_strGroupID                 = objdv1["sample_group_id_chr"].ToString();
                            objTemp.m_strCheck_Item_ID           = objdv1["check_item_id_chr"].ToString();
                            objTemp.m_strSample_ID               = objdv1["sample_id_chr"].ToString();
                            objTemp.m_strUnit                    = objdv1["unit_chr"].ToString();
                            objTemp.m_strDeviceID                = null;
                            objTemp.m_strDevice_Check_Item_Name  = null;
                            objTemp.m_strRefrange                = objdv1["ref_value_range_vchr"].ToString();
                            objTemp.m_strCheck_Item_Name         = objdv1["check_item_name_vchr"].ToString();
                            objTemp.m_strCheck_Item_English_Name = objdv1["check_item_english_name_vchr"].ToString();
                            objTemp.m_strMin_Val                 = objdv1["ref_min_val_vchr"].ToString();
                            objTemp.m_strMax_Val                 = objdv1["ref_max_val_vchr"].ToString();
                            objTemp.m_strAbnormal_Flag           = null;
                            objTemp.m_strCheck_Dat               = null;
                            objTemp.m_strClinicApp               = null;
                            objTemp.m_strMemo                    = null;
                            objTemp.m_strConfirm_Dat             = null;
                            objTemp.m_strPointliststr            = null;
                            objTemp.m_strSummary                 = null;
                            objTemp.m_intStatus                  = 1;
                            objTemp.m_strChecker1                = null;
                            objTemp.m_strChecker2                = null;
                            objTemp.m_strConfirm_Person          = null;
                            objTemp.m_strOperator_ID             = p_objResultList[0].m_strOperator_ID;
                            objTemp.m_strCheck_DeptID            = null;
                            p_objCheckResultVO.Add(objTemp);
                        }
                    }
                }
                //------------------------------------------------------------------------------------------->
            }
        }
예제 #20
0
        public long m_lngGetInstoragenfoByconditions(System.Security.Principal.IPrincipal p_objPrincipal, bool p_blnCombine, string m_strBeginDate, string m_strEndDate, string m_strMakeOrderName, string m_strTypeCode, int m_intStatus, string m_strBorrowDeptID, string m_strBillID, string p_strMedicineID,
                                                     out DataTable m_dtInstorage)
        {
            m_dtInstorage = null;
            long lngRes = 0;

            try
            {
                string strSQL =
                    @"select distinct a.seriesid_int,
                a.indrugstoreid_vchr,
                b.medstorename_vchr,
                a.askid_vchr,
                a.outstorageid_vchr,
                a.drugstoreid_chr,
                a.comment_vchr,
                a.status as status_int,
                decode(a.status,
                       0,
                       '删除',
                       1,
                       '新制',
                       2,
                       '审核',
                       3,
                       '入帐',
                       4,
                       '退审') as status,
                formtype_int,
                a.typecode_vchr,
                a.borrowdept_chr,
                c.deptname_vchr,
                a.makeorder_dat,
                a.storageexamid_chr,
                d.lastname_vchr as storageexamname,
                a.drugstoreexamid_chr,
                e.lastname_vchr as drugstoreexamname_chr,
                a.inaccounterid_chr,
                f.lastname_vchr as inaccountername,
                a.makerid_chr,
                h.lastname_vchr as makername,
                i.typename_vchr,
                a.drugstoreexam_date,
                a.inaccount_dat,
                0 summoney
  from t_ds_instorage        a,
       t_bse_medstore        b,
       t_bse_deptdesc        c,
       t_bse_employee        d,
       t_bse_employee        e,
       t_bse_employee        f,
       t_bse_employee        h,
       t_aid_impexptype      i,
       t_ds_instorage_detail j,
       t_bse_medicine        k
 where a.drugstoreid_chr = b.deptid_chr(+)
   and a.borrowdept_chr = c.deptid_chr(+)
   and a.storageexamid_chr = d.empid_chr(+)
   and a.drugstoreexamid_chr = e.empid_chr(+)
   and a.inaccounterid_chr = f.empid_chr(+)
   and a.makerid_chr = h.empid_chr(+)
   and a.typecode_vchr = i.typecode_vchr(+)
   and (a.seriesid_int = j.seriesid2_int(+) and j.status = 1)
   and j.medicineid_chr = k.medicineid_chr(+)   
   and a.makeorder_dat between ? and ?";
                if (m_strMakeOrderName != string.Empty)
                {
                    strSQL += " and h.lastname_vchr like '" + m_strMakeOrderName + "%' ";
                }
                if (m_strTypeCode != string.Empty)
                {
                    strSQL += " and a.typecode_vchr=" + m_strTypeCode + " ";
                }

                if (m_intStatus != -1)
                {
                    strSQL += " and a.status=" + m_intStatus + " ";
                }
                if (m_strBorrowDeptID != string.Empty)
                {
                    strSQL += " and a.borrowdept_chr ='" + m_strBorrowDeptID + "' ";
                }
                if (m_strBillID != string.Empty)
                {
                    strSQL += " and a.indrugstoreid_vchr ='" + m_strBillID + "' ";
                }

                if (p_strMedicineID.Length > 0)
                {
                    if (p_blnCombine)
                    {
                        strSQL += " and k.assistcode_chr = '" + p_strMedicineID + "' ";
                    }
                    else
                    {
                        strSQL += " and j.medicineid_chr = '" + p_strMedicineID + "' ";
                    }
                }
                strSQL += " order by a.indrugstoreid_vchr desc";
                clsHRPTableService           objHRPServ   = new clsHRPTableService();
                System.Data.IDataParameter[] m_objParaArr = null;
                objHRPServ.CreateDatabaseParameter(2, out m_objParaArr);
                m_objParaArr[0].Value  = Convert.ToDateTime(m_strBeginDate);
                m_objParaArr[0].DbType = DbType.DateTime;
                m_objParaArr[1].Value  = Convert.ToDateTime(m_strEndDate);
                m_objParaArr[1].DbType = DbType.DateTime;
                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref m_dtInstorage, m_objParaArr);
                objHRPServ.Dispose();
                objHRPServ = null;
                DataView dv = m_dtInstorage.DefaultView;
                dv.RowFilter  = "status_int<> 0 and formtype_int in (1,2,3,4,6)";
                m_dtInstorage = dv.ToTable();
                foreach (DataRow dr in m_dtInstorage.Rows)
                {
                    if (Convert.ToString(dr["inaccount_dat"]).Substring(0, 4) == "0001")
                    {
                        dr["inaccount_dat"] = DBNull.Value;
                    }
                    if (Convert.ToString(dr["drugstoreexam_date"]).Substring(0, 4) == "0001")
                    {
                        dr["drugstoreexam_date"] = DBNull.Value;
                    }
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #21
0
        public long m_mthSearchData(bool blnIsDrugStore, DateTime dtmBegin, DateTime dtmEnd, string strMedStorageid, string strMedTypeid, string strDeptid, out DataTable m_objTable)
        {
            long lngRes = -1;

            m_objTable = new DataTable();
            StringBuilder strSQL = new StringBuilder("");

            if (blnIsDrugStore)
            {
                #region 药房
                strSQL.Append(@"select b.instoredept_chr diagdept_chr,
       case
         when c.deptname_vchr is null then
          '其他'
         else
          c.deptname_vchr
       end deptname_vchr,
       sum(round(a.opretailprice_int * a.ipamount_int / a.packqty_dec, 4)) allprice
  from t_ds_outstorage_detail a,
       t_ds_outstorage        b,
       t_bse_deptdesc         c,
       t_bse_medstore         d,
       t_bse_medicine         e,
       t_aid_medicinetype     f
 where a.seriesid2_int = b.seriesid_int(+)
   and a.status = 1
   and b.instoredept_chr = c.deptid_chr
   and (b.status_int = 2 or b.status_int = 3)
   and b.drugstoreid_chr = d.deptid_chr
   and a.medicineid_chr = e.medicineid_chr(+)
   and e.medicinetypeid_chr = f.medicinetypeid_chr
   and (b.examdate_dat between ? and ?)");
                #endregion
            }
            else
            {
                #region 药库
                strSQL.Append(@"select b.askdept_chr,
       case
         when c.deptname_vchr is null then
          '其他'
         else
          c.deptname_vchr
       end deptname_vchr,
       sum(a.retailprice_int * a.netamount_int) outstorageprice,
       sum(a.retailprice_int * a.netamount_int) retailprice,
       0 retailoutloss
  from t_ms_outstorage_detail a,
       t_ms_outstorage        b,
       t_bse_deptdesc         c,
       t_bse_storage          d,
       t_bse_medicine         e,
       t_aid_medicinetype     f
 where a.seriesid2_int = b.seriesid_int(+)
   and a.status = 1
   and b.askdept_chr = c.deptid_chr
   and (b.status = 2 or b.status = 3)
   and b.storageid_chr = d.storageid_chr
   and a.medicineid_chr = e.medicineid_chr(+)
   and e.medicinetypeid_chr = f.medicinetypeid_chr
   and (b.examdate_dat between ? and ?)");
                #endregion
            }
            try
            {
                int intCount = 2;
                if (strMedStorageid != "0000")
                {
                    if (blnIsDrugStore)
                    {
                        strSQL.Append(@" and d.medstoreid_chr=?");
                    }
                    else
                    {
                        strSQL.Append(@" and d.storageid_chr=?");
                    }
                    intCount++;
                }

                if (!string.IsNullOrEmpty(strMedTypeid))
                {
                    strSQL.Append(@" and f.medicinetypeid_chr=?");
                    intCount++;
                }

                if (!string.IsNullOrEmpty(strDeptid))
                {
                    if (blnIsDrugStore)
                    {
                        strSQL.Append(@" and b.instoredept_chr like ?");
                    }
                    else
                    {
                        strSQL.Append(@" and b.askdept_chr like ?");
                    }
                    intCount++;
                }

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objDPArr   = null;
                objHRPServ.CreateDatabaseParameter(intCount, out objDPArr);
                objDPArr[0].Value = Convert.ToDateTime(dtmBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                objDPArr[1].Value = Convert.ToDateTime(dtmEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                if (intCount == 3)
                {
                    if (strMedStorageid != "0000")
                    {
                        objDPArr[2].Value = strMedStorageid;
                    }
                    else if (!string.IsNullOrEmpty(strMedTypeid))
                    {
                        objDPArr[2].Value = strMedTypeid;
                    }
                    else
                    {
                        objDPArr[2].Value = strDeptid + "%";
                    }
                }
                else if (intCount == 4)
                {
                    if (strMedStorageid != "0000")
                    {
                        objDPArr[2].Value = strMedStorageid;
                        if (!string.IsNullOrEmpty(strMedTypeid))
                        {
                            objDPArr[3].Value = strMedTypeid;
                        }
                        else
                        {
                            objDPArr[3].Value = strDeptid + "%";
                        }
                    }
                    else
                    {
                        objDPArr[2].Value = strMedTypeid;
                        objDPArr[3].Value = strDeptid + "%";
                    }
                }
                else if (intCount == 5)
                {
                    objDPArr[2].Value = strMedStorageid;
                    objDPArr[3].Value = strMedTypeid;
                    objDPArr[4].Value = strDeptid + "%";
                }

                if (blnIsDrugStore)
                {
                    strSQL.Append(@"group by b.instoredept_chr, c.deptname_vchr order by c.deptname_vchr");
                }
                else
                {
                    strSQL.Append(@"group by b.askdept_chr, c.deptname_vchr order by c.deptname_vchr");
                }
                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL.ToString(), ref m_objTable, objDPArr);

                objHRPServ.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
예제 #22
0
        public long m_lngGetInstorageDetailByID(System.Security.Principal.IPrincipal p_objPrincipal, bool p_blnIsHospital, long m_lngSeqid, out DataTable dt)
        {
            long lngRes = 0;

            dt = new DataTable();
            try
            {
                string strSQL = "";
                if (p_blnIsHospital)
                {
                    strSQL = @"select a.seriesid_int,
       a.seriesid2_int,
       a.medicineid_chr,
       a.medspec_vchr,
       a.opamount_int,
       a.opunit_chr,
       a.ipamount_int,
       a.ipunit_chr,
       a.packqty_dec,
       a.opwholesaleprice_int,
       a.ipwholesaleprice_int,
       a.opretailprice_int,
       a.ipretailprice_int,
       decode(a.lotno_vchr, 'UNKNOWN', '', a.lotno_vchr) lotno_vchr,
       a.validperiod_dat,
       a.status,
       a.medicinename_vchr,
       b.assistcode_chr,
       b.medicinetypeid_chr,
       a.instoreid_vchr,
       a.instoragedate_dat,
       a.productorid_chr,
       0 as retailmoney,
       b.opchargeflg_int,
       b.ipchargeflg_int,
       decode(b.ipchargeflg_int, 0, a.opamount_int, a.ipamount_int) amount_int,
       decode(b.ipchargeflg_int, 0, a.opunit_chr, a.ipunit_chr) unit_chr,
       decode(b.ipchargeflg_int,
              0,
              a.opwholesaleprice_int,
              a.ipwholesaleprice_int) wholesaleprice_int,
       decode(b.ipchargeflg_int,
              0,
              a.opretailprice_int,
              a.ipretailprice_int) retailprice_int
  from t_ds_instorage_detail a, t_bse_medicine b
 where a.medicineid_chr = b.medicineid_chr(+)
   and a.status = 1
   and a.seriesid2_int = ?";
                }
                else
                {
                    strSQL = @"select a.seriesid_int,
       a.seriesid2_int,
       a.medicineid_chr,
       a.medspec_vchr,
       a.opamount_int,
       a.opunit_chr,
       a.ipamount_int,
       a.ipunit_chr,
       a.packqty_dec,
       a.opwholesaleprice_int,
       a.ipwholesaleprice_int,
       a.opretailprice_int,
       a.ipretailprice_int,
       decode(a.lotno_vchr, 'UNKNOWN', '', a.lotno_vchr) lotno_vchr,
       a.validperiod_dat,
       a.status,
       a.medicinename_vchr,
       b.assistcode_chr,
       b.medicinetypeid_chr,
       a.instoreid_vchr,
       a.instoragedate_dat,
       a.productorid_chr,
       0 as retailmoney,
       b.opchargeflg_int,
       b.ipchargeflg_int,
       decode(b.opchargeflg_int, 0, a.opamount_int, a.ipamount_int) amount_int,
       decode(b.opchargeflg_int, 0, a.opunit_chr, a.ipunit_chr) unit_chr,
       decode(b.opchargeflg_int,
              0,
              a.opwholesaleprice_int,
              a.ipwholesaleprice_int) wholesaleprice_int,
       decode(b.opchargeflg_int,
              0,
              a.opretailprice_int,
              a.ipretailprice_int) retailprice_int
  from t_ds_instorage_detail a, t_bse_medicine b
 where a.medicineid_chr = b.medicineid_chr(+)
   and a.status = 1
   and a.seriesid2_int = ?";
                }

                clsHRPTableService           objHRPServ  = new clsHRPTableService();
                System.Data.IDataParameter[] objDataParm = null;
                objHRPServ.CreateDatabaseParameter(1, out objDataParm);
                objDataParm[0].Value = m_lngSeqid;
                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dt, objDataParm);
                objHRPServ.Dispose();
                objHRPServ = null;
                dt.Columns["retailmoney"].Expression = "opretailprice_int*ipamount_int/packqty_dec";
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #23
0
        public long m_mthSelectAdjustData(int intDsOrMs, DateTime strBegin, DateTime strEnd, string p_Medid, out DataTable m_objTable)
        {
            long lngRes = -1;

            m_objTable = new DataTable();
            string strSql = "";

            if (intDsOrMs == 0)
            {
                #region 药房
                strSql = @"select b.medicinename_vch,
                                      b.medspec_vchr,
                                      b.opunit_vchr opunit_vchr,
                                      c.productorid_chr,
                                      b.opoldretailprice_int oldretailprice_int,
                                      b.opnewretailprice_int newretailprice_int,
                                      decode(c.opchargeflg_int,0,b.opoldretailprice_int,
                                      1,b.ipoldretailprice_int) as opoldprice,
                                      decode(c.opchargeflg_int,0,b.opnewretailprice_int,
                                      1,b.ipnewretailprice_int) as opnewprice,
                                      decode(to_char(a.examdate_dat),'0001-1-1','',
                                      to_char(a.examdate_dat,'yyyy-mm-dd')) as examdate_dat,
                                      b.reason_vchr
                                 from t_ds_adjustprice a,
                                      t_ds_adjustprice_detail b,
                                      t_bse_medicine c,
                                      t_bse_medstore d
                                where a.seriesid_int=b.seriesid2_int(+)
                                  and (a.status_int=2 or a.status_int=3)
                                  and b.status_int=1
                                  and b.medicineid_chr=c.medicineid_chr(+)
                                  and b.drugstoreid_chr=d.deptid_chr(+)
                                  and a.examdate_dat between ? and ?";
                #endregion
            }
            else
            {
                #region 药库
                strSql = @"select b.medicinename_vch,
                                      b.medspec_vchr,
                                      b.opunit_vchr,
                                      c.productorid_chr,
                                      b.oldretailprice_int,
                                      b.newretailprice_int,
                                      decode(to_char(a.examdate_dat),'0001-1-1','',
                                      to_char(a.examdate_dat,'yyyy-mm-dd')) as examdate_dat,
                                      b.reason_vchr
                                 from t_ms_adjustprice a,
                                      t_ms_adjustprice_detail b,
                                      t_bse_medicine c,
                                      t_bse_storage d
                                where a.seriesid_int=b.seriesid2_int(+)
                                  and (a.formstate_int=2 or a.formstate_int=3)
                                  and b.status_int=1
                                  and b.medicineid_chr=c.medicineid_chr(+)
                                  and a.storageid_chr=d.storageid_chr(+)
                                  and a.adjustpricedate_dat between ? and ?";
                #endregion
            }
            try
            {
                if (!string.IsNullOrEmpty(p_Medid))
                {
                    strSql += @" and b.medicineid_chr=?";
                }

                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();

                IDataParameter[] objDPArr = null;

                if (!string.IsNullOrEmpty(p_Medid))
                {
                    objHRPSvc.CreateDatabaseParameter(3, out objDPArr);
                    objDPArr[0].DbType = DbType.DateTime;
                    objDPArr[0].Value  = DateTime.Parse(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                    objDPArr[1].DbType = DbType.DateTime;
                    objDPArr[1].Value  = DateTime.Parse(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                    objDPArr[2].Value  = p_Medid;
                }
                else
                {
                    objHRPSvc.CreateDatabaseParameter(2, out objDPArr);
                    objDPArr[0].DbType = DbType.DateTime;
                    objDPArr[0].Value  = DateTime.Parse(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                    objDPArr[1].DbType = DbType.DateTime;
                    objDPArr[1].Value  = DateTime.Parse(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                }

                //if (strStorageid == "0000")
                //{
                //    objHRPSvc.CreateDatabaseParameter(2, out objDPArr);
                //    objDPArr[0].DbType = DbType.DateTime;
                //    objDPArr[0].Value = DateTime.Parse(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                //    objDPArr[1].DbType = DbType.DateTime;
                //    objDPArr[1].Value = DateTime.Parse(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                //}
                //else
                //{
                //    objHRPSvc.CreateDatabaseParameter(3, out objDPArr);
                //    objDPArr[0].Value = strStorageid;
                //    objDPArr[1].DbType = DbType.DateTime;
                //    objDPArr[1].Value = DateTime.Parse(strBegin.ToString("yyyy-MM-dd HH:mm:ss"));
                //    objDPArr[2].DbType = DbType.DateTime;
                //    objDPArr[2].Value = DateTime.Parse(strEnd.ToString("yyyy-MM-dd HH:mm:ss"));
                //}

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSql, ref m_objTable, objDPArr);

                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #24
0
        public long m_lngLoadBill(System.Security.Principal.IPrincipal p_objPrincipal, bool p_blnIsHospital, string p_strBillID, out clsDS_Instorage_VO p_objMain, out DataTable p_dtbSub)
        {
            p_objMain = null;
            p_dtbSub  = null;
            DataTable dtbMain = new DataTable();
            long      lngRes  = 0;

            try
            {
                string strSQL =
                    @"select a.seriesid_int,
       a.indrugstoreid_vchr,
       b.deptname_vchr as medstorename_vchr,
       a.askid_vchr,
       a.outstorageid_vchr,
       a.drugstoreid_chr,
       a.comment_vchr,
       decode(a.status,
              0,
              '删除',
              1,
              '新制',
              2,
              '审核',
              3,
              '入帐',
              4,
              '退审') as status,
       formtype_int,a.status as status_int,
       a.typecode_vchr,
       a.borrowdept_chr,
       c.deptname_vchr,
       a.makeorder_dat,
       a.storageexamid_chr,
       d.lastname_vchr as storageexamname,
       a.drugstoreexamid_chr,
       e.lastname_vchr as drugstoreexamname_chr,
       a.inaccounterid_chr,
       f.lastname_vchr as inaccountername,
       a.makerid_chr,
       h.lastname_vchr as makername,
       i.typename_vchr,
       a.drugstoreexam_date,
       a.inaccount_dat,
       0 summoney
  from t_ds_instorage   a,
       t_bse_deptdesc   b,
       t_bse_deptdesc   c,
       t_bse_employee   d,
       t_bse_employee   e,
       t_bse_employee   f,
       t_bse_employee   h,
       t_aid_impexptype i
 where a.drugstoreid_chr = b.deptid_chr(+)
   and a.borrowdept_chr = c.deptid_chr(+)
   and a.storageexamid_chr = d.empid_chr(+)
   and a.drugstoreexamid_chr = e.empid_chr(+)
   and a.inaccounterid_chr = f.empid_chr(+)
   and a.makerid_chr = h.empid_chr(+)
   and a.typecode_vchr = i.typecode_vchr(+)
   and a.indrugstoreid_vchr = ?";

                clsHRPTableService           objHRPServ   = new clsHRPTableService();
                System.Data.IDataParameter[] m_objParaArr = null;
                objHRPServ.CreateDatabaseParameter(1, out m_objParaArr);
                m_objParaArr[0].Value = p_strBillID;
                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtbMain, m_objParaArr);
                if (dtbMain != null && dtbMain.Rows.Count > 0)
                {
                    p_objMain = new clsDS_Instorage_VO();
                    p_objMain.m_datMAKEORDER_DAT      = Convert.ToDateTime(dtbMain.Rows[0]["makeorder_dat"]);
                    p_objMain.m_strMakeName           = dtbMain.Rows[0]["makername"].ToString();
                    p_objMain.m_strTYPENAME_VCHR      = dtbMain.Rows[0]["typename_vchr"].ToString();
                    p_objMain.m_strBORROWDEPTName_CHR = dtbMain.Rows[0]["deptname_vchr"].ToString();
                    p_objMain.m_strDRUGSTOREName      = dtbMain.Rows[0]["medstorename_vchr"].ToString();
                    p_objMain.m_strINDRUGSTOREID_VCHR = dtbMain.Rows[0]["indrugstoreid_vchr"].ToString();
                    p_objMain.m_strCOMMENT_VCHR       = dtbMain.Rows[0]["comment_vchr"].ToString();

                    m_lngGetInstorageDetailByID(p_objPrincipal, p_blnIsHospital, Convert.ToInt64(dtbMain.Rows[0]["seriesid_int"]), out p_dtbSub);
                }
                objHRPServ.Dispose();
                objHRPServ = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
예제 #25
0
        public long m_lngGetMedicineInnerWithdrawDetailDataReport(string instorageid_vchr, out DataTable dtbResult)
        {
            long lngRes = 0;

            IDataParameter[] objDPArr = null;
            dtbResult = null;
            //创建COM对象
            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
            //问题:少一个字段:ComputeBillSum单据金额
            string strSQL = @"select distinct b.seriesid_int,
                b.seriesid2_int,
                b.medicineid_chr,
                b.medicinename_vch,
                b.medspec_vchr,
                case
                  when b.lotno_vchr = 'UNKNOWN' then
                   ''
                  else
                   b.lotno_vchr
                end lotno_vchr,
                b.amount,
                b.unit_vchr,
                b.callprice_int,
                b.wholesaleprice_int,
                b.retailprice_int,
                b.instorageid_vchr,
                b.outstorageid_vchr,
                b.validperiod_dat,
                b.ruturnnum_int,
                b.productorid_chr,
                b.status,
                d.netamount_int,
                e.vendorid_chr,
                e.vendorname_vchr,
                f.assistcode_chr,
                g.realgross_int
  from t_ms_instorage a
 inner join t_ms_instorage_detal b on a.seriesid_int = b.seriesid2_int
  left outer join t_bse_medicine f on b.medicineid_chr = f.medicineid_chr
  left outer join t_ms_outstorage c on b.outstorageid_vchr =
                                       c.outstorageid_vchr
                                   and c.status > 1
  left outer join t_ms_outstorage_detail d on c.seriesid_int =
                                              d.seriesid2_int
                                          and d.status = 1
                                          and d.medicineid_chr =
                                              b.medicineid_chr
                                          and d.lotno_vchr = b.lotno_vchr
                                          and b.validperiod_dat =
                                              d.validperiod_dat
                                          and b.callprice_int =
                                              d.callprice_int
  left outer join t_bse_vendor e on d.vendorid_chr = e.vendorid_chr
  left outer join T_MS_STORAGE_DETAIL g on b.medicineid_chr =
                                           g.medicineid_chr
                                       and b.lotno_vchr = g.lotno_vchr
                                       and b.instorageid_vchr =
                                           g.instorageid_vchr
                                       and b.validperiod_dat =
                                           g.validperiod_dat
                                       and b.callprice_int =
                                           g.callprice_int
                                       and g.status = 1";

            try
            {
                int           m_intParamCount = 0;
                StringBuilder m_strbCondition = new StringBuilder("");

                objHRPSvc.CreateDatabaseParameter(1, out objDPArr);
                objDPArr[0].Value = instorageid_vchr;
                lngRes            = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objDPArr);
            }//try

            finally
            {
                objHRPSvc.Dispose();
                objDPArr = null;
            }

            return(lngRes);
        }
예제 #26
0
        public long m_lngAddNewAppAndSampleInfoWithBarcode(
            IPrincipal principal,
            clsLisApplMainVO applMain, out clsLisApplMainVO applMainOut,
            clsT_OPR_LIS_APP_REPORT_VO[] arrReports, clsT_OPR_LIS_APP_SAMPLE_VO[] arrSamples,
            clsT_OPR_LIS_APP_CHECK_ITEM_VO[] arrCheckItems, clsT_OPR_LIS_APP_APPLY_UNIT_VO[] arrApplyUnits,
            clsLisAppUnitItemVO[] arrUnitItemRelations)
        {
            applMainOut = applMain;
            long lngRes  = 0;
            long lngReff = 0;

            if (applMain == null)
            {
                return(-2);
            }

            try
            {
                lngRes   = 0;
                lngRes   = m_lngAddNewAppl(applMain, out applMainOut);
                applMain = applMainOut;

                if (lngRes > 0)
                {
                    #region 赋申请单ID
                    for (int i = 0; i < arrReports.Length; i++)
                    {
                        arrReports[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrSamples.Length; i++)
                    {
                        arrSamples[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrCheckItems.Length; i++)
                    {
                        arrCheckItems[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrApplyUnits.Length; i++)
                    {
                        arrApplyUnits[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrUnitItemRelations.Length; i++)
                    {
                        arrUnitItemRelations[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    #endregion
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewReportGroup(arrReports);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppSampleGroup(arrSamples);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppCheckItem(arrCheckItems);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppApplyUint(arrApplyUnits);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppUintItemArr(arrUnitItemRelations);
                }
                if (lngRes > 0)
                {
                    //自动生成barcode号
                    clsHRPTableService objHRPSvc  = new clsHRPTableService();
                    string             strSQL     = @"select seq_lis_barcode.nextval from dual";
                    DataTable          dtResult   = new DataTable();
                    string             strBarcode = "";
                    lngRes = 0;
                    lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtResult);
                    if (lngRes > 0)
                    {
                        if (dtResult.Rows[0][0] == System.DBNull.Value)
                        {
                            strBarcode = "";
                        }
                        else
                        {
                            strBarcode = dtResult.Rows[0][0].ToString();
                        }
                    }
                    dtResult  = null;
                    objHRPSvc = null;

                    clsT_OPR_LIS_SAMPLE_VO objSampleVO = new clsT_OPR_LIS_SAMPLE_VO();

                    #region 构造SampleVO

                    objSampleVO.m_strAPPL_DAT                 = applMain.m_strAppl_Dat;
                    objSampleVO.m_strSEX_CHR                  = applMain.m_strSex;
                    objSampleVO.m_strPATIENT_NAME_VCHR        = applMain.m_strPatient_Name;
                    objSampleVO.m_strPATIENT_SUBNO_CHR        = applMain.m_strPatient_SubNO;
                    objSampleVO.m_strAGE_CHR                  = applMain.m_strAge;
                    objSampleVO.m_strPATIENT_TYPE_CHR         = applMain.m_strPatientType;
                    objSampleVO.m_strDIAGNOSE_VCHR            = applMain.m_strDiagnose;
                    objSampleVO.m_strBEDNO_CHR                = applMain.m_strBedNO;
                    objSampleVO.m_strICD_VCHR                 = applMain.m_strICD;
                    objSampleVO.m_strPATIENTCARDID_CHR        = applMain.m_strPatientcardID;
                    objSampleVO.m_strPATIENTID_CHR            = applMain.m_strPatientID;
                    objSampleVO.m_strAPPL_EMPID_CHR           = applMain.m_strAppl_EmpID;
                    objSampleVO.m_strAPPL_DEPTID_CHR          = applMain.m_strAppl_DeptID;
                    objSampleVO.m_strAPPLICATION_ID_CHR       = applMain.m_strAPPLICATION_ID;
                    objSampleVO.m_strPATIENT_INHOSPITALNO_CHR = applMain.m_strPatient_inhospitalno_chr;
                    objSampleVO.m_strSAMPLE_TYPE_ID_CHR       = applMain.m_strSampleTypeID;
                    objSampleVO.m_strSAMPLETYPE_VCHR          = applMain.m_strSampleType;
                    objSampleVO.m_intSTATUS_INT               = 3;
                    objSampleVO.m_strQCSAMPLEID_CHR           = "-1";

                    objSampleVO.m_strSAMPLEKIND_CHR = "1";
                    objSampleVO.m_strSAMPLE_ID_CHR  = null;

                    objSampleVO.m_strSAMPLESTATE_VCHR = "";

                    if (strBarcode.Trim() != "")
                    {
                        strBarcode = strBarcode.PadLeft(9, '0');
                    }

                    objSampleVO.m_strBARCODE_VCHR = strBarcode;

                    objSampleVO.m_strOPERATOR_ID_CHR = applMain.m_strOperator_ID;

                    objSampleVO.m_strSAMPLING_DATE_DAT = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                    objSampleVO.m_strCOLLECTOR_ID_CHR = null;

                    objSampleVO.m_strACCEPTOR_ID_CHR = applMain.m_strOperator_ID;

                    objSampleVO.m_strACCEPT_DAT = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                    #endregion

                    lngRes = 0;
                    lngRes = new clsSampleSvc().m_lngAddNewSampleAndModifyAppSampleGroup(principal, objSampleVO.m_strAPPLICATION_ID_CHR, objSampleVO);
                    for (int i = 0; i < arrSamples.Length; i++)
                    {
                        arrSamples[i].m_strSAMPLE_ID_CHR = objSampleVO.m_strSAMPLE_ID_CHR;
                    }
                }
                if (lngRes <= 0)
                {
                    throw new Exception(string.Empty);
                }
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
                throw objEx;
            }

            return(lngRes);
        }
예제 #27
0
        public long m_lngRefundAndResumeAndStrikePrePay(string PrePayID, string NewBillNO, string EmpID, string ConfirmID, int type, string CuyCate, out string NewPrePayID)
        {
            long   lngRes = 0, lngAffects = 0;
            string SQL = "";

            NewPrePayID = "";

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                IDataParameter[]   ParamArr  = null;

                if (type == 4)
                {
                    //取预交金序列ID
                    DataTable dt = new DataTable();

                    SQL    = "select lpad(seq_prepayid.NEXTVAL, 12, '0') from dual";
                    lngRes = objHRPSvc.lngGetDataTableWithoutParameters(SQL, ref dt);
                    if (lngRes > 0)
                    {
                        NewPrePayID = dt.Rows[0][0].ToString();
                    }

                    SQL = @"insert into t_opr_bih_prepay (prepayid_chr, patientid_chr, registerid_chr, paytype_int, cuycate_int, 
                                                             money_dec, prepayinv_vchr, areaid_chr, des_vchr, creatorid_chr, create_dat, 
                                                             status_int, isclear_int, uptype_int, balanceemp_chr, balance_dat, patientname_chr, 
                                                             areaname_vchr, balanceflag_int, balanceid_vchr, confirmemp_chr, originvono_vchr) 
                                                      select ?, 
                                                             patientid_chr,
                                                             registerid_chr,
                                                             ?,
                                                             ?,
                                                             -money_dec,
                                                             ?,
                                                             areaid_chr,
                                                             des_vchr, ?,                                                              
                                                             sysdate,
                                                             status_int,
                                                             isclear_int,
                                                             uptype_int,
                                                             null,
                                                             null,
                                                             patientname_chr,
                                                             areaname_vchr,  
                                                             0, 
                                                             null, 
                                                             null, 
                                                             prepayinv_vchr                                          
                                                        from t_opr_bih_prepay 
                                                       where prepayid_chr = ?";

                    objHRPSvc.CreateDatabaseParameter(6, out ParamArr);
                    ParamArr[0].Value = NewPrePayID;
                    ParamArr[1].Value = type;
                    ParamArr[2].Value = CuyCate;
                    ParamArr[3].Value = NewBillNO;
                    ParamArr[4].Value = EmpID;
                    ParamArr[5].Value = PrePayID;
                }
                else
                {
                    SQL = @"insert into t_opr_bih_prepay (prepayid_chr, patientid_chr, registerid_chr, paytype_int, cuycate_int, 
                                                             money_dec, prepayinv_vchr, areaid_chr, des_vchr, creatorid_chr, create_dat, 
                                                             status_int, isclear_int, uptype_int, balanceemp_chr, balance_dat, patientname_chr, 
                                                             areaname_vchr, balanceflag_int, balanceid_vchr, confirmemp_chr) 
                                                      select lpad(seq_prepayid.NEXTVAL, 12, '0'), 
                                                             patientid_chr,
                                                             registerid_chr,
                                                             ?,
                                                             cuycate_int,
                                                             -money_dec,
                                                             prepayinv_vchr,
                                                             areaid_chr,
                                                             des_vchr, ?,                                                              
                                                             sysdate,
                                                             status_int,
                                                             isclear_int,
                                                             uptype_int,
                                                             null,
                                                             null,
                                                             patientname_chr,
                                                             areaname_vchr,  
                                                             0, 
                                                             null, null  
                                                        from t_opr_bih_prepay 
                                                       where prepayid_chr = ?";

                    objHRPSvc.CreateDatabaseParameter(3, out ParamArr);
                    ParamArr[0].Value = type;
                    ParamArr[1].Value = EmpID;
                    ParamArr[2].Value = PrePayID;
                }

                lngRes = objHRPSvc.lngExecuteParameterSQL(SQL, ref lngAffects, ParamArr);

                if (type == 3)
                {
                    SQL = @"select prepayinv_vchr from t_opr_bih_prepay where prepayid_chr = ?";
                    objHRPSvc.CreateDatabaseParameter(1, out ParamArr);
                    ParamArr[0].Value = PrePayID;
                    DataTable dt = null;
                    objHRPSvc.lngGetDataTableWithParameters(SQL, ref dt, ParamArr);

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        SQL = @"update t_invoice_refundreason status = 0 where flagid = 3 and invono = ?";

                        objHRPSvc.CreateDatabaseParameter(1, out ParamArr);
                        ParamArr[0].Value = dt.Rows[0]["prepayinv_vchr"].ToString();
                        lngRes            = objHRPSvc.lngExecuteParameterSQL(SQL, ref lngAffects, ParamArr);
                    }
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
예제 #28
0
        private long m_lngAddNewAppl(clsLisApplMainVO applMain, out clsLisApplMainVO applMainOut)
        {
            #region == SQL ==

            string sql = @"insert into t_opr_lis_application
                                      ( application_id_chr      , modify_dat, 
							            patientid_chr           , application_dat, 
							            sex_chr                 , patient_name_vchr, 
							            patient_subno_chr       , age_chr, 
							            patient_type_id_chr     , diagnose_vchr, 
							            bedno_chr               , icdcode_chr, 
							            patientcardid_chr       , application_form_no_chr, 
							            operator_id_chr         , appl_empid_chr, 
							            appl_deptid_chr         , summary_vchr, 
							            pstatus_int             , emergency_int,
							            special_int             , form_int,
							            patient_inhospitalno_chr, sample_type_id_chr,
							            sample_type_vchr        , check_content_vchr,
							            oringin_dat             , charge_info_vchr,   orderunitrelation_vchr  )
								values(      ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?   )"                                ;


            #endregion

            applMainOut = applMain;
            long lngRes = 0;
            try
            {
                IDataParameter[]   objLisApplArr = null;
                clsHRPTableService objHRPSvc     = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(29, out objLisApplArr);

                DateTime CurTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                if (!IsNullOrEmptyOrSpace(applMain.m_strMODIFY_DAT))
                {
                    try
                    {
                        DateTime dtmPreModify = DateTime.Parse(applMain.m_strMODIFY_DAT);
                        TimeSpan ts           = CurTime - dtmPreModify;
                        if (ts.TotalMilliseconds < 1000)
                        {
                            CurTime = CurTime.AddSeconds(1f);
                        }
                    }
                    catch { }
                }

                if (IsNullOrEmptyOrSpace(applMain.m_strAPPLICATION_ID))
                {
                    string strNewApplID = null;
                    objHRPSvc.m_lngGenerateNewID("t_opr_lis_application", "APPLICATION_ID_CHR", out strNewApplID);
                    if (string.IsNullOrEmpty(strNewApplID))
                    {
                        throw new Exception("不能分配申请单ID");
                    }
                    applMain.m_strAPPLICATION_ID = strNewApplID;
                }


                objLisApplArr[0].Value   = applMain.m_strAPPLICATION_ID;
                applMain.m_strMODIFY_DAT = CurTime.ToString("yyyy-MM-dd HH:mm:ss");
                objLisApplArr[1].Value   = CurTime;
                if (IsNullOrEmptyOrSpace(applMain.m_strPatientID))
                {
                    applMain.m_strPatientID = "-1";
                }
                objLisApplArr[2].Value  = applMain.m_strPatientID;
                objLisApplArr[2].DbType = DbType.String;

                if (Microsoft.VisualBasic.Information.IsDate(applMain.m_strAppl_Dat))
                {
                    objLisApplArr[3].Value = System.DateTime.Parse(applMain.m_strAppl_Dat);
                }
                else
                {
                    applMain.m_strAppl_Dat = null;
                }
                objLisApplArr[4].Value  = applMain.m_strSex;
                objLisApplArr[5].Value  = applMain.m_strPatient_Name;
                objLisApplArr[6].Value  = applMain.m_strPatient_SubNO;
                objLisApplArr[7].Value  = applMain.m_strAge;
                objLisApplArr[8].Value  = applMain.m_strPatientType;
                objLisApplArr[9].Value  = applMain.m_strDiagnose;
                objLisApplArr[10].Value = applMain.m_strBedNO;
                objLisApplArr[11].Value = applMain.m_strICD;

                if (IsNullOrEmptyOrSpace(applMain.m_strPatientcardID))
                {
                    objLisApplArr[12].Value = System.DBNull.Value;
                }
                else
                {
                    objLisApplArr[12].Value = applMain.m_strPatientcardID;
                }

                objLisApplArr[13].Value = applMain.m_strApplication_Form_NO;
                objLisApplArr[14].Value = applMain.m_strOperator_ID;
                objLisApplArr[15].Value = applMain.m_strAppl_EmpID;
                objLisApplArr[16].Value = applMain.m_strAppl_DeptID;
                objLisApplArr[17].Value = applMain.m_strSummary;
                objLisApplArr[18].Value = applMain.m_intPStatus_int;
                objLisApplArr[19].Value = applMain.m_intEmergency;
                objLisApplArr[20].Value = applMain.m_intSpecial;
                objLisApplArr[21].Value = applMain.m_intForm_int;
                objLisApplArr[22].Value = applMain.m_strPatient_inhospitalno_chr;
                objLisApplArr[23].Value = applMain.m_strSampleTypeID;
                objLisApplArr[24].Value = applMain.m_strSampleType;
                objLisApplArr[25].Value = applMain.m_strCheckContent;
                try
                {
                    DateTime.Parse(applMain.m_strOriginDate);
                }
                catch
                {
                    applMain.m_strOriginDate = CurTime.ToString("yyyy-MM-dd HH:mm:ss");
                }

                objLisApplArr[26].Value = DateTime.Parse(applMain.m_strOriginDate);
                objLisApplArr[27].Value = applMain.m_strChargeInfo;
                objLisApplArr[28].Value = applMain.m_strOrderunitrelation;

                long lngRecEff = -1;

                lngRes = objHRPSvc.lngExecuteParameterSQL(sql, ref lngRecEff, objLisApplArr);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
                throw objEx;
            }
            return(lngRes);
        }
예제 #29
0
        public long SaveMedCommonUseInfo(System.Security.Principal.IPrincipal p_objPrincipal, System.Data.DataTable p_SrcDt, System.Data.DataTable p_DelDt)
        {
            long lngRes = 0;
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS", "SaveMedCommonUseInfo");
            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
            if (lngRes < 0)
            {
                return(-1);
            }
            string strSQL = "";

            if (p_DelDt != null)
            {
                for (int i1 = 0; i1 < p_DelDt.Rows.Count; i1++)
                {
                    strSQL = "DELETE T_AID_COMUSECHARGEITEM WHERE SEQID_CHR = '" + p_DelDt.Rows[i1]["SEQID_CHR"].ToString().Trim() + "'";
                    try
                    {
                        lngRes = objHRPSvc.DoExcute(strSQL);
                    }
                    catch (Exception objEx)
                    {
                        string strTmp = objEx.Message;
                        com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                        bool blnRes = objLogger.LogError(objEx);
                    }
                }
            }
            if (p_SrcDt != null)
            {
                string strSeqid = "";
                for (int i1 = 0; i1 < p_SrcDt.Rows.Count; i1++)
                {
                    if (p_SrcDt.Rows[i1].RowState == System.Data.DataRowState.Added)
                    {
                        objHRPSvc.lngGenerateID(10, "seqid_chr", "t_aid_comusechargeitem", out strSeqid);
                        strSQL = @"insert into t_aid_comusechargeitem(seqid_chr,CREATE_DAT ,deptid_chr, itemid_chr, createrid_chr, privilege_int) values(?,?,?,?,?,?)";
                        try
                        {
                            System.Data.IDataParameter[] paramArr = null;
                            objHRPSvc.CreateDatabaseParameter(6, out paramArr);
                            paramArr[0].Value = strSeqid;
                            paramArr[1].Value = System.DateTime.Now;
                            paramArr[2].Value = p_SrcDt.Rows[i1]["deptid_chr"].ToString().Trim();
                            paramArr[3].Value = p_SrcDt.Rows[i1]["itemid_chr"].ToString().Trim();
                            paramArr[4].Value = p_SrcDt.Rows[i1]["createrid_chr"].ToString().Trim();
                            paramArr[5].Value = p_SrcDt.Rows[i1]["privilege_int"].ToString().Trim();

                            long lngRecordsAffected = -1;
                            lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecordsAffected, paramArr);
                            objHRPSvc.Dispose();

                            p_SrcDt.Rows[i1]["seqid_chr"] = strSeqid;
                        }
                        catch (Exception objEx)
                        {
                            string strTmp = objEx.Message;
                            com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                            bool blnRes = objLogger.LogError(objEx);
                        }
                    }
                }
            }
            return(lngRes);
        }
예제 #30
0
        public long m_lngJudgeCanAdjustPriceByMedicineID_ALLNewBill(System.Security.Principal.IPrincipal p_objPrincipal, string m_strMedicineid, out string m_strReturnMsg)
        {
            m_strReturnMsg = string.Empty;

            long lngRes  = -1;
            int  intRows = 0;

            try
            {
                string             strSQL    = @"select   distinct a.outstorageid_vchr
                                      from t_ms_outstorage a, t_ms_outstorage_detail b
                                     where a.seriesid_int = b.seriesid2_int
                                       and a.status = 1
                                       and b.status = 1
                                       and b.medicineid_chr = ?";
                DataTable          dtValue   = null;
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                IDataParameter[]   param     = null;
                objHRPSvc.CreateDatabaseParameter(1, out param);
                param[0].Value = m_strMedicineid;

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtValue, param);
                objHRPSvc.Dispose();
                objHRPSvc = null;

                if (lngRes < 0)
                {
                    return(lngRes);
                }
                if (dtValue.Rows.Count > 0)
                {
                    m_strReturnMsg = "药库出库单据号:\r\n";
                    foreach (DataRow dr in dtValue.Rows)
                    {
                        intRows++;
                        if (intRows % 2 == 0)
                        {
                            m_strReturnMsg += dr[0].ToString() + "\r\n";
                        }
                        else
                        {
                            m_strReturnMsg += dr[0].ToString() + "\t";
                        }
                    }
                    if (intRows % 2 != 0)
                    {
                        m_strReturnMsg += "\r\n";
                    }
                }

                strSQL    = @"select  distinct a.outdrugstoreid_vchr
                              from t_ds_outstorage a, t_ds_outstorage_detail b
                             where a.seriesid_int = b.seriesid2_int
                               and a.status_int = 1
                               and b.status = 1
                               and b.medicineid_chr = ?";
                objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(1, out param);
                param[0].Value = m_strMedicineid;
                dtValue        = null;

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtValue, param);
                objHRPSvc.Dispose();
                objHRPSvc = null;

                if (lngRes < 0)
                {
                    return(lngRes);
                }
                if (dtValue.Rows.Count > 0)
                {
                    intRows        = 0;
                    m_strReturnMsg = "药房出库单据号:\r\n";
                    foreach (DataRow dr in dtValue.Rows)
                    {
                        intRows++;
                        if (intRows % 2 == 0)
                        {
                            m_strReturnMsg += dr[0].ToString() + "\r\n";
                        }
                        else
                        {
                            m_strReturnMsg += dr[0].ToString() + "\t";
                        }
                    }
                    if (intRows % 2 != 0)
                    {
                        m_strReturnMsg += "\r\n";
                    }
                }

                strSQL    = @"select distinct a.indrugstoreid_vchr
                              from t_ds_instorage a, t_ds_instorage_detail b
                             where a.seriesid_int = b.seriesid2_int
                               and a.status = 1
                               and b.status = 1
                               and b.medicineid_chr = ?";
                objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(1, out param);
                param[0].Value = m_strMedicineid;
                dtValue        = null;

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtValue, param);
                objHRPSvc.Dispose();
                objHRPSvc = null;

                if (lngRes < 0)
                {
                    return(lngRes);
                }
                if (dtValue.Rows.Count > 0)
                {
                    intRows        = 0;
                    m_strReturnMsg = "药房入库单据号:\r\n";
                    foreach (DataRow dr in dtValue.Rows)
                    {
                        intRows++;
                        if (intRows % 2 == 0)
                        {
                            m_strReturnMsg += dr[0].ToString() + "\r\n";
                        }
                        else
                        {
                            m_strReturnMsg += dr[0].ToString() + "\t";
                        }
                    }
                    if (intRows % 2 != 0)
                    {
                        m_strReturnMsg += "\r\n";
                    }
                }

                strSQL    = @"select  distinct a.instorageid_vchr
                              from t_ms_instorage a, t_ms_instorage_detal b
                             where a.seriesid_int = b.seriesid2_int
                               and a.state_int = 1
                               and b.status = 1
                               and b.medicineid_chr = ?";
                objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(1, out param);
                param[0].Value = m_strMedicineid;
                dtValue        = null;

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtValue, param);
                objHRPSvc.Dispose();
                objHRPSvc = null;

                if (lngRes < 0)
                {
                    return(lngRes);
                }
                if (dtValue.Rows.Count > 0)
                {
                    intRows        = 0;
                    m_strReturnMsg = "药库入库单据号:\r\n";
                    foreach (DataRow dr in dtValue.Rows)
                    {
                        intRows++;
                        if (intRows % 2 == 0)
                        {
                            m_strReturnMsg += dr[0].ToString() + "\r\n";
                        }
                        else
                        {
                            m_strReturnMsg += dr[0].ToString() + "\t";
                        }
                    }
                    if (intRows % 2 != 0)
                    {
                        m_strReturnMsg += "\r\n";
                    }
                }

                dtValue.Dispose();
                dtValue = null;

                m_strReturnMsg = m_strReturnMsg.Trim();
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }