Exemplo n.º 1
0
        /// <summary>
        /// 初始化申请报告
        /// </summary>
        /// <param name="applyId"></param>
        private void InitApplyReport(string applyId)
        {
            cbxReports.Items.Clear();

            cbxReports.ComboBox.DisplayMember = "DisplayName";
            cbxReports.ComboBox.ValueMember   = "Value";

            DataTable dtReports = ReportContextModel.GetApplyReport(applyId);

            ItemBind ib = null;

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

            foreach (DataRow dr in dtReports.Rows)
            {
                ReportContextData reportData = new ReportContextData();
                reportData.BindRowData(dr);

                ib = new ItemBind(reportData.报告名称, reportData.报告ID);

                ib.DisplayName = "(" + (dtReports.Rows.IndexOf(dr) + 1) + "/" + dtReports.Rows.Count + ")" + reportData.报告名称;
                ib.Tag         = reportData.部位名称;
                ib.Data        = reportData;

                cbxReports.Items.Add(ib);
            }


            cbxReports.SelectedIndex = 0;
        }
Exemplo n.º 2
0
        private void DrawLabelInfo(ReportContextData reportData)
        {
            string stateInfo = "";

            if (reportData == null)
            {
                stateInfo = "报告人:          ×查阅 ×打印 ×发放 ×PDF";//×完结
            }
            else
            {
                stateInfo = "报告人:" + reportData.报告信息.报告医生 + "  ";

                if (reportData.状态信息.是否可查阅)
                {
                    stateInfo = stateInfo + "√查阅 ";
                }
                else
                {
                    stateInfo = stateInfo + "×查阅 ";
                }

                if (reportData.状态信息.是否已打印)
                {
                    stateInfo = stateInfo + "√打印 ";
                }
                else
                {
                    stateInfo = stateInfo + "×打印 ";
                }

                if (reportData.状态信息.是否已发放)
                {
                    stateInfo = stateInfo + "√发放 ";
                }
                else
                {
                    stateInfo = stateInfo + "×发放 ";
                }

                //if (reportData.状态信息.是否已完结)
                //{
                //    stateInfo = stateInfo + "√完结 ";
                //}
                //else
                //{
                //    stateInfo = stateInfo + "×完结 ";
                //}

                if (reportData.状态信息.是否转PDF)
                {
                    stateInfo = stateInfo + "√PDF ";
                }
                else
                {
                    stateInfo = stateInfo + "×PDF ";
                }
            }

            tsLabState.Text = stateInfo;
        }
Exemplo n.º 3
0
        private void cbxReports_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                ItemBind ib = cbxReports.SelectedItem as ItemBind;

                ReportContextData reportData = null;

                if (ib.Data == null)
                {
                    return;
                }

                reportData = ib.Data as ReportContextData;

                LoadReport(reportData);


                ResetReportState(reportData);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Exemplo n.º 4
0
        private ReportContextData SelectReport()
        {
            if (cbxReports.SelectedItem == null)
            {
                MessageBox.Show("请选择对应的报告项目。", "提示");
                return(null);
            }

            ItemBind ibReport = cbxReports.SelectedItem as ItemBind;

            if (ibReport == null)
            {
                MessageBox.Show("无效的报告项目数据。", "提示");
                return(null);
            }

            if (ibReport.Data == null)
            {
                MessageBox.Show("报告尚未生成,不能进行此操作。", "提示");
                return(null);
            }

            ReportContextData reportData = ibReport.Data as ReportContextData;

            if (reportData == null)
            {
                MessageBox.Show("当前报告信息对象无效,不能进行此操作。", "提示");
                return(null);
            }

            return(reportData);
        }
Exemplo n.º 5
0
        private void ActionOutputToPrint()
        {
            ReportContextData reportData = SelectReport();

            if (reportData == null)
            {
                return;
            }

            //检查报告签名
            if (CheckReportSign(reportData) == false)
            {
                return;
            }

            //检查报告是否被驳回
            if (CheckReportReject(reportData) == false)
            {
                return;
            }

            //TODO:打印限制判断,如普通患者是否终审

            //执行报告打印
            ReportPrint(reportData);
        }
