예제 #1
0
        //追加病程
        private void CaseHistory_MenuItem_AppendRecord_Click(object sender, EventArgs e)
        {
            if (dgv_FinishedCaseHistory.SelectedRows.Count > 0)
            {
                var selectedCaseHistory = dgv_FinishedCaseHistory.SelectedRows[0].DataBoundItem as CaseHistory;
                if (selectedCaseHistory != null && selectedCaseHistory.CaseType >= (int)Enums.CaseType.ProgressNote)
                {
                    if (currentSelectedPatient != null)
                    {
                        ProgressNoteTypeSelectionView form = new ProgressNoteTypeSelectionView();
                        var types = new List <TreeNode>();
                        // Mark:第四树节点为病程节点
                        if (tv_TemplateCatalog.Nodes.Count > 2)
                        {
                            foreach (TreeNode subNode in tv_TemplateCatalog.Nodes[2].Nodes)
                            {
                                types.Add(subNode);
                            }
                        }

                        form.ProgressNoteTypes = types;
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            if (form.SelectedTypeNode != null)
                            {
                                LoadTemplateView loadTemplateForm = new LoadTemplateView((TemplateCatalogNode)form.SelectedTypeNode.Tag);
                                loadTemplateForm.SelectTemplateEvent += HandleSelectTemplateForProgressNote;
                                loadTemplateForm.ShowDialog();
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
        private void btn_LoadTemplate_Click(object sender, EventArgs e)
        {
            if (tv_TemplateCatalog.SelectedNode != null && tv_TemplateCatalog.SelectedNode.Level == 1)
            {
                var nodeId = ((TemplateCatalogNode)tv_TemplateCatalog.SelectedNode.Tag).TemplateNodeId.ToString();
                var type   = (int)GetTabPageTypeById(nodeId);
                //病程
                if (type > 1)
                {
                    //if (!isAddedBaseProgressTemplate)
                    //{
                    if (currentSelectedPatient == null)
                    {
                        UIHelper.ShowInformationMessage("请选择病人");
                        return;
                    }
                    if (type == 2)
                    {
                        if (!currentSelectedPatient.IsHasProgressCommonNote && !currentSelectedPatient.IsHasProgressTCMNote)
                        {
                            UIHelper.ShowInformationMessage("请为当前病人添加首日病程");
                            return;
                        }
                        else
                        {
                            UIHelper.ShowInformationMessage("请在已经添加的首日病程中追加病程");
                            return;
                        }
                    }
                    else if (type == 3 || type == 4)
                    {
                        if (currentSelectedPatient.IsHasProgressCommonNote && type == 3)
                        {
                            UIHelper.ShowInformationMessage("当前病人已经添加过首日病程");
                            return;
                        }
                        else if (currentSelectedPatient.IsHasProgressTCMNote && type == 4)
                        {
                            UIHelper.ShowInformationMessage("当前病人已经添加过首日中医病程");
                            return;
                        }
                    }
                    if (type == 3 && currentSelectedPatient.IsHasProgressTCMNote)
                    {
                        UIHelper.ShowInformationMessage("当前病人已经添加过首日中医病程,不能添加普通病程");
                        return;
                    }
                    else if (type == 4 && currentSelectedPatient.IsHasProgressCommonNote)
                    {
                        UIHelper.ShowInformationMessage("当前病人已经添加过首日普通病程,不能添加中医病程");
                        return;
                    }


                    if (type == 3 && currentSelectedPatient.HasBaseTemplateForCommonProgressNote)
                    {
                        LoadTemplateView form = new LoadTemplateView((TemplateCatalogNode)tv_TemplateCatalog.SelectedNode.Tag);
                        form.SelectTemplateEvent += HandleSelectTemplateEvent;
                        form.ShowDialog();
                        return;
                    }
                    else if (type == 4 && currentSelectedPatient.HasBaseTemplateForTCMProgressNote)
                    {
                        LoadTemplateView form = new LoadTemplateView((TemplateCatalogNode)tv_TemplateCatalog.SelectedNode.Tag);
                        form.SelectTemplateEvent += HandleSelectTemplateEvent;
                        form.ShowDialog();
                        return;
                    }

                    TabPage       newTabPage = null;
                    EditorControl editor     = null;
                    if (editorTabPageControl.TabPages.Count == 1 && (Guid)editorTabPageControl.TabPages[0].Tag == Guid.Empty)
                    {
                        newTabPage = editorTabPageControl.TabPages[0];
                        //newTabPage.Text = currentSelectedTemplate.FileTitle;
                        //newTabPage.Tag = currentSelectedTemplate.RecordId;
                        editor = editorTabPageControl.TabPages[0].Controls[0] as EditorControl;
                    }
                    else
                    {
                        newTabPage = new TabPage()
                        {
                            Text = currentSelectedTemplate.FileTitle,
                            Tag  = currentSelectedTemplate.RecordId
                        };

                        editor = new EditorControl()
                        {
                            Dock     = DockStyle.Fill,
                            Location = new Point(3, 3),
                            Margin   = new Padding(3, 4, 3, 4),
                            Size     = new Size(865, 600),
                            //FileContent = content
                        };

                        newTabPage.Controls.Add(editor);
                        editorTabPageControl.TabPages.Add(newTabPage);
                        editorTabPageControl.SelectedTab = newTabPage;
                    }
                    // 加载框架模版
                    string tempPath = Path.Combine(Application.StartupPath, "BaseProgressTemplate.xml");
                    editor.WriteControl.LoadDocument(tempPath, null);
                    editor.WriteControl.Document.Body.Elements.Clear();
                    if (type == 3)
                    {
                        currentSelectedPatient.HasBaseTemplateForCommonProgressNote = true;
                    }
                    else if (type == 4)
                    {
                        currentSelectedPatient.HasBaseTemplateForTCMProgressNote = true;
                    }
                }
                else
                {
                    LoadTemplateView form = new LoadTemplateView((TemplateCatalogNode)tv_TemplateCatalog.SelectedNode.Tag);
                    form.SelectTemplateEvent += HandleSelectTemplateEvent;
                    form.ShowDialog();
                }
            }
            else
            {
                UIHelper.ShowInformationMessage("请在病历目录里选择要加载的病历类型!");
            }
        }