Example #1
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);
            }
        }
Example #2
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();
        }