Exemplo n.º 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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 关闭当前文档
 /// </summary>
 /// <returns>DataLayer.SystemData.ReturnValue</returns>
 public short CloseDocument()
 {
     //清空病历内容以及病历信息数据
     this.textEditor1.CloseDocument();
     this.m_documents = null;
     return(SystemData.ReturnValue.OK);
 }
Exemplo n.º 6
0
        /// <summary>
        /// 关闭当前文档
        /// </summary>
        /// <returns>DataLayer.SystemData.ReturnValue</returns>
        public short CloseDocument()
        {
            //清空病历内容以及病历信息数据
            this.m_documents = null;
            if (this.MedEditor != null)
            {
                this.MedEditor.CloseDocument();
                this.MedEditor.Dispose();
            }

            return(SystemData.ReturnValue.OK);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 关闭当前文档
 /// </summary>
 /// <returns>DataLayer.SystemData.ReturnValue</returns>
 public short CloseDocument()
 {
     //清空病历内容以及病历信息数据
     if (this.winWordCtrl1 != null && !this.winWordCtrl1.IsDisposed)
     {
         this.winWordCtrl1.CloseDocument();
         this.winWordCtrl1.CloseWordApplication();
     }
     GlobalMethods.IO.DeleteFile(this.m_szCacheFile);
     this.m_szCacheFile = string.Empty;
     this.m_documents   = null;
     return(SystemData.ReturnValue.OK);
 }
Exemplo n.º 8
0
        /// <summary>
        /// 初始化已写病历字典表
        /// </summary>
        /// <returns>SystemData.ReturnValue</returns>
        private short InitDocumentDict()
        {
            if (TimeEventHandler.Instance.TimeCheckQuery == null)
            {
                return(SystemData.ReturnValue.OK);
            }
            if (this.m_dicDocInfos != null)
            {
                return(SystemData.ReturnValue.OK);
            }
            if (this.m_dicDocInfos != null && this.m_dicDocInfos.Count <= 0)
            {
                return(SystemData.ReturnValue.CANCEL);
            }

            this.m_dicDocInfos = new Dictionary <string, MedDocList>();

            string     szPatientID = TimeEventHandler.Instance.TimeCheckQuery.PatientID;
            string     szVisitID   = TimeEventHandler.Instance.TimeCheckQuery.VisitNO;//编辑器将visit_id存成了visit_no
            MedDocList lstDocInfos = null;
            short      shRet       = EmrDocAccess.Instance.GetDocInfos(szPatientID, szVisitID
                                                                       , SystemData.VisitType.IP, DateTime.Now, null, ref lstDocInfos);

            if (shRet != SystemData.ReturnValue.OK)
            {
                return(shRet);
            }
            if (lstDocInfos == null || lstDocInfos.Count <= 0)
            {
                return(SystemData.ReturnValue.CANCEL);
            }

            lstDocInfos.SortByTime(false);
            for (int index = 0; index < lstDocInfos.Count; index++)
            {
                string     szDocTypeID         = lstDocInfos[index].DOC_TYPE;
                MedDocList lstCurrTypeDocInfos = null;
                if (this.m_dicDocInfos.ContainsKey(szDocTypeID))
                {
                    lstCurrTypeDocInfos = this.m_dicDocInfos[szDocTypeID];
                    lstCurrTypeDocInfos.Add(lstDocInfos[index]);
                }
                else
                {
                    lstCurrTypeDocInfos = new MedDocList();
                    lstCurrTypeDocInfos.Add(lstDocInfos[index]);
                    this.m_dicDocInfos.Add(szDocTypeID, lstCurrTypeDocInfos);
                }
            }
            return(SystemData.ReturnValue.OK);
        }
Exemplo n.º 9
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());
     }
 }
Exemplo n.º 10
0
        private void mnuOpenAllDoc_Click(object sender, EventArgs e)
        {
            if (this.MainForm == null || this.MainForm.IsDisposed)
            {
                return;
            }
            if (this.dgvDetailList.Rows.Count <= 0)
            {
                return;
            }
            DataGridViewRow selectRow = this.dgvDetailList.SelectedRows[0];

            if (selectRow == null)
            {
                return;
            }

            MedDocList lstDocInfo = new  MedDocList();
            MedDocInfo docInfo    = null;

            for (int index = 0; index < this.dgvDetailList.Rows.Count; index++)
            {
                selectRow = this.dgvDetailList.Rows[index];
                docInfo   = selectRow.Tag as  MedDocInfo;
                if (docInfo == null)
                {
                    continue;
                }
                lstDocInfo.Add(docInfo);
            }
            if (lstDocInfo.Count <= 0)
            {
                return;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在下载并打开病历,请稍候...");
            this.MainForm.OpenDocument(lstDocInfo);
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 打开医生或护士创建的所有病历
        /// <param name="parentNode">双击的节点</param>
        /// </summary>
        private void OpenAllDocList(VirtualNode parentNode)
        {
            if (parentNode == null || parentNode.Nodes.Count <= 0)
            {
                return;
            }

            MedDocList lstDocInfos = new MedDocList();
            DateTime   dtCheckTime = SysTimeHelper.Instance.Now;

            for (int index = 0; index < parentNode.Nodes.Count; index++)
            {
                if (!parentNode.Nodes[index].Data.Equals(COMBIN_NODE_TAG))
                {
                    continue;
                }

                if (index > 0)
                {
                    dtCheckTime = dtCheckTime.AddSeconds(1);
                }
                for (int ii = 0; ii < parentNode.Nodes[index].Nodes.Count; ii++)
                {
                    VirtualNode childNode = parentNode.Nodes[index].Nodes[ii];
                    MedDocInfo  docInfo   = childNode.Data as MedDocInfo;
                    if (docInfo == null)
                    {
                        continue;
                    }

                    if (ii > 0)
                    {
                        dtCheckTime = dtCheckTime.AddSeconds(1);
                    }
                    this.SaveReadLogInfo(docInfo, dtCheckTime, childNode);
                    lstDocInfos.Add(docInfo);
                }
            }
            this.Update();
            this.MainForm.OpenDocument(lstDocInfos);
        }
Exemplo n.º 12
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);
            }
            //编辑器控件加载文档
            shRet = this.medEditor1.OpenDocument(byteSmdfData, null, true);
            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.Show("无法打开文档!文档数据加载失败!");
                return(shRet);
            }
            //打开文档后是否显示为只读状态
            if (!SystemConfig.Instance.Get(SystemData.ConfigKey.DOCUMENT_READONLY, false))
            {
                this.MedEditor.Readonly = false;
            }
            return(SystemData.ReturnValue.OK);
        }
