Exemple #1
0
        public long m_lngVerichDropRecord(System.Security.Principal.IPrincipal p_objPrincipal, int p_Seq, int p_Order)
        {
            long lngRes = 0;

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_lngVerichDropRecord");

            if (lngRes < 0)
            {
                return(-1);
            }

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                string strSQL = @" update T_OPR_MEDSTOREWINQUE set  ORDER_INT=? where SEQ_INT=?";

                System.Data.IDataParameter[] paramArr = null;
                objHRPSvc.CreateDatabaseParameter(2, out paramArr);
                paramArr[0].Value = p_Order;
                paramArr[1].Value = p_Seq;
                long lngRecordsAffected = -1;
                lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecordsAffected, paramArr);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Exemple #2
0
        public long m_lngGetMedStoreInfo(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable p_dtable)
        {
            long lngRes = 0;

            p_dtable = new DataTable();

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_lngGetMedStoreInfo");
            if (lngRes < 0)
            {
                return(-1);
            }
            string strSQL = @"select e.medstoreid_chr,e.medstorename_vchr from t_bse_medstore e    where  e.medstoretype_int in (1, 3)";

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref p_dtable);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
Exemple #3
0
        public long m_thDelMedSendGiveRelation(System.Security.Principal.IPrincipal p_objPrincipal, int p_intID)
        {
            long lngRes = 0;

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_thDelMedSendGiveRelation");
            if (lngRes < 0)
            {
                return(-1);
            }
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                string strSQL = @"delete T_OPR_MEDSTOREWINRLT  where SEQ_INT=" + p_intID + "";
                lngRes = objHRPSvc.DoExcute(strSQL);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
Exemple #4
0
        public long m_lngDeleteReportObject(System.Security.Principal.IPrincipal p_objPrincipal,
                                            string p_strApplicationID)
        {
            long lngRes = 0;

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

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

            string strSQL = @"DELETE FROM t_opr_lis_report_object
								WHERE application_id_chr = ?"                                ;

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

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

            lngRes = 0;
            long lngEff = 0;

            lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngEff, objDPArr);
            return(lngRes);
        }
        private long m_getMedTypeResult(string strSQL, out com.digitalwave.iCare.ValueObject.clsMedicineType_VO[] p_objResultArr)
        {
            long lngRes = 0;

            p_objResultArr = new com.digitalwave.iCare.ValueObject.clsMedicineType_VO[0];
            try
            {
                DataTable dtbResult = new DataTable();
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtbResult);


                if (lngRes > 0 && dtbResult.Rows.Count > 0)
                {
                    p_objResultArr = new com.digitalwave.iCare.ValueObject.clsMedicineType_VO[dtbResult.Rows.Count];

                    for (int i1 = 0; i1 < p_objResultArr.Length; i1++)
                    {
                        p_objResultArr[i1] = new com.digitalwave.iCare.ValueObject.clsMedicineType_VO();
                        p_objResultArr[i1].m_strMedicineTypeID   = dtbResult.Rows[i1]["medicinetypeid_chr"].ToString().Trim();
                        p_objResultArr[i1].m_strMedicineTypeName = dtbResult.Rows[i1]["medicinetypename_vchr"].ToString().Trim();
                    }
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
        public long m_lngGetMedType(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable dtMedType)
        {
            long lngRes = 0;

            dtMedType = new DataTable();
            com.digitalwave.security.clsPrivilegeHandleService objPrivilege = new com.digitalwave.security.clsPrivilegeHandleService();
            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.MedicineStoreService.clsGetStorageCheckMedicineSVC", "m_lngGetMedType");
            if (lngRes < 0)
            {
                return(-1);
            }
            string strSQL = @"select medicinetypeid_chr, medicinetypename_vchr
                                from t_aid_medicinetype";

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtMedType);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Exemple #7
0
        public long m_lngGetMedWindowInfo(System.Security.Principal.IPrincipal p_objPrincipal, string p_TypeID, int flage, out clsOPMedStoreWin_VO[] p_objResArr)
        {
            long lngRes = 0;

            p_objResArr = new clsOPMedStoreWin_VO[0];
            DataTable p_dtRes = new DataTable();

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_lngGetMedWindowInfo");
            if (lngRes < 0)
            {
                return(-1);
            }
            string strSQL = @"select a.windowid_chr,a.windowname_vchr,a.medstoreid_chr,a.windowtype_int,a.workstatus_int,b.medstorename_vchr from T_BSE_MEDSTOREWIN a,T_bse_medStore b
            where a.medstoreid_chr=b.medstoreid_chr and a.windowtype_int=? and b.medstoreid_chr=? order by a.medstoreid_chr,a.windowname_vchr";

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

                System.Data.IDataParameter[] paramArr = null;
                objHRPSvc.CreateDatabaseParameter(2, out paramArr);
                paramArr[0].Value = flage;
                paramArr[1].Value = p_TypeID.Trim();
                lngRes            = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref p_dtRes, paramArr);
                objHRPSvc.Dispose();
                if (lngRes > 0 && p_dtRes != null)
                {
                    int intRow = p_dtRes.Rows.Count;
                    if (intRow > 0)
                    {
                        p_objResArr = new clsOPMedStoreWin_VO[intRow];
                        for (int i = 0; i < intRow; i++)
                        {
                            p_objResArr[i] = new clsOPMedStoreWin_VO();
                            p_objResArr[i].m_strWindowID   = p_dtRes.Rows[i]["windowid_chr"].ToString().Trim();
                            p_objResArr[i].m_strWindowName = p_dtRes.Rows[i]["windowname_vchr"].ToString().Trim();
                            p_objResArr[i].m_intWindowType = Convert.ToInt32(p_dtRes.Rows[i]["windowtype_int"].ToString().Trim());
                            p_objResArr[i].m_intWorkStatus = Convert.ToInt32(p_dtRes.Rows[i]["workstatus_int"].ToString().Trim());
                        }
                    }
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
Exemple #8
0
        public long m_lngGetMedWinByID(System.Security.Principal.IPrincipal p_objPrincipal, string p_WinID, out clsMedSendConfig_VO[] p_objResArr)
        {
            long lngRes = 0;

            p_objResArr = new clsMedSendConfig_VO[0];
            DataTable p_dtRes = new DataTable();

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_lngGetMedWinByID");
            if (lngRes < 0)
            {
                return(-1);
            }
            string strSQL = @" select c.seq_int,c.treatwinid_chr,c.givewinid_chr,c.order_int,d.windowname_vchr  
 from T_OPR_MEDSTOREWINRLT c ,T_BSE_MEDSTOREWIN d
 where c.givewinid_chr=d.windowid_chr(+) and c.treatwinid_chr='" + p_WinID.Trim() + "' order by  c.order_int";

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref p_dtRes);
                objHRPSvc.Dispose();
                if (lngRes > 0 && p_dtRes != null)
                {
                    int intRow = p_dtRes.Rows.Count;
                    if (intRow > 0)
                    {
                        p_objResArr = new clsMedSendConfig_VO[intRow];
                        for (int i = 0; i < intRow; i++)
                        {
                            p_objResArr[i]                  = new clsMedSendConfig_VO();
                            p_objResArr[i].m_intSeq         = Convert.ToInt32(p_dtRes.Rows[i]["seq_int"].ToString().Trim());
                            p_objResArr[i].m_TreatWinID_chr = p_dtRes.Rows[i]["treatwinid_chr"].ToString().Trim();
                            p_objResArr[i].m_GiveWinID_chr  = p_dtRes.Rows[i]["givewinid_chr"].ToString().Trim();
                            p_objResArr[i].m_intOrder       = Convert.ToInt32(p_dtRes.Rows[i]["order_int"].ToString().Trim());
                            p_objResArr[i].m_strGiveWinName = p_dtRes.Rows[i]["windowname_vchr"].ToString().Trim();
                        }
                    }
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
Exemple #9
0
        public long m_lngAddMedSendGiveRelation(System.Security.Principal.IPrincipal p_objPrincipal, out int p_intSeq,
                                                clsMedSendConfig_VO p_objWinArr)
        {
            long lngRes = 0;

            p_intSeq = 0;          //流水号

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_lngAddMedSendGiveRelation");
            if (lngRes < 0)
            {
                return(-1);
            }
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                p_intSeq = Convert.ToInt32(objHRPSvc.m_strGetNewID("T_OPR_MEDSTOREWINRLT", "SEQ_INT", 6));

                string strSQL = @"INSERT INTO T_OPR_MEDSTOREWINRLT
										  (SEQ_INT, TREATWINID_CHR, GIVEWINID_CHR,
										   ORDER_INT
										  )
								  VALUES (?,?,?,?)"                                ;


                System.Data.IDataParameter[] paramArr = null;
                objHRPSvc.CreateDatabaseParameter(4, out paramArr);
                paramArr[0].Value = p_intSeq;
                paramArr[1].Value = p_objWinArr.m_TreatWinID_chr;
                paramArr[2].Value = p_objWinArr.m_GiveWinID_chr;
                paramArr[3].Value = p_objWinArr.m_intOrder;
                long lngRecordsAffected = -1;
                lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecordsAffected, paramArr);


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

            return(lngRes);
        }
Exemple #10
0
        public long m_thJudgeIsOldData(System.Security.Principal.IPrincipal p_objPrincipal, int p_Seq, int p_WinStyle, out int p_Status)
        {
            long lngRes = 0;

            p_Status = -2;
            DataTable dtable = new DataTable();
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_lngVerichDropRecord");
            if (lngRes < 0)
            {
                return(-1);
            }
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                string strSQL = "";
                if (p_WinStyle == 1)
                {
                    strSQL = @" select a.pstatus_int from t_opr_medRecipesend a,T_OPR_MEDSTOREWINQUE b
                            where b.seq_int=" + p_Seq + "and a.outpatrecipeid_chr=b.outpatrecipeid_chr and a.windowid_chr=b.windowid_chr";
                }
                else if (p_WinStyle == 0)
                {
                    strSQL = @" select a.pstatus_int from t_opr_medRecipesend a,T_OPR_MEDSTOREWINQUE b
                            where b.seq_int=" + p_Seq + "and a.outpatrecipeid_chr=b.outpatrecipeid_chr and a.sendemp_chr=b.windowid_chr";
                }
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtable);
                if (lngRes > 0 && dtable.Rows.Count > 0)
                {
                    p_Status = Convert.ToInt32(dtable.Rows[0][0].ToString());
                }

                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Exemple #11
0
        public long m_lngGetDeviceModelNameByDeviceID(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable dtbAllDeciveName)
        {
            long   lngRes = 0;
            string strSQL = @"SELECT t1.deviceid_chr, t2.device_model_desc_vchr
								FROM t_bse_lis_device t1, t_bse_lis_device_model t2
								WHERE t1.device_model_id_chr = t2.device_model_id_chr"                                ;

            dtbAllDeciveName = null;
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtbAllDeciveName);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                bool blnRes = objLogger.LogError(objEx);//要在LogError方法中抛出异常。
            }
            return(lngRes);
        }
Exemple #12
0
        public long m_lngInsertReportObject(System.Security.Principal.IPrincipal p_objPrincipal,
                                            clsReportObject p_objReportObject)
        {
            long lngRes = 0;

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

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

            string strSQL = @"delete t_opr_lis_report_object a where a.application_id_chr = ?";

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

            IDataParameter[] objDPArr = null;
            long             lngEff   = 0;

            objHRPSvc.CreateDatabaseParameter(1, out objDPArr);
            objDPArr[0].Value = p_objReportObject.strApplicationID;
            lngRes            = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngEff, objDPArr);
            if (lngRes <= 0)
            {
                return(lngRes);
            }
            strSQL = @"insert into t_opr_lis_report_object
								values (?, ?,?)"                                ;
            objHRPSvc.CreateDatabaseParameter(3, out objDPArr);
            objDPArr[0].Value = p_objReportObject.strApplicationID;
            objDPArr[1].Value = p_objReportObject.bytReportObjectArr;
            objDPArr[2].Value = 0;

            lngRes = 0;

            lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngEff, objDPArr);
            return(lngRes);
        }
