Exemple #1
0
        /// <summary>
        /// 打开指定的文档
        /// </summary>
        /// <param name="document">文档信息</param>
        /// <returns>DataLayer.SystemData.ReturnValue</returns>
        public short OpenDocument(MedDocInfo document)
        {
            this.m_documents = new MedDocList();
            this.m_documents.Add(document);
            this.RefreshFormTitle(null);
            if (document == null || GlobalMethods.Misc.IsEmptyString(document.DOC_ID))
            {
                MessageBoxEx.Show("无法打开文档!文档信息非法!");
                return(SystemData.ReturnValue.FAILED);
            }

            byte[] byteSmdfData = null;
            short  shRet        = EmrDocAccess.Instance.GetDocByID(document.DOC_ID, ref byteSmdfData);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("无法打开文档!文档数据下载失败!");
                return(shRet);
            }
            //编辑器控件加载文档
            shRet = this.medEditor1.OpenDocument(byteSmdfData, false, document.DOC_ID, document.DOC_TITLE);
            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("无法打开文档!文档数据加载失败!");
                return(shRet);
            }
            return(SystemData.ReturnValue.OK);
        }
Exemple #2
0
        private void metroTextBox1_TextChanged(object sender, EventArgs e)
        {
            string     szDocID = this.txtCaseNo.Text.Trim();
            MedDocInfo docInfo = null;
            short      shRet   = EmrDocAccess.Instance.GetDocInfo(szDocID, ref docInfo);

            if (docInfo == null)
            {
                return;
            }
            string       szPatientID   = docInfo.PATIENT_ID;
            string       szVisitNo     = docInfo.VISIT_ID;//文书VisitID存了 VisitNo
            PatVisitInfo patVisitInfos = null;

            shRet = PatVisitAccess.Instance.GetPatVisit(szPatientID, szVisitNo, ref patVisitInfos);

            List <MedDocInfo> lstMedDocInfos = null;

            shRet = EmrDocAccess.Instance.GetDocList(szPatientID, szVisitNo, ref lstMedDocInfos);
            if (lstMedDocInfos == null)
            {
                return;
            }
            List <RecPaper> lstRecPapers = new List <RecPaper>();

            shRet = RecPaperAccess.Instance.GetRecPapers(szPatientID, szVisitNo, ref lstRecPapers);

            string[] arrSignKeyName = DataCache.Instance.DicHdpParameter[SystemData.ConfigKey.SignKeyName] != null?null: DataCache.Instance.DicHdpParameter[SystemData.ConfigKey.SignKeyName].Split('|');
            int      rowIndex       = 0;

            this.dataGridView1.Rows.Clear();
        }