Exemplo n.º 13
0
 public IDocumentForm CreateDocForm(MainForm mainForm, MedDocList lstDocInfos)
 {
     return((lstDocInfos == null || lstDocInfos.Count <= 0) ? null : this.CreateDocForm(mainForm, lstDocInfos[0]));
 }
Exemplo n.º 14
0
        private void LoadHerenMedDocList()
        {
            if (SystemParam.Instance.PatVisitInfo == null)
            {
                return;
            }

            string szPatientID = SystemParam.Instance.PatVisitInfo.PATIENT_ID;
            string szVisitID   = SystemParam.Instance.PatVisitInfo.VISIT_ID;

            if (GlobalMethods.Misc.IsEmptyString(szPatientID) || GlobalMethods.Misc.IsEmptyString(szVisitID))
            {
                return;
            }

            this.virtualTree1.SuspendLayout();
            this.virtualTree1.Tag = null;
            this.virtualTree1.Nodes.Clear();
            this.virtualTree1.PerformLayout();

            string     szVisitType = MedDocSys.DataLayer.SystemData.VisitType.IP;
            MedDocList lstDocInfos = null;
            short      shRet       = EmrDocAccess.Instance.GetDocInfos(szPatientID, szVisitID, szVisitType, DateTime.Now, string.Empty, ref lstDocInfos);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                MessageBoxEx.Show("获取新格式病程记录失败!");
                return;
            }
            if (lstDocInfos == null || lstDocInfos.Count <= 0)
            {
                return;
            }
            lstDocInfos.Sort();

            //文档时间显示格式
            string szDocTimeFormat = "yyyy-MM-dd HH:mm";

            this.virtualTree1.SuspendLayout();
            this.virtualTree1.Tag = lstDocInfos;

            VirtualNode lastDocRootNode = new VirtualNode();

            lastDocRootNode.Text       = "医生的病历";
            lastDocRootNode.ForeColor  = Color.Blue;
            lastDocRootNode.ImageIndex = 0;
            lastDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            lastDocRootNode.Data       = DOCTOR_NODE_TAG;
            lastDocRootNode.Expand();

            VirtualNode LastNurRootNode = new VirtualNode();

            LastNurRootNode.Text       = "护士的病历";
            LastNurRootNode.ForeColor  = Color.Blue;
            LastNurRootNode.ImageIndex = 0;
            LastNurRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            LastNurRootNode.Data       = NURSE_NODE_TAG;
            LastNurRootNode.CollapseAll();

            VirtualNode otherDocRootNode = new VirtualNode("未被归类的病历");

            otherDocRootNode.ForeColor  = Color.Blue;
            otherDocRootNode.ImageIndex = 1;
            otherDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            otherDocRootNode.Data       = UNKNOWN_NODE_TAG;
            otherDocRootNode.Expand();

            Hashtable          htDocType     = new Hashtable();
            List <VirtualNode> childDocNodes = new List <VirtualNode>();

            //加载已有文档列表到指定的容器
            for (int index = 0; index < lstDocInfos.Count; index++)
            {
                MedDocInfo docInfo = lstDocInfos[index];
                if (docInfo == null)
                {
                    continue;
                }

                VirtualNode docInfoNode = new VirtualNode(docInfo.DOC_TITLE);
                if (!htDocType.ContainsKey(docInfo.DOC_ID))
                {
                    htDocType.Add(docInfo.DOC_ID, docInfoNode);
                }
                docInfoNode.HitExpand = HitExpandMode.None;
                docInfoNode.Expand();
                docInfoNode.Data      = docInfo;
                docInfoNode.ForeColor = Color.Black;
                if (m_htQCMsgInfs != null && m_htQCMsgInfs.ContainsKey(docInfo.DOC_SETID))
                {
                    docInfoNode.ForeColor = Color.OrangeRed;
                }
                docInfoNode.Font = new Font("宋体", 10.5f, FontStyle.Regular);

                VirtualSubItem subItem   = null;
                DateTime       dtDocTime = docInfo.DOC_TIME;
                {
                    dtDocTime = docInfo.RECORD_TIME;
                }

                subItem           = new VirtualSubItem(dtDocTime.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(dtDocTime.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.CREATOR_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.MODIFY_TIME.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.MODIFIER_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);


                string szReadTime = string.Empty;
                if (this.m_htQCActionLog.Contains(docInfo.DOC_SETID))
                {
                    szReadTime = this.m_htQCActionLog[docInfo.DOC_SETID].ToString();
                }

                subItem           = new VirtualSubItem();
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    subItem.Text = "是";
                }
                else
                {
                    subItem.Text = "否";
                }

                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(szReadTime);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                subItem.ForeColor = Color.Blue;
                docInfoNode.SubItems.Add(subItem);


                subItem           = new VirtualSubItem();
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                GetCnNameSignCode(docInfo, subItem);



                docInfoNode.SubItems.Add(subItem);

                DocTypeInfo currDocType = null;
                DocTypeAccess.Instance.GetDocTypeInfo(docInfo.DOC_TYPE, ref currDocType);
                if (currDocType == null)
                {
                    otherDocRootNode.Nodes.Add(docInfoNode);
                    continue;
                }
                //病历类型不需要审签
                if (string.IsNullOrEmpty(currDocType.SignFlag) ||
                    currDocType.SignFlag == SystemData.SignType.NONE)
                {
                    subItem.Text = string.Empty;
                }

                if (currDocType.NeedCombin && !currDocType.IsHostType)
                {
                    childDocNodes.Add(docInfoNode);
                    continue;
                }

                DocTypeInfo hostDocType = null;
                DocTypeAccess.Instance.GetDocTypeInfo(currDocType.HostTypeID, ref hostDocType);
                if (hostDocType == null)
                {
                    hostDocType = currDocType;
                }
                VirtualNode hostDocRootNode = null;
                if (htDocType.ContainsKey(hostDocType.DocTypeID))
                {
                    hostDocRootNode = htDocType[hostDocType.DocTypeID] as VirtualNode;
                }

                if (hostDocRootNode == null)
                {
                    hostDocRootNode           = new VirtualNode();
                    hostDocRootNode.Text      = hostDocType.DocTypeName;
                    hostDocRootNode.Tag       = hostDocType.DocTypeName;
                    hostDocRootNode.Data      = COMBIN_NODE_TAG;
                    hostDocRootNode.HitExpand = HitExpandMode.Click;
                    hostDocRootNode.Expand();
                    hostDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
                    hostDocRootNode.ImageIndex = 0;
                    if (hostDocType.DocRight != MedDocSys.DataLayer.SystemData.UserType.NURSE)
                    {
                        lastDocRootNode.Nodes.Add(hostDocRootNode);
                    }
                    else if (hostDocType.DocRight == MedDocSys.DataLayer.SystemData.UserType.NURSE)
                    {
                        LastNurRootNode.Nodes.Add(hostDocRootNode);
                    }
                    else
                    {
                        this.virtualTree1.Nodes.Add(hostDocRootNode);
                    }
                    htDocType.Add(hostDocType.DocTypeID, hostDocRootNode);
                }
                hostDocRootNode.Nodes.Add(docInfoNode);
            }

            foreach (VirtualNode node in childDocNodes)
            {
                if (node.Parent != null)
                {
                    continue;
                }
                MedDocInfo docInfo = node.Data as MedDocInfo;
                if (docInfo == null)
                {
                    continue;
                }

                if (htDocType.ContainsKey(docInfo.DOC_SETID))
                {
                    VirtualNode parent = htDocType[docInfo.DOC_SETID] as VirtualNode;
                    if (parent != null && parent != node)
                    {
                        parent.Nodes.Add(node);
                    }
                }
            }
            htDocType.Clear();
            this.m_DoctorNode = lastDocRootNode;
            this.m_NurseNode  = LastNurRootNode;
            if (otherDocRootNode.Nodes.Count > 0)
            {
                this.virtualTree1.Nodes.Add(otherDocRootNode);
            }
            if (lastDocRootNode.Nodes.Count > 0)
            {
                this.virtualTree1.Nodes.Add(lastDocRootNode);
            }
            if (LastNurRootNode.Nodes.Count > 0)
            {
                this.virtualTree1.Nodes.Add(LastNurRootNode);
            }
            this.virtualTree1.PerformLayout();
        }