Exemplo n.º 6
0
        private void tscbxReports_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (_isBinding)
                {
                    return;
                }

                if (_preview == null)
                {
                    _preview          = new FormPart.PreviewControl();
                    _preview.ReadOnly = true;
                    _preview.Hide();

                    this.Controls.Add(_preview);
                }

                _preview.ImportByXml("");

                ItemBind ib = tscbxReports.ComboBox.SelectedItem as ItemBind;

                ReportContextData reportData = null;

                if (ib.Data == null)
                {
                    return;
                }

                reportData = ib.Data as ReportContextData;

                _preview.ImportByXml(reportData.报告信息.报告内容);

                //读取对应报告模板信息
                string context = "";
                ReportTemplateItemData reportTemplate = ReportContextModel.GetReportTemplateData(reportData.报告信息.模板ID);
                foreach (JReportSectionItem si in reportTemplate.关联段落.段落关联信息)
                {
                    if (string.IsNullOrEmpty(si.模板元素名))
                    {
                        continue;
                    }

                    object eleContext = _preview.GetItemValue(si.模板元素名);

                    if (eleContext != null && string.IsNullOrEmpty(eleContext.ToString()) == false)
                    {
                        context = context + "■■" + ((string.IsNullOrEmpty(si.段落显示名)) ? si.报告段落名 : si.段落显示名) + ":" + System.Environment.NewLine + eleContext.ToString() + System.Environment.NewLine;
                        context = context + System.Environment.NewLine;
                    }
                }

                richTextBox1.Text = context;
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Exemplo n.º 7
0
        private bool CheckReportReject(ReportContextData reportData)
        {
            if (reportData.状态信息.是否驳回中)
            {
                MessageBox.Show("报告已被驳回不允许进行此操作。", "提示");
                return(false);
            }

            return(true);
        }
Exemplo n.º 8
0
        private bool CheckReportSign(ReportContextData reportData)
        {
            if (string.IsNullOrEmpty(reportData.报告信息.报告医生))
            {
                MessageBox.Show("未签名报告不允许进行此操作。", "提示");
                return(false);
            }

            return(true);
        }
Exemplo n.º 9
0
        public void ShowReject(ReportContextModel reportDbModel, ReportContextData reportData, ILoginUser userData, IWin32Window owner)
        {
            _isOk = false;

            _reportDbModel = reportDbModel;
            _reportData    = reportData;
            _userData      = userData;

            this.ShowDialog(owner);
        }
Exemplo n.º 10
0
        public void ShowManager(ReportContextModel reportDbModel, ReportContextData reportData, ILoginUser userData, ReportPars reportPars, IWin32Window owner)
        {
            _isOk = false;

            _reportDbModel = reportDbModel;
            _reportData    = reportData;
            _userData      = userData;
            _reportPars    = reportPars;

            this.ShowDialog(owner);
        }
Exemplo n.º 11
0
        private void ActionReportPreview()
        {
            ReportContextData reportData = SelectReport();

            if (reportData == null)
            {
                return;
            }

            _reportEdit.preview();
        }
Exemplo n.º 12
0
        private void LoadReport(ReportContextData reportData)
        {
            tsLabCritical.Image     = (reportData.报告信息.是否危急重) ? imageList1.Images[1] : imageList1.Images[0];
            tsLabCritical.ForeColor = (reportData.报告信息.是否危急重) ? Color.FromArgb(255, 150, 150) : Color.FromArgb(224, 224, 224);

            tsLabNP.Image     = (reportData.报告信息.是否阳性) ? imageList1.Images[1] : imageList1.Images[0];
            tsLabNP.ForeColor = (reportData.报告信息.是否阳性) ? Color.Yellow : Color.FromArgb(224, 224, 224);

            _reportEdit.ImportByXml(reportData.报告信息.报告内容);
            _reportEdit.ReadOnly = true;
        }
Exemplo n.º 13
0
        /// <summary>
        /// 获取最后签名信息
        /// </summary>
        /// <param name="reportData"></param>
        /// <returns></returns>
        static public JReportSignItem GetLastSignInfo(ReportContextData reportData)
        {
            if (reportData.签名信息 == null)
            {
                return(null);
            }
            if (reportData.签名信息.签名明细.Count <= 0)
            {
                return(null);
            }

            return(reportData.签名信息.签名明细[reportData.签名信息.签名明细.Count - 1]);
        }