Exemple #3
0
        /// <summary>
        /// 判断是否需要下载最新的XML文档
        /// </summary>
        /// <param name="docInfo"></param>
        /// <param name="szCacheFile"></param>
        /// <returns></returns>
        private bool IsNeedDoanLoadXml(MedDocInfo docInfo, string szCacheFile)
        {
            //不存在文件则重新下载
            if (!System.IO.File.Exists(szCacheFile))
            {
                return(true);
            }
            XmlDocument doc = new XmlDocument();

            doc.Load(szCacheFile);
            XmlNode node = null;

            if (docInfo.EMR_TYPE != "HEREN")
            {
                node = doc.SelectSingleNode("EmrDoc/DocHeader/DocInfo/ModifyTime");
            }
            else
            {
                node = doc.SelectSingleNode("EmrDoc/DocInfo/ModifyTime");
            }
            if (node == null)
            {
                return(true);
            }
            DateTime modifyTime = docInfo.DefaultTime;

            DateTime.TryParse(node.InnerText, out modifyTime);
            if (docInfo.MODIFY_TIME > modifyTime)
            {
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// 将数据信息加载到DataGridView中
        /// </summary>
        /// <param name="row"></param>
        /// <param name="qcWorkloadStatInfo"></param>
        private void SetRowData(DataGridViewRow row, MedDocInfo docInfo)
        {
            if (row == null || docInfo == null)
            {
                return;
            }
            if (row.DataGridView == null)
            {
                return;
            }

            row.Cells[this.colDeptName.Index].Value      = docInfo.DEPT_NAME;
            row.Cells[this.colPatientID.Index].Value     = docInfo.PATIENT_ID;
            row.Cells[this.colPatientName.Index].Value   = docInfo.PATIENT_NAME;
            row.Cells[this.colVisitTime.Index].Value     = docInfo.VISIT_TIME.ToString("yyyy-MM-dd HH:mm");
            row.Cells[this.col_DOC_TIME.Index].Value     = docInfo.DOC_TIME.ToString("yyyy-MM-dd HH:mm");
            row.Cells[this.col_DOC_TITLE.Index].Value    = docInfo.DOC_TITLE;
            row.Cells[this.col_RECORD_TIME.Index].Value  = docInfo.RECORD_TIME.ToString("yyyy-MM-dd HH:mm");
            row.Cells[this.col_CREATOR_NAME.Index].Value = docInfo.CREATOR_NAME;
            if (docInfo.DischargeTime != docInfo.DefaultTime)
            {
                row.Cells[this.colDischargeTime.Index].Value = docInfo.DischargeTime.ToString("yyyy-MM-dd HH:mm");
            }
            row.Tag = docInfo;
        }
        private void dgvMainList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            if (this.dgvMainList.SelectedRows.Count <= 0)
            {
                this.dgvDetailList.SuspendLayout();
                this.dgvDetailList.Rows.Clear();
                this.dgvDetailList.ResumeLayout();
                return;
            }
            this.ShowStatusMessage("正在下载病历文档数据,请稍候...");
            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);

            MedDocInfo docInfo = this.dgvMainList.SelectedRows[0].Tag as  MedDocInfo;

            if (docInfo != null)
            {
                this.LoadDocList(docInfo.DOC_SETID, docInfo.MODIFIER_ID);
            }
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
        private void mnuOpenDoc_Click(object sender, EventArgs e)
        {
            if (this.MainForm == null || this.MainForm.IsDisposed)
            {
                return;
            }
            DataGridViewRow selectRow = this.dgvDetailList.SelectedRows[0];

            if (selectRow == null)
            {
                return;
            }

            MedDocInfo docInfo = selectRow.Tag as  MedDocInfo;

            if (docInfo == null)
            {
                return;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在下载并打开病历,请稍候...");
            this.MainForm.OpenDocument(docInfo);
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
Exemple #7
0
        /// <summary>
        /// 质控人员打开历史病历
        /// </summary>
        /// <returns>DataLayer.SystemData.ReturnValue</returns>
        public short OpenHistoryDocument(EMRDBLib.MedicalQcMsg questionInfo)
        {
            MedDocInfo docInfo = new MedDocInfo();

            docInfo.PATIENT_ID   = questionInfo.PATIENT_ID;
            docInfo.VISIT_ID     = questionInfo.VISIT_ID;
            docInfo.DOC_SETID    = questionInfo.TOPIC_ID;
            docInfo.DOC_TITLE    = questionInfo.TOPIC;
            docInfo.CREATOR_NAME = questionInfo.ISSUED_BY;
            docInfo.DOC_TIME     = questionInfo.ISSUED_DATE_TIME;
            docInfo.DOC_ID       = questionInfo.TOPIC_ID;
            this.m_documents     = new MedDocList();
            this.m_documents.Add(docInfo);
            this.RefreshFormTitle(null);
            byte[] byteSmdfData = null;
            string szRemoteFile = SystemParam.Instance.GetQCFtpDocPath(questionInfo, "smdf");
            short  shRet        = EmrDocAccess.Instance.GetFtpHistoryDocByID(docInfo.DOC_SETID, questionInfo.ISSUED_DATE_TIME, szRemoteFile, ref byteSmdfData);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("无法打开文档!文档数据下载失败!");
                return(shRet);
            }
            //编辑器控件加载文档
            bool result = textEditor1.LoadDocument2(byteSmdfData);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("无法打开文档!文档数据加载失败!");
                return(shRet);
            }
            this.textEditor1.ReviseEnabled = true;
            return(SystemData.ReturnValue.OK);
        }
        /// <summary>
        /// 根据文档集ID查询病历列表并显示在列表中
        /// </summary>
        /// <param name="szDocSetID">文档集ID</param>
        /// <param name="szModifierID">修改者ID</param>
        private void LoadDocList(string szDocSetID, string szModifierID)
        {
            this.dgvDetailList.Rows.Clear();
            if (string.IsNullOrEmpty(szDocSetID))
            {
                return;
            }
            List <MedDocInfo> lstDocInfo = null;
            short             shRet      = EmrDocAccess.Instance.GetDocInfoBySetID(szDocSetID, ref lstDocInfo);

            if (shRet != SystemData.ReturnValue.OK || lstDocInfo == null)
            {
                return;
            }

            for (int index = 0; index < lstDocInfo.Count; index++)
            {
                MedDocInfo docInfo = lstDocInfo[index];
                if (docInfo.DOC_VERSION == 1)
                {
                    continue;
                }
                if (docInfo.MODIFIER_ID != szModifierID)
                {
                    continue;
                }

                int             rowIndex = this.dgvDetailList.Rows.Add();
                DataGridViewRow row      = this.dgvDetailList.Rows[rowIndex];
                row.Cells[this.colModifyDate.Index].Value = docInfo.MODIFY_TIME;
                row.Cells[this.colDeptName.Index].Value   = docInfo.DEPT_NAME;
                row.Cells[this.colCreateTime.Index].Value = docInfo.DOC_TIME;
                row.Tag = docInfo;
            }
        }
        ///<summary>
        /// 记录质控者阅读病历日志信息
        /// </summary>
        /// <param name="lstDocInfo">病历文档信息列表</param>
        /// <param name="dtCheckTime">检查时间</param>
        /// <param name="node">当前节点</param>
        private void SaveReadLogInfo(MedDocInfo docInfo, DateTime dtCheckTime, VirtualNode node)
        {
            if (string.IsNullOrEmpty(docInfo.DOC_SETID))
            {
                return;
            }

            EMRDBLib.MedicalQcLog qcActionLog = new EMRDBLib.MedicalQcLog();
            qcActionLog.PATIENT_ID    = SystemParam.Instance.PatVisitInfo.PATIENT_ID;
            qcActionLog.VISIT_ID      = SystemParam.Instance.PatVisitInfo.VISIT_ID;
            qcActionLog.DEPT_STAYED   = SystemParam.Instance.PatVisitInfo.DEPT_CODE;
            qcActionLog.DOC_SETID     = docInfo.DOC_SETID;
            qcActionLog.CHECKED_BY    = SystemParam.Instance.UserInfo.USER_NAME;
            qcActionLog.CHECKED_ID    = SystemParam.Instance.UserInfo.USER_ID;
            qcActionLog.DEPT_CODE     = SystemParam.Instance.UserInfo.DEPT_CODE;
            qcActionLog.DEPT_NAME     = SystemParam.Instance.UserInfo.DEPT_NAME;
            qcActionLog.CHECK_TYPE    = 0;
            qcActionLog.CHECK_DATE    = dtCheckTime;
            qcActionLog.LOG_TYPE      = 1;
            qcActionLog.LOG_DESC      = "质控者阅读病历";
            qcActionLog.AddQCQuestion = false;
            short shRet = MedicalQcLogAccess.Instance.Insert(qcActionLog);

            if (shRet != SystemData.ReturnValue.OK)
            {
                return;
            }

            node.SubItems[5].Text      = "是";
            node.SubItems[6].Text      = dtCheckTime.ToString("yyyy-MM-dd HH:mm:ss");
            node.SubItems[6].ForeColor = Color.Blue;
        }
Exemple #10
0
        /// <summary>
        /// 打开指定的文档
        /// </summary>
        /// <param name="document">文档信息</param>
        /// <returns>DataLayer.SystemData.ReturnValue</returns>
        public short OpenDocument(MedDocInfo document)
        {
            this.m_documents = new MedDocList();
            this.m_documents.Add(document);
            this.RefreshFormTitle(null);
            if (document == null || GlobalMethods.Misc.IsEmptyString(document.DOC_ID))
            {
                MessageBoxEx.Show("无法打开文档!文档信息非法!");
                return(SystemData.ReturnValue.FAILED);
            }

            byte[] byteSmdfData = null;
            short  shRet        = SystemData.ReturnValue.OK;

            shRet = EmrDocAccess.Instance.GetDocByID(document.DOC_ID, ref byteSmdfData);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("无法打开文档!文档数据下载失败!");
                return(shRet);
            }

            //编辑器控件加载文档
            this.textEditor1.LoadDocument2(byteSmdfData);
            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("无法打开文档!文档数据加载失败!");
                return(shRet);
            }
            this.AppendHistory(SystemParam.Instance.UserInfo);
            this.GoSection(document);

            return(SystemData.ReturnValue.OK);
        }