Exemplo n.º 15
0
        private void LoadMedDocList(EMRDBLib.PatVisitInfo patVisitLog, VirtualNode patientNode)
        {
            if (patVisitLog == null)
            {
                return;
            }

            string szPatientID = patVisitLog.PATIENT_ID;
            string szVisitID   = patVisitLog.VISIT_ID;

            if (GlobalMethods.Misc.IsEmptyString(szPatientID) || GlobalMethods.Misc.IsEmptyString(szVisitID))
            {
                return;
            }

            string     szVisitType = MedDocSys.DataLayer.SystemData.VisitType.IP;
            MedDocList lstDocInfos = null;
            short      shRet       = EmrDocAccess.Instance.GetDocInfos(szPatientID, szVisitID, szVisitType, DateTime.Now, string.Empty, ref lstDocInfos);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                MessageBoxEx.Show("获取新格式病程记录失败!");
                return;
            }
            if (lstDocInfos == null || lstDocInfos.Count <= 0)
            {
                return;
            }

            lstDocInfos.Sort();

            //文档时间显示格式
            string szDocTimeFormat = "yyyy-MM-dd HH:mm";

            this.virtualTree1.SuspendLayout();
            this.virtualTree1.Tag = lstDocInfos;

            VirtualNode lastDocRootNode = new VirtualNode();

            lastDocRootNode.Text       = "医生的病历";
            lastDocRootNode.ImageIndex = 0;
            lastDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            lastDocRootNode.Data       = DOCTOR_NODE_TAG;
            lastDocRootNode.Expand();

            VirtualNode LastNurRootNode = new VirtualNode();

            LastNurRootNode.Text       = "护士的病历";
            LastNurRootNode.ImageIndex = 0;
            LastNurRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            LastNurRootNode.Data       = NURSE_NODE_TAG;
            LastNurRootNode.CollapseAll();

            VirtualNode otherDocRootNode = new VirtualNode("未被归类的病历");

            otherDocRootNode.ImageIndex = 1;
            otherDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            otherDocRootNode.Data       = UNKNOWN_NODE_TAG;
            otherDocRootNode.Expand();

            Hashtable htDocType = new Hashtable();

            //加载已有文档列表到指定的容器
            for (int index = 0; index < lstDocInfos.Count; index++)
            {
                MedDocInfo docInfo = lstDocInfos[index];
                if (docInfo == null)
                {
                    continue;
                }

                VirtualNode docInfoNode = new VirtualNode(docInfo.DOC_TITLE);
                docInfoNode.Data      = docInfo;
                docInfoNode.Tag       = patVisitLog;
                docInfoNode.ForeColor = Color.Black;
                docInfoNode.Font      = new Font("宋体", 10.5f, FontStyle.Regular);

                VirtualSubItem subItem   = null;
                DateTime       dtDocTime = docInfo.DOC_TIME;
                dtDocTime         = docInfo.DOC_TIME;
                subItem           = new VirtualSubItem(dtDocTime.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.CREATOR_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.MODIFY_TIME.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.MODIFIER_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                string szReadTime = string.Empty;
                if (this.m_htQCActionLog.Contains(docInfo.DOC_SETID))
                {
                    szReadTime = this.m_htQCActionLog[docInfo.DOC_SETID].ToString();
                }

                subItem           = new VirtualSubItem();
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    subItem.Text = "是";
                }
                else
                {
                    subItem.Text = "否";
                }
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(szReadTime);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);
                //如果病历被阅读过,则子项的字体颜色分为绿色
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    docInfoNode.ForeColor = Color.Green;
                    for (int nIndex = 0; nIndex < docInfoNode.SubItems.Count; nIndex++)
                    {
                        docInfoNode.SubItems[nIndex].ForeColor = Color.Green;
                    }
                }
                DocTypeInfo currDocType = null;
                DocTypeAccess.Instance.GetDocTypeInfo(docInfo.DOC_TYPE, ref currDocType);
                if (currDocType == null)
                {
                    otherDocRootNode.Nodes.Add(docInfoNode);
                    continue;
                }
                DocTypeInfo hostDocType = null;
                DocTypeAccess.Instance.GetDocTypeInfo(currDocType.HostTypeID, ref hostDocType);
                if (hostDocType == null)
                {
                    otherDocRootNode.Nodes.Add(docInfoNode);
                    continue;
                }

                VirtualNode hostDocRootNode = null;
                if (!htDocType.Contains(hostDocType.DocTypeID))
                {
                    hostDocRootNode           = new VirtualNode();
                    hostDocRootNode.Text      = hostDocType.DocTypeName;
                    hostDocRootNode.Tag       = hostDocType.DocTypeName;
                    hostDocRootNode.Data      = COMBIN_NODE_TAG;
                    hostDocRootNode.HitExpand = HitExpandMode.Click;
                    hostDocRootNode.Expand();
                    hostDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
                    hostDocRootNode.ImageIndex = 1;
                    if (hostDocType.DocRight != MedDocSys.DataLayer.SystemData.UserType.NURSE)
                    {
                        lastDocRootNode.Nodes.Add(hostDocRootNode);
                    }
                    else if (hostDocType.DocRight == MedDocSys.DataLayer.SystemData.UserType.NURSE)
                    {
                        LastNurRootNode.Nodes.Add(hostDocRootNode);
                    }
                    else
                    {
                        this.virtualTree1.Nodes.Add(hostDocRootNode);
                    }
                    htDocType.Add(hostDocType.DocTypeID, hostDocRootNode);
                }
                else
                {
                    hostDocRootNode = htDocType[hostDocType.DocTypeID] as VirtualNode;
                }
                hostDocRootNode.Nodes.Add(docInfoNode);
            }
            htDocType.Clear();
            this.m_DoctorNode = lastDocRootNode;
            this.m_NurseNode  = LastNurRootNode;
            if (otherDocRootNode.Nodes.Count > 0)
            {
                patientNode.Nodes.Add(otherDocRootNode);
            }
            if (lastDocRootNode.Nodes.Count > 0)
            {
                patientNode.Nodes.Add(lastDocRootNode);
            }
            if (LastNurRootNode.Nodes.Count > 0)
            {
                patientNode.Nodes.Add(LastNurRootNode);
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 合并打开指定的一系列文档
        /// </summary>
        /// <param name="documents">文档信息</param>
        /// <returns>DataLayer.SystemData.ReturnValue</returns>
        public short OpenDocument(MedDocList documents)
        {
            this.m_documents = documents;
            this.RefreshFormTitle(null);
            if (this.m_documents == null || this.m_documents.Count <= 0)
            {
                return(SystemData.ReturnValue.FAILED);
            }

            short shRet = SystemData.ReturnValue.OK;

            for (int index = 0; index < this.m_documents.Count; index++)
            {
                MedDocInfo document = this.m_documents[index];
                if (GlobalMethods.Misc.IsEmptyString(document.PATIENT_ID))
                {
                    MessageBoxEx.Show("无法打开旧病历!患者ID为空!");
                    return(SystemData.ReturnValue.FAILED);
                }
                if (GlobalMethods.Misc.IsEmptyString(document.VISIT_ID))
                {
                    MessageBoxEx.Show("无法打开旧病历!患者就诊ID非法!");
                    return(SystemData.ReturnValue.FAILED);
                }

                string szPatientID    = document.PATIENT_ID.Trim().PadLeft(10, '0');
                string szLastTwoChars = szPatientID.Substring(szPatientID.Length - 2);
                string szPrefixChars  = szPatientID.Substring(0, szPatientID.Length - 2);

                string szLocalDocDir = string.Format("{0}\\Cache\\EMRPadX", GlobalMethods.Misc.GetWorkingPath());
                GlobalMethods.IO.CreateDirectory(szLocalDocDir);

                string szRemoteFile = string.Format("{0}\\{1}\\{2}", szLastTwoChars, szPrefixChars, document.FileName);
                string szLocalFile  = string.Format("{0}\\{1}{2}.emr", szLocalDocDir, document.PATIENT_ID, document.FileName);

                if (!GlobalMethods.IO.DeleteFile(szLocalFile))
                {
                    MessageBoxEx.Show(string.Format("病历“{0}”下载失败!", document.DOC_TITLE));
                    return(SystemData.ReturnValue.FAILED);
                }
                shRet = MedDocSys.DataLayer.FsrvAccess.Instance.DownloadFile(szRemoteFile, szLocalFile);
                if (shRet != SystemData.ReturnValue.OK)
                {
                    MessageBoxEx.Show(string.Format("病历“{0}”下载失败!", document.DOC_TITLE));
                    return(SystemData.ReturnValue.FAILED);
                }

                if (index == 0 && !this.InitMedEditor(szLocalFile))
                {
                    MessageBoxEx.Show("病历打开失败,无法创建病历编辑器控件!");
                    return(SystemData.ReturnValue.FAILED);
                }
                if (index == 0)
                {
                    shRet = this.MedEditor.OpenDocument(szLocalFile);
                }
                else
                {
                    if (this.MedEditor.Readonly)
                    {
                        this.MedEditor.Readonly = false;
                    }
                }
                GlobalMethods.IO.DeleteFile(szLocalFile);
                if (shRet != MedDocSys.DataLayer.SystemData.ReturnValue.OK)
                {
                    break;
                }
            }
            this.MedEditor.Readonly = true;
            return(shRet);
        }
Exemplo n.º 17
0
 /// <summary>
 /// 打开指定的EMRPad文档
 /// </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);
     return(this.OpenDocument(this.m_documents));
 }
