private void btnOK_Click(object sender, EventArgs e)
        {
            Neusoft.HISFC.BizProcess.Integrate.Order orderIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Order();

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

            int hyTestValue = this.GetHypotestValue();

            if (hyTestValue == -1)
            {
                return;
            }

            ArrayList alOrderListClone = new ArrayList();

            foreach (Neusoft.HISFC.Models.Order.OutPatient.Order var in this.alOrderList)
            {
                alOrderListClone.Add(var.Clone());
            }

            foreach (Neusoft.HISFC.Models.Order.OutPatient.Order var in alOrderListClone)
            {
                if (var.HypoTest == 1) //不需要皮试
                {
                    continue;
                }

                int returnVlue = orderIntegrate.UpdateOrderHyTest(hyTestValue.ToString(), var.ID.ToString());


                if (returnVlue < 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("更新医嘱的皮试信息出错!" + orderIntegrate.Err);
                    return;
                }

                var.HypoTest = hyTestValue;
            }


            foreach (Neusoft.HISFC.Models.Order.OutPatient.Order var in this.alOrderList)
            {
                foreach (Neusoft.HISFC.Models.Order.OutPatient.Order varClone in alOrderListClone)
                {
                    if (var.ID == varClone.ID)
                    {
                        var.HypoTest = varClone.HypoTest;
                    }
                }
            }


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

            MessageBox.Show("修改成功");
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        /// <summary>
        /// 向Fp内加入数据
        /// </summary>
        /// <param name="alApply">摆药申请信息</param>
        /// <returns></returns>
        protected int AddDataToFp(ArrayList alApply)
        {
            this.fpApply_Sheet1.Rows.Count = 0;

            int i = 0;

            Neusoft.HISFC.BizProcess.Integrate.Order orderIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Order();

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alApply)
            {
                if (info.State == "0")
                {
                    continue;
                }
                this.fpApply_Sheet1.Rows.Add(i, 1);

                if (info.UseTime != System.DateTime.MinValue)
                {
                    this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColUseTime].Text = info.UseTime.ToString();
                }

                if (info.User01.Length > 4)
                {
                    this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColBedName].Text = "[" + info.User01.Substring(4) + "]" + info.User02;
                }
                else
                {
                    this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColBedName].Text = "[" + info.User01 + "]" + info.User02;
                }

                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColSelect].Value        = true;
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColTradeNameSpecs].Text = info.Item.Name + "[" + info.Item.Specs + "]";
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColRetailPrice].Text    = info.Item.PriceCollection.RetailPrice.ToString();
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColDoseOnce].Text       = info.DoseOnce.ToString();
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColDoseUnit].Text       = info.Item.DoseUnit;
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColQty].Text            = (info.Operation.ApplyQty * info.Days).ToString();
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColUnit].Text           = info.Item.MinUnit;
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColFrequency].Text      = info.Frequency.ID;
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColUsage].Text          = info.Usage.Name;

                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColDoctor].Text        = info.RecipeInfo.ID;
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColApplyTime].Text     = info.Operation.ApplyOper.OperTime.ToString();
                this.fpApply_Sheet1.Cells[i, (int)ColumnSet.ColCompoundGroup].Text = info.CompoundGroup;
                this.fpApply_Sheet1.Rows[i].Tag = info;
            }

            return(1);
        }
        /// <summary>
        /// 列表显示
        /// </summary>
        /// <returns></returns>
        public int RefreshTree()
        {
            Neusoft.HISFC.BizProcess.Integrate.Order   orderManager   = new Neusoft.HISFC.BizProcess.Integrate.Order();
            Neusoft.HISFC.BizProcess.Integrate.Manager deptManager    = new Neusoft.HISFC.BizProcess.Integrate.Manager();
            Neusoft.HISFC.BizProcess.Integrate.RADT    patientManager = new Neusoft.HISFC.BizProcess.Integrate.RADT();
            if (string.IsNullOrEmpty(operDept))
            {
                operDept = oper.Dept.ID;
            }
            ArrayList alDept = orderManager.QueryPatientDeptByConfirmDeptID(operDept);

            this.Nodes.Clear();

            System.Windows.Forms.TreeNode deptNode = new System.Windows.Forms.TreeNode();

            foreach (Neusoft.FrameWork.Models.NeuObject dept in alDept)
            {
                deptNode = new System.Windows.Forms.TreeNode();

                deptNode.Text               = this.deptHelper.GetName(dept.ID);
                deptNode.ImageIndex         = 0;
                deptNode.SelectedImageIndex = 1;
                deptNode.Tag = deptManager.GetDepartment(dept.ID);

                this.Nodes.Add(deptNode);

                ArrayList alPatient = orderManager.QueryPatientByConfirmDeptAndPatDept(operDept, dept.ID);
                foreach (Neusoft.FrameWork.Models.NeuObject patient in alPatient)
                {
                    System.Windows.Forms.TreeNode         patientNode = new System.Windows.Forms.TreeNode();
                    Neusoft.HISFC.Models.RADT.PatientInfo patientInfo = patientManager.QueryPatientInfoByInpatientNO(patient.ID);
                    patientNode.Text               = patientInfo.Name;
                    patientNode.ImageIndex         = 6;
                    patientNode.SelectedImageIndex = 7;
                    patientNode.Tag = patientInfo;

                    deptNode.Nodes.Add(patientNode);
                }
            }

            return(1);
        }