Exemple #11
0
        /// <summary>
        /// 合并打开指定的一系列文档
        /// </summary>
        /// <param name="documents">文档信息</param>
        /// <returns>DataLayer.SystemData.ReturnValue</returns>
        public short OpenDocument(MedDocList documents)
        {
            this.m_documents = documents;
            if (documents == null || documents.Count <= 0)
            {
                return(SystemData.ReturnValue.CANCEL);
            }

            MedDocInfo firstDocInfo = documents[0];

            this.RefreshFormTitle(null);

            WorkProcess.Instance.Initialize(this, documents.Count
                                            , string.Format("正在下载“{0}”,请稍候...", firstDocInfo.DOC_TITLE));

            //下载第一份文档
            byte[] byteDocData = null;
            short  shRet       = EmrDocAccess.Instance.GetDocByID(firstDocInfo.DOC_ID, ref byteDocData);

            if (shRet != SystemData.ReturnValue.OK)
            {
                WorkProcess.Instance.Close();
                MessageBoxEx.Show(this, string.Format("文档“{0}”下载失败!", firstDocInfo.DOC_TITLE));
                return(SystemData.ReturnValue.FAILED);
            }

            if (WorkProcess.Instance.Canceled)
            {
                WorkProcess.Instance.Close();
                return(SystemData.ReturnValue.CANCEL);
            }

            return(SystemData.ReturnValue.OK);
        }