Exemplo n.º 18
0
        private void LoadPastDocList(EMRDBLib.PatVisitInfo patVisitLog, VirtualNode patientNode)
        {
            if (this.MainForm == null || this.MainForm.IsDisposed || patVisitLog == null)
            {
                return;
            }

            string szPatientID = patVisitLog.PATIENT_ID;
            string szVisitID   = patVisitLog.VISIT_ID;

            if (GlobalMethods.Misc.IsEmptyString(szPatientID) || GlobalMethods.Misc.IsEmptyString(szVisitID))
            {
                return;
            }

            MedDocList lstPastDocInfos = null;
            short      shRet           = EMRDBAccess.Instance.GetPastDocList(szPatientID, szVisitID, ref lstPastDocInfos);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                MessageBoxEx.Show("获取旧病程记录列表失败!");
                return;
            }
            if (lstPastDocInfos == null || lstPastDocInfos.Count <= 0)
            {
                return;
            }
            lstPastDocInfos.Sort();

            //文档时间显示格式
            string      szDocTimeFormat = "yyyy-MM-dd HH:mm";
            VirtualNode oldDocRootNode  = new VirtualNode("以往旧病历");

            oldDocRootNode.Data       = lstPastDocInfos;
            oldDocRootNode.ImageIndex = 1;
            oldDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            oldDocRootNode.Expand();

            Hashtable htDocType = new Hashtable();

            //加载已有文档列表到指定的容器
            for (int index = 0; index < lstPastDocInfos.Count; index++)
            {
                MedDocInfo pastDocInfo = lstPastDocInfos[index];
                if (pastDocInfo == null)
                {
                    continue;
                }

                string szDocTitle = "无主题";
                if (!GlobalMethods.Misc.IsEmptyString(pastDocInfo.DOC_TITLE))
                {
                    szDocTitle = pastDocInfo.DOC_TITLE;
                }
                VirtualNode docInfoNode = new VirtualNode(szDocTitle);
                docInfoNode.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                docInfoNode.Data      = pastDocInfo;
                docInfoNode.Tag       = patVisitLog;
                docInfoNode.ForeColor = Color.Black;

                VirtualSubItem subItem = null;
                subItem           = new VirtualSubItem(pastDocInfo.DOC_TIME.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(pastDocInfo.CREATOR_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(pastDocInfo.MODIFY_TIME.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(pastDocInfo.MODIFIER_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                string szReadTime = string.Empty;
                if (this.m_htQCActionLog.Contains(pastDocInfo.DOC_SETID))
                {
                    szReadTime = this.m_htQCActionLog[pastDocInfo.DOC_SETID].ToString();
                }
                subItem           = new VirtualSubItem();
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    subItem.Text = "是";
                }
                else
                {
                    subItem.Text = "否";
                }
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(szReadTime);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);
                //如果病历被阅读过,则子项的字体颜色分为绿色
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    docInfoNode.ForeColor = Color.Green;
                    for (int nIndex = 0; nIndex < docInfoNode.SubItems.Count; nIndex++)
                    {
                        docInfoNode.SubItems[nIndex].ForeColor = Color.Green;
                    }
                }
                oldDocRootNode.Nodes.Add(docInfoNode);
            }
            patientNode.Nodes.Add(oldDocRootNode);
        }
