Beispiel #1
0
        public void btn_patlist_Clicked()
        {
            PatientListForm      plForm      = new PatientListForm();
            PatientListPresenter plPresenter = new PatientListPresenter(plForm);

            plForm.Show();
        }
Beispiel #2
0
        /// <summary>
        /// 检索符合条件的患者就诊信息
        /// </summary>
        /// <param name="szDeptCode">科室代码</param>
        /// <param name="patientType">患者列表检索方式</param>
        /// <param name="dtBeginTime">起始时间</param>
        /// <param name="dtEndTime">截止时间</param>
        /// <param name="patientListForm">患者列表窗口</param>
        /// <returns>SystemData.ReturnValue</returns>
        public short ExecuteSearch(string szDeptCode, EMRDBLib.PatientType patientType, DateTime dtBeginTime, DateTime dtEndTime
                                   , PatientListForm patientListForm, EMRDBLib.PatSearchType SearchType, string szOperationCode, MDSDBLib.DocTypeInfo docTypeInfo)
        {
            if (patientListForm == null || patientListForm.IsDisposed)
            {
                return(SystemData.ReturnValue.FAILED);
            }

            if (this.StopThreadsWork() != SystemData.ReturnValue.OK)
            {
                return(SystemData.ReturnValue.FAILED);
            }

            if (this.m_ThrdList != null && this.m_ThrdList.Count > 0)
            {
                this.m_ThrdList.Clear();
            }

            while (dtBeginTime.AddDays(30) < dtEndTime)
            {
                this.AddSearchThread(szDeptCode, dtBeginTime, dtBeginTime.AddDays(30), patientType, patientListForm, SearchType, szOperationCode, docTypeInfo);
                dtBeginTime = dtBeginTime.AddDays(31);
            }
            if (dtBeginTime < dtEndTime)
            {
                this.AddSearchThread(szDeptCode, dtBeginTime, dtEndTime, patientType, patientListForm, SearchType, szOperationCode, docTypeInfo);
            }
            this.StartNextThread();
            return(SystemData.ReturnValue.OK);
        }
Beispiel #3
0
 public PatSearchCondition(string szThrdName, string szDeptCode, PatientListForm patientListForm, DateTime dtBeginTime
                           , DateTime dtEndTime, EMRDBLib.PatientType patientType, EMRDBLib.PatSearchType patSearchType, string szOperationCode, MDSDBLib.DocTypeInfo docTypeInfo)
 {
     this.m_szDeptCode      = szDeptCode;
     this.m_szThreadName    = szThrdName;
     this.m_PatientListForm = patientListForm;
     this.m_dtBeginTime     = dtBeginTime;
     this.m_dtEndTime       = dtEndTime;
     this.m_PatientType     = patientType;
     this.m_PatSearchType   = patSearchType;
     this.m_szOperationCode = szOperationCode;
     this.m_DocType         = docTypeInfo;
 }
Beispiel #4
0
        /// <summary>
        /// 将线程添加到线程池中
        /// </summary>
        /// <param name="szDeptCode">科室代码</param>
        /// <param name="dtBeginTime">查询起始时间</param>
        /// <param name="dtEndTime">查询截止时间</param>
        /// <param name="patientType">检索方式</param>
        /// <param name="patientListForm">患者列表检索窗口</param>
        /// <param name="patSearchType">患者质控方式</param>
        private void AddSearchThread(string szDeptCode, DateTime dtBeginTime, DateTime dtEndTime, EMRDBLib.PatientType patientType
                                     , PatientListForm patientListForm, EMRDBLib.PatSearchType patSearchType, string szOperationCode, MDSDBLib.DocTypeInfo docTypeInfo)
        {
            if (this.m_ThrdList == null)
            {
                this.m_ThrdList = new ArrayList();
            }
            string szThreadName = "Thread" + (this.m_ThrdList.Count + 1).ToString();

            dtEndTime = DateTime.Parse(dtEndTime.ToString("yyyy-M-d 23:59:59"));
            PatSearchCondition searchConditon = new PatSearchCondition(szThreadName, szDeptCode, patientListForm, dtBeginTime, dtEndTime
                                                                       , patientType, patSearchType, szOperationCode, docTypeInfo);
            SearchThread searchThread = new SearchThread();

            searchThread.Name               = szThreadName;
            searchThread.Thread             = null;
            searchThread.ThreadState        = EMRDBLib.SearchThreadState.ready;
            searchThread.PatSearchCondition = searchConditon;
            this.m_ThrdList.Add(searchThread);
        }
Beispiel #5
0
        public override bool Execute(object param, object data)
        {
            MainForm form = param as MainForm;

            if (form == null)
            {
                return(false);
            }
            foreach (DockContentBase item in form.DockPanel.Contents)
            {
                if (item is PatientListForm)
                {
                    item.Activate();
                    item.OnRefreshView();
                    return(true);
                }
            }
            PatientListForm role = new PatientListForm(form);

            role.Show(form.DockPanel, DockState.Document);
            role.Activate();
            role.OnRefreshView();
            return(true);
        }
Beispiel #6
0
        private void OpenForm(object sender, EventArgs e)
        {
            var btn  = (Button)sender;
            var text = btn.Text;

            CatelogForm form = null;

            if (Application.OpenForms.OfType <CatelogForm>().Count() != 0)
            {
                form = Application.OpenForms.OfType <CatelogForm>().LastOrDefault();
            }
            if (form != null)
            {
                var gbo = form.pnlFill;
                form.Skip = true;
                gbo.Controls.Clear();

                if (text == "Worker")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <WorkerListForm>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <WorkerListForm>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                            var selectionForm = new WorkerListForm()
                            {
                                TopLevel    = false,
                                Dock        = DockStyle.Fill,
                                AutoScroll  = true,
                                CatelogForm = form
                            };
                            gbo.Controls.Add(selectionForm);
                            selectionForm.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new WorkerListForm()
                        {
                            TopLevel    = false,
                            Dock        = DockStyle.Fill,
                            AutoScroll  = true,
                            CatelogForm = form
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "Category")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <Category>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <Category>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                        }
                        var selectionForm = new Category()
                        {
                            TopLevel   = false,
                            Dock       = DockStyle.Fill,
                            AutoScroll = true
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new Category()
                        {
                            TopLevel   = false,
                            Dock       = DockStyle.Fill,
                            AutoScroll = true
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "Patient")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <PatientListForm>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <PatientListForm>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                            var selectionForm = new PatientListForm()
                            {
                                TopLevel    = false,
                                Dock        = DockStyle.Fill,
                                AutoScroll  = true,
                                Account     = _account,
                                CatelogForm = form
                            };
                            gbo.Controls.Add(selectionForm);
                            selectionForm.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}

                    else
                    {
                        var selectionForm = new PatientListForm()
                        {
                            TopLevel    = false,
                            Dock        = DockStyle.Fill,
                            AutoScroll  = true,
                            Account     = _account,
                            CatelogForm = form
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "CheckIn")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <CheckInsForm>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <CheckInsForm>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                            var selectionForm = new CheckInsForm
                            {
                                TopLevel   = false,
                                Dock       = DockStyle.Fill,
                                AutoScroll = true
                            };
                            gbo.Controls.Add(selectionForm);
                            selectionForm.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new CheckInsForm
                        {
                            TopLevel   = false,
                            Dock       = DockStyle.Fill,
                            AutoScroll = true
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "Sample")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <SamplesForm>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <SamplesForm>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                            var selectionForm = new SamplesForm()
                            {
                                TopLevel   = false,
                                Dock       = DockStyle.Fill,
                                AutoScroll = true,
                                Account    = _account
                            };
                            gbo.Controls.Add(selectionForm);
                            selectionForm.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new SamplesForm()
                        {
                            TopLevel   = false,
                            Dock       = DockStyle.Fill,
                            AutoScroll = true,
                            Account    = _account
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "Management")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <Managements>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <Managements>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                            var selectionForm = new Managements()
                            {
                                TopLevel   = false,
                                Dock       = DockStyle.Fill,
                                AutoScroll = true
                            };
                            gbo.Controls.Add(selectionForm);
                            selectionForm.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new Managements()
                        {
                            TopLevel   = false,
                            Dock       = DockStyle.Fill,
                            AutoScroll = true
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "Medical")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <MedicalsForm>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <MedicalsForm>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            gbo.Controls.Add(firstOrDefault);
                            firstOrDefault.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new MedicalsForm()
                        {
                            TopLevel    = false,
                            Dock        = DockStyle.Fill,
                            AutoScroll  = true,
                            Account     = _account,
                            CatelogForm = form
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "WaitingList")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <WaitingForm>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <WaitingForm>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                            var selectionForm = new WaitingForm()
                            {
                                TopLevel    = false,
                                Dock        = DockStyle.Fill,
                                AutoScroll  = true,
                                Account     = _account,
                                CatelogForm = form
                            };
                            gbo.Controls.Add(selectionForm);
                            selectionForm.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new WaitingForm()
                        {
                            TopLevel    = false,
                            Dock        = DockStyle.Fill,
                            AutoScroll  = true,
                            Account     = _account,
                            CatelogForm = form
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
                if (text == "Report")
                {
                    if (Application.OpenForms.OfType <HistorysForm>().Count() != 0)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <HistorysForm>().LastOrDefault();
                        if (firstOrDefault != null)
                        {
                            if (firstOrDefault.NewMedical || firstOrDefault.Editing)
                            {
                                var result = MessageBox.Show(@"Do you really want to leave this? leaving this document will delete all your current work.", @"Leave", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    gbo.Controls.Add(firstOrDefault);
                                    firstOrDefault.CatelogForm.Skip = false;
                                    firstOrDefault.Show();
                                    return;
                                }
                                if (result == DialogResult.Yes)
                                {
                                    firstOrDefault.Close();
                                }
                            }
                        }
                    }
                    if (Application.OpenForms.OfType <WaitingForm>().Count() == 1)
                    {
                        var firstOrDefault = Application.OpenForms.OfType <WaitingForm>().FirstOrDefault();
                        if (firstOrDefault != null)
                        {
                            firstOrDefault.Close();
                            var selectionForm = new Report()
                            {
                                TopLevel   = false,
                                Dock       = DockStyle.Fill,
                                AutoScroll = true,
                            };
                            gbo.Controls.Add(selectionForm);
                            selectionForm.Show();
                        }
                    }
                    //if (Application.OpenForms.OfType<MedicalsForm>().Count() == 1)
                    //{
                    //    var firstOrDefault = Application.OpenForms.OfType<MedicalsForm>().FirstOrDefault();
                    //    if (firstOrDefault != null)
                    //    {
                    //        firstOrDefault.Clear();
                    //        firstOrDefault.Close();
                    //    }
                    //}
                    else
                    {
                        var selectionForm = new Report()
                        {
                            TopLevel   = false,
                            Dock       = DockStyle.Fill,
                            AutoScroll = true,
                        };
                        gbo.Controls.Add(selectionForm);
                        selectionForm.Show();
                    }
                }
            }
        }