Exemple #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            //查询文档
            string szDocID = this.txtDocID.Text;

            if (string.IsNullOrEmpty(szDocID))
            {
                MessageBox.Show("请输入文档ID号");
                return;
            }
            MedDocInfo medDocInfo = null;
            short      shRet      = EmrDocAccess.Instance.GetDocInfo(szDocID, ref medDocInfo);

            if (medDocInfo == null)
            {
                MessageBoxEx.ShowError("查找文档信息失败");
                return;
            }
            if (!string.IsNullOrEmpty(SystemParam.Instance.LocalConfigOption.IgnoreDocTypeIDs) &&
                SystemParam.Instance.LocalConfigOption.IgnoreDocTypeIDs.Contains(medDocInfo.DOC_TYPE))
            {
                MessageBoxEx.Show(string.Format("{0}已忽略分析,忽略DocTypeIDs有{1}"
                                                , medDocInfo.DOC_TITLE
                                                , SystemParam.Instance.LocalConfigOption.IgnoreDocTypeIDs));
                return;
            }
            Editor.Instance.ParentControl = this;
            string szTextData = Editor.Instance.GetDocText(medDocInfo);

            if (this.m_bugCheckEngine == null)
            {
                this.m_bugCheckEngine = new BugCheckEngine();
            }
            m_bugCheckEngine.PatientInfo = GetPatientInfo(medDocInfo.PATIENT_ID, medDocInfo.VISIT_ID);
            m_bugCheckEngine.VisitInfo   = GetVisitInfo(medDocInfo.PATIENT_ID, medDocInfo.VISIT_ID);
            m_bugCheckEngine.UserInfo    = GetUserInfo();
            m_bugCheckEngine.DocType     = medDocInfo.DOC_TITLE;
            m_bugCheckEngine.DocText     = szTextData;
            shRet = m_bugCheckEngine.InitializeEngine();
            if (shRet != SystemData.ReturnValue.OK)
            {
                LogManager.Instance.WriteLog(string.Format("{0} 病历质控引擎初始化失败,无法对病历进行自动质控!", DateTime.Now), null,
                                             LogType.Information);
            }
            //检查文档内容缺陷
            List <DocuemntBugInfo> lstDocuemntBugList = null;

            if (shRet == SystemData.ReturnValue.OK)
            {
                lstDocuemntBugList       = m_bugCheckEngine.PerformBugCheck();
                m_bugCheckEngine.DocText = null;
            }
            //检查文档元素缺陷
            List <ElementBugInfo> lstElementBugList = null;

            Editor.Instance.CheckElementBugs(medDocInfo.EMR_TYPE, ref lstElementBugList);
            LoadGridBugs(lstDocuemntBugList, lstElementBugList);
        }
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex > this.dataGridView1.Rows.Count - 1)
            {
                return;
            }
            if (e.ColumnIndex > this.dataGridView1.Columns.Count - 1)
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            DataGridViewRow row             = this.dataGridView1.Rows[e.RowIndex];
            TimeCheckResult checkResultInfo = row.Tag as TimeCheckResult;

            if (checkResultInfo == null || GlobalMethods.Misc.IsEmptyString(checkResultInfo.DocID))
            {
                return;
            }
            if (this.MainForm == null || this.MainForm.IsDisposed)
            {
                return;
            }
            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在准备打开病历,请稍候...");

            MedDocInfo docInfo = null;
            short      shRet   = EmrDocAccess.Instance.GetDocInfo(checkResultInfo.DocID, ref docInfo);

            if (shRet == SystemData.ReturnValue.OK)
            {
                PatVisitInfo patVisitInfo = null;
                shRet = PatVisitAccess.Instance.GetPatVisit(docInfo.PATIENT_ID, docInfo.VISIT_ID, ref patVisitInfo);
                if (shRet != SystemData.ReturnValue.OK)
                {
                    MessageBoxEx.Show("患者信息查找失败,无法打开病历!");
                    this.ShowStatusMessage(null);
                    GlobalMethods.UI.SetCursor(this, Cursors.Default);
                    return;
                }
                this.MainForm.SwitchPatient(patVisitInfo, docInfo);
            }
            //this.MainForm.OpenDocument(docInfo);
            else
            {
                MessageBoxEx.Show("病历详细信息下载失败,无法打开病历!");
            }

            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