Exemplo n.º 19
0
 /// <summary>
 /// 合并打开指定的一系列文档
 /// </summary>
 /// <param name="documents">文档信息</param>
 /// <returns>DataLayer.SystemData.ReturnValue</returns>
 public short OpenDocument(MedDocList documents)
 {
     return(SystemData.ReturnValue.OK);
 }
Exemplo n.º 20
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);
            }
            WorkProcess.Instance.Show(string.Format("正在打开“{0}”,请稍候...", firstDocInfo.DOC_TITLE), 1);

            //打开第一份文档
            shRet = this.medEditor1.InitCombinDisplay(byteDocData, firstDocInfo.DOC_ID);
            if (shRet != SystemData.ReturnValue.OK)
            {
                WorkProcess.Instance.Close();
                MessageBoxEx.Show(this, string.Format("文档“{0}”加载失败!", firstDocInfo.DOC_TITLE));
                return(SystemData.ReturnValue.FAILED);
            }

            DocTypeInfo prevDocTypeInfo = null;

            DataCache.Instance.GetDocTypeInfo(firstDocInfo.DOC_TYPE, ref prevDocTypeInfo);

            //循环打开其余的文档
            for (int index = 1; index < documents.Count; index++)
            {
                MedDocInfo docInfo = documents[index];

                if (WorkProcess.Instance.Canceled)
                {
                    break;
                }
                WorkProcess.Instance.Show(string.Format("正在下载“{0}”,请稍候...", docInfo.DOC_TITLE), index + 1);

                //下载文档内容
                byteDocData = null;
                shRet       = EmrDocAccess.Instance.GetDocByID(docInfo.DOC_ID, ref byteDocData);
                if (shRet != SystemData.ReturnValue.OK)
                {
                    string szTipInfo = string.Format("“{0}”文档数据下载失败!是否继续?", docInfo.DOC_TITLE);
                    if (MessageBoxEx.Show(szTipInfo, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                    {
                        break;
                    }
                }

                if (WorkProcess.Instance.Canceled)
                {
                    break;
                }
                WorkProcess.Instance.Show(string.Format("正在打开“{0}”,请稍候...", docInfo.DOC_TITLE), index + 1);

                //当前文档或前一文档是需要独立打印的,那么插入一个或两个硬分页符
                DocTypeInfo docTypeInfo = null;
                DataCache.Instance.GetDocTypeInfo(docInfo.DOC_TYPE, ref docTypeInfo);
                if ((docTypeInfo != null && docTypeInfo.IsTotalPage) ||
                    (prevDocTypeInfo != null && prevDocTypeInfo.IsEndEmpty))
                {
                    int nTotalPageCount = 0;

                    //获取总页数.注意:单面打印时只需要插入一个空白页
                    if (this.medEditor1.PageSettings.PageLayout != MedDocSys.DataLayer.PageLayout.Normal)
                    {
                        //格式化一次文档,才能正确获取总页数
                        this.medEditor1.RefreshCombinDisplay();
                        this.medEditor1.GetPageCount(ref nTotalPageCount);
                    }

                    int nBlankPageCount = (nTotalPageCount % 2 == 0) ? 1 : 2;
                    this.AppendBlankToCombin(nBlankPageCount, true);
                }
                prevDocTypeInfo = docTypeInfo;

                if (WorkProcess.Instance.Canceled)
                {
                    break;
                }

                //OCX编辑器装载文档
                shRet = this.medEditor1.AppendToCombinDisplay(byteDocData, docInfo.DOC_ID);
                if (shRet != SystemData.ReturnValue.OK)
                {
                    string szTipInfo = string.Format("“{0}”文档数据加载失败!是否继续?", docInfo.DOC_TITLE);
                    if (MessageBoxEx.Show(szTipInfo, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                    {
                        break;
                    }
                }
            }
            this.medEditor1.RefreshCombinDisplay();

            WorkProcess.Instance.Close();
            return(SystemData.ReturnValue.OK);
        }
Exemplo n.º 21
0
        private void virtualTree1_NodeMouseDoubleClick(object sender, VirtualTreeEventArgs e)
        {
            if (this.MainForm == null || this.MainForm.IsDisposed)
            {
                return;
            }
            if (e.Node == null || e.Type == HitTestType.None)
            {
                return;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在下载并打开病历,请稍候...");

            DateTime   dtCheckTime = SysTimeHelper.Instance.Now;
            MedDocInfo docInfo     = e.Node.Data as MedDocInfo;

            //如果是和仁编辑器,暂不支持合并打开
            if ((SystemParam.Instance.LocalConfigOption.DefaultEditor == "2") &&
                docInfo == null)
            {
                return;
            }
            if (docInfo != null)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
                this.Update();
                this.MainForm.OpenDocument(docInfo);

                //提示已经被质控过,确认后才更新质控阅读记录
                //提示文档被质控过的信息,如果最新质控记录为当前用户,则不提示,如果为其他用户,则提示。
                MedicalQcLog qcActionLog = null;
                short        shRet       = MedicalQcLogAccess.Instance.GetQCLogInfo(docInfo.DOC_SETID, 1, ref qcActionLog);
                if (shRet == SystemData.ReturnValue.OK)
                {
                    if (qcActionLog.CHECKED_ID != SystemParam.Instance.UserInfo.USER_ID)
                    {
                        string msg = string.Format("当前病历已经被{0}于{1}质控阅读过!\t\n如需重新质控,请单击【确定】按钮"
                                                   , qcActionLog.CHECKED_BY
                                                   , qcActionLog.CHECK_DATE.ToString("yyyy-MM-dd HH:mm:ss"));
                        if (MessageBoxEx.ShowConfirm(msg) != DialogResult.OK)
                        {
                            this.ShowStatusMessage(null);
                            GlobalMethods.UI.SetCursor(this, Cursors.Default);
                            return;
                        }
                    }
                }
                this.SaveReadLogInfo(docInfo, dtCheckTime, e.Node);
            }
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
            return;


            //打开合并病历
            if (COMBIN_NODE_TAG.Equals(e.Node.Data))
            {
                int count = e.Node.Nodes.Count;
                if (count <= 0)
                {
                    return;
                }

                GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
                MedDocList lstDocInfos = new MedDocList();
                for (int index = 0; index < count; index++)
                {
                    docInfo = e.Node.Nodes[index].Data as MedDocInfo;
                    if (docInfo == null)
                    {
                        continue;
                    }
                    if (index > 0)
                    {
                        dtCheckTime = dtCheckTime.AddSeconds(1);
                    }
                    this.SaveReadLogInfo(docInfo, dtCheckTime, e.Node.Nodes[index]);
                    lstDocInfos.Add(docInfo);
                }
                this.Update();
                this.MainForm.OpenDocument(lstDocInfos);
                this.ShowStatusMessage(null);
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
            }
            else
            {
                if (DOCTOR_NODE_TAG.Equals(e.Node.Data))
                {
                    this.OpenAllDocList(this.m_DoctorNode);
                }
                else if (NURSE_NODE_TAG.Equals(e.Node.Data))
                {
                    this.OpenAllDocList(this.m_NurseNode);
                }
                this.ShowStatusMessage(null);
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 获取指定病人指定就诊下的以往病历文档列表.
        /// 需要创建DB_LINK,LINK到旧病历数据库,本接口再通过视图获取以往病历列表.
        /// 注意:该接口不对返回病历列表进行排序,需要外部主动调用Sort方法排序
        /// </summary>
        /// <param name="szPatientID">病人ID</param>
        /// <param name="szVisitID">就诊ID</param>
        /// <param name="lstPastDocInfos">Word病历文档列表</param>
        /// <returns>SystemData.ReturnValue</returns>
        public short GetPastDocList(string szPatientID, string szVisitID, ref MedDocList lstPastDocInfos)
        {
            if (base.MeddocAccess == null)
            {
                return(SystemData.ReturnValue.PARAM_ERROR);
            }

            string szField = string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19},{20}"
                                           , SystemData.PastDocView.DOC_ID, SystemData.PastDocView.DOC_TYPE, SystemData.PastDocView.DOC_TITLE
                                           , SystemData.PastDocView.CREATOR_ID, SystemData.PastDocView.CREATOR_NAME, SystemData.PastDocView.CREATE_TIME
                                           , SystemData.PastDocView.MODIFIER_ID, SystemData.PastDocView.MODIFIER_NAME, SystemData.PastDocView.MODIFY_TIME
                                           , SystemData.PastDocView.PATIENT_ID, SystemData.PastDocView.PATIENT_NAME, SystemData.PastDocView.VISIT_ID
                                           , SystemData.PastDocView.VISIT_TIME, SystemData.PastDocView.VISIT_TYPE, SystemData.PastDocView.DEPT_CODE
                                           , SystemData.PastDocView.DEPT_NAME, SystemData.PastDocView.ORDER_VALUE, SystemData.PastDocView.NEED_COMBIN
                                           , SystemData.PastDocView.FILE_TYPE, SystemData.PastDocView.FILE_NAME, SystemData.PastDocView.FILE_PATH);
            string szCondition = string.Format("{0}='{1}' AND {2}='{3}' AND {4}!='CHENPAD' AND {4}!='BAODIAN'"
                                               , SystemData.PastDocView.PATIENT_ID, szPatientID, SystemData.PastDocView.VISIT_ID, szVisitID
                                               , SystemData.PastDocView.FILE_TYPE);
            string szSQL = string.Format(SystemData.SQL.SELECT_WHERE_ORDER_ASC, szField
                                         , SystemData.DataView.PAST_DOC, szCondition, SystemData.PastDocView.CREATE_TIME);
            IDataReader dataReader = null;

            try
            {
                dataReader = base.MeddocAccess.ExecuteReader(szSQL, CommandType.Text);
                if (dataReader == null || dataReader.IsClosed || !dataReader.Read())
                {
                    return(SystemData.ReturnValue.RES_NO_FOUND);
                }
                if (lstPastDocInfos == null)
                {
                    lstPastDocInfos = new MedDocList();
                }

                do
                {
                    MedDocInfo pastDocInfo = new MedDocInfo();
                    if (!dataReader.IsDBNull(0))
                    {
                        pastDocInfo.DOC_ID = dataReader.GetString(0);
                    }
                    if (!dataReader.IsDBNull(1))
                    {
                        pastDocInfo.DOC_TYPE = dataReader.GetString(1);
                    }
                    if (!dataReader.IsDBNull(2))
                    {
                        pastDocInfo.DOC_TITLE = dataReader.GetString(2);
                    }
                    if (!dataReader.IsDBNull(3))
                    {
                        pastDocInfo.CREATOR_ID = dataReader.GetString(3);
                    }
                    if (!dataReader.IsDBNull(4))
                    {
                        pastDocInfo.CREATOR_NAME = dataReader.GetString(4);
                    }
                    if (!dataReader.IsDBNull(5))
                    {
                        pastDocInfo.DOC_TIME = dataReader.GetDateTime(5);
                    }
                    if (!dataReader.IsDBNull(6))
                    {
                        pastDocInfo.MODIFIER_ID = dataReader.GetString(6);
                    }
                    if (!dataReader.IsDBNull(7))
                    {
                        pastDocInfo.MODIFIER_NAME = dataReader.GetString(7);
                    }
                    if (!dataReader.IsDBNull(8))
                    {
                        pastDocInfo.MODIFY_TIME = dataReader.GetDateTime(8);
                    }
                    if (!dataReader.IsDBNull(9))
                    {
                        pastDocInfo.PATIENT_ID = dataReader.GetString(9);
                    }
                    if (!dataReader.IsDBNull(10))
                    {
                        pastDocInfo.PATIENT_NAME = dataReader.GetString(10);
                    }
                    if (!dataReader.IsDBNull(11))
                    {
                        pastDocInfo.VISIT_ID = dataReader.GetString(11);
                    }
                    if (!dataReader.IsDBNull(12))
                    {
                        pastDocInfo.VISIT_TIME = dataReader.GetDateTime(12);
                    }
                    if (!dataReader.IsDBNull(13))
                    {
                        pastDocInfo.VISIT_TYPE = dataReader.GetString(13);
                    }
                    if (!dataReader.IsDBNull(14))
                    {
                        pastDocInfo.DEPT_CODE = dataReader.GetString(14);
                    }
                    if (!dataReader.IsDBNull(15))
                    {
                        pastDocInfo.DEPT_NAME = dataReader.GetString(15);
                    }
                    if (!dataReader.IsDBNull(16))
                    {
                        pastDocInfo.ORDER_VALUE = int.Parse(dataReader.GetValue(16).ToString());
                    }
                    if (!dataReader.IsDBNull(17))
                    {
                        pastDocInfo.NeedCombin = dataReader.GetValue(17).ToString() == "1";
                    }
                    if (!dataReader.IsDBNull(18))
                    {
                        pastDocInfo.EMR_TYPE = dataReader.GetString(18);
                    }
                    if (!dataReader.IsDBNull(19))
                    {
                        pastDocInfo.FileName = dataReader.GetString(19);
                    }
                    if (!dataReader.IsDBNull(20))
                    {
                        pastDocInfo.FilePath = dataReader.GetString(20);
                    }

                    if (string.IsNullOrEmpty(pastDocInfo.DOC_ID))
                    {
                        pastDocInfo.DOC_ID = string.Concat(pastDocInfo.PATIENT_ID, "_", pastDocInfo.VISIT_ID, "_", pastDocInfo.FileName);
                    }
                    lstPastDocInfos.Add(pastDocInfo);
                } while (dataReader.Read());
                return(SystemData.ReturnValue.OK);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("EMRDBAccess.GetPastDocList", new string[] { "szSQL" }, new object[] { szSQL }, ex);
                return(SystemData.ReturnValue.EXCEPTION);
            }
            finally { base.MeddocAccess.CloseConnnection(false); }
            //#endif
        }
Exemplo n.º 23
0
        private void virtualTree1_NodeMouseDoubleClick(object sender, VirtualTreeEventArgs e)
        {
            if (this.MainForm == null || this.MainForm.IsDisposed)
            {
                return;
            }
            if (e.Node == null || e.Type == HitTestType.None)
            {
                return;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在下载并打开病历,请稍候...");

            MedDocInfo docInfo     = e.Node.Data as MedDocInfo;
            DateTime   dtCheckTime = SysTimeHelper.Instance.Now;

            if (docInfo != null)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
                this.Update();
                this.MainForm.OpenDocument(docInfo);
                this.SaveReadLogInfo(docInfo, dtCheckTime, e.Node);
                this.ShowStatusMessage(null);
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                return;
            }

            //打开合并病历
            if (COMBIN_NODE_TAG.Equals(e.Node.Data))
            {
                int count = e.Node.Nodes.Count;
                if (count <= 0)
                {
                    return;
                }
                GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
                MedDocList lstDocInfos = new MedDocList();
                for (int index = 0; index < count; index++)
                {
                    docInfo = e.Node.Nodes[index].Data as MedDocInfo;
                    if (docInfo == null)
                    {
                        continue;
                    }

                    if (index > 0)
                    {
                        dtCheckTime = dtCheckTime.AddSeconds(1);
                    }
                    this.SaveReadLogInfo(docInfo, dtCheckTime, e.Node.Nodes[index]);
                    lstDocInfos.Add(docInfo);
                }
                this.Update();
                this.MainForm.OpenDocument(lstDocInfos);
                this.ShowStatusMessage(null);
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
            }
            else
            {
                if (DOCTOR_NODE_TAG.Equals(e.Node.Data))
                {
                    this.OpenAllDocList(e.Node);
                }
                else if (NURSE_NODE_TAG.Equals(e.Node.Data))
                {
                    this.OpenAllDocList(e.Node);
                }
                this.ShowStatusMessage(null);
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
            }
        }