Exemple #1
0
        private void toolStrip1_ItemClicked_1(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem == this.tbAddOrder)
            {
                /// <summary>
                /// [功能描述: 开立医嘱]<br></br>
                /// [创 建 者: ]<br></br>
                /// [创建时间: ]<br></br>
                /// <修改记录
                ///		修改人='张琦'
                ///		修改时间='2007-8-25'
                ///		修改目的='对会诊医师能否开立医嘱进行控制'
                ///		修改描述='判断会诊患者有无开立医嘱的权限'
                ///  />
                /// </summary>
                //选择子节点
                if (this.tvDoctorPatientList1.SelectedNode.Parent != null && this.tvDoctorPatientList1.SelectedNode.Parent.Tag != null)
                {
                    int count = 0;
                    count = this.tvDoctorPatientList1.SelectedNode.Parent.GetNodeCount(false);
                    //判断所选节点父节点如果为会诊患者,则判断有无开立医嘱的权限/如果不是会诊患者则不需要进行判断,都可以进行开立医嘱
                    if (this.tvDoctorPatientList1.SelectedNode.Parent.Text == ("会诊患者" + "(" + count.ToString() + ")"))
                    {
                        patient = this.tvDoctorPatientList1.SelectedNode.Tag as Neusoft.HISFC.Models.RADT.PatientInfo;

                        //处理床位号截位
                        string bedNO = patient.PVisit.PatientLocation.Bed.ID;
                        if (bedNO.Length > 4)
                        {
                            bedNO = bedNO.Substring(4);
                        }
                        //处理住院号显示
                        string patientNO = patient.PID.PatientNO;
                        if (string.IsNullOrEmpty(patientNO) == true)
                        {
                            patientNO = patient.ID;
                        }

                        this.Text   = "您正在操作的患者为 住院号:" + patientNO + "姓名:" + patient.Name + "性别:" + patient.Sex.Name + "年龄:" + consultation.GetAge(this.patient.Birthday) + " 床号:" + bedNO;
                        inpatientNo = patient.ID;
                        co          = consultation.QueryConsulation(this.inpatientNo);
                        if (co != null || co.Count != 0)
                        {
                            for (int i = 0; i < co.Count; i++)
                            {
                                Neusoft.HISFC.Models.Order.Consultation obj = co[i] as Neusoft.HISFC.Models.Order.Consultation;
                                //根据会诊患者有效的会诊单信息,判断医生是否有对该会诊患者开立医嘱权限
                                if ((Neusoft.FrameWork.Management.Connection.Operator.ID == obj.DoctorConsultation.ID) &&
                                    (obj.EndTime >= consultation.GetDateTimeFromSysDateTime()) &&
                                    (obj.IsCreateOrder))
                                {
                                    if (this.ucOrder1.Add() == 0)
                                    {
                                        this.initButton(true);
                                    }
                                    break;//{3541798B-AF9C-415c-AFAA-8BD22A34A808}
                                }
                                else
                                {
                                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("对不起,您没有对该患者开立医嘱的权限!"), "提示");
                                    return;
                                }
                            }
                        }
                    }
                    else
                    {
                        Neusoft.HISFC.Models.RADT.PatientInfo patient1 = this.tvDoctorPatientList1.SelectedNode.Tag as Neusoft.HISFC.Models.RADT.PatientInfo;

                        //处理床位号截位
                        string bedNO = patient1.PVisit.PatientLocation.Bed.ID;
                        if (bedNO.Length > 4)
                        {
                            bedNO = bedNO.Substring(4);
                        }
                        //处理住院号显示
                        string patientNO = patient1.PID.PatientNO;
                        if (string.IsNullOrEmpty(patientNO) == true)
                        {
                            patientNO = patient1.ID;
                        }

                        this.Text = "您正在操作的患者为 住院号:" + patientNO + "姓名:" + patient1.Name + " 性别:" + patient1.Sex.Name + "年龄:" + consultation.GetAge(patient1.Birthday) + " 床号:" + bedNO;

                        //{FBBE8298-886C-4b33-8CF6-69134BE95422} 判断是否请假患者 20100507 yangw
                        if (patient1.PVisit.PatientLocation.Bed != null && patient1.PVisit.PatientLocation.Bed.Status.ID.ToString() == Neusoft.HISFC.Models.Base.EnumBedStatus.R.ToString())
                        {//请假患者不能开医嘱,须先销假,主要为防止请假后开立长嘱下次执行时间不对,这个bug有点2
                            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("患者请假中,如需开立医嘱请先销假"));
                            return;
                        }

                        if (this.ucOrder1.Add() == 0)
                        {
                            this.initButton(true);
                        }
                    }
                }
            }
            else if (e.ClickedItem == this.tbCheck)
            {
                this.ucOrder1.AddTest();
            }
            else if (e.ClickedItem == this.tbRefresh)
            {
                //刷新
                this.tvDoctorPatientList1.RefreshInfo();
            }
            else if (e.ClickedItem == this.tbGroup)
            {
                if (this.tbGroup.CheckState == CheckState.Checked)
                {
                    this.tbGroup.CheckState = CheckState.Unchecked;
                }
                else
                {
                    this.tbGroup.CheckState = CheckState.Checked;
                }

                if (this.tbGroup.CheckState == CheckState.Checked)
                {
                    this.ucOrder1.SetEditGroup(true);
                    this.ucOrder1.SetPatient(null);
                    this.initButtonGroup(true);
                }
                else
                {
                    this.ucOrder1.SetEditGroup(false);
                    this.initButtonGroup(false);
                }
            }
            else if (e.ClickedItem == this.tbOperation)
            {
                //Neusoft.HISFC.Models.RADT.PatientInfo pi = (Neusoft.HISFC.Models.RADT.PatientInfo)this.tvDoctorPatientList1.SelectedNode.Tag;
                //frmOperation frmOpt = new frmOperation(pi);
                //frmOpt.ShowDialog();

                //ucOperation operation = new ucOperation(pi);
                //operation.Show();
                //operation.Show();
                //UFC.Operation.ucApplicationForm appForm = new UFC.Operation.ucApplicationForm();
                //appForm.PatientInfo = pi;
                //Neusoft.FrameWork.WinForms.Classes.Function.PopShowControl(appForm);
                //appForm.Show();
                //UFC.Operation.ucApplication ucApply = new UFC.Operation.ucApplication(pi, pi);
                Neusoft.HISFC.Models.RADT.PatientInfo pi = (Neusoft.HISFC.Models.RADT.PatientInfo) this.tvDoctorPatientList1.SelectedNode.Tag;
                frmOperation frmOpt = new frmOperation(pi);
                frmOpt.ShowDialog();
            }
            else if (e.ClickedItem == this.tbAssayCure)
            {
                this.ucOrder1.AddAssayCure();
            }
            else if (e.ClickedItem == this.tbDelOrder)
            {
                this.ucOrder1.Delete();
            }
            else if (e.ClickedItem == this.tbQueryOrder)
            {
                try
                {
                    this.ucOrder1.Query(this.tvDoctorPatientList1.SelectedNode, this.tvDoctorPatientList1.SelectedNode.Tag);
                }
                catch { }
            }
            else if (e.ClickedItem == this.tbPrintOrder)
            {
                if (CurrentControl != null)
                {
                    try
                    {
                        Neusoft.FrameWork.WinForms.Controls.ucBaseControl control = CurrentControl as Neusoft.FrameWork.WinForms.Controls.ucBaseControl;
                        if (control != null)
                        {
                            control.Print(null, null);
                        }
                    }
                    catch { }
                }
            }
            else if (e.ClickedItem == this.tbComboOrder)
            {
                this.ucOrder1.ComboOrder();
            }
            else if (e.ClickedItem == this.tbCancelOrder)
            {
                this.ucOrder1.CancelCombo();
            }
            else if (e.ClickedItem == this.tbExitOrder)
            {
                if (this.isEditGroup)
                {
                    if (this.tbGroup.CheckState == CheckState.Checked)
                    {
                        this.tbGroup.CheckState = CheckState.Unchecked;
                    }
                    else
                    {
                        this.tbGroup.CheckState = CheckState.Checked;
                    }
                    this.ucOrder1.SetEditGroup(false);
                    //this.initButtonGroup(false);//{64E07B94-39F0-439a-BB53-6C3D8DB7EFE4}退出医嘱,患者树不失去焦点
                }
                else
                {
                    if (this.ucOrder1.ExitOrder() == 0)
                    {
                        this.initButton(false);
                    }
                    tvDoctorPatientList1.RefreshInfo();
                }
            }
            else if (e.ClickedItem == this.tbInValid)
            {
                this.ucOrder1.Filter(Neusoft.HISFC.Components.Order.Controls.EnumFilterList.Invalid);
            }
            else if (e.ClickedItem == this.tbValid)
            {
                this.ucOrder1.Filter(Neusoft.HISFC.Components.Order.Controls.EnumFilterList.Valid);
            }
            else if (e.ClickedItem == this.tbAll)
            {
                this.ucOrder1.Filter(Neusoft.HISFC.Components.Order.Controls.EnumFilterList.All);
            }
            else if (e.ClickedItem == this.tbToday)
            {
                this.ucOrder1.Filter(Neusoft.HISFC.Components.Order.Controls.EnumFilterList.Today);
            }
            else if (e.ClickedItem == this.tbNew)
            {
                this.ucOrder1.Filter(Neusoft.HISFC.Components.Order.Controls.EnumFilterList.New);
            }
            else if (e.ClickedItem == this.tbSaveOrder)
            {
                //
                if (isEditGroup)
                {
                    SaveGroup();
                }
                else
                {
                    if (this.ucOrder1.Save() == -1)
                    {
                    }
                    else
                    {
                        this.initButton(false);
                        //tvDoctorPatientList1.RefreshInfo();//{64E07B94-39F0-439a-BB53-6C3D8DB7EFE4}保存医嘱,患者树不失去焦点
                    }
                }
            }
            else if (e.ClickedItem == this.tsbHerbal)
            {
                this.ucOrder1.HerbalOrder();
            }
            else if (e.ClickedItem == this.tbChooseDoct)//{D5517722-7128-4d0c-BBC4-1A5558A39A03}
            {
                this.ucOrder1.ChooseDoctor();
            }
            else if (e.ClickedItem == this.tb1Exit)
            {
                if (this.ucOrder1.IsDesignMode) //是在开立状态
                {
                    DialogResult result = MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("医嘱目前处于开立模式,是否保存?"), "提示", MessageBoxButtons.YesNoCancel);
                    if (result == DialogResult.Yes)
                    {
                        if (this.ucOrder1.Save() == 0)
                        {
                            this.Close();
                        }
                    }
                    else if (result == DialogResult.Cancel)
                    {
                        return;
                    }

                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    this.Close();
                }
            }
            ///{FB86E7D8-A148-4147-B729-FD0348A3D670}  增加医嘱重整按钮
            else if (e.ClickedItem == this.tbRetidyOrder)
            {
                if (this.ucOrder1.IsDesignMode == false)
                {
                    this.ucOrder1.ReTidyOrder();
                }
                else
                {
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("非开立状态下才允许进行医嘱重整"), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            else if (e.ClickedItem == this.tbDiseaseReport)      //  {E53A21A7-2B74-4b48-A9F4-9E05F8FA11A2} 传染病报告卡
            {
                if (this.dcpInstance == null)
                {
                    this.dcpInstance = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.DCP.IDCP)) as Neusoft.HISFC.BizProcess.Interface.DCP.IDCP;
                }

                if (this.dcpInstance != null)
                {
                    Neusoft.HISFC.Models.RADT.PatientInfo patientInfo = this.tvDoctorPatientList1.SelectedNode.Tag as Neusoft.HISFC.Models.RADT.PatientInfo;

                    this.dcpInstance.RegisterDiseaseReport(patientInfo, Neusoft.HISFC.Models.Base.ServiceTypes.I);
                }
            }
            else if (e.ClickedItem == this.tbLisResultPrint)//{17CC6DF8-1883-4d3c-8D24-2E08C93F047F},Lis结果打印,shangxw 2009-11-10
            {
                patient = this.tvDoctorPatientList1.SelectedNode.Tag as Neusoft.HISFC.Models.RADT.PatientInfo;

                if (this.patient == null || this.patient.PID.ID == "" || this.patient.PID.ID == null)
                {
                    MessageBox.Show("请选择一个患者!");
                    return;
                }

                try
                {
                    #region 郑大修改---{15C4A9D2-34AF-484b-B65B-BBD3CACABA5C}

                    rm_barprinter_common.In_rm_barprinter_common mobj = new rm_barprinter_common.COClass_n_rm_barprinter_commonClass();

                    if (!string.IsNullOrEmpty(patient.ID))
                    {
                        mobj.uf_lis_result(patient.ID, "3");
                    }
                    else
                    {
                        MessageBox.Show("Lis调用失败");
                        return;
                    }

                    //string s = "LisResult";

                    //System.Diagnostics.Process[] proc = System.Diagnostics.Process.GetProcessesByName(s);
                    //if (proc.Length > 0)
                    //{
                    //    for (int i = 0; i < proc.Length; i++)
                    //    {
                    //        proc[i].Kill();
                    //    }
                    //}

                    //System.Diagnostics.Process p = new System.Diagnostics.Process();

                    //p.StartInfo.FileName = Application.StartupPath + @"\LisBin\LisResult.exe";    //需要启动的程序名
                    //#region 取配置参数
                    //ArrayList defaultValue = Neusoft.FrameWork.WinForms.Classes.Function.GetDefaultValue("lis");
                    //if ((defaultValue == null) || (defaultValue.Count == 0))
                    //{
                    //    p.StartInfo.Arguments = " '" + this.patient.PID.ID + "' " + "住院" + "";// +" " + "'住院'";//启动参数

                    //}
                    //else
                    //{
                    //    p.StartInfo.Arguments = " '" + defaultValue[1].ToString() + "' " + "住院" + "";// +" " + "'住院'";//启动参数

                    //}

                    //#endregion

                    //p.Start();//启动
                    #endregion
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (e.ClickedItem == this.tbPacsResultPrint)//{17CC6DF8-1883-4d3c-8D24-2E08C93F047F},Lis结果打印,shangxw 2009-11-10
            {
                patient = this.tvDoctorPatientList1.SelectedNode.Tag as Neusoft.HISFC.Models.RADT.PatientInfo;

                if (this.patient == null || this.patient.PID.ID == "" || this.patient.PID.ID == null)
                {
                    MessageBox.Show("请选择一个患者!");
                    return;
                }

                try
                {
                    string patientNo = patient.ID;
                    this.ucOrder1.ShowPacsResultByPatient(patientNo);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (e.ClickedItem == this.tbChooseDrugDept)
            {
                #region 进入医嘱窗口选择药房 {CD0DD444-07D0-4e80-9D26-0DB79BA9A177} wbo 2010-10-26
                this.ChooseDrugDept(true);
                #endregion
            }
        }
        /// <summary>
        /// 将患者信息显示到控件上
        /// </summary>
        /// <param name="PatientInfo"></param>
        private void SetPatientInfo(Neusoft.HISFC.Models.RADT.PatientInfo PatientInfo)
        {
            this.txtPatientNo.Text     = PatientInfo.PID.PatientNO;
            this.txtPatientNo.Tag      = PatientInfo.ID;
            this.txtName.Text          = PatientInfo.Name;
            this.txtSex.Text           = PatientInfo.Sex.Name;
            this.cmbDoc.Text           = PatientInfo.PVisit.AdmittingDoctor.Name;
            this.cmbDoc.Tag            = PatientInfo.PVisit.AdmittingDoctor.ID;
            this.cmbAttendingDoc.Text  = PatientInfo.PVisit.AttendingDoctor.Name;
            this.cmbAttendingDoc.Tag   = PatientInfo.PVisit.AttendingDoctor.ID;
            this.cmbConsultingDoc.Text = PatientInfo.PVisit.ConsultingDoctor.Name;
            this.cmbConsultingDoc.Tag  = PatientInfo.PVisit.ConsultingDoctor.ID;
            this.cmbAdmittingNur.Text  = PatientInfo.PVisit.AdmittingNurse.Name;
            this.cmbAdmittingNur.Tag   = PatientInfo.PVisit.AdmittingNurse.ID;
            this.cmbBedNo.Tag          = patientInfo.PVisit.PatientLocation.Bed.ID;
            this.cmbBedNo.Text         = patientInfo.PVisit.PatientLocation.Bed.ID;
            //this.cmbBedNo.AddItems(deptManager.QueryUnoccupiedBed(PatientInfo.PVisit.PatientLocation.NurseCell.ID));
            //this.cmbAdmittingNur.AddItems(deptManager.QueryNurse(PatientInfo.PVisit.PatientLocation.NurseCell.ID));

            ArrayList alDepts = deptManager.QueryDepartment(PatientInfo.PVisit.PatientLocation.NurseCell.ID);

            try
            {
                //取医生列表
                ArrayList al = new ArrayList();

                foreach (Neusoft.FrameWork.Models.NeuObject dept in alDepts)
                {
                    al.AddRange(deptManager.QueryEmployee(Neusoft.HISFC.Models.Base.EnumEmployeeType.D, dept.ID));
                }

                //加载住院医生列表
                this.cmbDoc.AddItems(al);
                //加载主治医生列表
                this.cmbAttendingDoc.AddItems(al);
                //加载主任医生列表
                this.cmbConsultingDoc.AddItems(al);
                //加载责任护士列表
                this.cmbAdmittingNur.AddItems(deptManager.QueryNurse(PatientInfo.PVisit.PatientLocation.NurseCell.ID));
                //加载床位列表
                this.cmbBedNo.AddItems(deptManager.QueryUnoccupiedBed(PatientInfo.PVisit.PatientLocation.NurseCell.ID));
                this.cmbDoc.IsListOnly           = true;
                this.cmbBedNo.IsListOnly         = true;
                this.cmbAdmittingNur.IsListOnly  = true;
                this.cmbAttendingDoc.IsListOnly  = true;
                this.cmbConsultingDoc.IsListOnly = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            //this.cmbDoc.AddItems(deptManager.QueryEmployee())
            //换医生或者婴儿召回不用选择床位,跟妈妈相同
            if (PatientInfo.IsBaby)
            {
                this.cmbBedNo.Enabled = false;
            }
            else
            {
                this.cmbBedNo.Enabled = true;
            }
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public virtual int Save()
        {
            if (cmbZg.Tag == null || cmbZg.Tag.ToString().Trim() == string.Empty)
            {
                this.Err = "请输入出院情况";
                this.cmbZg.Focus();
                return(-1);
            }
            //如果患者不是当天出院提示
            if (this.dtOutDate.Value.Date != this.inpatient.GetDateTimeFromSysDateTime().Date)
            {
                DialogResult dr = MessageBox.Show("该患者的出院日期是: " +
                                                  this.dtOutDate.Value.ToString("yyyy年MM月dd日") + "  是否继续?", "提示",
                                                  MessageBoxButtons.YesNo, MessageBoxIcon.Information,
                                                  MessageBoxDefaultButton.Button1);
                if (dr == DialogResult.No)
                {
                    this.Err = "";
                    return(-1);
                }
            }

            if (this.PatientInfo == null || string.IsNullOrEmpty(this.PatientInfo.ID))
            {
                this.Err = "请回车确认住院号是否存在!";

                return(-1);
            }

            //取患者最新的住院主表信息
            PatientInfo = this.radt.GetPatientInfomation(this.PatientInfo.ID);
            if (PatientInfo == null)
            {
                this.Err = this.radt.Err;
                return(-1);
            }
            this.Err = "";

            //如果患者在院状态发生变化,则不允许操作

            string in_State = PatientInfo.PVisit.InState.ID.ToString();

            if (PatientInfo.PVisit.InState.ID.ToString() != "I")
            {
                this.Err = "该患者没有接诊";
                return(-1);
            }

            //取出院登记信息
            this.GetOutInfo();
            //{2A467990-BDA3-4cb4-BB89-5801796EBC95}
            Neusoft.HISFC.BizProcess.Interface.IPatientShiftValid obj = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.IPatientShiftValid)) as Neusoft.HISFC.BizProcess.Interface.IPatientShiftValid;
            if (obj != null)
            {
                string err = string.Empty;
                bool   bl  = obj.IsPatientShiftValid(PatientInfo, Neusoft.HISFC.Models.Base.EnumPatientShiftValid.O, ref err);
                if (!bl)
                {
                    MessageBox.Show(err);
                    return(-1);
                }
            }
            //出院登记
            HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy medcareInterfaceProxy = new Neusoft.HISFC.BizProcess.Integrate.FeeInterface.MedcareInterfaceProxy();
            long returnValue = medcareInterfaceProxy.SetPactCode(this.PatientInfo.Pact.ID);

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            radt.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            medcareInterfaceProxy.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            medcareInterfaceProxy.BeginTranscation();

            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获得合同单位失败" + medcareInterfaceProxy.ErrMsg));
                return(-1);
            }

            returnValue = medcareInterfaceProxy.Connect();
            {
                if (returnValue != 1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    medcareInterfaceProxy.Rollback();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获得合同单位失败" + medcareInterfaceProxy.ErrMsg));
                    return(-1);
                }
            }
            medcareInterfaceProxy.BeginTranscation();
            //returnValue = medcareInterfaceProxy.GetRegInfoInpatient(this.PatientInfo);
            //if (returnValue != 1)
            //{
            //    t.RollBack();
            //    medcareInterfaceProxy.Rollback();
            //    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获得患者信息失败" + medcareInterfaceProxy.ErrMsg));
            //    return -1;
            //}
            //出院登记(带改)
            returnValue = medcareInterfaceProxy.LogoutInpatient(this.PatientInfo);
            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("待遇接口获出院登记失败" + medcareInterfaceProxy.ErrMsg));
                return(-1);
            }


            int i = radt.OutPatient(PatientInfo);

            this.Err = radt.Err;
            if (i == -1)
            {
                         //失败
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    medcareInterfaceProxy.Rollback();
                    return(-1);
                }
            }
            else if (i == 0)//取消
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                this.Err = "";
                return(0);
            }
            //zhangjunyi 注释掉 改为commit
            //medcareInterfaceProxy.Rollback();
            if (medcareInterfaceProxy.Commit() < 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                medcareInterfaceProxy.Rollback();
                this.Err = "医保接口提交事务出错!请检查读卡器连接是否正确";
                return(-1);
            }

            #region addby xuewj 2010-3-15

            if (this.adt == null)
            {
                this.adt = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.IHE.IADT)) as Neusoft.HISFC.BizProcess.Interface.IHE.IADT;
            }
            if (this.adt != null)
            {
                this.adt.DischargeInpatient(this.PatientInfo);
            }

            #endregion

            Neusoft.FrameWork.Management.PublicTrans.Commit();



            return(1);
        }
        /// <summary>
        /// 设置患者信息到控件
        /// </summary>
        /// <param name="PatientInfo"></param>
        protected virtual void SetPatientInfo(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo)
        {
            this.txtPatientNo.Text = patientInfo.PID.PatientNO;                    //住院号
            this.txtCard.Text      = patientInfo.PID.CardNO;                       //门诊卡号
            this.txtPatientNo.Tag  = patientInfo.ID;                               //住院流水号
            this.txtName.Text      = patientInfo.Name;                             //姓名
            this.txtSex.Text       = patientInfo.Sex.Name;                         //性别
            this.txtIndate.Text    = patientInfo.PVisit.InTime.ToString();         //入院日期
            this.txtDept.Text      = patientInfo.PVisit.PatientLocation.Dept.Name; //科室名称
            this.txtDept.Tag       = patientInfo.PVisit.PatientLocation.Dept.ID;   //科室编码

            Neusoft.FrameWork.Public.ObjectHelper helper = new Neusoft.FrameWork.Public.ObjectHelper(manager.GetConstantList(Neusoft.HISFC.Models.Base.EnumConstant.PAYKIND));
            this.txtBalKind.Text = helper.GetName(patientInfo.Pact.PayKind.ID);


            this.txtBedNo.Text   = patientInfo.PVisit.PatientLocation.Bed.ID;   //床号
            this.txtFreePay.Text = patientInfo.FT.LeftCost.ToString();          //剩余预交金
            this.txtTotcost.Text = patientInfo.FT.TotCost.ToString();           //总金额
            this.cmbZg.Tag       = patientInfo.PVisit.ZG.ID;                    //转归
            //{DDE7D11F-61CF-4e09-BC2D-F49B03446261}
            //传入的patientInfo.PVisit.OutTime是0002-1-1,报错,这样改是否可以?
            if (patientInfo.PVisit.OutTime < this.dtOutDate.MinDate || patientInfo.PVisit.OutTime > this.dtOutDate.MaxDate)
            {
                this.dtOutDate.Value = this.inpatient.GetDateTimeFromSysDateTime();
            }
            else
            {
                this.dtOutDate.Value = patientInfo.PVisit.OutTime;                              //出院日期
            }
            // this.dtOutDate.Value = patientInfo.PVisit.OutTime;				//出院日期
            //{DDE7D11F-61CF-4e09-BC2D-F49B03446261}


            //出院登记修改时间处理 {28C63B3A-9C64-4010-891D-46F846EA093D}

            string rtn = this.ctlMgr.QueryControlerInfo("ZY0002");

            if (rtn == null || rtn == "-1" || rtn == "")
            {
                rtn = "0";
            }
            else
            {
                rtn = "1";
            }

            if (rtn == "1")//
            {
                System.Collections.ArrayList alShiftDataInfo = this.radt.QueryPatientShiftInfoNew(this.PatientInfo.ID);

                if (alShiftDataInfo == null)
                {
                    MessageBox.Show("获取变更表记录信息出错");
                    return;
                }

                bool isExitInfo = false;

                foreach (Neusoft.HISFC.Models.Invalid.CShiftData myCShiftDate in alShiftDataInfo)
                {
                    if (myCShiftDate.ShitType == "BB") //有结算召回
                    {
                        this.dtOutDate.Enabled = true;
                        isExitInfo             = true;
                        break;
                    }
                }


                this.dtOutDate.Enabled = isExitInfo;
            }
            else
            {
                this.dtOutDate.Enabled = false;
            }


            this.dtOutDate.Focus();
        }
        private string GetStrPatientInfo(Neusoft.HISFC.Models.RADT.PatientInfo pInfo)
        {
            string strPatientInfo = "";

            if (bs1)
            {
                strPatientInfo += "姓名:" + pInfo.Name + " " + pInfo.Sex.Name + " ";
            }
            if (bs17)
            {
                strPatientInfo += "床号:" + pInfo.PVisit.PatientLocation.Bed.ID;
            }
            if (bs2)
            {
                strPatientInfo += "入院日期:" + pInfo.InTimes + " ";
            }
            if (bs3)
            {
                strPatientInfo += "住院科室:" + pInfo.PVisit.PatientLocation.Dept.Name + " ";
            }
            if (bs4)
            {
                strPatientInfo += "余额:" + pInfo.FT.LeftCost.ToString() + " ";
            }
            if (bs5)
            {
                strPatientInfo += "出生年月:" + pInfo.Birthday.ToShortDateString() + " ";
            }
            if (bs6)
            {
                strPatientInfo += "担保人:" + pInfo.Surety.Name + " ";
            }
            if (bs7)
            {
                strPatientInfo += "结算方式:" + this.cmbBalanceType.Text + " ";//结算方式
            }
            if (bs8)
            {
                strPatientInfo += "警戒线:" + pInfo.PVisit.MoneyAlert.ToString() + " ";
            }
            if (bs9)
            {
                strPatientInfo += "结算方式:" + pInfo.Pact.Name + " ";
            }
            if (bs10)
            {
                strPatientInfo += "担保金额:" + pInfo.Surety.SuretyCost.ToString() + " ";
            }
            if (bs11)
            {
                strPatientInfo += "以往费用:" + pInfo.FT.TotCost.ToString() + " ";
            }
            if (bs12)
            {
                strPatientInfo += "血滞纳金:" + pInfo.FT.BloodLateFeeCost.ToString();
            }
            if (bs13)
            {
                strPatientInfo += "主治医生:" + pInfo.PVisit.AttendingDoctor.Name + " ";
            }
            if (bs14)
            {
                strPatientInfo += "住院医生:" + pInfo.PVisit.AdmittingDoctor.Name + " ";
            }
            if (bs15)
            {
                strPatientInfo += "责任护士:" + pInfo.PVisit.AdmittingNurse.Name + " ";
            }
            if (bs15)
            {
                strPatientInfo += "血滞纳金:" + pInfo.FT.BloodLateFeeCost.ToString();
            }

            return(strPatientInfo);
        }