Exemple #14
0
 public void OpenDocument(MedDocInfo docInfo)
 {
     foreach (DockContent item in this.dockPanel1.Contents)
     {
         if (item is DocumentListNewForm)
         {
             DocumentListNewForm frm = item as DocumentListNewForm;
             frm.Activate();
             frm.OpenDocument(docInfo);
         }
     }
 }
Exemple #15
0
        /// <summary>
        /// 获取指定病历的时间与当前检查结果的时间差
        /// </summary>
        /// <param name="docInfo">病历信息</param>
        /// <returns>long</returns>
        internal long TimeSpan(MedDocInfo docInfo)
        {
            if (docInfo == null)
            {
                return(-1);
            }

            if (docInfo.DOC_TIME == docInfo.DefaultTime)
            {
                return(-1);
            }
            return(docInfo.DOC_TIME.Ticks - this.m_dtStartTime.Ticks);
        }
Exemple #16
0
        internal void GoSection(MedDocInfo docInfo)
        {
            this.Text            = docInfo.DOC_TITLE;
            this.m_documents[0]  = docInfo;
            this.m_ClickDocument = docInfo;
            SectionInfo section = this.TextEditor.GetSection(docInfo.DOC_ID, MatchMode.ID);

            if (this.TextEditor.GotoSection(section))
            {
                this.TextEditor.ScrollToView();
                this.TextEditor.SelectCurrentLine();
            }
        }
Exemple #17
0
        private void txtDocID_TextChanged(object sender, EventArgs e)
        {
            string     szDocID = this.txtDocID.Text;
            MedDocInfo docInfo = null;
            short      shRet   = EmrDocAccess.Instance.GetDocInfo(szDocID, ref docInfo);

            if (docInfo == null)
            {
                return;
            }
            this.txt_PATIENT_ID.Text = docInfo.PATIENT_ID;
            SearchRecPack();
        }
Exemple #18
0
        private void btnReceive_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.Rows.Count <= 0)
            {
                return;
            }
            short shRet = SystemData.ReturnValue.OK;

            foreach (DataGridViewRow item in this.dataGridView1.Rows)
            {
                RecPaper   recPaper = item.Cells[this.colCheckBox.Index].Tag as RecPaper;
                MedDocInfo doc      = item.Tag as MedDocInfo;
                if (item.Cells[this.colCheckBox.Index].Value != null &&
                    item.Cells[this.colCheckBox.Index].Value.ToString().ToLower() == "true")
                {
                    if (recPaper != null)
                    {
                        recPaper.PAPER_STATE = SystemData.PaperState.Receive;
                        shRet = RecPaperAccess.Instance.Update(recPaper);
                    }
                    else
                    {
                        recPaper             = new RecPaper();
                        recPaper.PAPER_ID    = recPaper.MakeID();
                        recPaper.DOC_ID      = doc.DOC_ID;
                        recPaper.VISIT_ID    = doc.VISIT_ID;
                        recPaper.VISIT_NO    = doc.VISIT_ID;
                        recPaper.PAPER_STATE = SystemData.PaperState.Receive;
                        recPaper.PATIENT_ID  = doc.PATIENT_ID;
                        shRet = RecPaperAccess.Instance.Insert(recPaper);
                    }
                    if (shRet != SystemData.ReturnValue.OK)
                    {
                        MessageBoxEx.ShowError("操作失败");
                        return;
                    }
                    //item.Cells[this.colCheckBox.Index].Value = true;
                }
                else
                {
                    if (recPaper != null)
                    {
                        recPaper.PAPER_STATE = SystemData.PaperState.UnReceive;
                        shRet = RecPaperAccess.Instance.Update(recPaper);
                    }
                    //item.Cells[this.colCheckBox.Index].Value = false;
                }
            }
            MessageBoxEx.ShowMessage("操作成功");
        }
        private void virtualTree1_NodeMouseClick(object sender, VirtualTreeEventArgs e)
        {
            this.m_SelectedNode = e.Node;
            //显示质检问题
            if (this.MainForm == null || this.MainForm.IsDisposed)
            {
                return;
            }
            if (e.Node == null || e.Type == HitTestType.None)
            {
                return;
            }
            MedDocInfo docInfo = e.Node.Data as MedDocInfo;

            this.MainForm.ShowQuestionListByDocInfo(docInfo);
        }
