예제 #1
0
 private void DoInsertDeItem(HCEmrView aEmrView, HCSection aSection, HCCustomData aData, HCCustomItem aItem)
 {
     if (aItem is DeCombobox)
     {
         (aItem as DeCombobox).OnPopupItem = DoRecordDeComboboxGetItem;
     }
 }
예제 #2
0
        public frmRecord()
        {
            InitializeComponent();

            PrintToolVisible = false;

            System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
            foreach (System.Drawing.FontFamily family in fonts.Families)
            {
                cbbFont.Items.Add(family.Name);
            }
            cbbFont.Text          = "宋体";
            cbbFontSize.Text      = "五号";
            cbbZoom.SelectedIndex = 3;

            if (FEmrView == null)
            {
                FEmrView = new HCEmrView();
                FEmrView.OnSectionItemInsert      = DoItemInsert;
                FEmrView.MouseDown               += DoEmrViewMouseDown;
                FEmrView.MouseUp                 += DoEmrViewMouseUp;
                FEmrView.OnCaretChange            = DoCaretChange;
                FEmrView.OnVerScroll              = DoVerScroll;
                FEmrView.OnChangedSwitch          = DoChangedSwitch;
                FEmrView.OnSectionReadOnlySwitch  = DoReadOnlySwitch;
                FEmrView.OnCanNotEdit             = DoCanNotEdit;
                FEmrView.OnSectionPaintPaperBefor = DoPaintPaperBefor;
                FEmrView.ContextMenuStrip         = this.pmView;
                //
                this.pnlView.Controls.Add(FEmrView);
                //FEmrView.Parent = this;
                FEmrView.Dock = DockStyle.Fill;
                FEmrView.Show();
            }
        }
예제 #3
0
        public frmImportRecord()
        {
            InitializeComponent();

            FEmrViewLite = new HCEmrView();
            this.pnlRecord.Controls.Add(FEmrViewLite);
            FEmrViewLite.Dock = DockStyle.Fill;
            FEmrViewLite.Show();
        }
예제 #4
0
        private void mniInsertTemplate_Click(object sender, EventArgs e)
        {
            if (TreeNodeIsTemplate(tvTemplate.SelectedNode))
            {
                frmRecord vFrmRecord = GetActiveRecord();
                if (vFrmRecord != null)
                {
                    TreeNode vNode = tvTemplate.SelectedNode;
                    using (MemoryStream vSM = new MemoryStream())
                    {
                        emrMSDB.DB.GetTemplateContent((vNode.Tag as TemplateInfo).ID, vSM);

                        while (vNode.Parent != null)
                        {
                            vNode = vNode.Parent;
                        }

                        int vGroupClass = (vNode.Tag as DataSetInfo).GroupClass;

                        if (vGroupClass == DataSetInfo.CLASS_PAGE)
                        {
                            vSM.Position = 0;
                            vFrmRecord.EmrView.InsertStream(vSM);
                        }
                        else
                        if ((vGroupClass == DataSetInfo.CLASS_HEADER) || (vGroupClass == DataSetInfo.CLASS_FOOTER))
                        {
                            HCEmrView vEmrView = new HCEmrView();
                            vEmrView.LoadFromStream(vSM);
                            vSM.SetLength(0);
                            vEmrView.Sections[0].Header.SaveToStream(vSM);
                            vSM.Position = 0;

                            if (vGroupClass == DataSetInfo.CLASS_HEADER)
                            {
                                vFrmRecord.EmrView.ActiveSection.Header.LoadFromStream(vSM, vEmrView.Style, HC.View.HC.HC_FileVersionInt);
                            }
                            else
                            {
                                vFrmRecord.EmrView.ActiveSection.Footer.LoadFromStream(vSM, vEmrView.Style, HC.View.HC.HC_FileVersionInt);
                            }

                            vFrmRecord.EmrView.IsChanged = true;
                            vFrmRecord.EmrView.UpdateView();
                        }
                    }
                }
            }
        }
예제 #5
0
        private void SyncDeGroupByStruct(HCEmrView aEmrView)
        {
            for (int i = 0; i < aEmrView.Sections.Count; i++)
            {
                HCViewData vData  = aEmrView.Sections[0].Page;
                int        vIndex = vData.Items.Count - 1;

                while (vIndex >= 0)
                {
                    if (HCDomainItem.IsBeginMark(vData.Items[vIndex]))                            // 是数据组开始位置
                    {
                        string    vDeGroupIndex = (vData.Items[vIndex] as DeGroup)[DeProp.Index]; // 数据组标识
                        DataRow[] vRows         = FDataElementSetMacro.Select("MacroType=3 and ObjID=" + vDeGroupIndex);
                        if (vRows.Length > 0)                                                     // 有该数据组的引用替换配置信息
                        {
                            // 得到指定的数据集对应的病历结构xml文档,并从xml中找该数据组的节点
                            XmlElement vXmlNode = GetDeItemNodeFromStructDoc(PatientInfo.PatID,
                                                                             int.Parse(vRows[0]["Macro"].ToString()), vDeGroupIndex);

                            if (vXmlNode != null)  // 找到了该数据组对应的节点
                            {
                                string vText = "";
                                for (int j = 0; j < vXmlNode.ChildNodes.Count; j++)
                                {
                                    vText = vText + vXmlNode.ChildNodes[j].InnerText;
                                }

                                if (vText != "")  // 得到不为空的节点内容并赋值给数据组
                                {
                                    aEmrView.SetDeGroupText(vData, vIndex, vText);
                                }
                            }
                        }
                    }

                    vIndex--;
                }
            }
        }
예제 #6
0
        private void SyncDeGroupByStruct(HCEmrView aEmrView)
        {
            for (int i = 0; i < aEmrView.Sections.Count; i++)
            {
                HCViewData vData  = aEmrView.Sections[0].Page;
                int        vIndex = vData.Items.Count - 1;

                while (vIndex >= 0)
                {
                    if (HCDomainItem.IsBeginMark(vData.Items[vIndex]))
                    {
                        string    vDeGroupIndex = (vData.Items[vIndex] as DeGroup)[DeProp.Index];
                        DataRow[] vRows         = FDataElementSetMacro.Select("MacroType=3 and ObjID=" + vDeGroupIndex);
                        if (vRows.Length > 0)
                        {
                            XmlElement vXmlNode = GetDeItemNodeFromStructDoc(PatientInfo.PatID,
                                                                             int.Parse(vRows[0]["Macro"].ToString()), vDeGroupIndex);

                            if (vXmlNode != null)
                            {
                                string vText = "";
                                for (int j = 0; j < vXmlNode.ChildNodes.Count; j++)
                                {
                                    vText = vText + vXmlNode.ChildNodes[j].InnerText;
                                }

                                if (vText != "")
                                {
                                    aEmrView.SetDeGroupText(vData, vIndex, vText);
                                }
                            }
                        }
                    }

                    vIndex--;
                }
            }
        }
예제 #7
0
 protected override HCCustomItem DoSectionCreateStyleItem(HCCustomData aData, int aStyleNo)
 {
     return(HCEmrView.CreateEmrStyleItem(aData, aStyleNo));
 }