Exemple #6
0
        /// <summary>
        /// 上传
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnUpload_Click(object sender, EventArgs e)
        {
            long returnValue = 0;

            this.errText = "";

            returnValue = this.proManager.Connect();
            for (int j = 0; j < this.neuSpread1_Sheet1.Rows.Count; j++)
            {
                if (Neusoft.FrameWork.Function.NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[j, 0].Value))
                {
                    Neusoft.HISFC.Models.RADT.PatientInfo inpatient = this.radtManager.QueryPatientInfoByInpatientNO(this.neuSpread1_Sheet1.Cells[j, 1].Value.ToString());
                    errText = errText + "正在上传" + inpatient.Name + "的费用信息......" + "\r\n";
                    ArrayList itemlist = this.QueryUnuploadInfo(inpatient);
                    if (itemlist != null)
                    {
                        //foreach (Neusoft.HISFC.Models.Fee.Inpatient.FeeItemList list in itemlist)
                        if (itemlist.Count > 0)
                        {
                            this.localManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                            this.proManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);


                            if (returnValue != 1)
                            {
                                errText = errText + ("上传" + inpatient.Name + " 信息失败,待遇接口登陆医保服务器失败!" + this.proManager.ErrMsg + "\r\n");
                                continue;
                            }

                            //returnValue = this.proManager.UploadFeeDetailsInpatient(this.Patient, ref this.unUploadMedList);
                            returnValue = this.proManager.SortFeeItemList(inpatient, itemlist);
                            if (returnValue != 1)
                            {
                                errText = errText + ("上传" + inpatient.Name + " 信息失败,待遇接口上传患者费用凭单失败!" + this.proManager.ErrMsg + "\r\n");
                                continue;
                            }

                            #region 更新上传标志
                            foreach (Neusoft.HISFC.Models.Fee.Inpatient.FeeItemList f in itemlist)
                            {
                                if (this.localManager.updateUploadFlagInpatient(f) < 0)
                                {
                                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                    errText = errText + ("上传" + inpatient.Name + " 信息失败,更新本地上传标志出错!!" + this.localManager.Err + "\r\n");
                                    break;
                                    continue;
                                }
                            }

                            foreach (Neusoft.HISFC.Models.Fee.Inpatient.FeeItemList f in itemlist)
                            {
                                if (this.localManager.updateUploadFlagInpatient(f) < 0)
                                {
                                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                    errText = errText + ("上传" + inpatient.Name + " 信息失败,更新本地上传标志出错!!" + this.localManager.Err + "\r\n");
                                    break;
                                    continue;
                                }
                            }
                            #endregion

                            returnValue = this.proManager.Disconnect();
                            if (returnValue != 1)
                            {
                                errText = errText + ("上传" + inpatient.Name + " 信息失败,待遇接口断开登陆医保服务器失败!" + "\r\n");
                                continue;
                            }

                            returnValue = this.proManager.Commit();
                            if (returnValue < 0)
                            {
                                errText = errText + ("上传" + inpatient.Name + " 信息失败,待遇接口提交事务失败!" + "\r\n");
                                continue;
                            }

                            Neusoft.FrameWork.Management.PublicTrans.Commit();

                            errText = errText + ("上传" + inpatient.Name + " 信息成功,费用凭单导入成功!" + "\r\n");
                        }
                        else
                        {
                            errText = errText + "无可上传费用" + "\r\n";
                        }
                    }
                    else
                    {
                        errText = errText + "取上传费用出错" + "\r\n";
                    }
                }
            }
            this.lblText.Text = this.errText;
        }
        /// <summary>
        /// 设置入院通知单打印值
        /// </summary>
        /// <param name="prePatientInfo"></param>
        /// <returns></returns>
        public int SetValue(Neusoft.HISFC.Models.RADT.PatientInfo prePatientInfo)
        {
            this.neuLabel466.Text = this.manager.GetHospitalName() + "入院通知单";
            this.SetVisible(false);
            this.lblPriName.Text = prePatientInfo.Name;
            if (!string.IsNullOrEmpty(prePatientInfo.ID))
            {
                this.ID.Text = prePatientInfo.ID.Substring(4);
            }
            this.lblPriSex.Text      = prePatientInfo.Sex.Name;
            this.lblPriAge.Text      = inpatientManager.GetAge(prePatientInfo.Birthday);
            this.lblPriDeptName.Text = prePatientInfo.PVisit.PatientLocation.Dept.Name;
            this.ID.Text             = prePatientInfo.PID.CardNO;
            //this.lblPriClinicDiag.Text = prePatientInfo.ClinicDiagnose;
            ////this.lblPriDoc.Text = prePatientInfo.PatientInfo.DoctorReceiver.Name;
            //if (prePatientInfo.PVisit.Circs.ID == "1")
            //{
            //    this.lblPriCommon.Text = "一般";
            //    this.lblPriEmergency.Text = "";
            //    this.lblPriDanger.Text = "";
            //}
            //else if (prePatientInfo.PVisit.Circs.ID == "2")
            //{
            //    this.lblPriCommon.Text = "";
            //    this.lblPriEmergency.Text = "急";
            //    this.lblPriDanger.Text = "";
            //}
            //else
            //{
            //    this.lblPriCommon.Text = "";
            //    this.lblPriEmergency.Text = "";
            //    this.lblPriDanger.Text = "危";
            //}
            //this.lblName.Text = prePatientInfo.Name;//姓名
            //this.lblBirth.Text = prePatientInfo.Birthday.ToShortDateString();//出生日期
            //this.lblProfession.Text = prePatientInfo.Profession.Name;//职业
            //this.lblPriPreCost.Text = prePatientInfo.FT.PrepayCost.ToString();//预交金

            if (prePatientInfo.PVisit.InTime > DateTime.MinValue)
            {
                this.lblPriYear.Text  = (prePatientInfo.PVisit.InTime.Year.ToString()).Substring(2, 2); //入院年份
                this.lblPriMonth.Text = prePatientInfo.PVisit.InTime.Month.ToString();                  //入院月份
                this.lblPriDay.Text   = prePatientInfo.PVisit.InTime.Day.ToString();                    //入院日期
            }
            else
            {
                this.lblPriYear.Text  = (DateTime.Now.Year.ToString()).Substring(2, 2); //入院年份
                this.lblPriMonth.Text = DateTime.Now.Month.ToString();                  //入院月份
                this.lblPriDay.Text   = DateTime.Now.Day.ToString();                    //入院日期
            }

            this.lblDocName.Text = "";//Neusoft.NFC.Management.Connection.Operator.Name; //医生签名
            //this.lblID.Text = prePatientInfo.IDCard; //身份证
            //this.lblTelephone.Text = prePatientInfo.PhoneHome; //家庭电话
            //this.lblWorkStationAndAddr.Text = prePatientInfo.CompanyName; //工作单位

            Neusoft.HISFC.BizLogic.Manager.Constant constant  = new Neusoft.HISFC.BizLogic.Manager.Constant();
            Neusoft.FrameWork.Models.NeuObject      birthArea = constant.GetConstant(Neusoft.HISFC.Models.Base.EnumConstant.AREA, prePatientInfo.AreaCode);
            //if (!string.IsNullOrEmpty(birthArea.Name))
            //{
            //    this.lblBirthArea.Text = birthArea.Name; //出生地
            //}

            //this.lblPeople.Text = prePatientInfo.Nationality.Name; //民族

            //if (string.IsNullOrEmpty(prePatientInfo.Nationality.Name))//有的地方传入的民族只有id没有名字
            //{
            //    Neusoft.FrameWork.Models.NeuObject nationality = constant.GetConstant(Neusoft.HISFC.Models.Base.EnumConstant.NATION, prePatientInfo.Nationality.ID);

            //    this.lblPeople.Text = nationality.Name;
            //}

            Neusoft.FrameWork.Models.NeuObject pact = constant.GetConstant("PACTUNIT", prePatientInfo.Pact.ID);

            this.lblPactName.Text = pact.Name; //身份类型

            //this.lblNational.Text = prePatientInfo.Country.Name;// 国籍
            //this.lblHomeZip.Text = prePatientInfo.HomeZip; //家庭邮编
            //this.lblTel.Text = prePatientInfo.Kin.RelationPhone; //联系电话
            //this.relaName.Text = prePatientInfo.Kin.ID; //联系人姓名

            //this.neuLabel8.Text = pact.Name;

            //this.lblRelations.Text = prePatientInfo.Kin.Relation.Name; //与患者关系

            //this.lblProvice.Text = prePatientInfo.AddressHome;

            //if (!string.IsNullOrEmpty(prePatientInfo.MaritalStatus.Name))
            //{
            //    this.isMarried.Text = prePatientInfo.MaritalStatus.Name;
            //}
            //else
            //{
            //    this.isMarried.Text = "未知";
            //}
            return(1);
        }
 public void SetPatientInfo(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo)
 {
     this.InitControl();
     this.patientInfo = patientInfo.Clone();
     RefreshList(this.patientInfo);
 }
 protected override int OnSetValue(object neuObject, TreeNode e)
 {
     this.patientInfo = neuObject as Neusoft.HISFC.Models.RADT.PatientInfo;
     RefreshList(this.patientInfo);
     return(0);
 }