Exemple #20
0
        private bool LoadMeddoc(MedDocInfo meddocInfo, ref byte[] docBytes)
        {
            if (meddocInfo == null || string.IsNullOrEmpty(meddocInfo.EMR_TYPE))
            {
                return(false);
            }

            short shRet = EmrDocAccess.Instance.GetDocByID(meddocInfo.DOC_ID, ref docBytes);

            if (shRet != SystemData.ReturnValue.OK || docBytes == null || docBytes.Length <= 0)
            {
                return(false);
            }

            return(true);
        }
 private static void GetCnNameSignCode(MedDocInfo docInfo, VirtualSubItem subItem)
 {
     if (string.IsNullOrEmpty(docInfo.SIGN_CODE))
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.CREATOR_SAVE_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.CREATOR_SAVE)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.CREATOR_SAVE_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.CREATOR_COMMIT)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.CREATOR_COMMIT_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.PARENT_SAVE)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.PARENT_SAVE_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.SUPER_SAVE)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.SUPER_SAVE_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.CREATOR_COMMIT)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.CREATOR_COMMIT_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.PARENT_COMMIT)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.PARENT_COMMIT_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.SUPER_COMMIT)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.SUPER_COMMIT_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.PARENT_ROLLBACK)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.PARENT_ROLLBACK_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.SUPER_ROLLBACK)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.SUPER_ROLLBACK_CH;
     }
     else if (docInfo.SIGN_CODE == MedDocSys.DataLayer.SystemData.SignState.QC_ROLLBACK)
     {
         subItem.Text = MedDocSys.DataLayer.SystemData.SignState.QC_ROLLBACK_CH;
     }
 }
Exemple #22
0
        /// <summary>
        /// 获取选中节点的病历文档的标题和文档集ID
        /// </summary>
        /// <param name="selectedNode">当前节点</param>
        /// <param name="szDocSetID">文档集ID</param>
        /// <param name="szDocTitle">文档标题</param>
        private void GetSelectedNodeInfo(VirtualNode selectedNode, ref MedDocInfo meddocInfo)
        {
            MedDocInfo docInfo = selectedNode.Data as MedDocInfo;

            if (SystemParam.Instance.PatVisitInfo == null)
            {
                return;
            }

            if (docInfo != null)
            {
                meddocInfo.DOC_TITLE = docInfo.DOC_TITLE;
                if (docInfo.EMR_TYPE != "BAODIAN" && docInfo.EMR_TYPE != "CHENPAD" &&
                    docInfo.EMR_TYPE != "HEREN")
                {
                    meddocInfo.DOC_SETID = string.Empty;
                }
                else
                {
                    meddocInfo.DOC_SETID = docInfo.DOC_SETID;
                }
                meddocInfo.CREATOR_NAME = docInfo.CREATOR_NAME;
                meddocInfo.CREATOR_ID   = docInfo.CREATOR_ID;
                meddocInfo.DEPT_CODE    = docInfo.DEPT_CODE;
                meddocInfo.DEPT_NAME    = docInfo.DEPT_NAME;
            }
            else if (selectedNode.Data.Equals(COMBIN_NODE_TAG))
            {
                meddocInfo.DOC_TITLE = string.Concat(SystemParam.Instance.PatVisitInfo.PATIENT_NAME, "的病历");
            }
            else if (selectedNode.Data.Equals(DOCTOR_NODE_TAG))
            {
                meddocInfo.DOC_TITLE = "医生写的病历";
            }
            else if (selectedNode.Data.Equals(NURSE_NODE_TAG))
            {
                meddocInfo.DOC_TITLE = "护士写的病历";
            }
            else if (selectedNode.Data.Equals(UNKNOWN_NODE_TAG))
            {
                meddocInfo.DOC_TITLE = "未被归类的病历";
            }
            else
            {
                meddocInfo.DOC_TITLE = string.Concat(SystemParam.Instance.PatVisitInfo.PATIENT_NAME, "的以往旧病历");
            }
        }
Exemple #23
0
        /// <summary>
        /// 将数据信息加载到DataGridView中
        /// </summary>
        /// <param name="row"></param>
        /// <param name="qcWorkloadStatInfo"></param>
        private void SetRowData(DataGridViewRow row, MedDocInfo docInfo)
        {
            if (row == null || docInfo == null)
            {
                return;
            }
            if (row.DataGridView == null)
            {
                return;
            }


            row.Cells[this.colPatientID.Index].Value   = docInfo.PATIENT_ID;
            row.Cells[this.colPatientName.Index].Value = docInfo.PATIENT_NAME;

            row.Tag = docInfo;
        }
