Пример #1
0
        public object Execute(object param)
        {
            string sql = "";

            try
            {
                using (RisDAL dal = new RisDAL())
                {
                    sql = "select tRole2User.rolename, tUser.userGuid, LoginName, localName, englishname,"
                          + " isnull(tRoleProfile.value, 0) as [level], tUser.IKEYSN, u1.Value as WriteReportModalityType, u2.Value as ApproveReportModalityType"
                          + " from tUser left join tRole2User"
                          + "		 left join tRoleProfile on tRoleProfile.rolename=tRole2User.rolename and tRoleProfile.name='RoleLevel'"
                          + "   on tUser.UserGuid = tRole2User.UserGuid"
                          + "		 left join tUserProfile u1 on u1.UserGuid=tUser.UserGuid and u1.name='WriteReportModalityType'"
                          + "		 left join tUserProfile u2 on u2.UserGuid=tUser.UserGuid and u2.name='ApproveReportModalityType'"
                          + " order by tRole2User.rolename, loginName";

                    DataSet ds = new DataSet();

                    dal.ExecuteQuery(sql, ds, "UserList");

                    return(ds);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetUserListDAO_MSSQL, MSG=" + ex.Message + ", SQL=" + sql, "", 0);
            }

            return(null);
        }
Пример #2
0
        public object Execute(object param)
        {
            try
            {
                using (RisDAL dal = new RisDAL())
                {
                    string sql = "select rolename, tUser.userGuid, LoginName, localName, englishname "
                                 + " from tUser, tRole2User where tUser.UserGuid = tRole2User.UserGuid"
                                 + " order by rolename, loginName";

                    DataSet ds = new DataSet();

                    dal.ExecuteQuery(sql, ds, "UserList");

                    return(ds);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetUserListDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
Пример #3
0
        private string OnDeliverReport(tagReportInfo rptInfo)
        {
            string sql = "";
            // Need to send gateway
            if (!ServerPubFun.GetSystemProfile_Bool("SendToGateServer", ReportCommon.ModuleID.Integration))
                return sql;
            try
            {
                // Gateway
                string guid = Guid.NewGuid().ToString();
                int event_type = 34;
                string exam_status = "";

                sql = "insert GW_DataIndex(data_id, data_dt, event_type, RECORD_INDEX_1, Data_Source)"
                + " values('" + guid + "', getdate(), '" + event_type.ToString() + "', 'ReportGuid', 'Local')"
                + " insert GW_Patient(DATA_ID,DATA_DT,PATIENTID,OTHER_PID,PATIENT_NAME,PATIENT_LOCAL_NAME,"
                + "BIRTHDATE,SEX,PATIENT_ALIAS,ADDRESS,PHONENUMBER_HOME,MARITAL_STATUS,PATIENT_TYPE,"
                + "PATIENT_LOCATION,VISIT_NUMBER,BED_NUMBER,CUSTOMER_1,CUSTOMER_2,CUSTOMER_3,CUSTOMER_4)"
                + "    values('" + guid + "', getdate(), '" + rptInfo.patientID + "','" + rptInfo.remotePID + "','"
                + rptInfo.patientName + "',N'" + rptInfo.patientLocalName + "','" + rptInfo.birthday.ToString("yyyy-MM-dd") + "','"
                + rptInfo.gender + "', '" + rptInfo.patientAlias + "', '" + rptInfo.patientAddress + "', '"
                + rptInfo.patientPhone + "', '" + rptInfo.patientMarriage + "','" + rptInfo.patientType + "','"
                + rptInfo.inHospitalRegion + "', '" + rptInfo.visitNo + "', '" + rptInfo.bedNo + "', '" + rptInfo.patientName + "', '"
                + rptInfo.isVIP + "', '" + rptInfo.inHospitalNo + "', '" + rptInfo.patientComment + "') "
                + " insert GW_Order(DATA_ID,DATA_DT,ORDER_NO,PLACER_NO,FILLER_NO,PATIENT_ID,EXAM_STATUS,"
                + "PLACER_DEPARTMENT, PLACER, FILLER_DEPARTMENT, FILLER, REF_PHYSICIAN, REQUEST_REASON, "
                + "REUQEST_COMMENTS, EXAM_REQUIREMENT, SCHEDULED_DT, MODALITY, STATION_NAME, EXAM_LOCATION, "
                + "EXAM_DT, DURATION, TECHNICIAN, BODY_PART, PROCEDURE_CODE, PROCEDURE_DESC, EXAM_COMMENT, "
                + "CHARGE_STATUS, CHARGE_AMOUNT,CUSTOMER_1,CUSTOMER_2,CUSTOMER_3) "
                + "    values('" + guid + "', getdate(), '" + rptInfo.orderGuid + "','" + rptInfo.remoteAccNo + "', '"
                + rptInfo.AccNO + "', '" + rptInfo.patientID + "', '" + exam_status.ToString() + "', '" + rptInfo.dept + "', '" + rptInfo.applyDoctor + "','"
                + rptInfo.dept + "', '" + rptInfo.applyDoctor + "', '" + rptInfo.applyDoctor + "', '" + rptInfo.observation + "', '"
                + rptInfo.visitComments + "', '" + rptInfo.orderComments + "', '" + rptInfo.registerDt.ToString("yyyy-MM-dd HH:mm:ss") + "', '"
                + rptInfo.modalityType + "', '" + rptInfo.modality + "', '', '" + rptInfo.examineDt.ToString("yyyy-MM-dd HH:mm:ss") + "', '"
                + rptInfo.duration + "', '" + rptInfo.technician__LocalName + "', '" + rptInfo.bodypart + "', '" + rptInfo.procedureCode + "', '"
                + rptInfo.procedureDesc + "', '" + rptInfo.orderComments + "', '" + (rptInfo.isCharge == "1" ? "Y" : "N") + "', '"
                + rptInfo.charge + "','" + rptInfo.cardno + "','" + rptInfo.hisid + "','" + rptInfo.MedicareNo + "') ";

                /*
                + " insert GW_Report(data_id, data_dt, report_no, ACCESSION_NUMBER, PATIENT_ID, REPORT_STATUS, MODALITY, "
                + " REPORT_TYPE, REPORT_FILE, REPORT_WRITER, REPORT_APPROVER, REPORTDT, OBSERVATIONMETHOD,DIAGNOSE,COMMENTS,CUSTOMER_4)"
                + " values('" + guid + "', getdate(), '" + rptInfo.reportGuid + "', '" + rptInfo.AccNO + "',"
                + " '" + rptInfo.patientID + "', '" + report_status.ToString() + "', '" + rptInfo.modalityType + "', '0', '', '" + rptInfo.reportCreater_LocalName + "',"
                + " '" + rptInfo.reportApprover_LocalName + "', '" + rptInfo.reportCreateDt.ToString("yyyy-MM-dd HH:mm:ss") + "',"
                + " '" + rptInfo.operationStep + "','" + rptInfo.wysText + "','" + rptInfo.wygText + "','" + rptInfo.techinfo + "')";
                  */


            }
            catch (Exception ex)
            {

                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "Deliver report send to gateway MSG=" + ex.Message,
                    (new System.Diagnostics.StackFrame()).GetFileName(),
                    (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }
            return sql;
        }
Пример #4
0
        public object Execute(object param)
        {
            bool isModified = false;

            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;
                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in UpdateReportIsModifiedDAO!"));
                }


                string reportGuid = paramMap["reportguid"] as string;
                using (RisDAL dal = new RisDAL())
                {
                    DataSet ds = new DataSet();

                    string strLatestSumittedSQL = string.Format("select top 1 reporttext from treportlist where reportguid='{0}' and status = 110 order by operationtime desc", reportGuid);
                    string strLatestApprovedSQL = string.Format("select top 1 reporttext from treportlist where reportguid='{0}' and status = 120 order by operationtime desc", reportGuid);
                    string strUpdateIsModified  = "update treport set ismodified = {0} where reportguid ='{1}'";
                    object lastSumittedRptText  = Convert.ToString(dal.ExecuteScalar(strLatestSumittedSQL));
                    if (string.IsNullOrEmpty(Convert.ToString(lastSumittedRptText)))    //no submitted record
                    {
                        dal.ExecuteNonQuery(string.Format(strUpdateIsModified, 0, reportGuid));
                        return(isModified);
                    }
                    else
                    {
                        object lastApprovedRptText = Convert.ToString(dal.ExecuteScalar(strLatestApprovedSQL));
                        if (string.IsNullOrEmpty(Convert.ToString(lastApprovedRptText)))    //no approved record
                        {
                            dal.ExecuteNonQuery(string.Format(strUpdateIsModified, 0, reportGuid));
                            return(isModified);
                        }
                        else if (lastSumittedRptText.ToString().Equals(lastApprovedRptText.ToString(), StringComparison.OrdinalIgnoreCase))
                        {
                            dal.ExecuteNonQuery(string.Format(strUpdateIsModified, 0, reportGuid));
                            return(isModified);
                        }
                        else
                        {
                            dal.ExecuteNonQuery(string.Format(strUpdateIsModified, 1, reportGuid));
                            return(isModified = true);   //sumbmited reporttext differ with approved one
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "UpdateReportIsModifiedDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                return(isModified);
            }
        }
Пример #5
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> inMap = param as Dictionary <string, object>;

                if (inMap == null || inMap.Count < 1)
                {
                    throw (new Exception("No parameter in DeleteReportDAO!"));
                }

                string orderGuid = "", assignSite = "";

                foreach (string key in inMap.Keys)
                {
                    if (key.ToUpper() == "ORDERGUID")
                    {
                        orderGuid = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "ASSIGNSITE")
                    {
                        assignSite = inMap[key] as string;
                    }
                }

                if (orderGuid == null || orderGuid.Length < 1 ||
                    assignSite == null || assignSite.Length < 1)
                {
                    System.Diagnostics.Debug.Assert(false, "Missing Parameter");
                    throw (new Exception("Miss Parameter in DeleteReportDAO!"));
                }
                string sql = string.Format("update tRegOrder set Assign2Siet ={0} where orderGuid={1}",
                                           orderGuid, assignSite);


                ServerPubFun.RISLog_Info(0, "AssingReportDAO_MSSQL, SQL=" + sql,
                                         (new System.Diagnostics.StackFrame()).GetFileName(),
                                         (new System.Diagnostics.StackFrame()).GetFileLineNumber());

                using (RisDAL dal = new RisDAL())
                {
                    dal.ExecuteNonQuery(sql);
                }

                return(1);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "AssingReportDAO_MSSQL=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return("-1");
        }
Пример #6
0
        public string GetAllReportColumn()
        {
            try
            {
                string sql = "select table_name as tblname, column_name as colname,"
                             + " data_type as coltype, data_length as collength"
                             + " from user_tab_cols"
                             + " where table_name in ('TREGPATIENT','TREGORDER', 'TREGPROCEDURE', 'TPROCEDURECODE', 'TREPORT')"
                             + " and column_name not like 'SYS_NC%$' ";

                DataSet ds = new DataSet();

                using (RisDAL dal = new RisDAL())
                {
                    dal.ExecuteQuery(sql, ds, "ReportColumn");

                    if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        string rptCol = "";
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            string alias = ds.Tables[0].Rows[i]["TBLNAME"].ToString() + ReportCommon.ReportCommon.FIELD_SEPERATOR + ds.Tables[0].Rows[i]["COLNAME"].ToString();
                            if (alias.Length > 30)
                            {
                                alias = alias.Substring(0, 30);
                            }

                            rptCol += ds.Tables[0].Rows[i]["TBLNAME"].ToString() + "." + ds.Tables[0].Rows[i]["COLNAME"].ToString() + " as "
                                      + alias + ", ";
                        }

                        rptCol = rptCol.Trim(", ".ToCharArray());

                        if (dal != null)
                        {
                            dal.Dispose();
                        }

                        return(rptCol);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetReportInfoDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return("*");
        }
Пример #7
0
        /// <summary>
        /// Get the user-defined grid column
        /// </summary>
        /// <param name="gridName"></param>
        /// <param name="userGuid"></param>
        /// <returns>
        ///     String like "TableName0.Column0 as TableName0__Column0, TableName1.Column1 as TableName1__Column1"
        /// </returns>
        private string GetSqlCol(string gridName, string userGuid)
        {
            try
            {
                GetGridColumnDAO ggc = new GetGridColumnDAO();

                DataSet ds = ggc.GetGridCol(gridName, userGuid);

                if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    string sqlCol = "";
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        DataRow dr = ds.Tables[0].Rows[i];

                        string expression = dr["Expression"] as string;
                        string tablename  = dr["TableName"] as string;
                        string columnname = dr["ColumnName"] as string;

                        // expression & #alias#
                        if (expression != null && (expression = expression.Trim()).Length > 0)
                        {
                            expression = expression.Replace("#alias#", tablename + ReportCommon.ReportCommon.FIELD_SEPERATOR + columnname);

                            sqlCol += expression + ", ";
                        }
                        else
                        {
                            sqlCol += tablename + "." + columnname + " as "
                                      + tablename + ReportCommon.ReportCommon.FIELD_SEPERATOR + columnname + ", ";
                        }
                    }

                    sqlCol = sqlCol.Trim(", ".ToCharArray());

                    return(sqlCol);
                }
                else
                {
                    System.Diagnostics.Debug.Assert(false, "Can't get the Grid Columns!");
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetReportsListDAO_ORACLE=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return("'No Columns Setting'");
        }
Пример #8
0
        private int getUnApprovedReportCount(string userGuid)
        {
            int unapprovedReportCount = 0;

            try
            {
                using (RisDAL dal = new RisDAL())
                {
                    DataTable dtUnApprovedReportNoLock = new DataTable();
                    DataTable dtLockedRp           = new DataTable();
                    DataTable dtLockedReportGuids  = new DataTable();
                    string    lockedSyncRpGuids    = "";
                    string    lockedRpGuids        = "";
                    string    sqlLockedRp          = string.Format("select rpguids from tsync where owner ='{0}' and moduleid='0400'", userGuid);
                    string    sqlLockedReportGuids = "select distinct reportguid from tRegProcedure where status = 110 and ProcedureGuid in ('{0}')";

                    dal.ExecuteQuery(sqlLockedRp, dtLockedRp);
                    foreach (DataRow dr in dtLockedRp.Rows)
                    {
                        lockedSyncRpGuids = Convert.ToString(dr["RPGuids"]);
                        if (lockedSyncRpGuids.Length > 0)
                        {
                            lockedRpGuids += lockedSyncRpGuids.Split("&".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0] + ",";
                        }
                    }

                    if (lockedRpGuids.Length > 0)
                    {
                        lockedRpGuids = lockedRpGuids.TrimEnd(",".ToCharArray());
                        lockedRpGuids = lockedRpGuids.Replace(",", "','");
                    }

                    if (lockedRpGuids.Length > 0)
                    {
                        dal.ExecuteQuery(string.Format(sqlLockedReportGuids, lockedRpGuids), dtLockedReportGuids);
                    }

                    unapprovedReportCount = dtLockedReportGuids.Rows.Count;
                }
                return(unapprovedReportCount);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                return(unapprovedReportCount);
            }
        }
Пример #9
0
        public object Execute(object param)
        {
            int    count      = 0;
            string userGuid   = "";
            string reportGuid = "";
            int    countType  = 0;

            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;
                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetReportHoldCountDAO_MSSQL!"));
                }

                userGuid = paramMap["UserGuid"] as string;
                if (paramMap.ContainsKey("ReportGuid"))
                {
                    reportGuid = paramMap["ReportGuid"] as string;
                }
                countType = Convert.ToInt32(paramMap["CountType"]);
                switch (countType)
                {
                case 1:
                    count = getUnWrittenReportCount(userGuid, reportGuid);
                    break;

                case 2:
                    count = getUnApprovedReportCount(userGuid);
                    break;

                case 3:
                    count = getUnWrittenUnApprovedReportCount(userGuid, reportGuid);
                    break;

                default:
                    break;
                }
                return(count);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                return(count);
            }
        }
Пример #10
0
        /// <summary>
        /// GetIsolationLevel
        /// 0 -- ReadUncommitted
        /// 1 -- ReadCommitted
        /// 2 -- Snapshot
        /// 3 -- RepeatableRead
        /// 4 -- Serializable
        /// 5 -- Chaos
        /// 6 -- Unspecified
        /// </summary>
        /// <returns></returns>
        public static IsolationLevel GetIsolationLevel()
        {
            try
            {
                if (_iIsolationLevel < 0)
                {
                    _iIsolationLevel = ServerPubFun.GetSystemProfile_Int(ReportCommon.ProfileName.IsolationLevel);
                }

                if (_iIsolationLevel == 0)
                {
                    return(IsolationLevel.ReadUncommitted);
                }
                else if (_iIsolationLevel == 1)
                {
                    return(IsolationLevel.ReadCommitted);
                }
                else if (_iIsolationLevel == 2)
                {
                    return(IsolationLevel.Snapshot);
                }
                else if (_iIsolationLevel == 3)
                {
                    return(IsolationLevel.RepeatableRead);
                }
                else if (_iIsolationLevel == 4)
                {
                    return(IsolationLevel.Serializable);
                }
                else if (_iIsolationLevel == 5)
                {
                    return(IsolationLevel.Chaos);
                }
                else if (_iIsolationLevel == 6)
                {
                    return(IsolationLevel.Unspecified);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetIsolationLevel=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(IsolationLevel.ReadUncommitted);
        }
Пример #11
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetReportHistoryDAO!"));
                }

                string patientID = "", reportGuid = "", strType = "";

                foreach (string key in paramMap.Keys)
                {
                    if (key.ToUpper() == "REPORTGUID" || key.ToUpper() == "REPORTID")
                    {
                        reportGuid = paramMap[key] as string;

                        if (reportGuid == null)
                        {
                            reportGuid = "";
                        }
                    }
                }
                using (RisDAL dal = new RisDAL())
                {
                    string    sql = "select PrintCopies from tReport where ReportGuid ='" + reportGuid + "'";
                    DataTable dt  = dal.ExecuteQuery(sql);

                    if (dt != null && dt.Rows.Count == 1)
                    {
                        int count = Convert.ToInt32(dt.Rows[0][0]);
                        return(count = (count >= 0 ? count : 0));
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetReportPrintCopiesCountDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(0);
        }
Пример #12
0
        public Object Execute(object param)
        {
            try
            {
                using (RisDAL oKodak = new RisDAL())
                {
                    string strOrderGuid  = CommonGlobalSettings.Utilities.GetParameter("OrderGuid", param.ToString());
                    string strReportGuid = CommonGlobalSettings.Utilities.GetParameter("ReportGuid", param.ToString());
                    string strSQL        = "";
                    if (!string.IsNullOrWhiteSpace(strOrderGuid))
                    {
                        strSQL = string.Format("select IsFilmSent from tregorder where OrderGuid='{0}'", strOrderGuid);
                    }
                    else
                    {
                        strSQL = string.Format("select IsPrint from treport where ReportGuid='{0}'", strReportGuid);
                    }

                    Object obj = oKodak.ExecuteScalar(strSQL);
                    if (obj == null || Convert.ToInt32(obj) == 0)
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetRePrintDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }


            return(false);
            //KodakDAL oKodak = new KodakDAL();
            //string clsType = string.Format("{0}_{1}", this.GetType().ToString(), oKodak.DriverClassName.ToUpper());

            //Type type = Type.GetType(clsType);
            //IReportDAO iRptDAO = Activator.CreateInstance(type) as IReportDAO;
            //return iRptDAO.Execute(param);
        }
Пример #13
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in SaveLeaveSoundDAO!"));
                }



                using (RisDAL dal = new RisDAL())
                {
                    DataSet ds = paramMap["DataSet"] as DataSet;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        string strSoundGuid  = Guid.NewGuid().ToString();
                        string strReportGuid = Convert.ToString(dr["ReportGuid"]);
                        string strPath       = Convert.ToString(dr["Path"]);
                        int    nStatus       = 0;
                        string strLeaveTime  = GlobalCommon.ToLongDateTime(DateTime.Now);
                        string strOwner      = Convert.ToString(dr["Owner"]);
                        string strDomain     = Convert.ToString(dr["Domain"]);

                        string strSQL = string.Format("insert into tLeaveSound(SoundGuid,ReportGuid,Path,Status,LeaveTime,Owner,Domain) values('{0}','{1}','{2}',{3},'{4}','{5}','{6}')",
                                                      strSoundGuid, strReportGuid, strPath, nStatus, strLeaveTime, strOwner, strDomain);
                        dal.ExecuteNonQuery(strSQL);
                        strSQL = string.Format("update tReport set IsLeaveSound=1 where ReportGuid='{0}'", strReportGuid);
                        dal.ExecuteNonQuery(strSQL);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "SaveLeaveSoundDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                return(false);
            }

            return(true);
        }
Пример #14
0
            public Object Execute(object param)
            {
                try
                {
                    using (RisDAL oKodak = new RisDAL())
                    {
                        string strOrderGuid  = CommonGlobalSettings.Utilities.GetParameter("OrderGuid", param.ToString());
                        string strReportGuid = CommonGlobalSettings.Utilities.GetParameter("ReportGuid", param.ToString());
                        string strSQL        = "";
                        if (string.IsNullOrWhiteSpace(strOrderGuid))
                        {
                            strSQL = string.Format("select IsFilmSent from tregorder where OrderGuid='{0}'", strOrderGuid);
                        }
                        else
                        {
                            strSQL = string.Format("select IsPrint from treport where ReportGuid='{0}'", strReportGuid);
                        }

                        Object obj = oKodak.ExecuteScalar(strSQL);
                        if (obj == null || Convert.ToInt32(obj) == 0)
                        {
                            return(false);
                        }
                        else
                        {
                            return(true);
                        }
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.Assert(false, ex.Message);

                    ServerPubFun.RISLog_Error(0, "GetRePrintDAO=" + ex.Message,
                                              (new System.Diagnostics.StackFrame()).GetFileName(),
                                              (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                }


                return(false
                       );
            }
Пример #15
0
        public object Execute(object param)
        {
            try
            {
                BaseDataSetModel bdsm = param as BaseDataSetModel;

                if (bdsm == null || bdsm.DataSetParameter == null)
                {
                    throw (new Exception("No parameter in SaveLeaveWordDAO!"));
                }



                //KodakDAL dal = new KodakDAL();
                {
                    DataSet ds = bdsm.DataSetParameter;
                    if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        string strReportGuid = Convert.ToString(ds.Tables[0].Rows[0]["ReportGuid"]);
                        string strLeaveWord  = Convert.ToString(ds.Tables[0].Rows[0]["LeaveWord"]);
                        string strSQL        = string.Format("update tReport set isLeaveWord=1, Comments= @Comments where ReportGuid='{0}'", strReportGuid);
                        using (var dal = new RisDAL())
                        {
                            dal.Parameters.Add("@Comments", strLeaveWord);
                            dal.ExecuteNonQuery(strSQL);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "SaveLeaveWordDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                return(false);
            }


            return(true);
        }
Пример #16
0
        public DataSet GetGridCol(string gridName, string userGuid)
        {
            try
            {
                gridName = gridName == null ? "" : gridName.Trim();
                userGuid = userGuid == null ? "" : userGuid.Trim();

                if (gridName.Length > 0)
                {
                    string sql = " select * from tGridColumnOption"
                                 + " left join tGridColumn on tGridColumn.Guid = tGridColumnOption.Guid"
                                 + "	and tGridColumn.UserGuid is null"
                                 + " where tGridColumnOption.listname = '" + gridName + "'"
                                 + " order by tGridColumnOption.OrderID";



                    DataSet ds = new DataSet();

                    using (RisDAL dal = new RisDAL())
                    {
                        dal.ExecuteQuery(sql, ds, "GridColumn");

                        return(ds);
                    }
                }
                else
                {
                    throw (new Exception("Missing Parameter!"));
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetGridColumnDAO_ORACLE, MSG=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
Пример #17
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetLeaveSoundDAO!"));
                }



                string strReportGuid = paramMap["ReportGuid"] as string;



                DataSet ds = new DataSet();


                using (RisDAL oKodak = new RisDAL())
                {
                    string    strSQL       = string.Format("select A.SoundGuid,A.ReportGuid,A.Path,A.Status,A.LeaveTime,A.Owner,B.LocalName from tLeaveSound A,tUser B where A.Owner=B.UserGuid and ReportGuid='{0}' order  by LeaveTime desc", strReportGuid);
                    DataTable dtLeaveSound = oKodak.ExecuteQuery(strSQL);
                    ds.Tables.Add(dtLeaveSound);
                    return(ds);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetLeaveSoundDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                return(null);
            }

            return(null);
        }
Пример #18
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> inMap = param as Dictionary <string, object>;

                if (inMap == null || inMap.Count < 1)
                {
                    throw (new Exception("No parameter!"));
                }

                string gridName = "", userGuid = "";

                foreach (string key in inMap.Keys)
                {
                    if (key.ToUpper() == "GRIDNAME")
                    {
                        gridName = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "USERGUID" || key.ToUpper() == "USERID")
                    {
                        userGuid = inMap[key] as string;
                    }
                }

                return(GetGridCol(gridName, userGuid));
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetGridColumnDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
Пример #19
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public object Execute(object param)
        {
            bool bHide0 = ServerPubFun.GetSystemProfile_Bool(ReportCommon.ProfileName.ReportList_HideCount, ReportCommon.ModuleID.Report);
            bool bHide1 = ServerPubFun.GetSystemProfile_Bool(ReportCommon.ProfileName.ReportPrint_HideCount, ReportCommon.ModuleID.Report);

            if (bHide0 && bHide1)
            {
                return(-1);
            }

            using (RisDAL oKodak = new RisDAL())
            {
                string clsType = string.Format("{0}_{1}", this.GetType().ToString(), oKodak.DriverClassName.ToUpper());
                if (oKodak != null)
                {
                    oKodak.Dispose();
                }

                Type       type    = Type.GetType(clsType);
                IReportDAO iRptDAO = Activator.CreateInstance(type) as IReportDAO;
                return(iRptDAO.Execute(param));
            }
        }
Пример #20
0
        public DataSet GetGridCol(string gridName, string userGuid)
        {
            try
            {
                gridName = gridName == null ? "" : gridName.Trim();
                userGuid = userGuid == null ? "" : userGuid.Trim();

                if (gridName.Length > 0)
                {
                    /*
                     * string sql = "if exists(select 1 from tGridColumn, tGridColumnOption"
                     + " where tGridColumn.Guid = tGridColumnOption.Guid"
                     + " and tGridColumnOption.listname = '" + gridName + "' and tGridColumn.UserGuid = '" + userGuid + "') \r\n"
                     + "  select * from tGridColumn, tGridColumnOption"
                     + "  where tGridColumn.Guid = tGridColumnOption.Guid"
                     + "  and tGridColumnOption.listname = '" + gridName + "'"
                     + "  and tGridColumn.UserGuid = '" + userGuid + "' order by tGridColumn.OrderID \r\n"
                     + " else if exists(select 1 from tGridColumn, tGridColumnOption"
                     + " where tGridColumn.Guid = tGridColumnOption.Guid"
                     + " and tGridColumnOption.listname = '" + gridName + "' and tGridColumn.UserGuid = '') \r\n"
                     + "  select * from tGridColumn, tGridColumnOption"
                     + "  where tGridColumn.Guid = tGridColumnOption.Guid"
                     + "  and tGridColumnOption.listname = '" + gridName + "'"
                     + "  and tGridColumn.UserGuid = '' order by tGridColumn.OrderID \r\n"
                     + " else \r\n"
                     + "  select * from tGridColumnOption"
                     + "  left join tGridColumn on tGridColumn.Guid = tGridColumnOption.Guid"
                     + "	 and tGridColumn.UserGuid = ''"
                     + "  where tGridColumnOption.listname = '" + gridName + "' order by tGridColumnOption.OrderID";
                     */
                    string sql = string.Format("select tGridColumn.Guid,tGridColumn.ColumnWidth,tGridColumn.IsHidden,tGridColumnOption.ColumnID," +
                                               " tGridColumnOption.TableName,tGridColumnOption.ColumnName,tGridColumnOption.Expression," +
                                               " tGridColumnOption.ModuleID, tGridColumnOption.isImageColumn, tGridColumnOption.ImagePath" +
                                               " from tGridColumn left join tGridColumnOption on " +
                                               " tGridColumn.Guid=tGridColumnOption.Guid where " +
                                               " tGridColumn.UserGuid='' AND tGridColumnOption.ListName='{0}' " +
                                               " order by tGridColumn.OrderID ", gridName);



                    DataSet ds = new DataSet();

                    using (RisDAL dal = new RisDAL())
                    {
                        dal.ExecuteQuery(sql, ds, "GridColumn");

                        return(ds);
                    }
                }
                else
                {
                    throw (new Exception("Missing Parameter!"));
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetGridColumnDAO_MSSQL, MSG=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
Пример #21
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetLockDAO!"));
                }

                string userGuid              = "";
                string reportGuid            = "";
                string SignActions           = "";
                string certsn                = "";
                bool   IsGetDigitalSignImage = false;

                foreach (string key in paramMap.Keys)
                {
                    if (key.ToUpper() == "USERGUID")
                    {
                        userGuid = paramMap[key] as string;

                        if (userGuid == null)
                        {
                            userGuid = "";
                        }
                    }
                    if (key.ToUpper() == "REPORTGUID")
                    {
                        reportGuid = paramMap[key] as string;

                        if (reportGuid == null)
                        {
                            reportGuid = "";
                        }
                    }

                    if (key.ToUpper() == "ISGETDIGITALSIGNIMAGE")
                    {
                        IsGetDigitalSignImage = Convert.ToBoolean(paramMap[key]);
                    }

                    if (key.ToUpper() == "SIGNACTIONS")
                    {
                        SignActions = Convert.ToString(paramMap[key]);
                    }
                }



                DataSet ds = new DataSet();

                //dal.BeginTransaction();

                try
                {
                    using (RisDAL dal = new RisDAL())
                    {
                        if (reportGuid.Trim().Length > 0)
                        {
                            string    strSQL = string.Format("SELECT Creater,Submitter,FirstApprover,SecondApprover FROM tReport WHERE REPORTGUID = '{0}'", reportGuid);
                            DataTable dt     = dal.ExecuteQuery(strSQL);


                            if (dt == null || dt.Rows.Count == 0)
                            {
                                return(null);
                            }

                            string strCreater = "", strFirstApprover = "", strSubmitter = "", strSecondApprover = "";
                            if (dt.Rows[0]["Creater"] != null)
                            {
                                strCreater = Convert.ToString(dt.Rows[0]["Creater"]);
                            }

                            if (dt.Rows[0]["FirstApprover"] != null)
                            {
                                strFirstApprover = Convert.ToString(dt.Rows[0]["FirstApprover"]);
                            }

                            if (dt.Rows[0]["Submitter"] != null)
                            {
                                strSubmitter = Convert.ToString(dt.Rows[0]["Submitter"]);
                            }

                            if (dt.Rows[0]["SecondApprover"] != null)
                            {
                                strSecondApprover = Convert.ToString(dt.Rows[0]["SecondApprover"]);
                            }

                            if (!IsGetDigitalSignImage)
                            {
                                if (strCreater.Length > 0)
                                {
                                    strSQL = string.Format("SELECT SignImage FROM tUser WHERE userguid = '{0}'", strCreater);
                                    DataTable dtCreater = dal.ExecuteQuery(strSQL);
                                    dtCreater.TableName = "CreaterSignImage";
                                    ds.Tables.Add(dtCreater);
                                }

                                if (strFirstApprover.Length > 0)
                                {
                                    strSQL = string.Format("SELECT SignImage FROM tUser WHERE userguid = '{0}'", strFirstApprover);
                                    DataTable dtFirstApprover = dal.ExecuteQuery(strSQL);
                                    dtFirstApprover.TableName = "FirstApproverSignImage";
                                    ds.Tables.Add(dtFirstApprover);
                                }

                                if (strSubmitter.Length > 0)
                                {
                                    strSQL = string.Format("SELECT SignImage FROM tUser WHERE userguid = '{0}'", strSubmitter);
                                    DataTable dtSubmitter = dal.ExecuteQuery(strSQL);
                                    dtSubmitter.TableName = "SubmitterSignImage";
                                    ds.Tables.Add(dtSubmitter);
                                }

                                if (strSecondApprover.Length > 0)
                                {
                                    strSQL = string.Format("SELECT SignImage FROM tUser WHERE userguid = '{0}'", strSecondApprover);
                                    DataTable dtSecondApprover = dal.ExecuteQuery(strSQL);
                                    dtSecondApprover.TableName = "SecondApproverSignImage";
                                    ds.Tables.Add(dtSecondApprover);
                                }
                            }
                            else
                            {
                                #region CA sign pic
                                string[] signActionsArr = SignActions.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

                                if (signActionsArr.Length > 0)
                                {
                                    bool isSubmitAction, isApproveAction, isSecondApproveAction;
                                    isSubmitAction = isApproveAction = isSecondApproveAction = false;
                                    foreach (string act in signActionsArr)
                                    {
                                        if (act.Equals("submitreport", StringComparison.OrdinalIgnoreCase))
                                        {
                                            isSubmitAction = true;
                                        }
                                        else if (act.Equals("approvereport", StringComparison.OrdinalIgnoreCase))
                                        {
                                            isApproveAction = true;
                                        }
                                        else if (act.Equals("secondapprovereport", StringComparison.OrdinalIgnoreCase))
                                        {
                                            isSecondApproveAction = true;
                                        }
                                    }
                                    if (isSubmitAction)
                                    {
                                        strSQL = string.Format("SELECT signpic FROM tUserCerts WHERE certsn = (select top 1 certsn  from tsignedhistory where reportguid ='{0}' and action='submitreport' order by createdt desc)", reportGuid);
                                        dal.ExecuteQuery(strSQL, ds, "SubmitterSignImage");
                                    }

                                    if (isApproveAction)
                                    {
                                        strSQL = string.Format("SELECT signpic FROM tUserCerts WHERE certsn = (select top 1 certsn  from tsignedhistory where reportguid ='{0}' and action='ApproveReport' order by createdt desc)", reportGuid);
                                        dal.ExecuteQuery(strSQL, ds, "FirstApproverSignImage");
                                    }

                                    if (isSecondApproveAction)
                                    {
                                        strSQL = string.Format("SELECT signpic FROM tUserCerts WHERE certsn = (select top 1 certsn  from tsignedhistory where reportguid ='{0}' and action='SecondApproveReport' order by createdt desc)", reportGuid);
                                        dal.ExecuteQuery(strSQL, ds, "SecondApproverSignImage");
                                    }
                                }
                                #endregion
                            }
                        }
                        else
                        {
                            string strSQL = string.Format("SELECT SignImage FROM tUser WHERE userguid = '{0}'", userGuid);

                            dal.ExecuteQuery(strSQL, ds, "SignImage");
                        }
                    }
                }
                catch (Exception ex)
                {
                    //dal.RollbackTransaction();

                    System.Diagnostics.Debug.Assert(false, ex.Message);

                    throw (ex);
                }

                //dal.CommitTransaction();



                return(ds);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetLockDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
Пример #22
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetLockDAO!"));
                }

                string action   = "";
                string lockType = "";
                string lockGuid = "";
                string owner    = "";
                string ownerIP  = "";

                foreach (string key in paramMap.Keys)
                {
                    if (key.ToUpper() == "LOCKTYPE")
                    {
                        lockType = paramMap[key] as string;

                        if (lockType == null)
                        {
                            lockType = "";
                        }
                    }
                    else if (key.ToUpper() == "LOCKGUID")
                    {
                        lockGuid = paramMap[key] as string;

                        if (lockGuid == null)
                        {
                            lockGuid = "";
                        }
                    }
                    else if (key.ToUpper() == "ACTION")
                    {
                        action = paramMap[key] as string;

                        if (action == null)
                        {
                            action = "";
                        }
                    }
                    else if (key.ToUpper() == "OWNER")
                    {
                        owner = paramMap[key] as string;

                        if (owner == null)
                        {
                            owner = "";
                        }
                    }
                    else if (key.ToUpper() == "OWNERIP")
                    {
                        ownerIP = paramMap[key] as string;

                        if (ownerIP == null)
                        {
                            ownerIP = "";
                        }
                    }
                }



                DataSet ds = new DataSet();

                //dal.BeginTransaction();

                try
                {
                    using (RisDAL dal = new RisDAL())
                    {
                        if (action.ToUpper() == "ADD")
                        {
                            string sql0 = "merge into tSync D"
                                          + " using (select " + lockType + " syncType, '" + lockGuid + "' guid, '"
                                          + owner + "' owner, '" + ownerIP + "' ownerIP from dual) S"
                                          + " on (s.synctype = d.syncType and s.guid = d.guid)"
                                          + " when not matched then insert (d.syncType, d.guid, d.owner, d.ownerIP)"
                                          + " values(s.synctype, s.guid, s.owner, s.ownerip)";
                            string sql1 = " select * from tSync, tUser where tSync.Owner = tUser.UserGuid"
                                          + " and tSync.SyncType=" + lockType + " and tSync.Guid='" + lockGuid + "' for update";
                            string sql2 = " commit";



                            dal.ExecuteNonQuery(sql0);
                            dal.ExecuteQuery(sql1, ds, "tSync");
                            dal.ExecuteNonQuery(sql2);
                        }
                        else if (action.ToUpper() == "DELETE" || action.ToUpper() == "DEL")
                        {
                            string sql0 = "delete from tSync"
                                          + " where syncType=" + lockType + " and guid='" + lockGuid + "'";
                            string sql1 = " select * from tSync, tUser where tSync.Owner = tUser.UserGuid"
                                          + " and tSync.SyncType=" + lockType + " and tSync.Guid='" + lockGuid + "' ";
                            string sql2 = " commit";

                            dal.ExecuteNonQuery(sql0);
                            dal.ExecuteQuery(sql1, ds, "tSync");
                            dal.ExecuteNonQuery(sql2);
                        }
                        else
                        {
                            string sql = "select * from tSync, tUser where tSync.Owner=tUser.UserGuid and tSync.SyncType="
                                         + lockType + " and tSync.Guid='" + lockGuid + "'";

                            dal.ExecuteQuery(sql, ds, "tSync");
                        }
                    }
                }
                catch (Exception ex)
                {
                    //dal.RollbackTransaction();

                    throw (ex);
                }

                //dal.CommitTransaction();



                return(ds);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetLockDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
Пример #23
0
        public object Execute(object param, ref string strObjectGuids)
        {
            try
            {
                #region Parse the parameters

                Dictionary <string, object> inMap = param as Dictionary <string, object>;

                if (inMap == null || inMap.Count < 1)
                {
                    throw (new Exception("No parameter in ReportOpenPolicyDAO!"));
                }

                string RPGuids      = "";
                bool   bAssociated  = false;
                bool   bOfflineData = false;

                foreach (string key in inMap.Keys)
                {
                    switch (key.ToUpper())
                    {
                    case "RPGUIDS":
                    {
                        RPGuids = inMap[key] as string;
                    }
                    break;

                    case "ASSOCIATED":
                    {
                        bAssociated = (System.Convert.ToString(inMap[key]) == "1");
                    }
                    break;

                    case "OFFLINEDATA":
                    {
                        bOfflineData = (System.Convert.ToString(inMap[key]) == "1");
                    }
                    break;
                    }
                }

                #endregion

                string strSQL = "";

                bool bExistImage = true;
                using (RisDAL dal = new RisDAL())
                {
                    if (bAssociated)
                    {
                        string strTemp = "";
                        strSQL = string.Format(
                            "   SELECT OrderGuid,status,reportGuid FROM tregprocedure where procedureguid='{0}' ", RPGuids.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0]);

                        if (bOfflineData)
                        {
                            strSQL += string.Format(" UNION "
                                                    + " SELECT OrderGuid,status,reportGuid FROM RISArchive..tregprocedure where procedureguid='{0}' ", RPGuids.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0]);
                        }

                        DataTable dt1 = dal.ExecuteQuery(strSQL);
                        if (dt1 == null || dt1.Rows.Count < 1)
                        {
                            // RP not exists
                            return(2);
                        }

                        if (Convert.ToInt32(dt1.Rows[0]["status"]) != 50)
                        {
                            strObjectGuids = Convert.ToString(dt1.Rows[0]["ReportGuid"]);

                            if (string.IsNullOrEmpty(strObjectGuids))
                            {
                                return(2);
                            }
                            else
                            {
                                return(1);
                            }
                        }


                        strSQL = string.Format(
                            "   SELECT ProcedureGuid,IsExistImage  FROM   tregprocedure where status=50 and OrderGuid='{0}' "
                            , Convert.ToString(dt1.Rows[0]["OrderGuid"]));

                        if (bOfflineData)
                        {
                            strSQL += string.Format(" UNION "
                                                    + " SELECT ProcedureGuid,IsExistImage  FROM   RISArchive..tregprocedure where status=50 and OrderGuid='{0}' "
                                                    , Convert.ToString(dt1.Rows[0]["OrderGuid"]));
                        }

                        dt1 = dal.ExecuteQuery(strSQL);


                        foreach (DataRow dr in dt1.Rows)
                        {
                            string strRPGuid = Convert.ToString(dr["ProcedureGuid"]);
                            strTemp += strRPGuid;
                            strTemp += ",";
                            if (dr["IsExistImage"] is DBNull || dr["IsExistImage"] == null || Convert.ToInt32(dr["IsExistImage"]) == 0)
                            {
                                bExistImage = false;
                            }
                        }
                        strObjectGuids = strTemp.TrimEnd(',');
                        return(bExistImage ? 0 : 4);
                    }

                    //
                    if (RPGuids.Split(',').Length > 1)
                    {
                        RPGuids = RPGuids.Trim(", ".ToCharArray());
                        RPGuids = RPGuids.Replace(",", "','");
                        RPGuids = "'" + RPGuids + "'";
                        strSQL  = string.Format(
                            "  SELECT A.OrderGuid,A.Status,A.IsExistImage,A.ReportGuid from tRegProcedure A  where A.ProcedureGuid in({0})"
                            , RPGuids);

                        if (bOfflineData)
                        {
                            strSQL += string.Format(" UNION "
                                                    + " SELECT A.OrderGuid,A.Status,A.IsExistImage,A.ReportGuid from RISArchive..tRegProcedure A  where A.ProcedureGuid in({0})"
                                                    , RPGuids);
                        }
                    }
                    else
                    {
                        strSQL = string.Format(
                            "  SELECT A.OrderGuid,A.Status,A.IsExistImage,A.ReportGuid from tRegProcedure A where A.ProcedureGuid ='{0}'"
                            , RPGuids);

                        if (bOfflineData)
                        {
                            strSQL += string.Format(" UNION "
                                                    + " SELECT A.OrderGuid,A.Status,A.IsExistImage,A.ReportGuid from RISArchive..tRegProcedure A where A.ProcedureGuid ='{0}'"
                                                    , RPGuids);
                        }
                    }

                    DataTable dt2 = dal.ExecuteQuery(strSQL);

                    if (dt2 == null || dt2.Rows.Count == 0)
                    {
                        // RP NOT exists
                        return(2);
                    }


                    bool bSameOrder = true;

                    string    strExpression = "status>50";
                    DataRow[] drFound       = dt2.Select(strExpression);
                    if (drFound.Length != 0)
                    {
                        foreach (DataRow dr in drFound)
                        {
                            if (dr["ReportGuid"] != null && !(dr["ReportGuid"] is DBNull))
                            {
                                strObjectGuids += Convert.ToString(dr["ReportGuid"]);
                            }
                            strObjectGuids += ",";
                        }
                        strObjectGuids.TrimEnd(',');
                        return(1);
                    }
                    else
                    {
                        strObjectGuids = RPGuids;
                    }

                    strExpression = "IsExistImage=0";
                    drFound       = dt2.Select(strExpression);
                    if (drFound.Length > 0)
                    {
                        bExistImage = false;
                    }

                    if (dt2.Rows.Count > 1)
                    {
                        List <string> listOrderGuid = new List <string>();
                        foreach (DataRow dr in dt2.Rows)
                        {
                            string strOrderGuid = Convert.ToString(dr["OrderGuid"]);
                            if (listOrderGuid.Count == 0)
                            {
                                listOrderGuid.Add(strOrderGuid);
                                continue;
                            }
                            if (!listOrderGuid.Contains(strOrderGuid))
                            {
                                bSameOrder = false;
                                break;
                            }
                        }
                    }


                    if (!bSameOrder)
                    {
                        return(3);
                    }

                    if (!bExistImage)
                    {
                        return(4);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "ReportOpenPolicyDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(0);
        }
Пример #24
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> inMap = param as Dictionary <string, object>;

                if (inMap == null || inMap.Count < 1)
                {
                    throw (new Exception("No parameter in SaveReportDAO!"));
                }

                string[] reportGuids = null;
                string   curUserGuid = "", comments = "", snapShotSrvPath = "", modalityType = "", modality = "";
                int      logType = 0, cnt = 1, costTime = 0;
                string   strType = "", strMultiCostTime = null;
                string   strPrintTemplateGuid = "";

                foreach (string key in inMap.Keys)
                {
                    if (key.ToUpper() == "LOGTYPE")
                    {
                        string tmp = inMap[key] as string;

                        if (tmp != null && tmp.Length > 0)
                        {
                            logType = System.Convert.ToInt32(tmp);
                        }
                    }
                    else if (key.ToUpper() == "REPORTGUIDS" || key.ToUpper() == "REPORTGUID")
                    {
                        string tmp = inMap[key] as string;

                        if (tmp != null && (tmp = tmp.Trim(", ".ToCharArray())).Length > 0)
                        {
                            reportGuids = tmp.Split(',');
                        }
                    }
                    else if (key.ToUpper() == "COUNT")
                    {
                        string tmp = inMap[key] as string;

                        if (tmp != null && tmp.Length > 0)
                        {
                            cnt = System.Convert.ToInt32(tmp);
                        }
                    }
                    else if (key.ToUpper() == "USERID" || key.ToUpper() == "USERGUID")
                    {
                        curUserGuid = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "COMMENTS")
                    {
                        comments = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "SNAPSHOTSRVPATH")
                    {
                        snapShotSrvPath = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "MODALITYTYPE")
                    {
                        modalityType = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "MODALITY")
                    {
                        modality = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "COSTTIME")
                    {
                        string tmp = inMap[key] as string;

                        if (tmp != null && tmp.Length > 0)
                        {
                            costTime = System.Convert.ToInt32(tmp);
                        }
                    }
                    else if (key.ToUpper() == "TYPE")
                    {
                        strType = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "MULTICOSTTIME")
                    {
                        strMultiCostTime = inMap[key] as string;
                    }
                    else if (key.ToUpper() == "PRINTTEMPLATEGUID")
                    {
                        strPrintTemplateGuid = inMap[key] as string;
                    }
                }

                string sql = "";

                string strDomain = CommonGlobalSettings.Utilities.GetCurDomain();

                if (strMultiCostTime != null && strMultiCostTime.Trim().Length > 0)
                {
                    string[] arrCostTime = strMultiCostTime.Split('|');

                    sql += " insert into tEventLog(guid, eventCode, ModalityType, costtime, createdt, operator,Domain)"
                           + " values('" + Guid.NewGuid().ToString() + "', " + (int)ReportCommon.ReportLog_Type.EventLog_Exam2Draft + ", '" + modalityType + "', "
                           + arrCostTime[0].ToString() + ", getdate(), '" + curUserGuid + "','" + strDomain + "') \r\n";

                    sql += " insert into tEventLog(guid, eventCode, ModalityType, costtime, createdt, operator,Domain)"
                           + " values('" + Guid.NewGuid().ToString() + "', " + (int)ReportCommon.ReportLog_Type.EventLog_Draft2Submit + ", '" + modalityType + "', "
                           + arrCostTime[1].ToString() + ", getdate(), '" + curUserGuid + "','" + strDomain + "')  \r\n";

                    sql += " insert into tEventLog(guid, eventCode, ModalityType, costtime, createdt, operator,Domain)"
                           + " values('" + Guid.NewGuid().ToString() + "', " + (int)ReportCommon.ReportLog_Type.EventLog_Submit2Approve + ", '" + modalityType + "', "
                           + arrCostTime[2].ToString() + ", getdate(), '" + curUserGuid + "','" + strDomain + "')  \r\n";

                    sql += " insert into tEventLog(guid, eventCode, ModalityType, costtime, createdt, operator,Domain)"
                           + " values('" + Guid.NewGuid().ToString() + "', " + (int)ReportCommon.ReportLog_Type.EventLog_ApproveStart2End + ", '" + modalityType + "', "
                           + arrCostTime[3].ToString() + ", getdate(), '" + curUserGuid + "','" + strDomain + "')  \r\n";
                }
                else
                {
                    if (logType == System.Convert.ToInt32(ReportCommon.ReportLog_Type.EventLog_Exam2Draft) ||
                        logType == System.Convert.ToInt32(ReportCommon.ReportLog_Type.EventLog_Draft2Submit) ||
                        logType == System.Convert.ToInt32(ReportCommon.ReportLog_Type.EventLog_Submit2Approve) ||
                        logType == System.Convert.ToInt32(ReportCommon.ReportLog_Type.EventLog_ApproveStart2End) ||
                        logType == System.Convert.ToInt32(ReportCommon.ReportLog_Type.EventLog_Exam2Print))
                    {
                        if (reportGuids.Length > 0)
                        {
                            sql = "insert into tEventLog(guid, eventCode, ModalityType, costtime, createdt, operator,Domain)"
                                  + " values('" + Guid.NewGuid().ToString() + "', " + logType.ToString() + ", '" + modalityType + "', "
                                  + costTime.ToString() + ", getdate(), '" + curUserGuid + "','" + strDomain + "')";
                        }
                    }
                    // 2015-06-08, Oscar added (US25173)
                    else if (logType == (int)ReportCommon.ReportLog_Type.EventLog_SubmitCostTime ||
                             logType == (int)ReportCommon.ReportLog_Type.EventLog_ApproveCostTime)
                    {
                        if (reportGuids.Length > 0)
                        {
                            sql += UpsertEventLog(logType, modalityType, costTime, curUserGuid, strDomain, reportGuids[0]);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < reportGuids.Length; i++)
                        {
                            string tmp = reportGuids.GetValue(i) as string;
                            if (tmp != null && tmp.Length > 0)
                            {
                                if (cnt < 1)
                                {
                                    sql += " insert into tReportPrintLog(fileGuid, ReportGuid,Printer,PrintDt,Counts,Comments,snapShotSrvPath,Type,Domain) "
                                           + " values(newid(), '" + tmp + "', '" + curUserGuid + "', getdate(), "
                                           + cnt.ToString() + ", '" + comments + "', '" + snapShotSrvPath + "','" + strType + "','" + strDomain + "') \r\n";
                                }
                                else
                                {
                                    sql += " update tReport set isPrint=1,Optional1='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', PrintTemplateGuid ='" + strPrintTemplateGuid + "' where reportGuid='" + tmp + "' \r\n"
                                           + " insert into tReportPrintLog(fileGuid, ReportGuid,Printer,PrintDt,Counts,Comments,snapShotSrvPath,Type,PrintTemplateGuid,Domain)"
                                           + " values(newid(), '" + tmp + "', '" + curUserGuid + "', getdate(), "
                                           + cnt.ToString() + ", '" + comments + "', '" + snapShotSrvPath + "','" + strType + "','" + strPrintTemplateGuid + "','" + strDomain + "') \r\n";
                                }
                            }
                        }
                    }
                }
                if (0 == iWrittenLog++ % 100)
                {
                    ServerPubFun.RISLog_Info(0, "RecordLogDAO, UserGuid=" + curUserGuid + ", SQL=" + sql,
                                             (new System.Diagnostics.StackFrame()).GetFileName(),
                                             (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                }
                else
                {
                    ServerPubFun.RISLog_Info(0, "RecordLogDAO, UserGuid=" + curUserGuid + ", reportGuids=" + reportGuids.ToString(),
                                             (new System.Diagnostics.StackFrame()).GetFileName(),
                                             (new System.Diagnostics.StackFrame()).GetFileLineNumber());
                }

                if (sql.Length > 0)
                {
                    using (RisDAL dal = new RisDAL())
                    {
                        dal.ExecuteNonQuery(sql);

                        return(true);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "RecordLogDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(false);
        }
Пример #25
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetReportNameDAO!"));
                }

                string reportGuid = "";
                string rpGuids    = "";
                string accNO      = "";

                foreach (string key in paramMap.Keys)
                {
                    if (key.ToUpper() == "REPORTGUID")
                    {
                        reportGuid = paramMap[key] as string;

                        if (reportGuid == null)
                        {
                            reportGuid = "";
                        }
                    }
                    else if (key.ToUpper() == "PROCEDUREGUID")
                    {
                        rpGuids = paramMap[key] as string;

                        if (rpGuids == null)
                        {
                            rpGuids = "";
                        }
                    }
                    else if (key.ToUpper() == "ACCNO")
                    {
                        accNO = paramMap[key] as string;

                        if (accNO == null)
                        {
                            accNO = "";
                        }
                    }
                }

                string sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n" +
                             "select " + GetAllReportColumn() + " \r\n"
                             + " from tRegPatient with (nolock), tRegOrder with (nolock), tProcedureCode with (nolock), tRegProcedure with (nolock) \r\n"
                             + " left join tReport with (nolock) on tRegProcedure.reportGuid = tReport.reportGuid \r\n"
                             + " where tRegPatient.PatientGuid = tRegOrder.PatientGuid \r\n"
                             + " and tRegOrder.OrderGuid = tRegProcedure.OrderGuid \r\n"
                             + " and tRegProcedure.ProcedureCode = tProcedureCode.ProcedureCode \r\n";

                string sqlFile = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n" +
                                 " select distinct tReportFile.* from tReportFile, tReport "
                                 + " where tReportFile.reportGuid = tReport.reportGuid";


                #region Added by Kevin For SR

                string sqlreportcontent = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n" +
                                          " select * from tReportContent"
                                          + " where tReportContent.ReportId ='" + reportGuid + "' ";

                #endregion


                if (!string.IsNullOrWhiteSpace(reportGuid))
                {
                    sql += " and tReport.reportGuid = '" + reportGuid + "'";

                    sqlFile += " and tReport.reportGuid = '" + reportGuid + "'";
                }
                else if (!string.IsNullOrWhiteSpace(rpGuids))
                {
                    rpGuids = rpGuids.Trim(", ".ToCharArray());

                    string[] arr = rpGuids.Split(',');
                    if (arr.Length > 1)
                    {
                        if (!rpGuids.Contains("','"))
                        {
                            rpGuids = rpGuids.Replace(",", "','");
                            rpGuids = "'" + rpGuids + "'";
                        }
                        sql += " and tRegProcedure.ProcedureGuid in (" + rpGuids + ")";
                    }
                    else
                    {
                        rpGuids = "'" + rpGuids + "'";
                        sql    += " and tRegProcedure.ProcedureGuid =" + rpGuids;
                    }

                    sqlFile += " and 1=2 ";
                }
                else if (!string.IsNullOrWhiteSpace(accNO))
                {
                    sql += " AND tRegOrder.ACCNO = '" + accNO.Trim() + "'";

                    sqlFile += " AND 1=2 ";
                }

                if (0 == iWrittenCount++ % 100)
                {
                    ServerPubFun.RISLog_Info(0, "GetReportInfoDAO=" + sql + ", reportFile=" + sqlFile, "", 0);
                }
                else
                {
                    ServerPubFun.RISLog_Info(0, "GetReportInfoDAO, rpGuid=" + rpGuids + ", reportGuid=" + reportGuid + ", iWrittenCount=" + iWrittenCount.ToString(), "", 0);
                }

                DataSet ds = new DataSet();

                using (RisDAL dal = new RisDAL())
                {
                    //
                    // report info
                    DataTable dt0 = new DataTable("ReportInfo");

                    dal.ExecuteQuery(sql, dt0);

                    ds.Tables.Add(dt0);

                    //
                    // report file
                    DataTable dt1 = new DataTable("ReportFile");

                    dal.ExecuteQuery(sqlFile, dt1);

                    ds.Tables.Add(dt1);

                    string    sqlPrintTemplate = "select * from tPrintTemplate where Type=3 and TemplateName='QualityControlReportTemplate'";
                    DataTable dt2 = new DataTable("PrintTemplate");
                    dal.ExecuteQuery(sqlPrintTemplate, dt2);
                    ds.Tables.Add(dt2);
                    #region Added by Kevin For SR

                    // reportcontent
                    DataTable dt3 = new DataTable("ReportContent");

                    dal.ExecuteQuery(sqlreportcontent, dt3);

                    ds.Tables.Add(dt3);

                    #endregion
                }


                return(ds);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetReportInfoDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
Пример #26
0
        /// <summary>
        /// OnReportDelete
        /// </summary>
        /// <param name="rptInfo"></param>
        /// <param name="nextStatus"></param>
        public static void OnReportDelete(tagReportInfo rptInfo, ReportCommon.RP_Status nextStatus)
        {
            try
            {
                // Need to send gateway
                if (!ServerPubFun.GetSystemProfile_Bool("SendToGateServer", ReportCommon.ModuleID.Integration))
                {
                    return;
                }

                //
                // Gateway
                using (RisDAL dal = new RisDAL())
                {
                    string guid = Guid.NewGuid().ToString();

                    if (dal.DriverClassName.ToUpper() == "ORACLE")
                    #region Oracle
                    {
                        string sql = " insert into GW_DataIndex(data_id, data_dt, event_type, RECORD_INDEX_1, Data_Source)"
                                     + " values('" + guid + "', SYSDATE, '" + (nextStatus == ReportCommon.RP_Status.Repeatshot ? "32" : "33") + "', 'ReportGuid', 'Local'); "
                                     + " insert into GW_Patient(DATA_ID,DATA_DT,PATIENTID,PATIENT_NAME,PATIENT_LOCAL_NAME,BIRTHDATE,SEX)"
                                     + "    values('" + guid + "', SYSDATE, '" + rptInfo.patientID + "','" + rptInfo.patientName + "',N'" + rptInfo.patientLocalName + "','" + rptInfo.birthday.ToString("yyyy-MM-dd") + "','" + rptInfo.gender + "'); "
                                     + " insert into GW_Order(DATA_ID,DATA_DT,ORDER_NO,FILLER_NO,PATIENT_ID,EXAM_STATUS) "
                                     + "    values('" + guid + "', SYSDATE, '" + rptInfo.orderGuid + "', '" + rptInfo.AccNO + "', '" + rptInfo.patientID
                                     + "', '" + (nextStatus == ReportCommon.RP_Status.Repeatshot ? "17" : "16") + "'); "
                                     + " insert into GW_Report(data_id, data_dt, report_no, ACCESSION_NUMBER, PATIENT_ID, REPORT_STATUS, MODALITY, "
                                     + " REPORT_TYPE, REPORT_FILE, REPORT_WRITER, REPORT_APPROVER, REPORTDT, OBSERVATIONMETHOD)"
                                     + " values('" + guid + "', SYSDATE, '"
                                     + ((rptInfo.reportGuid == null || rptInfo.reportGuid == "") ? " " : rptInfo.reportGuid) + "', '"
                                     + rptInfo.AccNO + "'," + " '" + rptInfo.patientID + "', '204', '"
                                     + rptInfo.modality + "', '0', '', '" + rptInfo.reportCreater_LocalName + "',"
                                     + " '" + rptInfo.reportApprover_LocalName + "', '" + rptInfo.reportApproveDt.ToString("yyyy-MM-dd HH:mm:ss") + "',"
                                     + " '" + ReportCommon.ReportCommon.StringLeft(rptInfo.operationStep, ServerPubFun.GetColumnWidth("GW_Report", "OBSERVATIONMETHOD") / 2) + "'); ";

                        sql = "begin " + sql + " commit; end;";

                        dal.ExecuteNonQuery(sql);

                        if (rptInfo.wysText != null && rptInfo.wysText.Length > 0)
                        {
                            dal.WriteLargeObj("GW_Report", "data_id", guid, "DIAGNOSE", rptInfo.wysText, rptInfo.wysText.Length, RisDAL.ConnectionState.KeepOpen);
                        }

                        if (rptInfo.wygText != null && rptInfo.wygText.Length > 0)
                        {
                            dal.WriteLargeObj("GW_Report", "data_id", guid, "COMMENTS", rptInfo.wygText, rptInfo.wygText.Length, RisDAL.ConnectionState.KeepOpen);
                        }
                    }
                    #endregion
                    else if (dal.DriverClassName.ToUpper() == "MSSQL")
                    #region MSSQL
                    {
                        string sql = SaveReportDAO_MSSQL.MakeSQL4GateWay(rptInfo, guid, nextStatus == ReportCommon.RP_Status.Repeatshot ? 32 : 33, 16, 204);

                        using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(dal.ConnectionString))
                        {
                            conn.Open();

                            System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
                            cmd.Connection = conn;

                            try
                            {
                                //
                                // begin transaction
                                //cmd.Transaction = conn.BeginTransaction();

                                ServerPubFun.RISLog_Info(0, "OnReportDelete=" + sql,
                                                         (new System.Diagnostics.StackFrame(true)).GetFileName(),
                                                         (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());

                                cmd.CommandText = sql;
                                cmd.ExecuteNonQuery();
                            }
                            catch (Exception ex)
                            {
                                //cmd.Transaction.Rollback();

                                System.Diagnostics.Debug.Assert(false, ex.Message);

                                RISLog_Error(0, "OnReportDelete, MSG=" + ex.Message + ", SQL=" + sql,
                                             (new System.Diagnostics.StackFrame(true)).GetFileName(),
                                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
                            }
                        }
                    }
                    #endregion
                    else
                    {
                        System.Diagnostics.Debug.Assert(false, "Invalid DB setting!");
                    }

                    // Hippa
                    Server.Utilities.HippaLogTool.HippaLogTool.AuditPatientCareAssignMsg(
                        CommonGlobalSettings.HippaName.ActionCode.Delete,

                        rptInfo.AccNO, rptInfo.reportGuid, rptInfo.reportName, rptInfo.patientID, rptInfo.patientName, "", true);
                }
            }
            catch
            {
                Server.Utilities.HippaLogTool.HippaLogTool.AuditPatientCareAssignMsg(
                    CommonGlobalSettings.HippaName.ActionCode.Delete,
                    rptInfo.AccNO, rptInfo.reportGuid, rptInfo.reportName, rptInfo.patientID, rptInfo.patientName, "", false);
            }
        }
Пример #27
0
        /// <summary>
        /// Get Report Info by rp guid
        /// </summary>
        /// <param name="rpGuid"></param>
        /// <returns></returns>
        public static tagReportInfo GetReportInfo2(string rpGuid)
        {
            int    idx = rpGuid.IndexOf(',');
            string rp  = rpGuid;

            if (idx > 0 && idx < rpGuid.Length)
            {
                rp = rpGuid.Substring(0, idx);
            }
            rp = rp.Trim("' ".ToCharArray());


            string sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n" +
                         " select "
                         + "  tRegPatient.patientID, tRegPatient.localName, tRegPatient.EnglishName, tRegPatient.address, tRegPatient.telephone,"
                         + "  tRegPatient.isVip, tRegPatient.Comments tRegPatient__Comments, tRegPatient.remotePID tRegPatient__remotePID,"
                         + "  tRegPatient.Gender as tRegPatient__Gender, tRegPatient.Birthday as tRegPatient__Birthday,"
                         + "  tRegOrder.inhospitalNo, tRegOrder.clinicNo, tRegOrder.PatientType, tRegOrder.Observation, "
                         + "  tRegOrder.inHospitalRegion, tRegOrder.BedNo, tRegOrder.comments tRegOrder__orderComment,"
                         + "  tRegOrder.OrderGuid as tRegOrder__OrderGuid, tRegOrder.AccNo, tRegOrder.applyDept as tRegOrder__applyDept,"
                         + "  tRegOrder.applyDoctor as tRegOrder__applyDoctor, tRegOrder.VisitComment tRegOrder__VisitComment,"
                         + "  tRegOrder.remoteAccNo,"
                         + "  tRegProcedure.ProcedureGuid as tRegProcedure__ProcedureGuid, tRegProcedure.status as tRegProcedure__status, "
                         + "  tRegProcedure.charge, tRegProcedure.ModalityType, tRegProcedure.Modality, "
                         + "  tRegProcedure.Registrar, tRegProcedure.RegisterDt, tRegProcedure.Technician, "
                         + "  tRegProcedure.OperationStep, tRegProcedure.ExamineDt, tRegProcedure.comments tRegProcedure__comments, "
                         + "  tRegProcedure.isCharge, tRegProcedure.ProcedureCode tRegProcedure__ProcedureCode, "
                         + "  tRegProcedure.RPDesc tProcedureCode__Description, tRegProcedure.bodypart tProcedureCode__bodypart, "
                         + "  tReport.reportGuid, "
                         + "  tReport.ReportName, tReport.techInfo, tReport.wysText, tReport.wygText, "
                         + "  tReport.WYS, tReport.WYG, "
                         + "  tReport.creater as tReport__creater, tReport.createDt as tReport__createDt,"
                         + "  tReport.submitter as tReport__submitter, tReport.submitDt as tReport__submitDt,"
                         + "  tReport.firstApprover as tReport__firstApprover, tReport.firstApproveDt as tReport__firstApproveDt,"
                         + "  tReport.rejectDt as tReport__rejectDt"
                         + "  from tRegPatient with (nolock), "
                         + "  tRegOrder with (nolock), tRegProcedure with (nolock) "
                         + "  left join tReport with (nolock) on tRegProcedure.reportGuid = tReport.reportGuid "
                         + "  where tRegPatient.PatientGuid = tRegOrder.PatientGuid "
                         + "  and tRegOrder.OrderGuid = tRegProcedure.OrderGuid "
                         + " and tRegProcedure.procedureGuid = '" + rp + "'";

            DataTable dt = new DataTable("ReportInfo");



            tagReportInfo ri = new tagReportInfo();

            if (0 == iWrittenCount++ % 100)
            {
                ServerPubFun.RISLog_Info(0, "GetReportInfo2, SQL=" + sql,
                                         (new System.Diagnostics.StackFrame()).GetFileName(),
                                         (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }
            else
            {
                ServerPubFun.RISLog_Info(0, "GetReportInfo2, rpGuid=" + rpGuid,
                                         (new System.Diagnostics.StackFrame()).GetFileName(),
                                         (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }
            using (RisDAL dal = new RisDAL())
            {
                dal.ExecuteQuery(sql, dt);

                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];

                    ri.status           = ReportCommon.Converter.toInt(dr["tRegProcedure__status"]);
                    ri.dept             = dr["tRegOrder__applyDept"] as string;
                    ri.orderGuid        = dr["tRegOrder__OrderGuid"] as string;
                    ri.reportGuid       = dr["reportGuid"] as string;
                    ri.reportName       = dr["reportName"] as string;
                    ri.AccNO            = dr["AccNO"] as string;
                    ri.patientID        = dr["PatientID"] as string;
                    ri.patientName      = dr["EnglishName"] as string;
                    ri.patientLocalName = dr["LocalName"] as string;
                    // ri.patientAlias = dr["Alias"] as string;
                    ri.patientAddress = dr["Address"] as string;
                    ri.patientPhone   = dr["TelePhone"] as string;
                    // ri.patientMarriage = dr["Marriage"] as string;
                    ri.gender           = dr["tRegPatient__Gender"] as string;
                    ri.patientType      = dr["PatientType"] as string;
                    ri.remotePID        = dr["tRegPatient__remotePID"] as string;
                    ri.modality         = dr["Modality"] as string;
                    ri.modalityType     = dr["modalityType"] as string;
                    ri.operationStep    = dr["operationStep"] as string;
                    ri.reportCreater    = dr["tReport__creater"] as string;
                    ri.reportSubmitter  = dr["tReport__submitter"] as string;
                    ri.reportApprover   = dr["tReport__firstApprover"] as string;
                    ri.reportCreateDt   = ReportCommon.ReportCommon.GetDateTime(dr["tReport__createDt"]);
                    ri.reportSubmitDt   = ReportCommon.ReportCommon.GetDateTime(dr["tReport__submitDt"]);
                    ri.reportApproveDt  = ReportCommon.ReportCommon.GetDateTime(dr["tReport__firstApproveDt"]);
                    ri.reportRejectDt   = ReportCommon.ReportCommon.GetDateTime(dr["tReport__rejectDt"]);
                    ri.birthday         = ReportCommon.ReportCommon.GetDateTime(dr["tRegPatient__birthday"]);
                    ri.registerDt       = ReportCommon.ReportCommon.GetDateTime(dr["registerDt"]);
                    ri.examineDt        = ReportCommon.ReportCommon.GetDateTime(dr["examineDt"]);
                    ri.inHospitalRegion = dr["inHospitalRegion"] as string;
                    ri.visitNo          = dr["clinicNo"] as string;
                    ri.bedNo            = dr["bedNo"] as string;
                    ri.isVIP            = ReportCommon.Converter.toInt(dr["isVip"]).ToString();
                    ri.inHospitalNo     = dr["inhospitalNo"] as string;
                    ri.patientComment   = dr["tRegPatient__Comments"] as string;
                    ri.remoteAccNo      = dr["remoteAccNo"] as string;

                    ri.applyDoctor       = dr["tRegOrder__applyDoctor"] as string;
                    ri.visitComments     = dr["tRegOrder__visitComment"] as string;
                    ri.observation       = dr["Observation"] as string;
                    ri.orderComments     = dr["tRegOrder__orderComment"] as string;
                    ri.technician        = dr["technician"] as string;
                    ri.procedureComments = dr["remoteAccNo"] as string;
                    ri.isCharge          = ReportCommon.Converter.toInt(dr["isCharge"]).ToString();

                    string tmp     = "";
                    double dChange = 0;
                    foreach (DataRow tmpDr in dt.Rows)
                    {
                        tmp = tmpDr["tProcedureCode__bodypart"] as string;
                        if (tmp != null)
                        {
                            ri.bodypart += tmp + ", ";
                        }

                        tmp = tmpDr["tRegProcedure__ProcedureCode"] as string;
                        if (tmp != null)
                        {
                            ri.procedureCode += tmp + ", ";
                        }

                        tmp = tmpDr["tProcedureCode__Description"] as string;
                        if (tmp != null)
                        {
                            ri.procedureDesc += tmp + ", ";
                        }

                        double dTmp = System.Convert.ToDouble(tmpDr["charge"]);
                        dChange += dTmp;
                    }
                    ri.bodypart      = ri.bodypart.Trim(", ".ToCharArray());
                    ri.procedureCode = ri.procedureCode.Trim(", ".ToCharArray());
                    ri.procedureDesc = ri.procedureDesc.Trim(", ".ToCharArray());
                    ri.charge        = dChange.ToString();

                    ri.reportCreater_LocalName   = ServerPubFun.GetLocalName(ri.reportCreater);
                    ri.reportSubmitter_LocalName = ServerPubFun.GetLocalName(ri.reportSubmitter);
                    ri.reportApprover_LocalName  = ServerPubFun.GetLocalName(ri.reportApprover);
                    ri.technician__LocalName     = ServerPubFun.GetLocalName(ri.technician);

                    ri.duration = System.Convert.ToString(ri.examineDt - ri.registerDt);

                    Byte[] buff = dr["wys"] as Byte[];
                    if (buff == null)
                    {
                        ri.wys = "";
                    }
                    else
                    {
                        ri.wys = ReportCommon.Converter.GetStringFromBytes(buff);
                    }

                    buff = dr["wyg"] as Byte[];
                    if (buff == null)
                    {
                        ri.wyg = "";
                    }
                    else
                    {
                        ri.wyg = ReportCommon.Converter.GetStringFromBytes(buff);
                    }

                    //buff = dr["wysText"] as Byte[];
                    //if (buff == null)
                    ri.wysText = dr["wysText"] as string;
                    //else
                    //  ri.wysText = ReportCommon.Converter.GetStringFromBytes(buff);

                    // buff = dr["wygText"] as Byte[];
                    //if (buff == null)
                    ri.wygText = dr["wygText"] as string;
                    //else
                    //  ri.wygText = ReportCommon.Converter.GetStringFromBytes(buff);

                    ri.techinfo = System.Convert.ToString(dr["techinfo"]);
                }
            }

            return(ri);
        }
Пример #28
0
        public string GetAllReportColumn()
        {
            try
            {
                if (_strReportInfoColumns != null && _strReportInfoColumns.Length > 0)
                {
                    return(_strReportInfoColumns);
                }


                _strReportInfoColumns = " tRegOrder.OrderGuid as tRegOrder__OrderGuid,tRegOrder.AccNo as tRegOrder__AccNo, tRegOrder.ApplyDept as tRegOrder__ApplyDept, "
                                        + " tRegOrder.ApplyDoctor as tRegOrder__ApplyDoctor, tRegOrder.IsScan as tRegOrder__IsScan, "
                                        + " tRegOrder.Comments as tRegOrder__Comments, tRegOrder.RemoteAccNo as tRegOrder__RemoteAccNo, tRegOrder.TotalFee as tRegOrder__TotalFee,tRegOrder.InitialDomain as tRegOrder__InitialDomain,"
                                        + " tRegOrder.HisID as tRegOrder__HisID, tRegOrder.CardNo as tRegOrder__CardNo, tRegPatient.MedicareNo as tRegPatient__MedicareNo,tRegOrder.ReferralId as tRegOrder__ReferralId,tRegOrder.IsReferral as tRegOrder__IsReferral, "
                                        + " tRegPatient.PatientGuid as tRegPatient__PatientGuid,tRegPatient.GlobalID as tRegPatient__GlobalID, tRegPatient.PatientID as tRegPatient__PatientID, tRegPatient.LocalName as tRegPatient__LocalName, "
                                        + " tRegPatient.EnglishName as tRegPatient__EnglishName, tRegPatient.ReferenceNo as tRegPatient__ReferenceNo, tRegPatient.Birthday as tRegPatient__Birthday,"
                                        + " tRegPatient.Gender as tRegPatient__Gender, tRegPatient.Address as tRegPatient__Address, tRegPatient.Telephone as tRegPatient__Telephone, "
                                        + " tRegPatient.IsVIP as tRegPatient__IsVIP, tRegPatient.Comments as tRegPatient__Comments, tRegPatient.RemotePID as tRegPatient__RemotePID, "
                                        + " tRegPatient.CreateDt as tRegPatient__CreateDt, "
                                        + " tRegProcedure.ProcedureGuid as tRegProcedure__ProcedureGuid, tRegProcedure.ProcedureCode as tRegProcedure__ProcedureCode,"
                                        + " tRegProcedure.ExamSystem as tRegProcedure__ExamSystem, tRegProcedure.WarningTime as tRegProcedure__WarningTime, tRegProcedure.FilmSpec as tRegProcedure__FilmSpec,"
                                        + " tRegProcedure.FilmCount as tRegProcedure__FilmCount, tRegProcedure.ContrastName as tRegProcedure__ContrastName, tRegProcedure.ContrastDose as tRegProcedure__ContrastDose, "
                                        + " tRegProcedure.ImageCount as tRegProcedure__ImageCount, tRegProcedure.ExposalCount as tRegProcedure__ExposalCount, tRegProcedure.Deposit as tRegProcedure__Deposit, "
                                        + " tRegProcedure.Charge as tRegProcedure__Charge, tRegProcedure.ModalityType as tRegProcedure__ModalityType, tRegProcedure.Modality as tRegProcedure__Modality, "
                                        + " tRegProcedure.Registrar as tRegProcedure__Registrar, tRegProcedure.RegisterDt as tRegProcedure__RegisterDt, tRegProcedure.Priority as tRegProcedure__Priority,"
                                        + " tRegProcedure.Technician as tRegProcedure__Technician, tRegProcedure.TechDoctor as tRegProcedure__TechDoctor, tRegProcedure.TechNurse as tRegProcedure__TechNurse, "
                                        + " tRegProcedure.OperationStep as tRegProcedure__OperationStep, tRegProcedure.ExamineDt as tRegProcedure__ExamineDt, tRegProcedure.Mender as tRegProcedure__Mender, "
                                        + " tRegProcedure.ModifyDt as tRegProcedure__ModifyDt, tRegProcedure.IsExistImage as tRegProcedure__IsExistImage, tRegProcedure.Status as tRegProcedure__Status, "
                                        + " tRegProcedure.Comments as tRegProcedure__Comments,  tRegProcedure.IsCharge as tRegProcedure__IsCharge, tRegProcedure.RemoteRPID as tRegProcedure__RemoteRPID, "
                                        + " tRegProcedure.QueueNo as tRegProcedure__QueueNo, tRegProcedure.CreateDt as tRegProcedure__CreateDt, tRegOrder.VisitGuid as tRegOrder__VisitGuid, "
                                        + "  tRegProcedure.Posture as tRegProcedure__Posture, tRegProcedure.MedicineUsage as tRegProcedure__MedicineUsage, "

                                        + "  tRegOrder.InhospitalNo as tRegOrder__InhospitalNo, tRegOrder.ClinicNo as tRegOrder__ClinicNo, tRegOrder.PatientType as tRegOrder__PatientType, tRegOrder.Observation as tRegOrder__Observation,tRegOrder.Optional2 as tRegOrder__Inspection,"
                                        + "  tRegOrder.HealthHistory as tRegOrder__HealthHistory, tRegOrder.InhospitalRegion as tRegOrder__InhospitalRegion, tRegOrder.BedNo as tRegOrder__BedNo,tRegOrder.BedSide as tRegOrder__BedSide, tRegOrder.CreateDt as tRegOrder__CreateDt,"
                                        + "  tRegOrder.CurrentAge as tRegOrder__CurrentAge,tRegOrder.VisitComment as tRegOrder__VisitComment,tRegOrder.ChargeType as tRegOrder__ChargeType, tReport.ReportGuid as tReport__ReportGuid,"
                                        + "  tReport.ReportName as tReport__ReportName, tReport.WYS as tReport__WYS, tReport.WYG as tReport__WYG, tReport.AppendInfo as tReport__AppendInfo, tReport.TechInfo as tReport__TechInfo, "
                                        + "  tReport.ReportText as tReport__ReportText, tReport.DoctorAdvice as tReport__DoctorAdvice, tReport.IsPositive as tReport__IsPositive, tReport.AcrCode as tReport__AcrCode, "
                                        + "  tReport.AcrAnatomic as tReport__AcrAnatomic, tReport.AcrPathologic as tReport__AcrPathologic, tReport.Creater as tReport__Creater, tReport.CreateDt as tReport__CreateDt, tReport.Submitter as tReport__Submitter,"
                                        + "  tReport.SubmitDt as tReport__SubmitDt, tReport.FirstApprover as tReport__FirstApprover, tReport.FirstApproveDt as tReport__FirstApproveDt, tReport.SecondApprover as tReport__SecondApprover, "
                                        + "  tReport.SecondApproveDt as tReport__SecondApproveDt, tReport.IsDiagnosisRight as tReport__IsDiagnosisRight, tReport.KeyWord as tReport__KeyWord, tReport.ReportQuality as tReport__ReportQuality, "
                                        + "  tReport.RejectToObject as tReport__RejectToObject, tReport.Rejecter as tReport__Rejecter, tReport.RejectDt as tReport__RejectDt, tReport.Status as tReport__Status, "
                                        + "  tReport.Comments as tReport__Comments, tReport.DeleteMark as tReport__DeleteMark, tReport.Deleter as tReport__Deleter, "
                                        + "  tReport.DeleteDt as tReport__DeleteDt, tReport.Recuperator as tReport__Recuperator, tReport.ReconvertDt as tReport__ReconvertDt, tReport.Mender as tReport__Mender, "
                                        + "  tReport.ModifyDt as tReport__ModifyDt, tReport.IsPrint as tReport__IsPrint, tReport.CheckItemName as tReport__CheckItemName, tReport.Optional1 as tReport__Optional1, "
                                        + "  tReport.Optional2 as tReport__Optional2, tReport.Optional3 as tReport__Optional3, tReport.IsLeaveWord as tReport__IsLeaveWord, tReport.WYSText as tReport__WYSText, "
                                        + "  tReport.WYGText as tReport__WYGText, tReport.IsDraw as tReport__IsDraw, tReport.DrawerSign as tReport__DrawerSign, tReport.DrawTime as tReport__DrawTime, "
                                        + "  tReport.IsLeaveSound as tReport__IsLeaveSound, tReport.TakeFilmDept as tReport__TakeFilmDept, tReport.TakeFilmRegion as tReport__TakeFilmRegion, "
                                        + "  tReport.PrintTemplateGuid as tReport__PrintTemplateGuid, tReport.Domain as tReport__Domain,"
                                        + "  tReport.TakeFilmComment as tReport__TakeFilmComment, tReport.RebuildMark as tReport__RebuildMark, "
                                        + "  tReport.PrintCopies as tReport__PrintCopies, "
                                        + "  tProcedureCode.ProcedureCode as tProcedureCode__ProcedureCode, tProcedureCode.Description as tProcedureCode__Description, "
                                        + "  tProcedureCode.EnglishDescription as tProcedureCode__EnglishDescription, tProcedureCode.ModalityType as tProcedureCode__ModalityType, "
                                        + "  tProcedureCode.BodyPart as tProcedureCode__BodyPart, tProcedureCode.CheckingItem as tProcedureCode__CheckingItem, "
                                        + "  tProcedureCode.BodyCategory as tProcedureCode__BodyCategory, "
                                        + "  tReport.SubmitDomain as tReport__SubmitDomain, "
                                        + "  tReport.RejectDomain as tReport__RejectDomain, "
                                        + "  tReport.FirstApproveDomain as tReport__FirstApproveDomain, "
                                        + "  tRegPatient.Alias as tRegPatient__Alias, "
                                        + "  tRegPatient.ParentName as tRegPatient__ParentName, "
                                        + "  tRegOrder.curPatientName as tRegOrder__curPatientName,tRegOrder.BodyWeight as tRegOrder__BodyWeight,"
                                        + "  tRegOrder.curGender as tRegOrder__curGender, tRegOrder.IsCharge as tRegOrder__IsCharge,"
                                        + "  tRegOrder.AgeInDays as tRegOrder__AgeInDays, tRegProcedure.Booker as tRegProcedure__Booker,"
                                        + "  tRegProcedure.BookingBeginDt as tRegProcedure__BookingBeginDt, tRegProcedure.BookingEndDt as tRegProcedure__BookingEndDt "
                                        + " , tRegOrder.BookingSite AS tRegOrder__BookingSite, tRegOrder.ExamSite AS tRegOrder__ExamSite, tRegOrder.RegSite AS tRegOrder__RegSite, tRegPatient.Site AS tRegPatient__Site, tReport.FirstApproveSite AS tReport__FirstApproveSite, tReport.RejectSite AS tReport__RejectSite, tReport.SecondApproveSite AS tReport__SecondApproveSite, tReport.SubmitSite AS tReport__SubmitSite "
                                        + " , tRegOrder.ThreeDRebuild AS tRegOrder__ThreeDRebuild "
                                        + " , tReport.ReportQuality2 as tReport__ReportQuality2 "
                                        + " , TREGORDER.ORDERMESSAGE as TREGORDER__ORDERMESSAGE "
                                        + " , TREGORDER.PathologicalFindings as TREGORDER__PathologicalFindings "
                                        + " , TREGORDER.InternalOptional1 as TREGORDER__InternalOptional1 "
                                        + " , TREGORDER.InternalOptional2 as TREGORDER__InternalOptional2 "
                                        + " , TREGORDER.ExternalOptional1 as TREGORDER__ExternalOptional1 "
                                        + " , TREGORDER.ExternalOptional2 as TREGORDER__ExternalOptional2 "
                                        + " , TREGORDER.ExternalOptional3 as TREGORDER__ExternalOptional3 "
                                        + ", tReport.ReportQualityComments as tReport__ReportQualityComments"
                                        + ", tReport.CreaterName as tReport__CreaterName"
                                        + ", tReport.SubmitterName as tReport__SubmitterName"
                                        + ", tReport.FirstApproverName as tReport__FirstApproverName"
                                        + ", tReport.SecondApproverName as tReport__SecondApproverName"
                                        + ", tReport.ScoringVersion as tReport__ScoringVersion"
                                        + ", tReport.AccordRate as tReport__AccordRate"
                                        + ", tReport.SubmitterSign as tReport__SubmitterSign"
                                        + ", tReport.FirstApproverSign as tReport__FirstApproverSign"
                                        + ", tReport.SecondApproverSign as tReport__SecondApproverSign"
                                        + ", tReport.SubmitterSignTimeStamp as tReport__SubmitterSignTimeStamp"
                                        + ", tReport.FirstApproverSignTimeStamp as tReport__FirstApproverSignTimeStamp"
                                        + ", tReport.SecondApproverSignTimeStamp as tReport__SecondApproverSignTimeStamp"
                                        + ", tReport.IsModified as tReport__IsModified"
                                        + ", tRegProcedure.BookerName as tRegProcedure__BookerName"
                                        + ", tRegProcedure.RegistrarName as tRegProcedure__RegistrarName"
                                        + ", tRegProcedure.TechnicianName as tRegProcedure__TechnicianName"
                                        + ", tRegProcedure.UnwrittenCurrentOwner as tRegProcedure__UnwrittenCurrentOwner"
                                        + ", tRegProcedure.UnapprovedCurrentOwner as tRegProcedure__UnapprovedCurrentOwner"
                                        + ", tReport.MenderName as tReport__MenderName"
                                        + ", tRegOrder.InjectDose as tRegOrder__InjectDose"
                                        + ", tRegOrder.InjectTime as tRegOrder__InjectTime"
                                        + ", tRegOrder.BodyHeight as tRegOrder__BodyHeight"
                                        + ", tRegOrder.BloodSugar as tRegOrder__BloodSugar"
                                        + ", tRegOrder.Insulin as tRegOrder__Insulin"
                                        + ", tRegOrder.GoOnGoTime as tRegOrder__GoOnGoTime"
                                        + ", tRegOrder.InjectorRemnant as tRegOrder__InjectorRemnant"
                                        + ", tRegOrder.SubmitHospital as tRegOrder__SubmitHospital"
                                        + ", tRegOrder.SubmitDept as tRegOrder__SubmitDept"
                                        + ", tRegOrder.SubmitDoctor as tRegOrder__SubmitDoctor"
                                        + " , TREGORDER.Optional1 as TREGORDER__Optional1 "
                                        + " , TREGORDER.Optional2 as TREGORDER__Optional2 "
                                        + " , TREGORDER.Optional3 as TREGORDER__Optional3 "
                                        + ", tRegProcedure.RPDesc as tRegProcedure__RPDesc "
                                        + ", tRegProcedure.BodyPart as tRegProcedure__BodyPart"
                                        + ", tRegProcedure.CheckingItem as tRegProcedure__CheckingItem "
                                        + ", TREGPROCEDURE.UNAPPROVEDASSIGNDATE AS TREGPROCEDURE__UNAPPROVEDASSIGNDATE"
                                        + ", TREGPROCEDURE.UNAPPROVEDPREVIOUSOWNER AS TREGPROCEDURE__UNAPPROVEDPREVIOUSOWNER"
                                        + ", TREGPROCEDURE.UNWRITTENASSIGNDATE AS TREGPROCEDURE__UNWRITTENASSIGNDATE"
                                        + ", TREGPROCEDURE.UNWRITTENPREVIOUSOWNER AS TREGPROCEDURE__UNWRITTENPREVIOUSOWNER"
                                        + ", tRegOrder.Assign2site AS tRegOrder__Assign2site"
                                        + ", tRegOrder.CurrentSite AS tRegOrder__CurrentSite"
                                        + ", tRegPatient.SocialSecurityNo AS tRegPatient__SocialSecurityNo"
                                        + ", tRegProcedure.CheckItemName AS tRegProcedure__CheckItemName"
                                        + ", tRegOrder.PhysicalCompany AS tRegOrder__PhysicalCompany"
                                        + ", tRegOrder.PhysicalCompany AS tRegOrder__PhysicalCompany__Desc"
                                        + ", tRegOrder.PhysicalCompany AS tRegOrder__PhysicalCompany__Telephone"
                ;
                //_strReportInfoColumns = rptCol;


                return(_strReportInfoColumns);
                //}
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetAllReportColumn=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return("*");
        }
Пример #29
0
        /// <summary>
        /// GetLocalName
        /// </summary>
        /// <param name="userGuid"></param>
        /// <returns></returns>
        public static string GetLocalName(string userGuid)
        {
            try
            {
                if (userGuid != null && (userGuid = userGuid.Trim()).Length > 0)
                {
                    using (RisDAL dal = new RisDAL())
                    {
                        DataTable dt  = new DataTable();
                        string    sql = "";

                        //multi userguid
                        if (userGuid.Length > Guid.NewGuid().ToString().Length)
                        {
                            string tmp = "'" + userGuid.Replace(",", "','") + "'";
                            sql = "select UserGuid,LocalName from tUser where UserGuid in(" + tmp + ")";
                            dal.ExecuteQuery(sql, dt);
                            if (null != dt && dt.Rows.Count > 0)
                            {
                                tmp = "";
                                foreach (string str in userGuid.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
                                {
                                    DataRow[] drs = dt.Select("UserGuid='" + str + "'");
                                    if (drs.Length > 0)
                                    {
                                        tmp += drs[0]["LocalName"].ToString() + ",";
                                    }
                                    else
                                    {
                                        tmp += str + ",";
                                    }
                                }
                                tmp = tmp.TrimEnd(",".ToCharArray());
                                return(tmp);
                            }
                            return("");
                        }
                        else
                        {
                            sql = "select rolename, tUser.userGuid, LoginName, localName, englishname "
                                  + " from tUser, tRole2User"
                                  + " where tUser.UserGuid = tRole2User.UserGuid"
                                  + " and tUser.UserGuid = '" + userGuid + "'";

                            dal.ExecuteQuery(sql, dt);

                            if (dt != null && dt.Rows.Count > 0)
                            {
                                string retName = dt.Rows[0]["LocalName"].ToString();


                                return(retName);
                            }
                        }
                        if (dal != null)
                        {
                            dal.Dispose();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetLocalName=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return("");
        }
Пример #30
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetReportNameDAO!"));
                }

                string reportGuid = "";
                string rpGuids    = "";

                foreach (string key in paramMap.Keys)
                {
                    if (key.ToUpper() == "REPORTGUID")
                    {
                        reportGuid = paramMap[key] as string;

                        if (reportGuid == null)
                        {
                            reportGuid = "";
                        }
                    }
                    else if (key.ToUpper() == "PROCEDUREGUID")
                    {
                        rpGuids = paramMap[key] as string;

                        if (rpGuids == null)
                        {
                            rpGuids = "";
                        }
                    }
                }

                string sql = "select " + GetAllReportColumn()
                             + " from tRegPatient, tRegOrder, tProcedureCode, tRegProcedure "
                             + " left join tReport on tRegProcedure.reportGuid = tReport.reportGuid "
                             + " where tRegPatient.PatientGuid = tRegOrder.PatientGuid "
                             + " and tRegOrder.OrderGuid = tRegProcedure.OrderGuid "
                             + " and tRegProcedure.ProcedureCode = tProcedureCode.ProcedureCode ";

                string sqlFile = " select distinct tReportFile.* from tReportFile, tReport "
                                 + " where tReportFile.reportGuid = tReport.reportGuid ";



                if (reportGuid.Length > 0)
                {
                    sql += " and tReport.reportGuid = '" + reportGuid + "'";

                    sqlFile += " and tReport.reportGuid = '" + reportGuid + "'";
                }

                if (rpGuids.Length > 0 && reportGuid.Length == 0)
                {
                    rpGuids = rpGuids.Trim(", ".ToCharArray());
                    rpGuids = rpGuids.Replace(",", "','");
                    rpGuids = "'" + rpGuids + "'";

                    sql += " and tRegProcedure.ProcedureGuid in (" + rpGuids + ")";

                    sqlFile += " 1!=1";
                }

                DataSet ds = new DataSet();

                using (RisDAL dal = new RisDAL())
                {
                    //
                    // report info
                    DataTable dt0 = new DataTable("ReportInfo");



                    //ServerPubFun.DeclareOracleNoCase();

                    dal.ExecuteQuery(sql, dt0);

                    ds.Tables.Add(dt0);

                    //
                    // report file
                    DataTable dt1 = new DataTable("ReportFile");



                    dal.ExecuteQuery(sqlFile, dt1);

                    ds.Tables.Add(dt1);

                    if (dal != null)
                    {
                        dal.Dispose();
                    }
                }
                return(ds);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetReportInfoDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }