Example #1
0
        public void LeaveHospital()
        {
            if (!IsPassInputValidate())
            {
                return;
            }
            clsT_Opr_Bih_Leave_VO objPatientVO;

            ValueToVoForLeave(out objPatientVO);

            try
            {
                DateTime outDate;
                outDate = Convert.ToDateTime(this.m_objViewer.m_dtpOutDate.Text);
                System.TimeSpan diff1 = outDate.Subtract(DateTime.Now);
                if (diff1.Days < 0)
                {
                    MessageBox.Show("出院日期不能早于今天", "提示");
                    this.m_objViewer.m_dtpOutDate.Focus();
                    return;
                }

                long            lngReg    = -1;
                clsDclBihLeaHos domainObj = new clsDclBihLeaHos();
                lngReg = domainObj.LeaveHospital(objPatientVO);

                if (lngReg > 0)
                {
                    string msg = "操作成功!"
                                 + this.m_objViewer.m_lblPatientName.Text + "将于"
                                 + this.m_objViewer.m_dtpOutDate.Text
                                 + "出院。";
                    MessageBox.Show(msg, "出院", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    m_objViewer.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("出院失败!", "出院", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    m_objViewer.DialogResult = DialogResult.No;
                }
            }
            catch (Exception e)
            {
                m_objViewer.DialogResult = DialogResult.No;
                MessageBox.Show(m_objViewer, e.Message, "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (m_objViewer.DialogResult == DialogResult.OK && this.m_objViewer.m_ckbPrint.Checked)
            {
                // 打印出院通知单
                frmPrintLeaveNotice printLeaveNotice = new frmPrintLeaveNotice(this.m_objViewer.m_bedManageVO, objPatientVO);

                printLeaveNotice.ShowDialog();
            }
        }
Example #2
0
        public void PreLeaveHospital()
        {
            if (!IsPassInputValidate())
            {
                return;
            }


            //try
            //{
            //    DateTime outDate;
            //    outDate = Convert.ToDateTime(this.m_dtpOutDate.Text);
            //    System.TimeSpan diff1 = outDate.Subtract(DateTime.Now);
            //    if (diff1.Days > 0)
            //    {
            //        MessageBox.Show("出院日期不能早于今天", "提示");
            //        this.m_objViewer.m_dtpOutDate.Focus();
            //        return;
            //     }
            //}
            //catch
            //{ }

            clsT_Opr_Bih_Leave_VO objPatientVO;

            ValueToVoForLeave(out objPatientVO);

            try
            {
                DateTime outDate;
                outDate = Convert.ToDateTime(this.m_objViewer.m_dtpOutDate.Text).Date;
                System.TimeSpan diff1 = outDate.Subtract(DateTime.Today);
                if (diff1.Days < 0)
                {
                    MessageBox.Show("预出院日期不能早于今天", "提示");
                    this.m_objViewer.m_dtpOutDate.Focus();
                    return;
                }

                if (diff1.Days > 1)
                {
                    MessageBox.Show("预出院日期不能迟于明天", "提示");
                    this.m_objViewer.m_dtpOutDate.Focus();
                    return;
                }

                //调用算费接口
                bool charge;
                charge = clsPublic.m_blnChargeContinueItem(objPatientVO.m_strREGISTERID_CHR, objPatientVO.m_strOPERATORID_CHR);
                if (!charge)
                {
                    MessageBox.Show("调用费用接口失败", "提示");
                    //this.m_objViewer.m_dtpOutDate.Focus();
                    return;
                }

                long            lngReg    = -1;
                clsDclBihLeaHos domainObj = new clsDclBihLeaHos();

                //bool HasDisExcOrder;
                //domainObj.IfHasDisExcOrder(objPatientVO.m_strREGISTERID_CHR, out HasDisExcOrder);
                //if (HasDisExcOrder == true)
                //{
                //    string message = "该病人有医嘱未处理,请处理完毕才可以办理出院手续。是否继续?";
                //    string caption = "提示";
                //    MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                //    DialogResult result;

                //    result = MessageBox.Show(this.m_objViewer, message, caption, buttons,
                //        MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
                //        MessageBoxOptions.RightAlign);

                //    if (result == DialogResult.No)
                //    {
                //        return;
                //    }

                //}


                lngReg = domainObj.PreLeaveHospital(objPatientVO);

                if (lngReg > 0)
                {
                    string msg = "操作成功!"
                                 + this.m_objViewer.m_lblPatientName.Text + "将于"
                                 + this.m_objViewer.m_dtpOutDate.Text
                                 + "出院。";
                    MessageBox.Show(msg, "预出院", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    m_objViewer.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("预出院失败!", "预出院", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    m_objViewer.DialogResult = DialogResult.No;
                }
            }
            catch (Exception e)
            {
                m_objViewer.DialogResult = DialogResult.No;
                MessageBox.Show(m_objViewer, e.Message, "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (m_objViewer.DialogResult == DialogResult.OK && this.m_objViewer.m_ckbPrint.Checked)
            {
                // 打印出院通知单
                frmPrintLeaveNotice printLeaveNotice = new frmPrintLeaveNotice(this.m_objViewer.m_bedManageVO, objPatientVO);

                printLeaveNotice.Show();
                printLeaveNotice.Hide();
                printLeaveNotice.m_cmdPrint_Click(null, null);
            }
        }