Example #1
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;
        }
Example #2
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));
            }
        }
Example #3
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);
            }
        }
Example #4
0
        public object Execute(object param)
        {
            Dictionary <string, object> outMap = new Dictionary <string, object>();

            try
            {
                using (RisDAL dal = new RisDAL())
                {
                    #region Parse the parameters

                    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 = "", strGlobalID = "", strDBCenter = "0", strisSR = "";
                    string strHasReportHistory = null;
                    string szStartReportStatus = string.Empty;
                    bool   bOfflineData        = false;

                    foreach (string key in paramMap.Keys)
                    {
                        switch (key.ToUpper())
                        {
                        case "PATIENTGUID":
                        case "PATIENTID":
                        {
                            patientID = paramMap[key] as string;

                            if (patientID == null)
                            {
                                patientID = "";
                            }
                        }
                        break;

                        case "REPORTGUID":
                        case "REPORTID":
                        {
                            reportGuid = paramMap[key] as string;

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

                        case "HASREPORTHISTORY":
                        {
                            strHasReportHistory = paramMap[key] as string;
                        }
                        break;

                        case "GLOBALID":
                        {
                            strGlobalID = paramMap[key] as string;
                        }
                        break;

                        case "DBCENTER":
                        {
                            strDBCenter = paramMap[key] as string;
                        }
                        break;

                        case "STARTREPORTSTATUS":
                        {
                            szStartReportStatus = paramMap[key] as string;
                        }
                        break;

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

                        case "ISSR":
                        {
                            strisSR = paramMap[key] as string;
                        }
                        break;
                        }
                    }

                    if (string.IsNullOrEmpty(szStartReportStatus))
                    {
                        szStartReportStatus = System.Convert.ToInt32(ReportCommon.RP_Status.FirstApprove).ToString();
                    }

                    bool bRelatedPatient = ServerPubFun.GetSystemProfile_Bool("RelatePatient", ReportCommon.ModuleID.Global);

                    #endregion

                    if (strHasReportHistory != null)
                    #region Check whether history reports exist
                    {
                        // We check it using the procedure guid.
                        // Actually clients use the reportGuid to transmit the rpGuids
                        string[] rpGuids       = reportGuid.Split(",".ToCharArray());
                        string   strExpression = "";
                        foreach (string rpguid in rpGuids)
                        {
                            if (string.IsNullOrEmpty(rpguid))
                            {
                                continue;
                            }

                            string tmpRP = rpguid.Trim(",;|. ".ToCharArray());

                            if (string.IsNullOrEmpty(tmpRP))
                            {
                                continue;
                            }

                            strExpression += "'" + tmpRP + "',";
                        }

                        if (!string.IsNullOrEmpty(strExpression))
                        {
                            strExpression = strExpression.TrimEnd(new char[] { ',' });
                            strExpression = string.Format(" AND tRegProcedure.ProcedureGuid not in ({0})", strExpression);
                        }

                        string sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n"
                                     + " select tRegProcedure.reportGuid, tRegProcedure.ProcedureGuid "
                                     + " from tRegPatient with (nolock), tRegOrder with (nolock), tRegProcedure with (nolock) "
                                     + " where tRegPatient.PatientGuid = tRegOrder.PatientGuid"
                                     + " and tRegOrder.OrderGuid = tRegProcedure.OrderGuid"
                                     + " and tRegProcedure.status >= " + szStartReportStatus + strExpression
                                     + " and tRegPatient.PatientID = '" + patientID + "'";

                        if (bRelatedPatient)
                        {
                            sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n"
                                  + " declare @pguid nvarchar(64) select @pguid=RelatedID from tRegPatient where PatientID = '" + patientID + "' "
                                  + " select tRegProcedure.reportGuid, tRegProcedure.ProcedureGuid "
                                  + " from tRegPatient with (nolock), tRegOrder with (nolock), tRegProcedure with (nolock) "
                                  + " where tRegPatient.PatientGuid = tRegOrder.PatientGuid"
                                  + " and tRegOrder.OrderGuid = tRegProcedure.OrderGuid"
                                  + " and tRegProcedure.status >= " + szStartReportStatus + strExpression
                                  + " and ( tRegPatient.PatientID = '" + patientID + "' or (tRegPatient.RelatedID = @pguid AND tRegPatient.RelatedID <> '') )";
                        }

                        DataTable dtReport = dal.ExecuteQuery(sql);
                        if (dtReport == null || dtReport.Rows.Count == 0)
                        {
                            outMap.Add("HasReportHistory", "0");
                            return(outMap);
                        }

                        bool bHasReportHistory = false;
                        bHasReportHistory = dtReport.Rows.Count > 0;

                        outMap.Add("HasReportHistory", bHasReportHistory ? "1" : "0");
                        return(outMap);
                    }
                    #endregion
                    else
                    {
                        DataSet ds = new DataSet();


                        if (patientID != null && patientID.Length > 0)
                        #region History reports
                        {
                            // We check it using the procedure guid.
                            // Actually clients use the reportGuid to transmit the rpGuids
                            string[] rpGuids       = reportGuid.Split(",".ToCharArray());
                            string   strExpression = "";
                            foreach (string rpguid in rpGuids)
                            {
                                if (string.IsNullOrEmpty(rpguid))
                                {
                                    continue;
                                }

                                string tmpRP = rpguid.Trim(",;|. ".ToCharArray());

                                if (string.IsNullOrEmpty(tmpRP))
                                {
                                    continue;
                                }

                                strExpression += "'" + tmpRP + "',";
                            }

                            if (!string.IsNullOrEmpty(strExpression))
                            {
                                strExpression = strExpression.TrimEnd(new char[] { ',' });
                                strExpression = string.Format(" AND tRegProcedure.ProcedureGuid not in ({0})", strExpression);
                            }

                            GetReportInfoDAO_MSSQL rptInfo = new GetReportInfoDAO_MSSQL();
                            string allCol = rptInfo.GetAllReportColumn();

                            allCol = allCol.Replace("tRegPatient.Birthday as tRegPatient__Birthday,", "convert(nvarchar(10), tRegPatient.Birthday, 120) as tRegPatient__Birthday,");
                            allCol = allCol.Replace("tRegProcedure.Status as tRegProcedure__Status", "isnull(cast(tRegProcedure.status as varchar(8)), '50') as tRegProcedure__Status");
                            //allCol = allCol.Replace(", TREGORDER.ORDERMESSAGE as TREGORDER__ORDERMESSAGE", ""); reportlist wys/wyg comparing need show ordermessage
                            allCol = allCol.Replace("tProcedureCode.ProcedureCode as tProcedureCode__ProcedureCode,", "");
                            allCol = allCol.Replace("tProcedureCode.Description as tProcedureCode__Description,", "");
                            allCol = allCol.Replace("tProcedureCode.EnglishDescription as tProcedureCode__EnglishDescription,", "");
                            allCol = allCol.Replace("tProcedureCode.ModalityType as tProcedureCode__ModalityType,", "");
                            allCol = allCol.Replace("tProcedureCode.BodyPart as tProcedureCode__BodyPart,", "");
                            allCol = allCol.Replace("tProcedureCode.CheckingItem as tProcedureCode__CheckingItem,", "");
                            allCol = allCol.Replace("tProcedureCode.BodyCategory as tProcedureCode__BodyCategory,", "");
                            allCol = allCol.Replace("tReport.ScoringVersion as tReport__ScoringVersion,", "");
                            allCol = allCol.Replace("tReport.AccordRate as tReport__AccordRate,", "");
                            string sql = string.Empty;

                            if (bRelatedPatient)
                            {
                                sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n"
                                      + " declare @pguid nvarchar(64) select @pguid=RelatedID from tRegPatient where PatientID = '" + patientID + "' "
                                      + " select " + allCol.Trim(',')
                                      + " ,'1' as localreport, (select ContentHtml from tReportContent where ReportId = tReport.ReportGuid) as ContentHtml, (select NaturalContentHtml from tReportContent where ReportId = tReport.ReportGuid) as NaturalContentHtml 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.status >= " + szStartReportStatus + strExpression;

                                // Here, the latter sentence is obviously faster than "IN" subquery.
                                //sql += " and ( tRegPatient.PatientID = '" + patientID + "'"
                                //    + " or tRegPatient.PatientGuid in (select RelatedID from tRegPatient where PatientID = '" + patientID + "') )";
                                sql += " and ( tRegPatient.PatientID = '" + patientID + "' or (tRegPatient.RelatedID = @pguid AND tRegPatient.RelatedID <> '') )";

                                // Offline Data
                                if (bOfflineData)
                                {
                                    sql += " UNION select " + allCol.Trim(',')
                                           + " ,'1' as localreport from RISArchive..tRegPatient tRegPatient with (nolock), RISArchive..tRegOrder tRegOrder with (nolock), RISArchive..tRegProcedure tRegProcedure with (nolock)"
                                           + "  left join RISArchive..tReport tReport with (nolock) on tRegProcedure.ReportGuid = tReport.ReportGuid "
                                           + " where tRegPatient.PatientGuid = tRegOrder.PatientGuid"
                                           + " and tRegOrder.OrderGuid = tRegProcedure.OrderGuid"
                                           + " and tRegProcedure.status >= " + szStartReportStatus + strExpression;

                                    sql += " and ( tRegPatient.PatientID = '" + patientID + "' or (tRegPatient.RelatedID = @pguid AND tRegPatient.RelatedID <> '') )";
                                }
                            }
                            else
                            {
                                sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n"
                                      + " select " + allCol.Trim(',')
                                      + " ,'1' as localreport, (select ContentHtml from tReportContent where ReportId = tReport.ReportGuid) as ContentHtml, (select NaturalContentHtml from tReportContent where ReportId = tReport.ReportGuid) as NaturalContentHtml 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.status >= " + szStartReportStatus + strExpression;

                                sql += " and tRegPatient.PatientID = '" + patientID + "'";

                                // Offline Data
                                if (bOfflineData)
                                {
                                    sql += " UNION select " + allCol.Trim(',')
                                           + " ,'1' as localreport from RISArchive..tRegPatient tRegPatient with (nolock), RISArchive..tRegOrder tRegOrder with (nolock), RISArchive..tRegProcedure tRegProcedure with (nolock) "
                                           + "  left join RISArchive..tReport tReport with (nolock) on tRegProcedure.ReportGuid = tReport.ReportGuid "
                                           + " where tRegPatient.PatientGuid = tRegOrder.PatientGuid"
                                           + " and tRegOrder.OrderGuid = tRegProcedure.OrderGuid"
                                           + " and tRegProcedure.status >= " + szStartReportStatus + strExpression;

                                    sql += " and tRegPatient.PatientID = '" + patientID + "'";
                                }
                            }

                            sql += " order by tReport__CreateDt desc";

                            DataTable dt = new DataTable("Reports");

                            if (0 == iWrittenCount++ % 100)
                            {
                                ServerPubFun.RISLog_Info(0, "GetReportHistoryDAO_MSSQL=" + sql, "", 0);
                            }
                            else
                            {
                                ServerPubFun.RISLog_Info(0, "GetReportHistoryDAO_MSSQL, patientID=" + patientID + ", iWrittenCount=" + iWrittenCount.ToString(), "", 0);
                            }

                            dal.ExecuteQuery(sql, dt);

                            ds.Tables.Add(dt);
                        }
                        #endregion

                        if (reportGuid != null && reportGuid.Length > 0)
                        #region modify list
                        {
                            string sql = "";
                            if (strisSR == "true")
                            {
                                sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n" +
                                      "select tReportList.*,tReportContentList.ContentHtml,tReportContentList.NaturalContentHtml from tReportList,tReportContentList  "
                                      + " where tReportList.reportGuid = '" + reportGuid + "' and tReportList.ReportListGuid = tReportContentList.ReportListId order by operationTime desc";
                            }
                            else
                            {
                                sql = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED \r\n" +
                                      "select * from tReportList  "
                                      + " where tReportList.reportGuid = '" + reportGuid + "' order by operationTime desc";
                            }


                            DataTable dt = new DataTable("History");

                            if (0 == iWrittenCount++ % 100)
                            {
                                ServerPubFun.RISLog_Info(0, "GetReportHistoryDAO_MSSQL=" + sql, "", 0);
                            }
                            else
                            {
                                ServerPubFun.RISLog_Info(0, "GetReportHistoryDAO_MSSQL, reportGuid=" + reportGuid + ", iWrittenCount=" + iWrittenCount.ToString(), "", 0);
                            }

                            //if (strDBCenter == "1")
                            //{
                            //    KodakDAL okodak = new KodakDAL(2);
                            //    okodak.ExecuteQuery(sql, dt);
                            //}
                            //else
                            //{
                            dal.ExecuteQuery(sql, dt);
                            //}

                            ds.Tables.Add(dt);
                        }
                        #endregion


                        outMap.Add("DataSet", ds);

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

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

            return(null);
        }