Exemple #13
0
        /// <summary>
        /// 根据微孔板编号查询

        /// </summary>
        /// <param name="boardNo"></param>
        /// <param name="arrCheckResult"></param>
        /// <returns></returns>
        public long m_lngFind(string boardNo, out clsST360CheckResultVO[] arrCheckResult)
        {
            long lngRes = 0;

            arrCheckResult = null;

            string    sql       = @"
                              select * from t_opr_lis_st360_result where boardno_vchr=?
                          ";
            DataTable dtbResult = null;

            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService hrpService = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
            System.Data.IDataParameter[] objODPArr = clsPublicSvc.m_objConstructIDataParameterArr(boardNo);

            try
            {
                lngRes = hrpService.lngGetDataTableWithParameters(sql, ref dtbResult, objODPArr);
                if (dtbResult != null && dtbResult.Rows.Count > 0)
                {
                    arrCheckResult = new clsST360CheckResultVO[dtbResult.Rows.Count];
                    for (int i = 0; i < dtbResult.Rows.Count; i++)
                    {
                        clsST360CheckResultVO checkResult = new clsST360CheckResultVO();
                        ConstructVO(dtbResult.Rows[i], ref checkResult);
                        arrCheckResult[i] = checkResult;
                    }
                }
                else
                {
                    arrCheckResult = new clsST360CheckResultVO[0];
                }
            }
            catch (Exception ex)
            {
                new com.digitalwave.Utility.clsLogText().LogError(ex.Message);
            }

            return(lngRes);
        }
Exemple #14
0
        public long m_lngInsert(clsST360CheckResultVO m_objResult)
        {
            long lngRes = 0;

            string sql = @"
                            INSERT INTO t_opr_lis_st360_result
                                        (sampleid_int, sampletype_int, boardno_vchr, templateno_int,
                                         check_item_id_int, check_item_name_vchr,
                                         check_item_english_name_vchr, modify_dat, operator_dat,
                                         device_send_dat, resultnum_vchr, resulttext_vchr, status_int,
                                         deviceid_chr, operator_id_chr, summary_vchr,Positive_INT
                                        )
                                 VALUES (?, ?, ?, ?,
                                         ?, ?,
                                         ?, ?, ?,
                                         ?, ?, ?, ?,
                                         ?, ?, ?,?
                                        )
                          ";

            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService hrpService = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
            try
            {
                System.Data.IDataParameter[] objODPArr = GetInsertDataParameterArr(m_objResult);

                long lngRecEff = -1;
                //往表增加记录


                lngRes = 0;
                lngRes = hrpService.lngExecuteParameterSQL(sql, ref lngRecEff, objODPArr);
                hrpService.Dispose();
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
            }
            return(lngRes);
        }
Exemple #15
0
        public long m_lngGetWinQueueByMedStoreID(System.Security.Principal.IPrincipal p_objPrincipal, string p_strID, int flage, DateTime p_dtimeBegin, DateTime p_dtimeEnd, out DataTable p_DataTableQueue)
        {
            long lngRes = 0;

            p_DataTableQueue = new DataTable();
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_thDelMedSendGiveRelation");

            if (lngRes < 0)
            {
                return(-1);
            }

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                string strSQL;

                strSQL = @"SELECT distinct  g.seq_int, f.windowid_chr, f.windowname_vchr, g.lastname_vchr,
         g.sex_chr, g.order_int
    FROM 
      (  select  b.seq_int,b.windowid_chr,b.medstoreid_chr,b.order_int,t.lastname_vchr,t.sex_chr
      from t_opr_outpatientrecipeinv h, t_bse_patient t,t_opr_outpatientrecipe a,t_opr_medstorewinque b
      where  t.patientid_chr = a.patientid_chr and  h.outpatrecipeid_chr=b.outpatrecipeid_chr and b.outpatrecipeid_chr=a.outpatrecipeid_chr  and h.recorddate_dat between to_Date(?,'yyyy-MM-dd hh24:mi:ss') and to_Date(?,'yyyy-MM-dd hh24:mi:ss') ) g,(SELECT   e.windowid_chr, e.windowname_vchr,
                 CASE
                    WHEN e.windowname_vchr LIKE '一%'
                       THEN 1
                    WHEN e.windowname_vchr LIKE '二%'
                       THEN 2
                    WHEN e.windowname_vchr LIKE '三%'
                       THEN 3
                    WHEN e.windowname_vchr LIKE '四%'
                       THEN 4
                    WHEN e.windowname_vchr LIKE '五%'
                       THEN 5
                    WHEN e.windowname_vchr LIKE '六%'
                       THEN 6
                    WHEN e.windowname_vchr LIKE '七%'
                       THEN 7
                    WHEN e.windowname_vchr LIKE '八%'
                       THEN 8
                    WHEN e.windowname_vchr LIKE '九%'
                       THEN 9
                    WHEN e.windowname_vchr LIKE '十%'
                       THEN 10
                 END AS ord
            FROM  t_bse_medstorewin e 
           WHERE e.medstoreid_chr=? and e.windowtype_int=?) f  WHERE  g.windowid_chr(+) = f.windowid_chr ORDER BY f.ord, g.order_int";



                System.Data.IDataParameter[] paramArr = null;
                objHRPSvc.CreateDatabaseParameter(4, out paramArr);
                paramArr[0].Value = p_dtimeBegin.ToString("yyyy-MM-dd 00:00:00");
                paramArr[1].Value = p_dtimeEnd.ToString("yyyy-MM-dd 23:59:59");
                paramArr[2].Value = p_strID;
                paramArr[3].Value = flage;
                lngRes            = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref p_DataTableQueue, paramArr);

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

            return(lngRes);
        }
Exemple #16
0
        public long m_lngGetPrintData(string m_strSid_int, out ArrayList m_objList1, out ArrayList m_objList2, out ArrayList m_objListGroupName, out clsOutpatientPrintRecipe_VO obj_VO)
        {
            long lngRes = 0;

            m_objList1         = new ArrayList();
            m_objList2         = new ArrayList();
            m_objListGroupName = new ArrayList();
            obj_VO             = new clsOutpatientPrintRecipe_VO();
            string    strSQL    = @" select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.unitid_chr, b.usageid_chr, b.tolqty_dec,
         b.unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, b.days_int, b.qty_dec, b.discount_dec,
         b.freqid_chr, b.itemname_vchr, b.dosageunit_chr, b.itemspec_vchr,
         h.usagename_vchr, k.freqname_chr, b.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, b.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientpwmrecipede b,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_usagetype h,
         t_aid_recipefreq k,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and b.freqid_chr = k.freqid_chr
     and b.usageid_chr = f.usageid_chr
     and b.usageid_chr = h.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.unitid_chr, b.usageid_chr, 0 as tolqty_dec,
         b.unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         h.usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientcmrecipede b,
         t_bse_chargeitem d,
         t_opr_outpatientpwmrecipede n,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_usagetype h,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and b.usageid_chr = f.usageid_chr
     and b.usageid_chr = h.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientchkrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatienttestrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientopsrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientothrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.casehisid_chr = e.casehisid_chr
order by rowno_chr";
            DataTable dtbResult = new DataTable();

            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(6, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                objLisAddItemRefArr[1].Value = m_strSid_int;
                objLisAddItemRefArr[2].Value = m_strSid_int;
                objLisAddItemRefArr[3].Value = m_strSid_int;
                objLisAddItemRefArr[4].Value = m_strSid_int;
                objLisAddItemRefArr[5].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objLisAddItemRefArr);
                if (lngRes > 0 && dtbResult.Rows.Count > 0)
                {
                    DateTime dteBirth = Convert.ToDateTime("1900-1-1");
                    if (dtbResult.Rows[0]["BIRTH_DAT"] != System.DBNull.Value)
                    {
                        dteBirth = Convert.ToDateTime(dtbResult.Rows[0]["BIRTH_DAT"].ToString());
                    }

                    if (obj_VO == null)
                    {
                        obj_VO = new clsOutpatientPrintRecipe_VO();
                        obj_VO.objinjectArr = new ArrayList();
                        obj_VO.objPRDArr    = new ArrayList();
                        obj_VO.objPRDArr2   = new ArrayList();
                    }
                    //obj_VO.m_strAge = clsConvertDateTime.CalcAge(dteBirth);
                    obj_VO.m_strAge          = new clsBrithdayToAge().m_strGetAge(dteBirth);
                    obj_VO.m_strDiagDrName   = dtbResult.Rows[0]["DOCTORNAME_CHR"].ToString().Trim();
                    obj_VO.m_strHospitalName = "";
                    obj_VO.m_strPatientName  = dtbResult.Rows[0]["LASTNAME_VCHR"].ToString().Trim();
                    obj_VO.m_strPhotoNo      = dtbResult.Rows[0]["HOMEPHONE_VCHR"].ToString().Trim();
                    obj_VO.m_strCardID       = dtbResult.Rows[0]["PATIENTCARDID_CHR"].ToString().Trim();
                    obj_VO.m_strAddress      = "";
                    obj_VO.m_strRecipeType   = "";
                    obj_VO.m_strdiagnose     = dtbResult.Rows[0]["diag_vchr"].ToString().Trim();
                    obj_VO.m_strGOVCARD      = "";
                    obj_VO.m_strINSURANCEID  = "";
                    obj_VO.m_strRecordEmpID  = "";//员工ID
                    obj_VO.m_strRegisterID   = "";
                    if (dtbResult.Rows[0]["RECORDDATE_DAT"] != System.DBNull.Value)
                    {
                        obj_VO.m_strPrintDate = DateTime.Parse(dtbResult.Rows[0]["RECORDDATE_DAT"].ToString()).ToString("yyyy-MM-dd");
                    }
                    else
                    {
                        obj_VO.m_strPrintDate = DateTime.Now.ToString("yyyy-MM-dd");
                    }
                    obj_VO.m_strSex                 = dtbResult.Rows[0]["SEX_CHR"].ToString().Trim();
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strChargeUp            = "";
                    obj_VO.m_strRecipePrice         = "";
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strHerbalmedicineUsage = "";
                    obj_VO.m_strTimes               = "";
                    obj_VO.m_strSerNO               = dtbResult.Rows[0]["SERNO_CHR"].ToString().Trim();
                    obj_VO.objinjectArr2            = new ArrayList();
                    int temRow = 0;
                    for (int i = 0; i < dtbResult.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName  = dtbResult.Rows[i]["ITEMNAME_VCHR"].ToString().Trim();
                        objtemp.m_strCount       = dtbResult.Rows[i]["TOLQTY_DEC"].ToString().Trim() + dtbResult.Rows[i]["UNITID_CHR"].ToString().Trim();
                        objtemp.m_strPrice       = dtbResult.Rows[i]["UNITPRICE_MNY"].ToString().Trim();
                        objtemp.m_strSumPrice    = dtbResult.Rows[i]["TOLPRICE_MNY"].ToString().Trim();
                        objtemp.m_strUnit        = dtbResult.Rows[i]["UNITID_CHR"].ToString().Trim();
                        objtemp.m_strFrequency   = dtbResult.Rows[i]["FREQNAME_CHR"].ToString().Trim();
                        objtemp.m_strDosage      = dtbResult.Rows[i]["QTY_DEC"].ToString().Trim() + dtbResult.Rows[i]["dosageunit_chr"].ToString().Trim();
                        objtemp.m_strDays        = dtbResult.Rows[i]["DAYS_INT"].ToString().Trim();
                        objtemp.m_strSpec        = dtbResult.Rows[i]["ITEMSPEC_VCHR"].ToString().Trim();
                        objtemp.m_strUsage       = dtbResult.Rows[i]["USAGENAME_VCHR"].ToString().Trim();
                        objtemp.m_strRowNo       = dtbResult.Rows[i]["ROWNO_CHR"].ToString().Trim();
                        objtemp.m_strUsageDetail = dtbResult.Rows[i]["DESC_VCHR"].ToString().Trim();
                        if (objtemp.m_strRowNo == "" || objtemp.m_strRowNo == "0")
                        {
                            objtemp.m_strRowNo = "0" + temRow.ToString();
                            temRow++;
                        }
                        obj_VO.objinjectArr2.Add(objtemp);
                    }
                }
                else
                {
                    obj_VO.m_strAge          = "";
                    obj_VO.m_strDiagDrName   = "";
                    obj_VO.m_strHospitalName = "";
                    obj_VO.m_strPatientName  = "";
                    // obj_VO.m_strRecipeID = strRecipedeID;
                    obj_VO.m_strAddress             = "";
                    obj_VO.m_strRecipeType          = "";
                    obj_VO.m_strdiagnose            = "";
                    obj_VO.m_strGOVCARD             = "";
                    obj_VO.m_strINSURANCEID         = "";
                    obj_VO.m_strRecordEmpID         = "";//员工ID
                    obj_VO.m_strRegisterID          = "";
                    obj_VO.m_strPrintDate           = "";
                    obj_VO.m_strSex                 = "";
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strChargeUp            = "";
                    obj_VO.m_strRecipePrice         = "";
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strHerbalmedicineUsage = "";
                    obj_VO.m_strTimes               = "";
                    obj_VO.objinjectArr2            = new ArrayList();
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            DataTable ArrdtRow = new DataTable();

            ArrdtRow.Columns.Add("rowno_chr");
            ArrdtRow.Columns.Add("USAGEID_CHR");
            DataRow[] objRowsList = dtbResult.Select("rowno_chr>0 and USAGEID_CHR is not null", "rowno_chr");
            if (objRowsList.Length > 0)
            {
                for (int j = 0; j < objRowsList.Length; j++)
                {
                    if (j == 0)
                    {
                        DataRow newRow = ArrdtRow.NewRow();
                        newRow["rowno_chr"]   = objRowsList[j]["rowno_chr"].ToString();
                        newRow["USAGEID_CHR"] = objRowsList[j]["USAGEID_CHR"].ToString();
                        ArrdtRow.Rows.Add(newRow);
                    }
                    else
                    {
                        for (int r = 0; r < ArrdtRow.Rows.Count; r++)
                        {
                            if (objRowsList[j]["rowno_chr"].ToString() == ArrdtRow.Rows[r]["rowno_chr"].ToString())
                            {
                                break;
                            }
                            if (r == ArrdtRow.Rows.Count - 1)
                            {
                                DataRow newRow = ArrdtRow.NewRow();
                                newRow["rowno_chr"]   = objRowsList[j]["rowno_chr"].ToString();
                                newRow["USAGEID_CHR"] = objRowsList[j]["USAGEID_CHR"].ToString();
                                ArrdtRow.Rows.Add(newRow);
                            }
                        }
                    }
                }
            }
            DataTable dtItemArr = new DataTable();

            dtItemArr.Columns.Add("itemname_vchr");
            dtItemArr.Columns.Add("rowno_chr");
            dtItemArr.Columns.Add("itemid_chr");
            dtItemArr.Columns.Add("USAGEID_CHR");
            if (dtbResult.Rows.Count > 0)
            {
                for (int m = 0; m < dtbResult.Rows.Count; m++)
                {
                    if (m == 0)
                    {
                        DataRow newRow = dtItemArr.NewRow();
                        newRow["itemname_vchr"] = dtbResult.Rows[m]["itemname_vchr"].ToString();
                        newRow["rowno_chr"]     = dtbResult.Rows[m]["rowno_chr"];
                        newRow["itemid_chr"]    = dtbResult.Rows[m]["itemid_chr"].ToString();
                        newRow["USAGEID_CHR"]   = dtbResult.Rows[m]["USAGEID_CHR"].ToString();
                        dtItemArr.Rows.Add(newRow);
                    }
                    else
                    {
                        for (int n = 0; n < dtItemArr.Rows.Count; n++)
                        {
                            if (dtItemArr.Rows[n]["itemid_chr"].ToString().Trim() == dtbResult.Rows[m]["itemid_chr"].ToString().Trim() && dtItemArr.Rows[n]["rowno_chr"].ToString().Trim() == dtbResult.Rows[m]["rowno_chr"].ToString().Trim())
                            {
                                break;
                            }
                            if (n == dtItemArr.Rows.Count - 1)
                            {
                                DataRow newRow = dtItemArr.NewRow();
                                newRow["itemname_vchr"] = dtbResult.Rows[m]["itemname_vchr"].ToString();
                                newRow["rowno_chr"]     = dtbResult.Rows[m]["rowno_chr"];
                                newRow["itemid_chr"]    = dtbResult.Rows[m]["itemid_chr"].ToString();
                                newRow["USAGEID_CHR"]   = dtbResult.Rows[m]["USAGEID_CHR"].ToString();
                                dtItemArr.Rows.Add(newRow);
                            }
                        }
                    }
                }
            }
            strSQL = @"SELECT   a.itemid_chr, a.operatorid_chr, a.exectime_dat, a.operatortype_int,
         b.lastname_vchr
    FROM t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_nurseexecute a,
         t_bse_employee b,
         (SELECT MAX (itemid_chr) itemid_chr
            FROM t_opr_nurseexecute p,t_opr_recipesend m,t_opr_recipesendentry n 
           WHERE m.sid_int=n.sid_int and p.outpatrecipeid_chr=n.outpatrecipeid_chr and m.sid_int=?
             AND (operatortype_int = 1 OR operatortype_int = 2)
             AND status_int = 1) c
   WHERE m1.sid_int=n1.sid_int
     and n1.outpatrecipeid_chr=a.outpatrecipeid_chr
     and m1.sid_int=?
     AND (a.operatortype_int = 1 OR a.operatortype_int = 2)
     AND a.status_int = 1
     AND a.operatorid_chr = b.empid_chr
     AND a.itemid_chr = c.itemid_chr
ORDER BY a.seq_int DESC";
            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(2, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                objLisAddItemRefArr[1].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objLisAddItemRefArr);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            ArrayList list1  = new ArrayList();
            ArrayList objArr = new ArrayList();

            if (lngRes == 1)
            {
                ArrayList arr1 = new ArrayList();
                arr1.Add("配药人");
                ArrayList arr2 = new ArrayList();
                arr2.Add("时间");
                ArrayList arr3 = new ArrayList();
                arr3.Add("复核人");
                ArrayList arr4 = new ArrayList();
                arr4.Add("时间");
                if (dtbResult.Rows.Count > 0)
                {
                    int tolMunber1 = 0;
                    int tolMunber2 = 0;
                    for (int i1 = 0; i1 < dtbResult.Rows.Count; i1++)
                    {
                        if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "1" && tolMunber1 < 7)
                        {
                            arr1.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                            arr2.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                            tolMunber1++;
                        }
                        else if (tolMunber2 < 7)
                        {
                            arr3.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                            arr4.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                            tolMunber2++;
                        }
                    }
                }
                list1.Add(arr1);
                list1.Add(arr2);
                list1.Add(arr3);
                list1.Add(arr4);
            }
            strSQL = @"SELECT   a.itemid_chr, d.itemname_vchr, a.rowno_chr, a.operatorid_chr,
         a.exectime_dat, a.operatortype_int, b.lastname_vchr, a.remark1_vchr
    FROM t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_nurseexecute a,
         t_bse_employee b,
         t_bse_chargeitem d,
         (SELECT   MAX (a.itemid_chr) itemid_chr
              FROM t_opr_nurseexecute a,
                   t_opr_recipesend m,
                   t_opr_recipesendentry n
             WHERE m.sid_int = n.sid_int
               AND a.outpatrecipeid_chr = n.outpatrecipeid_chr
               AND m.sid_int = ?
               AND (   a.operatortype_int = 10
                    OR a.operatortype_int = 3
                    OR a.operatortype_int = 4
                   )
               AND a.status_int = 1
          GROUP BY rowno_chr) c
   WHERE m1.sid_int = n1.sid_int
     AND n1.outpatrecipeid_chr = a.outpatrecipeid_chr
     AND m1.sid_int = ?
     AND (   a.operatortype_int = 10
          OR a.operatortype_int = 3
          OR a.operatortype_int = 4
         )
     AND a.status_int = 1
     AND a.rowno_chr > 0
     AND a.operatorid_chr = b.empid_chr
     AND a.itemid_chr = c.itemid_chr
     AND a.itemid_chr = d.itemid_chr(+)
ORDER BY a.seq_int DESC ";
            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(2, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                objLisAddItemRefArr[1].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objLisAddItemRefArr);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            strSQL = @"SELECT   a.itemid_chr, d.itemname_vchr, a.rowno_chr, a.operatorid_chr,
         a.exectime_dat, a.operatortype_int, b.lastname_vchr, a.remark1_vchr
    FROM t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_nurseexecute a,
         t_bse_employee b,
         t_bse_chargeitem d
   WHERE m1.sid_int = n1.sid_int
     AND n1.outpatrecipeid_chr = a.outpatrecipeid_chr
     AND m1.sid_int = ?
     AND (   a.operatortype_int = 10
          OR a.operatortype_int = 3
          OR a.operatortype_int = 4
         )
     AND a.status_int = 1
     AND a.rowno_chr <= 0
     AND a.operatorid_chr = b.empid_chr
     AND a.itemid_chr = d.itemid_chr(+)
ORDER BY a.seq_int DESC ";
            DataTable dtbResult2 = new DataTable();

            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(1, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult2, objLisAddItemRefArr);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            DataTable dtUsage = new DataTable();//保存需要打印输液巡视单的用法数据

            strSQL = @"select USAGEID_CHR from t_opr_setusage where ORDERID_VCHR='1'";
            try
            {
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtUsage);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            ArrayList arrGroud = new ArrayList();

            if (ArrdtRow.Rows.Count > 0)
            {
                for (int f2 = 0; f2 < ArrdtRow.Rows.Count; f2++)
                {
                    DataRow[] objRows  = dtItemArr.Select("ROWNO_CHR =" + ArrdtRow.Rows[f2]["ROWNO_CHR"].ToString().Trim());
                    int       kk       = f2 + 1;
                    string    strGroud = "第" + kk.ToString() + "组:";
                    int       currInt  = 0;//标志当前组中是否存在需要打印的明细-1.有

                    int currint1 = 0;
                    for (int k1 = 0; k1 < objRows.Length; k1++)
                    {
                        DataRow[] tempArr = dtUsage.Select("USAGEID_CHR=" + objRows[k1]["usageid_chr"].ToString());
                        if (tempArr.Length == 0)
                        {
                            continue;
                        }
                        if (currint1 == 0)
                        {
                            currInt   = -1;
                            strGroud += objRows[k1]["ITEMNAME_VCHR"].ToString();
                            currint1++;
                        }
                        else
                        {
                            strGroud = strGroud + "、" + objRows[k1]["ITEMNAME_VCHR"].ToString();
                        }
                    }
                    if (currInt == -1)
                    {
                        ArrayList arr1 = new ArrayList();
                        arr1.Add("配药护士");
                        ArrayList arr2 = new ArrayList();
                        arr2.Add("时间");
                        ArrayList arr3 = new ArrayList();
                        arr3.Add("执行人");
                        ArrayList arr4 = new ArrayList();
                        arr4.Add("输液时间");
                        ArrayList arr5 = new ArrayList();
                        arr5.Add("滴速(分)");
                        ArrayList arr6 = new ArrayList();
                        arr6.Add("巡视时间");
                        ArrayList arr7 = new ArrayList();
                        arr7.Add("滴速(分)");
                        ArrayList arr8 = new ArrayList();
                        arr8.Add("签名");
                        int       tolMunber1 = 0;
                        int       tolMunber2 = 0;
                        int       tolMunber3 = 0;
                        ArrayList objList    = new ArrayList();
                        if (dtbResult.Rows.Count > 0)
                        {
                            for (int i1 = 0; i1 < dtbResult.Rows.Count; i1++)
                            {
                                if (ArrdtRow.Rows[f2]["ROWNO_CHR"].ToString() == dtbResult.Rows[i1]["ROWNO_CHR"].ToString())
                                {
                                    if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "3" && tolMunber1 < 7)
                                    {
                                        arr3.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                                        arr4.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                        arr5.Add(dtbResult.Rows[i1]["REMARK1_VCHR"].ToString());
                                        tolMunber1++;
                                    }
                                    if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "10" && tolMunber2 < 7)
                                    {
                                        arr1.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                                        arr2.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                        tolMunber2++;
                                    }
                                    if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "4" && tolMunber3 < 7)
                                    {
                                        arr8.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                                        arr6.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                        arr7.Add(dtbResult.Rows[i1]["REMARK1_VCHR"].ToString());
                                        tolMunber3++;
                                    }
                                }
                            }
                        }
                        objList.Add(arr1);
                        objList.Add(arr2);
                        objList.Add(arr3);
                        objList.Add(arr4);
                        objList.Add(arr5);
                        objList.Add(arr6);
                        objList.Add(arr7);
                        objList.Add(arr8);
                        objArr.Add(objList);
                        arrGroud.Add(strGroud);
                    }
                }
            }

            if (dtItemArr.Rows.Count > 0)
            {
                for (int h = 0; h < dtItemArr.Rows.Count; h++)
                {
                    try
                    {
                        if (int.Parse(dtItemArr.Rows[h]["ROWNO_CHR"].ToString()) > 0)
                        {
                            dtItemArr.Rows[h].Delete();
                            h--;
                        }
                    }
                    catch
                    {
                    }
                }
                dtItemArr.AcceptChanges();
            }
            if (dtItemArr.Rows.Count > 0)
            {
                for (int f2 = 0; f2 < dtItemArr.Rows.Count; f2++)
                {
                    DataRow[] tempArr = dtUsage.Select("USAGEID_CHR=" + dtItemArr.Rows[f2]["usageid_chr"].ToString());
                    if (tempArr.Length == 0)
                    {
                        continue;
                    }
                    arrGroud.Add(dtItemArr.Rows[f2]["ITEMNAME_VCHR"].ToString());
                    ArrayList tempList = new ArrayList();
                    ArrayList arr1     = new ArrayList();
                    arr1.Add("配药护士");
                    ArrayList arr2 = new ArrayList();
                    arr2.Add("时间");
                    ArrayList arr3 = new ArrayList();
                    arr3.Add("执行人");
                    ArrayList arr4 = new ArrayList();
                    arr4.Add("输液时间");
                    ArrayList arr5 = new ArrayList();
                    arr5.Add("滴速(分)");
                    ArrayList arr6 = new ArrayList();
                    arr6.Add("巡视时间");
                    ArrayList arr7 = new ArrayList();
                    arr7.Add("滴速(分)");
                    ArrayList arr8 = new ArrayList();
                    arr8.Add("签名");
                    int       tolMunber1 = 0;
                    int       tolMunber2 = 0;
                    int       tolMunber3 = 0;
                    ArrayList objList    = new ArrayList();
                    for (int i1 = 0; i1 < dtbResult2.Rows.Count; i1++)
                    {
                        if (dtItemArr.Rows[f2]["ITEMNAME_VCHR"].ToString().Trim() == dtbResult2.Rows[i1]["ITEMNAME_VCHR"].ToString().Trim())
                        {
                            if (dtbResult2.Rows[i1]["OPERATORTYPE_INT"].ToString() == "3" && tolMunber1 < 7)
                            {
                                arr3.Add(dtbResult2.Rows[i1]["LASTNAME_VCHR"].ToString());
                                arr4.Add(DateTime.Parse(dtbResult2.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                arr5.Add(dtbResult.Rows[i1]["REMARK1_VCHR"].ToString());
                                tolMunber1++;
                            }
                            if (dtbResult2.Rows[i1]["OPERATORTYPE_INT"].ToString() == "10" && tolMunber2 < 7)
                            {
                                arr1.Add(dtbResult2.Rows[i1]["LASTNAME_VCHR"].ToString());
                                arr2.Add(DateTime.Parse(dtbResult2.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                tolMunber2++;
                            }
                            if (dtbResult2.Rows[i1]["OPERATORTYPE_INT"].ToString() == "4" && tolMunber3 < 7)
                            {
                                arr8.Add(dtbResult2.Rows[i1]["LASTNAME_VCHR"].ToString());
                                arr6.Add(DateTime.Parse(dtbResult2.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                arr7.Add(dtbResult2.Rows[i1]["REMARK1_VCHR"].ToString());
                                tolMunber3++;
                            }
                        }
                    }
                    objList.Add(arr1);
                    objList.Add(arr2);
                    objList.Add(arr3);
                    objList.Add(arr4);

                    objList.Add(arr5);
                    objList.Add(arr6);
                    objList.Add(arr7);
                    objList.Add(arr8);
                    objArr.Add(objList);
                }
            }
            m_objList1         = list1;
            m_objList2         = objArr;
            m_objListGroupName = arrGroud;
            return(lngRes);
        }
Exemple #17
0
        public long m_lngHorDropRecord(System.Security.Principal.IPrincipal p_objPrincipal, int p_Seq, string p_WinID, int p_WinType, int p_Order)
        {
            long lngRes = 0;

            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsMedStoreBseInfoSvc", "m_lngHorDropRecord");

            if (lngRes < 0)
            {
                return(-1);
            }

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
                string strSQL = @"  update T_OPR_MEDSTOREWINQUE a set  a.ORDER_INT=?,a.WINDOWID_CHR=?  where a.SEQ_INT=?";


                System.Data.IDataParameter[] paramArr = null;
                objHRPSvc.CreateDatabaseParameter(3, out paramArr);
                paramArr[0].Value = p_Order;
                paramArr[1].Value = p_WinID;
                paramArr[2].Value = p_Seq;
                long lngRecordsAffected = -1;
                lngRes = objHRPSvc.lngExecuteParameterSQL(strSQL, ref lngRecordsAffected, paramArr);
                string p_strSQL = "";
                if (p_WinType == 0)
                {
                    p_strSQL = @"  update t_opr_medrecipesend b set  b.SENDWINDOWID=? where b.OUTPATRECIPEID_CHR in (select a.OUTPATRECIPEID_CHR from T_OPR_MEDSTOREWINQUE a where a.SEQ_INT=? )";
                    paramArr = null;
                    objHRPSvc.CreateDatabaseParameter(2, out paramArr);
                    paramArr[0].Value  = p_WinID;
                    paramArr[1].Value  = p_Seq;
                    lngRecordsAffected = -1;
                    lngRes             = objHRPSvc.lngExecuteParameterSQL(p_strSQL, ref lngRecordsAffected, paramArr);
                }
                else if (p_WinType == 1)
                {
                    paramArr = null;
                    objHRPSvc.CreateDatabaseParameter(2, out paramArr);
                    paramArr[0].Value  = p_WinID;
                    paramArr[1].Value  = p_Seq;
                    lngRecordsAffected = -1;
                    p_strSQL           = @"  update t_opr_medrecipesend b set  b.WINDOWID_CHR=? where b.OUTPATRECIPEID_CHR=(select a.outpatrecipeid_chr from T_OPR_MEDSTOREWINQUE a where a.seq_int=?)";
                    lngRes             = objHRPSvc.lngExecuteParameterSQL(p_strSQL, ref lngRecordsAffected, paramArr);
                    p_strSQL           = @"  update t_opr_outpatientpwmrecipede b set  b.WINDOWID_CHR=? where b.OUTPATRECIPEID_CHR=(select a.outpatrecipeid_chr from T_OPR_MEDSTOREWINQUE a where a.seq_int=?)";
                    lngRes             = objHRPSvc.lngExecuteParameterSQL(p_strSQL, ref lngRecordsAffected, paramArr);
                    p_strSQL           = @"  update T_OPR_OUTPATIENTCMRECIPEDE b set  b.WINDOWID_CHR=? where b.OUTPATRECIPEID_CHR=(select a.outpatrecipeid_chr from T_OPR_MEDSTOREWINQUE a where a.seq_int=?)";
                    lngRes             = objHRPSvc.lngExecuteParameterSQL(p_strSQL, ref lngRecordsAffected, paramArr);

                    p_strSQL = @"  update T_OPR_OUTPATIENTCHKRECIPEDE b set  b.WINDOWID_CHR=? where b.OUTPATRECIPEID_CHR=(select a.outpatrecipeid_chr from T_OPR_MEDSTOREWINQUE a where a.seq_int=?)";
                    lngRes   = objHRPSvc.lngExecuteParameterSQL(p_strSQL, ref lngRecordsAffected, paramArr);

                    p_strSQL = @"  update T_OPR_OUTPATIENTTESTRECIPEDE b set  b.WINDOWID_CHR=? where b.OUTPATRECIPEID_CHR=(select a.outpatrecipeid_chr from T_OPR_MEDSTOREWINQUE a where a.seq_int=?)";
                    lngRes   = objHRPSvc.lngExecuteParameterSQL(p_strSQL, ref lngRecordsAffected, paramArr);

                    p_strSQL = @"  update T_OPR_OUTPATIENTOPSRECIPEDE b set  b.WINDOWID_CHR=? where b.OUTPATRECIPEID_CHR=(select a.outpatrecipeid_chr from T_OPR_MEDSTOREWINQUE a where a.seq_int=?)";
                    lngRes   = objHRPSvc.lngExecuteParameterSQL(p_strSQL, ref lngRecordsAffected, paramArr);
                }

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