Exemplo n.º 1
0
 public void ShowFormByDocName(object patientId, object visitId, object operId, string docName)
 {
     panelSafetyDoc.Controls.Clear();
     ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(docName);
     //没有找到退出
     if (string.IsNullOrEmpty(document.Caption))
     {
         return;
     }
     try
     {
         Type t = Type.GetType(document.Type);
         baseDoc = Activator.CreateInstance(t) as BaseDoc;
         baseDoc.statusReadOnly = _statusName;
         baseDoc.isShowButton   = false;
         if (patientId != null)
         {
             object[] objs = new object[3];
             objs[0] = patientId;
             objs[1] = visitId;
             objs[2] = operId;
             baseDoc.SetDocParameters(objs);
         }
         baseDoc.LoadReport(ExtendApplicationContext.Current.AppPath + document.Path);
         baseDoc.AutoScroll = false;
         baseDoc.Height     = 1200;
         panelSafetyDoc.Controls.Add(baseDoc);
         // baseDoc.Dock = DockStyle.Fill;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 2
0
        private bool LoadDoc(string curDocName)
        {
            bool result = true;

            ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(curDocName);

            //没有找到退出
            if (string.IsNullOrEmpty(document.Caption))
            {
                result = false;
                ShowMessageBox(string.Format("无法加载文书'{0}'的设计模版,请确保模版文件已经存在", curDocName), MessageBoxButton.OK, MessageBoxImage.Error, callBack: (r) =>
                {
                    this.CloseContentWindow();
                    return;
                }, isAsyncShow: true);
            }
            else
            {
                // 载入文书,获取文书名
                ExtendAppContext.Current.CurrentDocName = curDocName;
                ExtendAppContext.Current.CurntOpenForm  = new OpenForm(curDocName, null);
                Type t = Type.GetType(document.Type);
                curBaseDoc           = Activator.CreateInstance(t) as BaseDoc;
                curBaseDoc.BackColor = Color.White;
                curBaseDoc.Name      = curDocName;
                curBaseDoc.HideScrollBar();
                curBaseDoc.Initial();
                curBaseDoc.LoadReport(Path.Combine(System.Windows.Forms.Application.StartupPath, document.Path));
                curBaseDoc.SetAllControlEditable(ExtendAppContext.Current.IsPermission);
                // 设置文书大小
                SetDocSize(curDocName);
            }

            return(result);
        }
Exemplo n.º 3
0
        public void ShowDocByDocName(string docName)
        {
            ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(docName);

            //没有找到退出
            if (string.IsNullOrEmpty(document.Caption))
            {
                //DialogResult dialogResult = XtraMessageBox.Show(string.Format("无法加载文书'{0}'的设计模版,请确保模版文件已经存在", docName),
                //        "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //this.workSpaceControl1.AddDocToWorkSpace(null);
                return;
            }

            try
            {
                Type    t       = Type.GetType(document.Type);
                BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc;
                baseDoc.BackColor = Color.White;
                baseDoc.Name      = docName;
                baseDoc.HideScrollBar();
                baseDoc.Initial();
                baseDoc.LoadReport(ExtendApplicationContext.Current.AppPath + document.Path);
                if (baseDoc.DocKind == DocKind.Anes)
                {
                    // baseDoc.AfterPrint += new Medicalsystem.Anes.Framework.Documents.BaseDoc.EventAfterPrint(AfterPrint);
                }
                // this.workSpaceControl1.AddDocToWorkSpace(baseDoc);

                Timer a = new Timer();
                a.Interval = 1;
                a.Tick    += delegate
                {
                    baseDoc.ShowScrollBar();
                    //销毁定义器
                    a.Enabled = false;
                    a.Stop();
                    a.Dispose();
                };
                a.Enabled = true;


                if (ExtendApplicationContext.Current.AppType == ApplicationType.Anesthesia)
                {
                }
                else if (ExtendApplicationContext.Current.AppType == ApplicationType.PACU)
                {
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.Handle(ex);
            }
        }
Exemplo n.º 4
0
 public override void LoadData()
 {
     //加载数据
     if (ExtendAppContext.Current._VitalSignGraph == null)
     {
         ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument("麻醉记录单");
         string _reportName = ExtendAppContext.Current.AppPath + document.Path;
         Panel  p           = new Panel();
         AssemblyHelper.ReadFile(_reportName, p);
         ReadControl(p);
         p.Dispose();
     }
     else
     {
         _vitalSignGraph = ExtendAppContext.Current._VitalSignGraph;
     }
 }
Exemplo n.º 5
0
 public void ShowFormByDocName(object patientId, object visitId, object operId, string docName)
 {
     ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(docName);
     //没有找到退出
     if (string.IsNullOrEmpty(document.Caption))
     {
         return;
     }
     try
     {
         Type    t       = Type.GetType(document.Type);
         BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc;
         baseDoc.ShowScrollBar();
         // 设置指定的患者信息
         if (patientId != null)
         {
             object[] objs = new object[3];
             objs[0] = patientId;
             objs[1] = visitId;
             objs[2] = operId;
             baseDoc.SetDocParameters(objs);
         }
         baseDoc.LoadReport(ExtendApplicationContext.Current.AppPath + document.Path);
         DialogHostFormPC dialogHostForm = null;
         dialogHostForm       = new DialogHostFormPC(docName, 1200, 900);
         dialogHostForm.Child = baseDoc;
         if (AccessControl.CheckModifyRightForOperator(docName))//有Modify权限
         {
             baseDoc.SetAllControlEditable(true);
         }
         else
         {
             baseDoc.SetAllButtonsEnable(false);
             baseDoc.SetAllControlEditable(false);
         }
         if (baseDoc.AllowSingleDocModify())
         {
             baseDoc.SetAllControlEditable(true);
         }
         dialogHostForm.ShowDialog();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 上传文书
        /// </summary>
        private void PostPDF(object docName)
        {
            // 减少资源消耗,每次加载文书前都手动释放资源
            GC.Collect();
            GC.Collect();

            string strCurDocName = ExtendAppContext.Current.CurrentDocName;

            try
            {
                ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(docName.ToString());
                Type t = Type.GetType(document.Type);
                using (BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc)
                {
                    baseDoc.BackColor = Color.White;
                    baseDoc.Name      = docName.ToString();
                    ExtendAppContext.Current.CurrentDocName = baseDoc.Name;
                    baseDoc.HideScrollBar();
                    baseDoc.Initial();
                    baseDoc.LoadReport(ExtendAppContext.Current.AppPath + document.Path);
                    baseDoc.SingPostPDFNoMsgbox();
                    if (this.IsPostSuccessed)                           // 保证有一张文书失败就是上传失败
                    {
                        this.IsPostSuccessed = baseDoc.IsPostSuccessed; // 文书上传失败的话,可以得提示
                    }
                    this.ProBarValue = this.ProBarValue + 1;
                }
            }
            catch (Exception ex)
            {
                Logger.Error("文书批量归档错误", ex);
            }
            finally
            {
                GC.Collect();
                GC.Collect();
            }

            // 重置当前文书名称
            ExtendAppContext.Current.CurrentDocName = strCurDocName;
        }
Exemplo n.º 7
0
        /// <summary>
        /// 集中打印按钮
        /// </summary>
        private void BtnPrint_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("文书是否要集中打印", "集中打印", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }

            // 集中打印文书前,记录当前文书的名称,在集中打印完成后重新设置回来。
            // 之所以记录当前文书名称,是防止在打印各时,需要根据根据文书名称来实现个性化的功能.
            string strCurDocName = ExtendAppContext.Current.CurrentDocName;

            foreach (CheckedListBoxItem item in chkDocCheckList.Items)
            {
                if (item.CheckState == CheckState.Checked)
                {
                    ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(item.Value.ToString());

                    //没有找到退出
                    if (string.IsNullOrEmpty(document.Caption))
                    {
                        DialogResult dialogResult = MessageBoxFormPC.Show(string.Format("无法加载文书'{0}'的设计模版,请确保模版文件已经存在",
                                                                                        item.Value.ToString()),
                                                                          "提示信息",
                                                                          MessageBoxButtons.OK,
                                                                          MessageBoxIcon.Information);
                        continue;
                    }

                    try
                    {
                        // 减少资源消耗,每次加载文书前都手动释放资源
                        GC.Collect();
                        GC.Collect();

                        // 使用using(){} 格式,确保在执行完该代码块时调用Dispose,实现手动释放资源
                        Type t = Type.GetType(document.Type);
                        using (CustomBaseDoc baseDoc = Activator.CreateInstance(t) as CustomBaseDoc)
                        {
                            baseDoc.BackColor = Color.White;
                            baseDoc.Name      = item.Value.ToString();
                            ExtendAppContext.Current.CurrentDocName = baseDoc.Name;
                            baseDoc.HideScrollBar();
                            baseDoc.Initial();
                            baseDoc.LoadReport(ExtendAppContext.Current.AppPath + document.Path);
                            bool IsPrintSuccess = baseDoc.PrintBaseDoc();
                            baseDoc.CommitDocNoMess();
                        }

                        List <string> fileList = new List <string>();
                        foreach (CheckedListBoxItem boxItem in chkDocCheckList.Items)
                        {
                            if (boxItem.CheckState == CheckState.Checked)
                            {
                                fileList.Add(boxItem.Value.ToString());
                            }
                        }
                    }
                    catch
                    {
                    }
                    finally
                    {
                        // 减少资源消耗,每次加载文书前都手动释放资源
                        GC.Collect();
                        GC.Collect();
                    }
                }
            }

            // 重置当前文书名称
            ExtendAppContext.Current.CurrentDocName = strCurDocName;

            //打印结束后,自动关闭打印选择界面。
            this.Close();
        }
Exemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("文书是否要集中打印", "集中打印", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }
            foreach (CheckedListBoxItem item in chkDocCheckList.Items)
            {
                if (item.CheckState == CheckState.Checked)
                {
                    ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(item.Value.ToString());

                    //没有找到退出
                    if (string.IsNullOrEmpty(document.Caption))
                    {
                        DialogResult dialogResult = MessageBoxFormPC.Show(string.Format("无法加载文书'{0}'的设计模版,请确保模版文件已经存在", item.Value.ToString()),
                                                                          "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        continue;
                    }

                    try
                    {
                        Type          t       = Type.GetType(document.Type);
                        CustomBaseDoc baseDoc = Activator.CreateInstance(t) as CustomBaseDoc;
                        baseDoc.BackColor = Color.White;
                        baseDoc.Name      = item.Value.ToString();
                        baseDoc.HideScrollBar();
                        baseDoc.Initial();
                        baseDoc.LoadReport(ExtendApplicationContext.Current.AppPath + document.Path);
                        bool IsPrintSuccess = baseDoc.PrintBaseDoc();

                        List <string> fileList = new List <string>();
                        foreach (CheckedListBoxItem boxItem in chkDocCheckList.Items)
                        {
                            if (boxItem.CheckState == CheckState.Checked)
                            {
                                fileList.Add(boxItem.Value.ToString());
                            }
                        }
                        //ApplicationConfiguration.multiPrintNames = string.Join(",", fileList.ToArray());

                        //(new ConfigurationDA()).UpdateConfigTableDataTable(ExtendApplicationContext.Current.CommDict.ConfigDict);

                        //if (ExtendApplicationContext.Current.PatientInformation != null && IsPrintSuccess)
                        //{
                        //    Common.MED_ANES_BUTTON_MARKDataTable buttonMarkDT = new CommonDA().GetAnesDocButtonMarkData(ExtendApplicationContext.Current.PatientInformation.PatientID,
                        //    ExtendApplicationContext.Current.PatientInformation.VisitID, ExtendApplicationContext.Current.PatientInformation.OperID, MedicalDocSettings.ReturnDocNameByKey(baseDoc.Name));
                        //    if (buttonMarkDT.Count == 0)
                        //    {
                        //        Common.MED_ANES_BUTTON_MARKRow dr = buttonMarkDT.NewMED_ANES_BUTTON_MARKRow();
                        //        dr.PATIENT_ID = ExtendApplicationContext.Current.PatientInformation.PatientID;
                        //        dr.VISIT_ID = ExtendApplicationContext.Current.PatientInformation.VisitID;
                        //        dr.OPER_ID = ExtendApplicationContext.Current.PatientInformation.OperID;
                        //        dr.BUTTON_NAME = MedicalDocSettings.ReturnDocNameByKey(baseDoc.Name);
                        //        dr.RGB = new CommonDA().returnRGB(Color.Blue);
                        //        buttonMarkDT.AddMED_ANES_BUTTON_MARKRow(dr);

                        //    }
                        //    else if (buttonMarkDT.Count > 0)
                        //    {
                        //        Common.MED_ANES_BUTTON_MARKRow dr = buttonMarkDT[0] as Common.MED_ANES_BUTTON_MARKRow;
                        //        dr.RGB = new CommonDA().returnRGB(Color.Blue);
                        //    }
                        //    try
                        //    {
                        //        int r = new CommonDA().UpdateAnesDocButtonMarkData(buttonMarkDT);
                        //    }
                        //    catch (Exception ex)
                        //    {
                        //        ExceptionHandler.Handle(ex);
                        //    }                 //todo
                        //}
                    }
                    catch
                    {
                    }
                }
            }
        }
Exemplo n.º 9
0
        public void ShowFormByDocName(object patientId, object visitId, object operId, List <string> item)
        {
            string firstDocName = "";

            bocList.Clear();
            reportNameDic.Clear();
            try
            {
                BaseDoc baseDoc = new BaseDoc();

                foreach (string docName in item)
                {
                    if (!string.IsNullOrEmpty(docName))
                    {
                        if (string.IsNullOrEmpty(firstDocName))
                        {
                            firstDocName = docName;
                        }
                        ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(docName);
                        //没有找到退出
                        if (!string.IsNullOrEmpty(document.Caption))
                        {
                            Type t = Type.GetType(document.Type);
                            baseDoc             = Activator.CreateInstance(t) as BaseDoc;
                            baseDoc.BtnClicked += baseDoc_BtnClicked;
                            baseDoc.Caption     = docName;
                            baseDoc.ShowScrollBar();
                            // 设置指定的患者信息
                            if (patientId != null)
                            {
                                object[] objs = new object[3];
                                objs[0] = patientId;
                                objs[1] = visitId;
                                objs[2] = operId;
                                baseDoc.SetDocParameters(objs);
                            }
                            bocList.Add(baseDoc);
                            reportNameDic.Add(docName, ExtendApplicationContext.Current.AppPath + document.Path);
                        }
                    }
                }
                if (reportNameDic.Count > 0)
                {
                    bocList[0].LoadReport(reportNameDic, firstDocName);
                    DialogHostFormPC dialogHostForm = null;
                    dialogHostForm       = new DialogHostFormPC("其他文书", 1200, 900);
                    dialogHostForm.Child = bocList[0];
                    if (AccessControl.CheckModifyRightForOperator(firstDocName))//有Modify权限
                    {
                        bocList[0].SetAllControlEditable(true);
                    }
                    else
                    {
                        bocList[0].SetAllButtonsEnable(false);
                        bocList[0].SetAllControlEditable(false);
                    }
                    if (bocList[0].AllowSingleDocModify())
                    {
                        bocList[0].SetAllControlEditable(true);
                    }
                    dialogHostForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }