Ejemplo n.º 1
0
 public int DeleteDiagnoseSingle(string InpatientNO, int happenNO, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes OperType)
 {
     this.SetDB(diagMgr);
     return(diagMgr.DeleteDiagnoseSingle(InpatientNO, happenNO, OperType));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns>1 保存成功 ,-1 保存失败</returns>
        private int Save()
        {
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            Neusoft.HISFC.BizLogic.HealthRecord.Diagnose diagNose = new Neusoft.HISFC.BizLogic.HealthRecord.Diagnose();
            //Neusoft.FrameWork.Management.Transaction trans = new Neusoft.FrameWork.Management.Transaction(diagNose.Connection);
            //trans.BeginTransaction();
            //diagNose.SetTrans(trans.Trans);

            ArrayList diagAdd = new ArrayList();
            ArrayList diagMod = new ArrayList();
            ArrayList diagDel = new ArrayList();

            this.ucDiagNoseInput1.deleteRow();
            this.ucDiagNoseInput1.GetList("A", diagAdd);
            this.ucDiagNoseInput1.GetList("M", diagMod);
            this.ucDiagNoseInput1.GetList("D", diagDel);

            //{6873115C-BBAC-4de0-95BB-F905B766F5AA}
            if (diagAdd.Count == 0 && diagDel.Count == 0 && diagMod.Count == 0)
            {
                MessageBox.Show("无需保存");
                return(-1);
            }

            if (this.ucDiagNoseInput1.ValueState(diagAdd) == -1 || this.ucDiagNoseInput1.ValueState(diagMod) == -1 || this.ucDiagNoseInput1.ValueState(diagDel) == -1)
            {
                //trans.RollBack();
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            if (diagDel != null)
            {
                foreach (Neusoft.HISFC.Models.HealthRecord.Diagnose obj in diagDel)
                {
                    //{8BC09475-C1D9-4765-918B-299E21E04C74} 诊断录入增加医生站、门诊医生站、病案室属性
                    if (enumdiaginput == enumDiagInput.cas)
                    {
                        if (diagNose.DeleteDiagnoseSingle(obj.DiagInfo.Patient.ID, obj.DiagInfo.HappenNo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.DOC) < 1)
                        {
                            //trans.RollBack();
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show("保存诊断信息失败" + diagNose.Err);
                            return(-1);
                        }
                    }
                    else
                    {
                        if (diagNose.DeleteDiagnoseSingle(obj.DiagInfo.Patient.ID, obj.DiagInfo.HappenNo) < 1)
                        {
                            //trans.RollBack();
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show("删除诊断信息失败" + diagNose.Err);
                            return(-1);
                        }
                    }
                }
            }
            if (diagMod != null)
            {
                foreach (Neusoft.HISFC.Models.HealthRecord.Diagnose obj in diagMod)
                {
                    //{8BC09475-C1D9-4765-918B-299E21E04C74} 诊断录入增加医生站、门诊医生站、病案室属性
                    if (enumdiaginput == enumDiagInput.cas)
                    {
                        if (diagNose.UpdateDiagnose(obj) < 1)
                        {
                            if (diagNose.InsertDiagnose(obj) < 1)
                            {
                                //trans.RollBack();
                                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                MessageBox.Show("保存诊断信息失败" + diagNose.Err);
                                return(-1);
                            }
                        }
                    }
                    else
                    {
                        if (diagNose.UpdatePatientDiagnose(obj) < 1)
                        {
                            if (diagNose.CreatePatientDiagnose(obj) < 1)
                            {
                                //trans.RollBack();
                                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                MessageBox.Show("保存诊断信息失败" + diagNose.Err);
                                return(-1);
                            }
                        }
                    }
                    string result = diagNose.IsInfect(obj.DiagInfo.ICD10.ID);
                    if (result == "Error")
                    {
                        MessageBox.Show("查询诊断信息出错!", "提示");
                    }
                    if (result == "1")
                    {
                        MessageBox.Show("诊断:" + obj.DiagInfo.ICD10.Name + "为传染病诊断,请填写传染病报告卡!", "提示");
                    }
                }
            }
            if (diagAdd != null)
            {
                foreach (Neusoft.HISFC.Models.HealthRecord.Diagnose obj in diagAdd)
                {
                    //{8BC09475-C1D9-4765-918B-299E21E04C74} 诊断录入增加医生站、门诊医生站、病案室属性
                    if (enumdiaginput == enumDiagInput.cas)
                    {
                        if (diagNose.InsertDiagnose(obj) < 1)
                        {
                            //trans.RollBack();
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show("保存诊断信息失败" + diagNose.Err);
                            return(-1);
                        }
                    }
                    else
                    {
                        obj.DiagInfo.HappenNo = diagNose.GetNewDignoseNo();
                        if (obj.DiagInfo.HappenNo < 0)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show("取诊断流水号失败" + diagNose.Err);
                            return(-1);
                        }

                        if (diagNose.CreatePatientDiagnose(obj) < 1)
                        {
                            //trans.RollBack();
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show("保存诊断信息失败" + diagNose.Err);
                            return(-1);
                        }
                    }
                    string result = diagNose.IsInfect(obj.DiagInfo.ICD10.ID);
                    if (result == "Error")
                    {
                        MessageBox.Show("查询诊断信息出错!", "提示");
                    }
                    if (result == "1")
                    {
                        MessageBox.Show("诊断:" + obj.DiagInfo.ICD10.Name + "为传染病诊断,请填写传染病报告卡!", "提示");
                    }
                }
            }

            this.ucDiagNoseInput1.fpEnterSaveChanges();

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

            this.ucDiagNoseInput1.ClearInfo();

            //{8BC09475-C1D9-4765-918B-299E21E04C74} 诊断录入增加医生站、门诊医生站、病案室属性
            //this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.DOC);
            if (Enumdiaginput == enumDiagInput.order || Enumdiaginput == enumDiagInput.outPatientOrder)
            {
                this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.DOC, enumdiaginput.ToString());
            }
            else if (Enumdiaginput == enumDiagInput.cas)
            {
                if (isList)
                {
                    //this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.DOC, enumdiaginput.ToString());
                    LoadInfo(patientInfo.ID);
                }
                else
                {
                    this.ucDiagNoseInput1.LoadInfo(patientInfo, Neusoft.HISFC.Models.HealthRecord.EnumServer.frmTypes.CAS, enumdiaginput.ToString());
                }
            }

            MessageBox.Show("保存成功");

            return(1);
        }