Exemple #4
0
        private void Print(ArrayList al, int current, int total)
        {
            try
            {
                //有备注的集合
                ArrayList alMemo = new ArrayList();
                Neusoft.HISFC.BizProcess.Integrate.Order orderMgr = new Neusoft.HISFC.BizProcess.Integrate.Order();
                //Neusoft.HISFC.BizLogic.Order.OutPatient.Order orderMgr
                //    = new Neusoft.HISFC.BizLogic.Order.OutPatient.Order();

                if (this.neuSpread1_Sheet1.RowCount > 0)
                {
                    this.neuSpread1_Sheet1.RemoveRows(0, this.neuSpread1_Sheet1.RowCount);
                }
                Neusoft.HISFC.Models.Nurse.Inject info = null;

                //接瓶次数
                int jpNum = 1;
                //赋值并打印
                for (int i = 0; i < al.Count; i++)
                {
                    info = (Neusoft.HISFC.Models.Nurse.Inject)al[i];
                    Neusoft.HISFC.Models.Order.OutPatient.Order orderinfo =
                        new Neusoft.HISFC.Models.Order.OutPatient.Order();
                    orderinfo = orderMgr.GetOneOrder(info.Item.Order.ID);
                    if (orderinfo != null && orderinfo.Memo != null)
                    {
                        info.Item.Memo = orderinfo.Memo;
                        alMemo.Add(info);
                    }
                    this.neuSpread1_Sheet1.Rows.Add(0, 1);
                    if (info.Item.Order.Combo.ID.Length <= 2)
                    {
                        this.neuSpread1_Sheet1.Cells[0, 0].Text =
                            info.Item.Order.Combo.ID;
                    }
                    else
                    {
                        this.neuSpread1_Sheet1.Cells[0, 0].Text =
                            info.Item.Order.Combo.ID.Substring(info.Item.Order.Combo.ID.Length - 2, 2);
                    }
                    if (info.Item.Item.Name != null && info.Item.Item.Name != "")
                    {
                        this.neuSpread1_Sheet1.Cells[0, 1].Text = info.Item.Item.Name;
                    }
                    else
                    {
                        this.neuSpread1_Sheet1.Cells[0, 1].Text = info.Item.Name;
                    }
                    jpNum = Neusoft.FrameWork.Function.NConvert.ToInt32(info.Memo);

                    if (jpNum == 0)
                    {
                        jpNum = 1;
                    }

                    this.neuSpread1_Sheet1.Cells[0, 2].Text = info.Item.Order.DoseOnce.ToString() + info.Item.Order.DoseUnit.ToString();
                    //Math.Round(info.Item.DoseOnce/jpNum,3).ToString() + info.Item.DoseUnit.ToString();
                    this.neuSpread1_Sheet1.Cells[0, 3].Text = info.Item.Order.Frequency.ID;
                    this.neuSpread1_Sheet1.Cells[0, 4].Text = info.Item.InjectCount.ToString();
                    this.neuSpread1_Sheet1.Cells[0, 5].Text = info.Item.Order.Usage.Name;
                    this.neuSpread1_Sheet1.Cells[0, 6].Text = info.Item.Memo.ToString();
                }

                #region 医嘱备注添加打印
                //if (alMemo.Count > 0)
                //{
                //    for (int i = 0; i < alMemo.Count; i++)
                //    {
                //        Neusoft.HISFC.Models.Nurse.Inject temp = (Neusoft.HISFC.Models.Nurse.Inject)alMemo[i];
                //        //					string strtemp = temp.Item.Name + ":" + temp.Item.Memo;
                //        string strtemp = "";
                //        if (temp.Item.Order.Combo.ID.Length <= 2)
                //        {
                //            strtemp = temp.Item.Order.Combo.ID.TrimStart('0') + "组:"
                //                + temp.Item.Memo;
                //        }
                //        else
                //        {
                //            strtemp = temp.Item.Order.Combo.ID.Substring(temp.Item.Order.Combo.ID.Length - 2, 2).TrimStart('0') + "组:"
                //                + temp.Item.Memo;
                //        }

                //        this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1);
                //        this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 0].ColumnSpan = 5;
                //        this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 0].Text = strtemp;
                //    }
                //}
                #endregion

                info             = (Neusoft.HISFC.Models.Nurse.Inject)al[0];
                this.lbCard.Text = info.Patient.PID.CardNO;
                this.lbName.Text = info.Patient.Name;
                this.lbTime.Text = "打印时间:" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                //this.lbAge.Text = this.injectMgr.GetAge(info.Patient.Birthday, System.DateTime.Now);
                this.lbAge.Text = Neusoft.HISFC.BizProcess.Integrate.Function.GetAge(info.Patient.Birthday);
                if (info.Patient.Sex.ID.ToString() == "M")
                {
                    this.lbSex.Text = "男";
                }
                else if (info.Patient.Sex.ID.ToString() == "F")
                {
                    this.lbSex.Text = "女";
                }
                else
                {
                    this.lbSex.Text = "";
                }
                this.lbPage.Text = "第" + current.ToString()
                                   + "页" + "/" + "共" + total.ToString() + "页";

                this.Print();
            }
            catch { }
        }
        /// <summary>
        /// 判断试敏
        /// </summary>
        /// <param name="feeItemLists">费用明细实体</param>
        /// <returns>成功 true 失败 false 错误信息包含在Err属性内</returns>
        protected virtual bool IsAllergyValid(ArrayList feeItemLists)
        {
            this.errText = string.Empty;

            //需要验证过敏结果的药品集合
            List <Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList> pharmarcys = new List <Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList>();

            //药品业务层
            Neusoft.HISFC.BizProcess.Integrate.Pharmacy pharmacyIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();
            //医嘱业务层
            Neusoft.HISFC.BizProcess.Integrate.Order orderIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Order();
            //不合法项目列表
            ArrayList unValidList = new ArrayList();

            foreach (Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList f in feeItemLists)
            {
                //如果是药品,并且需要试敏,那么加入以下试敏列表pharmarcys
                if (f.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug)
                {
                    Neusoft.HISFC.Models.Pharmacy.Item itemTemp = pharmacyIntegrate.GetItem(f.Item.ID);
                    if (itemTemp == null)
                    {
                        this.errText = "获得药品基本信息出错!" + pharmacyIntegrate.Err;

                        return(false);
                    }
                    //如果需要试敏,那么加入列表
                    if (itemTemp.IsAllergy)
                    {
                        pharmarcys.Add(f);
                    }
                }
            }

            //如果药品条目为0, 就不用判断试敏
            if (pharmarcys.Count == 0)
            {
                return(true);
            }

            //在医嘱表,判断试敏标记是否已经有值,没有试敏,或者试敏阳性,不能收费!
            foreach (Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList f in pharmarcys)
            {
                //如果没有医嘱号,说明不是医生站开出的医嘱,不判断试敏.
                if (string.IsNullOrEmpty(f.Order.ID))
                {
                    continue;
                }

                Neusoft.HISFC.Models.Order.OutPatient.Order orderTemp = orderIntegrate.GetOneOrder(f.Order.ID);
                //如果没有取出医嘱信息,那么不判断试敏,因为某些从门诊直接披费的项目,也有MoOrder号;
                if (orderTemp == null)
                {
                    continue;
                }

                //需要皮试,但是还没有皮试结果
                if (orderTemp.HypoTest == 2)
                {
                    this.errText += "[ " + f.Item.Name + " ]" + "应该皮试,没有皮试结果!" + "\n";

                    unValidList.Add(f);
                }
                if (orderTemp.HypoTest == 3)
                {
                    this.errText += "[ " + f.Item.Name + " ]" + "皮试结果为阳性!" + "\n";

                    unValidList.Add(f);
                }
            }

            if (unValidList.Count > 0)
            {
                return(false);
            }

            return(true);
        }