Exemplo n.º 14
0
        private void InitApplyReport(string applyId)
        {
            _isBinding = true;
            try
            {
                tscbxReports.Items.Clear();

                tscbxReports.ComboBox.DisplayMember = "DisplayName";
                tscbxReports.ComboBox.ValueMember   = "Value";

                tscbxReports.ComboBox.DataSource = null;

                DataTable dtReports = ReportContextModel.GetApplyReport(applyId);



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

                ItemBind ib = null;
                foreach (DataRow dr in dtReports.Rows)
                {
                    ReportContextData reportData = new ReportContextData();
                    reportData.BindRowData(dr);

                    ib = new ItemBind(reportData.报告名称, reportData.报告ID);

                    ib.DisplayName = "(" + (dtReports.Rows.IndexOf(dr) + 1) + "/" + dtReports.Rows.Count + ")" + reportData.报告名称;
                    ib.Tag         = reportData.部位名称;
                    ib.Data        = reportData;

                    tscbxReports.ComboBox.Items.Add(ib);
                }
            }
            finally
            {
                _isBinding = false;

                if (tscbxReports.ComboBox.Items.Count > 0)
                {
                    tscbxReports.ComboBox.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 15
0
        public void ShowSignBack(ReportContextModel reportModel,
                                 ReportContextData reportData,
                                 IDBQuery dbHelper,
                                 ILoginUser user,
                                 ReportPars reportPars,
                                 IWin32Window owner)
        {
            _IsOk = false;

            _reportModel = reportModel;
            _reportData  = reportData;
            _dbHelper    = dbHelper;
            _userData    = user;
            _reportPars  = reportPars;

            this.ShowDialog(owner);
        }
Exemplo n.º 16
0
        /// <summary>
        /// 获取最后一次签名的内容
        /// </summary>
        /// <returns></returns>
        static public string GetLastSignContext(ReportContextData reportData)
        {
            JReportSignInfo signInfo = reportData.签名信息;

            for (int i = signInfo.签名明细.Count - 1; i >= 0; i--)
            {
                JReportSignItem signItem = signInfo.签名明细[i];

                if (string.IsNullOrEmpty(signItem.签名报告))
                {
                    continue;
                }

                return(signItem.签名报告);
            }

            return("");
        }
Exemplo n.º 17
0
        /// <summary>
        /// 获取审核次数
        /// </summary>
        /// <param name="reportData"></param>
        /// <returns></returns>
        static public int GetAuditingCount(ReportContextData reportData)
        {
            JReportSignInfo signInfo = reportData.签名信息;

            if (signInfo.签名明细.Count <= 0)
            {
                return(0);
            }

            int    signCount = -1;
            string signName  = reportData.报告信息.报告医生;

            for (int i = 0; i <= signInfo.签名明细.Count - 1; i++)
            {
                JReportSignItem signItem = signInfo.签名明细[i];

                if (i == 0 && signName != signItem.用户名称)
                {
                    return(signCount);
                }

                if (i == 0)
                {
                    //为0 表示诊断签名,如果有签名,需要将signcount设置为0以便后续审核自增
                    signCount = signCount + 1;
                }
                else
                {
                    if (signItem.是否修订 == false && signItem.是否审核)
                    {
                        signCount = signCount + 1;
                    }
                }
            }

            return(signCount);
        }
Exemplo n.º 18
0
        private void ReportPrint(ReportContextData reportData)
        {
            _reportEdit.Print();

            JReportPrintItem printItem = new JReportPrintItem();

            printItem.打印人  = _userData.Name;
            printItem.打印时间 = ReportContextModel.GetServerDate();

            IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());

            printItem.打印站点 = host.HostName;
            if (host.AddressList.Length > 0)
            {
                printItem.打印IP地址 = host.AddressList[0].ToString();
            }

            reportData.打印信息.打印明细.Add(printItem);

            reportData.状态信息.是否已打印 = true;


            ReportContextModel.SaveReportPrint(reportData);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 检查状态改变
        /// </summary>
        /// <param name="reportData"></param>
        /// <returns></returns>
        private bool CheckStateChange(ReportContextData reportData)
        {
            //验证最新报告状态是否有变化
            if (reportData == null)
            {
                return(true);
            }

            JReportStateInfo newState = _reportModel.GetReportStateInfo(reportData.报告ID);

            if (reportData.状态信息.是否已完结)
            {
                MessageBox.Show("报告已被他人完结,请刷新后重设。", "提示");
                return(false);
            }

            if (reportData.状态信息.最后更新时间 != newState.最后更新时间)
            {
                MessageBox.Show("报告最后更新日期与当前不匹配,请刷新后重设。", "提示");
                return(false);
            }

            return(true);
        }
Exemplo n.º 20
0
        /// <summary>
        /// 绘制报告水印
        /// </summary>
        /// <param name="reportData"></param>
        public void DrawReportWater(ReportContextData reportData)
        {
            Font wfont = new Font("宋体", 30, FontStyle.Bold);

            _reportEdit.RemoveWaterMark();

            if (reportData == null)
            {
                return;
            }
            if (reportData.签名信息 == null)
            {
                return;
            }

            if (reportData.状态信息.是否驳回中)
            {
                _reportEdit.DrawWatermark("已驳回", wfont, Color.FromArgb(255, 230, 230));
                return;
            }

            string waterContext = "";
            int    auditCount   = ReportPublic.GetAuditingCount(reportData);

            if (auditCount > 0)
            {
                if (auditCount >= _reportPars.ReportAuditLevel)
                {
                    waterContext = "已终审";
                }
                else
                {
                    if (auditCount == 1)
                    {
                        waterContext = "已一审";
                    }
                    else if (auditCount == 2)
                    {
                        waterContext = "已二审";
                    }
                    else if (auditCount == 3)
                    {
                        waterContext = "已三审";
                    }
                }
            }
            else
            {
                if (reportData.签名信息.签名明细.Count == 1)
                {
                    waterContext = "已报告";
                }
                else if (reportData.签名信息.签名明细.Count > 1)
                {
                    waterContext = "已修订";
                }
            }

            if (string.IsNullOrEmpty(waterContext))
            {
                return;
            }


            _reportEdit.DrawWatermark(waterContext, wfont, Color.FromArgb(255, 230, 230));
        }
Exemplo n.º 21
0
        private void ResetReportState(ReportContextData reportData)
        {
            DrawReportWater(reportData);

            DrawLabelInfo(reportData);
        }
Exemplo n.º 22
0
        public override IBizDataItems QueryDatas(string dataIdentificationName)
        {
            BizDataItems resultDatas = null;
            BizDataItem  dataItem    = null;

            string dataName = _provideDataDesc.FormatDataName(_moduleName, dataIdentificationName);

            switch (dataName)
            {
            case HistoryDataDefine.SelTextContext:    //当前文本内容
                resultDatas = new BizDataItems();
                dataItem    = new BizDataItem();

                dataItem.Add(DataHelper.StdPar_ApplyId, _applyId);
                dataItem.Add(DataHelper.StdPar_Text, richTextBox1.SelectedText);

                resultDatas.Add(dataItem);

                return(resultDatas);

            case HistoryDataDefine.SelHistoryStudy:    //当前选择的历史检查信息

                if (listView1.SelectedItems.Count <= 0)
                {
                    return(null);
                }

                resultDatas = new BizDataItems();
                dataItem    = new BizDataItem();

                dataItem.Add(DataHelper.StdPar_ApplyId, _applyId);

                ListViewItem lvi       = listView1.SelectedItems[0];
                ApplyData    applyData = lvi.Tag as ApplyData;

                dataItem.Add(DataHelper.StdPar_StudyNo, applyData.检查号);
                dataItem.Add("historyapplyid", applyData.申请ID);
                dataItem.Add("historyapplydate", applyData.申请日期);
                dataItem.Add("historyapplyidentify", applyData.申请识别码);
                dataItem.Add("historypatientid", applyData.患者ID);

                resultDatas.Add(dataItem);

                return(resultDatas);

            case HistoryDataDefine.SelHistoryReport:    //当前选择的历史报告
                if (listView1.SelectedItems.Count <= 0)
                {
                    return(null);
                }

                if (tscbxReports.Items.Count <= 0)
                {
                    return(null);
                }

                resultDatas = new BizDataItems();
                dataItem    = new BizDataItem();

                dataItem.Add(DataHelper.StdPar_ApplyId, _applyId);

                //读取历史信息
                ListViewItem lviSel          = listView1.SelectedItems[0];
                ApplyData    reportApplyData = lviSel.Tag as ApplyData;

                dataItem.Add(DataHelper.StdPar_StudyNo, reportApplyData.检查号);
                dataItem.Add("historyapplyid", reportApplyData.申请ID);
                dataItem.Add("historyapplydate", reportApplyData.申请日期);
                dataItem.Add("historyapplyidentify", reportApplyData.申请识别码);
                dataItem.Add("historypatientid", reportApplyData.患者ID);

                //读取报告信息
                ItemBind ib = tscbxReports.ComboBox.SelectedItem as ItemBind;

                if (ib.Data == null)
                {
                    return(null);
                }

                ReportContextData reportData = ib.Data as ReportContextData;

                dataItem.Add("historyreportid", reportData.报告ID);
                dataItem.Add("historyreportname", reportData.报告名称);
                dataItem.Add("historyreportdoctor", reportData.报告信息.报告医生);
                dataItem.Add("historyreportcreatedate", reportData.报告信息.创建时间);

                resultDatas.Add(dataItem);

                return(resultDatas);

            default:
                return(null);
            }
        }