Exemple #24
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            DeptInfo deptInfo   = this.cboDeptName.SelectedItem as DeptInfo;
            string   szDeptCode = null;

            if (deptInfo != null)
            {
                szDeptCode = deptInfo.DEPT_CODE;
            }
            if (string.IsNullOrEmpty(this.cboDeptName.Text))
            {
                szDeptCode = null;
            }


            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在查询数据,请稍候...");
            this.dataGridView1.Rows.Clear();
            List <MedDocInfo> lstMedDocInfos = null;

            //short shRet = EmrDocAccess.Instance.GetEmrDocList(szTimeType,szDocTypeIDListCondition, dtBeginTime, dtEndTime, szDeptCode, ref lstMedDocInfos);
            //if (shRet != SystemData.ReturnValue.OK
            //    && shRet != SystemData.ReturnValue.RES_NO_FOUND)
            //{
            //    GlobalMethods.UI.SetCursor(this, Cursors.Default);
            //    MessageBoxEx.Show("查询数据失败!");
            //    return;
            //}
            if (lstMedDocInfos == null || lstMedDocInfos.Count <= 0)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                MessageBoxEx.Show("没有符合条件的数据!", MessageBoxIcon.Information);
                return;
            }
            int nRowIndex = 0;

            for (int index = 0; index < lstMedDocInfos.Count; index++)
            {
                MedDocInfo item = lstMedDocInfos[index];
                nRowIndex = this.dataGridView1.Rows.Add();
                DataGridViewRow row = this.dataGridView1.Rows[nRowIndex];
                this.SetRowData(row, item);
            }
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
 public void SelectDocNodeByDocSetID(VirtualNode node, string szDocSetId)
 {
     if (string.IsNullOrEmpty(szDocSetId))
     {
         return;
     }
     if (node == null)
     {
         foreach (VirtualNode item in this.virtualTree1.Nodes)
         {
             if (item == null)
             {
                 continue;
             }
             SelectDocNodeByDocSetID(item, szDocSetId);
         }
     }
     else
     {
         if (node.Nodes.Count > 0)
         {
             foreach (VirtualNode item in node.Nodes)
             {
                 if (item == null)
                 {
                     continue;
                 }
                 SelectDocNodeByDocSetID(item, szDocSetId);
             }
         }
         else
         {
             MedDocInfo docInfo = node.Data as MedDocInfo;
             if (docInfo == null)
             {
                 return;
             }
             if (docInfo.DOC_SETID == szDocSetId)
             {
                 this.virtualTree1.SelectedNode = node;
                 this.m_SelectedNode            = node;
                 return;
             }
         }
     }
 }
Exemple #26
0
        /// <summary>
        /// 检查指定的病历信息是否在当前检查结果起止时间内
        /// </summary>
        /// <param name="docInfo">病历信息</param>
        /// <returns>bool</returns>
        internal bool IsTimeBetween(MedDocInfo docInfo)
        {
            if (docInfo == null)
            {
                return(false);
            }

            if (docInfo.RECORD_TIME == docInfo.DefaultTime)
            {
                return(docInfo.DOC_TIME >= this.m_dtStartTime &&
                       docInfo.DOC_TIME <= this.m_dtEndTime);
            }
            else
            {
                return(docInfo.RECORD_TIME >= this.m_dtStartTime &&
                       docInfo.RECORD_TIME <= this.m_dtEndTime);
            }
        }
        /// <summary>
        /// 刷新患者当次就诊产生的病程记录
        /// </summary>
        public override void OnRefreshView()
        {
            base.OnRefreshView();
            this.Update();
            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在刷新病程记录,请稍候...");
            if (this.m_htQCActionLog == null)
            {
                this.m_htQCActionLog = new Hashtable();
            }
            else
            {
                this.m_htQCActionLog.Clear();
            }
            this.GetQCMsgInfo();
            this.GetQCActionLogInfo();
            this.virtualTree1.Nodes.Clear();
            string szDocSetID = string.Empty;

            if (this.m_SelectedNode != null)
            {
                MedDocInfo docInfo = this.m_SelectedNode.Data as MedDocInfo;
                if (docInfo != null)
                {
                    szDocSetID = docInfo.DOC_SETID;
                }
            }
            this.m_SelectedNode = null;
            //新版和仁编辑器加载方式和老版本有差别
            if (SystemParam.Instance.LocalConfigOption.DefaultEditor == "2")
            {
                this.LoadHerenMedDocList();
            }
            else
            {
                this.LoadMedDocList();
            }
            //使用新版本控件加载病历类型
            //this.LoadPastDocList();
            //添加一次质检问题后,会刷新病历节点,导致m_SelectedNode为空,此处重新选上
            SelectDocNodeByDocSetID(null, szDocSetID);
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
        /// <summary>
        /// 把查询结果绑定到列表
        /// </summary>
        /// <param name="lstDocInfo">病历数据列表</param>
        private void BindDocList(List <MedDocInfo> lstDocInfo)
        {
            Hashtable         htDocInfo   = new Hashtable();
            List <MedDocInfo> docInfoList = null;

            for (int index = 0; index < lstDocInfo.Count; index++)
            {
                MedDocInfo docInfo = lstDocInfo[index];
                if (!htDocInfo.ContainsKey(docInfo.DOC_SETID))
                {
                    docInfoList = new List <MedDocInfo>();
                    docInfoList.Add(docInfo);
                    htDocInfo.Add(docInfo.DOC_SETID, docInfoList);
                }
                else
                {
                    docInfoList = htDocInfo[docInfo.DOC_SETID] as List <MedDocInfo>;
                    if (docInfoList == null)
                    {
                        continue;
                    }
                    htDocInfo.Remove(docInfo.DOC_SETID);
                    docInfoList.Add(docInfo);
                    htDocInfo.Add(docInfo.DOC_SETID, docInfoList);
                }
            }
            foreach (DictionaryEntry dicEntry in htDocInfo)
            {
                docInfoList = dicEntry.Value as List <MedDocInfo>;
                if (docInfoList == null || docInfoList.Count <= 0)
                {
                    continue;
                }
                MedDocInfo      docInfo  = docInfoList[docInfoList.Count - 1];
                int             rowIndex = this.dgvMainList.Rows.Add();
                DataGridViewRow row      = this.dgvMainList.Rows[rowIndex];
                row.Cells[this.colDocTitle.Index].Value    = docInfo.DOC_TITLE;
                row.Cells[this.colModifyName.Index].Value  = docInfo.MODIFIER_NAME;
                row.Cells[this.colModifyTimes.Index].Value = docInfoList.Count;
                row.Cells[this.colCreatorName.Index].Value = docInfo.CREATOR_NAME;
                row.Cells[this.colPatientName.Index].Value = docInfo.PATIENT_NAME;
                row.Tag = docInfo;
            }
        }
Exemple #29
0
 /// <summary>
 /// 打开指定的Word文档
 /// </summary>
 /// <param name="document">文档信息</param>
 /// <returns>DataLayer.SystemData.ReturnValue</returns>
 public short OpenDocument(MedDocInfo document)
 {
     if (document == null)
     {
         MessageBoxEx.Show("无法打开文档!文档信息非法!");
         return(SystemData.ReturnValue.FAILED);
     }
     this.m_documents = new  MedDocList();
     this.m_documents.Add(document);
     this.RefreshFormTitle(null);
     if (this.Document.FilePath == MedDocSys.DataLayer.SystemData.StorageMode.DB)
     {
         return(this.OpenDocumentFromDB());
     }
     else
     {
         return(this.OpenDocumentFromFS());
     }
 }
Exemple #30
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];

            EMRDBLib.MedicalQcMsg info = row.Tag as EMRDBLib.MedicalQcMsg;
            if (info == null)
            {
                return;
            }
            //切换当前患者
            PatVisitInfo patVisitLog = null;
            short        shRet       = PatVisitAccess.Instance.GetPatVisitInfo(info.PATIENT_ID, info.VISIT_ID, ref patVisitLog);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.ShowError("患者信息查询失败!");
                return;
            }
            SystemParam.Instance.PatVisitInfo = patVisitLog;
            this.MainForm.OnPatientInfoChanged(EventArgs.Empty);
            //如果是系统自动检查,则将内容检查者设置为当前用户和检查时间为当前时间,代表质控已确认自动查出的问题
            if (!string.IsNullOrEmpty(info.TOPIC_ID) &&
                info.ISSUED_BY == "系统自动")
            {
                UpdateQCContentRecord(info.TOPIC_ID);
            }
            if (!string.IsNullOrEmpty(info.DOC_ID))
            {
                MedDocInfo docInfo = null;
                shRet = EmrDocAccess.Instance.GetDocInfo(info.DOC_ID, ref docInfo);

                this.MainForm.SwitchPatient(patVisitLog, docInfo);
                //this.MainForm.OpenDocument(info.TOPIC_ID, info.PATIENT_ID, info.VISIT_ID);
            }
            else
            {
                this.MainForm.SwitchPatient(patVisitLog);
            }
        }