Example #1
0
 /// <summary>
 /// 作废医嘱信息
 /// </summary>
 /// <param name="r">患者挂号信息</param>
 /// <param name="order">医嘱实体</param>
 /// <param name="errText">错误信息</param>
 /// <returns></returns>
 public int CancelOrder(Register r, Neusoft.HISFC.Models.Order.OutPatient.Order order, ref string errText)
 {
     //普通患者
     if (r.Pact.ID == "6" || r.Pact.ID == "7" || r.Pact.ID == "8")
     {
         FeeItemList f = outPatientFee.QueryFeeItemListFromMOOrder(order.ID);
         if (f == null)
         {
             errText = "查询患者费用信息失败!";
             return(-1);
         }
         if (!string.IsNullOrEmpty(f.Invoice.ID))
         {
             errText = "发票已打印请去收费处退费!";
             return(-1);
         }
         int resultValue = 0;
         if (f.IsConfirmed)
         {
             resultValue = this.CancelOrderConfirm(r, f, order.DCOper.OperTime, ref errText);
         }
         else
         {
             resultValue = this.CancelOrderNOConfirm(r, f, order.DCOper.OperTime, ref errText);
         }
         return(resultValue);
     }
     return(0);
 }
Example #2
0
        /// <summary>
        /// 生成中草药处方
        /// </summary>
        /// <param name="alTmp"></param>
        private void SetPccRecipe(ArrayList alTmp)
        {
            view.RemoveRows(0, view.RowCount);
            view.AddRows(0, alTmp.Count);

            Neusoft.HISFC.Models.Order.OutPatient.Order orderInfo = null;
            decimal money = 0m;

            for (int row = 0, count = 0; count < alTmp.Count; row++, count += pccPerRowCount)
            {
                for (int perCol = 0; perCol < pccPerRowCount; perCol++)
                {
                    if (row * pccPerRowCount + perCol > alTmp.Count - 1)
                    {
                        break;
                    }
                    orderInfo = new Neusoft.HISFC.Models.Order.OutPatient.Order();
                    orderInfo = alTmp[row * pccPerRowCount + perCol] as Neusoft.HISFC.Models.Order.OutPatient.Order;

                    //不打印NULL和已经退费的
                    if (orderInfo == null || orderInfo.Qty == 0)
                    {
                        continue;
                    }


                    this.view.Cells[row, perCol * 11 + (int)Columns.drugName].Text   = orderInfo.Item.Name;
                    this.view.Cells[row, perCol * 11 + (int)Columns.specs].Text      = orderInfo.Item.Specs;
                    this.view.Cells[row, perCol * 11 + (int)Columns.comboNO].Text    = orderInfo.Combo.ID;
                    this.view.Cells[row, perCol * 11 + (int)Columns.hearbalQty].Text = orderInfo.HerbalQty.ToString();
                    this.view.Cells[row, perCol * 11 + (int)Columns.doseOnce].Text   = orderInfo.DoseOnce.ToString() + orderInfo.DoseUnit;
                    this.view.Cells[row, perCol * 11 + (int)Columns.frequence].Text  = orderInfo.Frequency.Name;
                    this.view.Cells[row, perCol * 11 + (int)Columns.usage].Text      = orderInfo.Usage.Name;
                    Neusoft.HISFC.Models.Pharmacy.Item phaItem = phaManagement.GetItem(orderInfo.Item.ID);
                    if (orderInfo.NurseStation.User03 == "1")
                    {
                        this.view.Cells[row, perCol * 11 + (int)Columns.totQty].Text = orderInfo.Qty.ToString() + orderInfo.Unit;
                    }
                    else
                    {
                        this.view.Cells[row, perCol * 11 + (int)Columns.totQty].Text = Convert.ToString(orderInfo.Qty * orderInfo.Item.PackQty) + phaItem.MinUnit;
                    }

                    this.view.Cells[row, perCol * 11 + (int)Columns.injectCount].Text = orderInfo.InjectCount.ToString();
                    this.view.Cells[row, perCol * 11 + (int)Columns.memo].Text        = orderInfo.Memo;

                    money += orderInfo.FT.OwnCost;
                }
            }

            if (orderInfo != null)
            {
                this.lblUsage.Text     = orderInfo.Usage.Name;
                this.lblFrequency.Text = orderInfo.Frequency.Name;
                this.lblTotQty.Text    = orderInfo.HerbalQty.ToString();
                this.lblIsProxy.Text   = orderInfo.Memo;
                this.lblSumMoney.Text  = money.ToString();
                this.lblRecipeNO.Text  = orderInfo.ReciptNO;
            }
        }
        /// <summary>
        /// A4纸张的签名卡
        /// </summary>
        private void PrintItinerateLarge()
        {
            ArrayList al        = new ArrayList();
            ArrayList alJiePing = new ArrayList();

            if (this.neuSpread1_Sheet1.RowCount <= 0)
            {
                MessageBox.Show("没有选择数据!");
                return;
            }
            for (int i = 0; i < this.neuSpread1_Sheet1.RowCount; i++)
            {
                if (this.neuSpread1_Sheet1.GetValue(i, 0).ToString().ToUpper() == "FALSE")
                {
                    continue;
                }
                Neusoft.HISFC.Models.Nurse.Inject info =
                    (Neusoft.HISFC.Models.Nurse.Inject) this.neuSpread1_Sheet1.Rows[i].Tag;
                Neusoft.HISFC.Models.Order.OutPatient.Order orderinfo =
                    (Neusoft.HISFC.Models.Order.OutPatient.Order) this.neuSpread1_Sheet1.Cells[i, 11].Tag;

                al.Add(info);
            }
            if (al == null || al.Count <= 0)
            {
                MessageBox.Show("没有选择数据!");
                return;
            }
            Nurse.Print.ucPrintItinerateLarge uc = new Nurse.Print.ucPrintItinerateLarge();
            uc.Init(al);
        }
Example #4
0
        /// <summary>
        /// 更新医嘱表费用信息
        /// </summary>
        /// <param name="r">患者挂号信息</param>
        /// <param name="alOrder">医嘱信息</param>
        /// <param name="feeTime">收费时间</param>
        /// <param name="errText">错误细腻些</param>
        /// <returns></returns>
        public int UpdateOrderFee(Register r, ArrayList alOrder, DateTime feeTime, ref string errText)
        {
            //普通患者
            if (r.Pact.ID == "6" || r.Pact.ID == "7" || r.Pact.ID == "8")
            {
                if (noFeeList.Count == 0)
                {
                    return(0);
                }
                for (int k = 0; k < alOrder.Count; k++)
                {
                    Neusoft.HISFC.Models.Order.OutPatient.Order tempOrder = alOrder[k] as Neusoft.HISFC.Models.Order.OutPatient.Order;

                    foreach (Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList feeitem in noFeeList)
                    {
                        if (tempOrder.ID == feeitem.Order.ID)
                        {
                            tempOrder.ChargeOper.OperTime = feeTime;
                            tempOrder.ChargeOper.ID       = feeitem.FeeOper.ID;
                            tempOrder.Status        = 1;
                            tempOrder.IsHaveCharged = true;
                            tempOrder.FT.PubCost    = tempOrder.FT.OwnCost;
                            tempOrder.FT.OwnCost    = 0;
                            tempOrder.FT.PayCost    = 0;
                            break;
                        }
                    }
                }
                return(1);
            }
            return(0);
        }
        protected virtual void ucOrderInputByType1_ItemSelected(Neusoft.HISFC.Models.Order.OutPatient.Order order, EnumOrderFieldList changedField)
        {
            dirty = true;

            this.txtQTY.Text = order.Qty.ToString();

            this.myOrderChanged(order, changedField);
            dirty = false;
        }
Example #6
0
        /// <summary>
        /// 显示医嘱信息
        /// </summary>
        /// <param name="cardNO"></param>
        /// <param name="clinicNO"></param>
        /// <returns></returns>
        protected virtual int ShowOutpatientOrder(string cardNO, string clinicNO)
        {
            this.neuSpread1_Sheet1.Rows.Count = 0;

            ArrayList alOrder = this.orderBizLogic.QueryOrderByCardNOClinicNO(cardNO, clinicNO);

            if (alOrder == null)
            {
                MessageBox.Show("查询医嘱信息失败");
                return(1);
            }

            //Neusoft.HISFC.Components.Common.Classes.Function.ShowOrder(this.neuSpread1_Sheet1, alOrder, Neusoft.HISFC.Models.Base.ServiceTypes.C);

            for (int i = 0; i < alOrder.Count; i++)
            {
                Neusoft.HISFC.Models.Order.OutPatient.Order order = alOrder[i] as Neusoft.HISFC.Models.Order.OutPatient.Order;
                this.neuSpread1_Sheet1.AddRows(0, 1);

                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.SEE_NO].Text         = order.SeeNO.ToString();
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.SEQUENCE_NO].Text    = order.ID;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.CLINIC_CODE].Text    = order.Patient.ID;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.CARD_NO].Text        = order.Patient.PID.CardNO;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.REG_DATE].Text       = order.RegTime.ToString();
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.DEPT_CODE].Text      = this.deptHelper.GetName(order.ReciptDept.ID);
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.ITEM_NAME].Text      = order.Item.Name;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.SPECS].Text          = order.Item.Specs;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.FEE_CODE].Text       = order.Item.MinFee.ID;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.UNIT_PRICE].Text     = order.Item.Price.ToString();
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.QTY].Text            = order.Qty.ToString();
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.ONCE_DOSE].Text      = order.DoseOnce.ToString();
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.ONCE_UNIT].Text      = order.DoseUnit;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.FREQUENCY_NAME].Text = order.Frequency.Name;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.USAGE_NAME].Text     = order.Usage.Name;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.HYPOTEST].Text       = this.GetHyteName(order.HypoTest);
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.DOCT_NAME].Text      = order.ReciptDoctor.Name;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.DOCT_DPCD].Text      = this.deptHelper.GetName(order.ReciptDept.ID);
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.OPER_DATE].Text      = order.MOTime.ToString();
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.EMC_FLAG].Value      = order.IsEmergency;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.ITEM_UNIT].Text      = order.Unit;
                this.neuSpread1_Sheet1.Cells[0, (int)EnumColumn.EXEC_DPNM].Text      = this.deptHelper.GetName(order.ExeDept.ID);
                if (order.HypoTest == 3)
                {
                    this.neuSpread1_Sheet1.Rows[0].ForeColor = Color.Red;
                }
                else
                {
                    this.neuSpread1_Sheet1.Rows[0].ForeColor = Color.Black;
                }
                this.neuSpread1_Sheet1.Rows[0].Tag = order;
            }


            return(1);
        }
Example #7
0
 public void PassSetRecipeInfo(Neusoft.HISFC.Models.Order.OutPatient.Order order)
 {
     if (this.PassEnabled && ((order != null) && (order.Item.ItemType.ToString() != ItemTypes.Undrug.ToString())))
     {
         string applyNO = order.ApplyNo;
         //string iD = order.Item.ID;
         string iD         = "Y00000001077";
         string name       = order.Item.Name;
         string singleDose = order.DoseOnce.ToString();
         string doseUnit   = order.DoseUnit;
         int    length     = 0;
         string str7       = "";
         if ((order.Frequency != null) && (order.Usage != null))
         {
             if (order.Frequency.Time == null)
             {
                 Neusoft.HISFC.BizLogic.Manager.Frequency frequency = new Neusoft.HISFC.BizLogic.Manager.Frequency();
                 order.Frequency = (Neusoft.HISFC.Models.Order.Frequency)frequency.Get(order.Frequency, "ROOT");
                 if (order.Frequency == null)
                 {
                     return;
                 }
             }
             if (order.Frequency.Time == null)
             {
                 length = 1;
             }
             else
             {
                 length = order.Frequency.Times.Length;
             }
             if (order.Frequency.Days == null)
             {
                 str7 = "1";
             }
             else
             {
                 str7 = order.Frequency.Days[0];
             }
             string str6           = length.ToString() + "/" + str7.ToString();
             string startOrderDate = order.BeginTime.ToString("yyyy-MM-dd");
             string stopOrderDate  = "";
             string routeName      = order.Usage.Name;
             string groupTag       = order.Combo.ID;
             string orderType      = "1";
             string orderDoctor    = order.Doctor.ID + "/" + order.Doctor.Name;
             PassSetRecipeInfo(applyNO, iD, name, singleDose, doseUnit, str6, startOrderDate, stopOrderDate, routeName, groupTag, orderType, orderDoctor);
         }
     }
 }
        /// <summary>
        /// 清空医嘱显示
        /// </summary>
        public void Clear()
        {
            try
            {
                this.order = null;
                this.ucInputItem1.txtItemCode.Text = "";                //项目编码
                this.ucInputItem1.txtItemName.Text = "";                //项目名称
                this.txtQTY.Text = "";                                  //总量

                this.cmbUnit.Items.Clear();
                this.ucOrderInputByType1.Clear();
            }

            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Example #9
0
 /// <summary>
 /// 清空
 /// </summary>
 public virtual void Clear()
 {
     this.IsNew                 = true;
     this.myorder               = null;
     this.txtDoseOnce.Text      = "0";                   //每次用量
     this.txtMinUnit.Text       = "";                    //每次用量单位
     this.cmbMemo1.Text         = "";                    //备注
     this.cmbMemo2.Text         = "";
     this.cmbMemo3.Text         = "";
     this.txtFu.Text            = "0";           //付数
     this.cmbExeDept.Text       = "";            //执行科室
     this.chkEmerce.Checked     = false;         //加急
     this.chkDrugEmerce.Checked = false;         //加急
     this.txtSample.Text        = "";
     this.cmbFrequency.Tag      = "";
     this.cmbFrequency.Text     = "";
     this.txtFrequency.Text     = "";
     this.cmbUsage1.Text        = "";
     this.cmbUsage1.Tag         = "";
     this.cmbUsage2.Text        = "";
     this.cmbUsage2.Tag         = "";
     this.IsNew                 = false;
 }
Example #10
0
        /// <summary>
        /// 医嘱保存
        /// </summary>
        protected int Save()
        {
            if (this.Valid() == -1)
            {
                return(-1);
            }
            Neusoft.HISFC.BizLogic.Order.Order orderManager = new Neusoft.HISFC.BizLogic.Order.Order();

            string comboID = "";

            try
            {
                comboID = orderManager.GetNewOrderComboID();//添加组合号;
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取医嘱组合号出错" + ex.Message);
                return(-1);
            }
            Neusoft.FrameWork.Models.NeuObject usageObj = null;
            //{D42BEEA5-1716-4be4-9F0A-4AF8AAF88988}
            this.AlOrder = new ArrayList();
            for (int i = 0; i < this.fpEnter1_Sheet1.Rows.Count; i++)
            {
                if (!this.isClinic)
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order order;

                    order      = new Neusoft.HISFC.Models.Order.Inpatient.Order();
                    order.Item = this.fpEnter1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Pharmacy.Item;
                    if (order.Item == null)
                    {
                        continue;
                    }
                    //患者信息
                    order.Patient = this.patient;
                    //医嘱组合号
                    order.Combo.ID = comboID;
                    //医嘱类型
                    order.OrderType = this.orderTypeHelper.GetObjectFromID(this.cmbOrderType.SelectedValue.ToString()) as Neusoft.HISFC.Models.Order.OrderType;
                    //用法
                    usageObj         = this.fpEnter1_Sheet1.Cells[i, (int)ColumnSet.ColUsage].Tag as Neusoft.FrameWork.Models.NeuObject;
                    order.Usage.ID   = usageObj.ID;
                    order.Usage.Name = usageObj.Name;

                    //单位  {AE53ACB5-3684-42e8-BF28-88C2B4FF2360}
                    order.Unit = (order.Item as Neusoft.HISFC.Models.Pharmacy.Item).MinUnit;

                    //剂数
                    order.HerbalQty = Neusoft.FrameWork.Function.NConvert.ToInt32(this.txtNum.Text);
                    //煎药方式
                    order.Memo = this.cmbMemo.Text;
                    //频次
                    order.Frequency = this.frequencyHelper.GetObjectFromID(this.cmbFrequency.Tag.ToString()) as Neusoft.HISFC.Models.Order.Frequency;//{57C91E41-6803-4c83-9B61-00F75FD04255}
                    //每次量
                    if (this.orderType == Neusoft.HISFC.Models.Order.EnumType.LONG)
                    {
                        order.DoseOnce = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpEnter1_Sheet1.Cells[i, (int)ColumnSet.ColNum].Text);
                    }
                    else
                    {
                        order.Qty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpEnter1_Sheet1.Cells[i, (int)ColumnSet.ColNum].Text);
                    }
                    order.BeginTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtBegin.Text);
                    if (this.dtEnd.Checked)
                    {
                        order.EndTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtEnd.Text);
                    }
                    //取药药房
                    order.StockDept.ID = order.Item.User02;

                    this.alOrder.Add(order);
                }
                else if (this.isClinic)
                {
                    Neusoft.HISFC.Models.Order.OutPatient.Order order;

                    order      = new Neusoft.HISFC.Models.Order.OutPatient.Order();
                    order.Item = this.fpEnter1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Pharmacy.Item;
                    if (order.Item == null)
                    {
                        continue;
                    }
                    //患者信息
                    order.Patient = this.patient;
                    //{D42BEEA5-1716-4be4-9F0A-4AF8AAF88988}
                    if (this.openType == "M") //修改
                    {
                        //医嘱组合号
                        order.Combo.ID = comboID;
                    }
                    else  //开立
                    {
                        //医嘱组合号
                        order.Combo.ID = comboID;
                    }
                    //医嘱类型
                    //order.OrderType = this.orderTypeHelper.GetObjectFromID(this.cmbOrderType.SelectedValue.ToString()) as Neusoft.HISFC.Models.Order.OrderType;
                    //用法
                    usageObj         = this.fpEnter1_Sheet1.Cells[i, (int)ColumnSet.ColUsage].Tag as Neusoft.FrameWork.Models.NeuObject;
                    order.Usage.ID   = usageObj.ID;
                    order.Usage.Name = usageObj.Name;

                    //单位 {AE53ACB5-3684-42e8-BF28-88C2B4FF2360}
                    order.Unit = (order.Item as Neusoft.HISFC.Models.Pharmacy.Item).MinUnit;

                    //剂数
                    order.HerbalQty = Neusoft.FrameWork.Function.NConvert.ToInt32(this.txtNum.Text);
                    //煎药方式
                    order.Memo = this.cmbMemo.Text;
                    //频次
                    order.Frequency = this.frequencyHelper.GetObjectFromID(this.cmbFrequency.Tag.ToString()) as Neusoft.HISFC.Models.Order.Frequency;//{57C91E41-6803-4c83-9B61-00F75FD04255}
                    //每次量
                    if (this.orderType == Neusoft.HISFC.Models.Order.EnumType.LONG)
                    {
                        order.DoseOnce = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpEnter1_Sheet1.Cells[i, (int)ColumnSet.ColNum].Text);
                    }
                    else
                    {
                        order.Qty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpEnter1_Sheet1.Cells[i, (int)ColumnSet.ColNum].Text);
                    }
                    order.BeginTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtBegin.Text);
                    if (this.dtEnd.Checked)
                    {
                        order.EndTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtEnd.Text);
                    }
                    //取药药房
                    order.StockDept.ID = order.Item.User02;

                    this.alOrder.Add(order);
                }
            }
            return(1);
        }
Example #11
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 { }
        }
Example #12
0
        /// <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);
        }
Example #13
0
        private void AddItem(int iIndex, Neusoft.HISFC.Models.Pharmacy.ApplyOut info)
        {
            //try
            //{
            this.neuSpread1_Sheet1.Rows.Get(iIndex).Height = 40;   //行高

            Neusoft.HISFC.BizLogic.Order.OutPatient.Order outPatientOrderManager = new Neusoft.HISFC.BizLogic.Order.OutPatient.Order();
            Neusoft.HISFC.Models.Order.OutPatient.Order   outPatientOrder        = outPatientOrderManager.QueryOneOrder(info.OrderNO);

            if (info.Item.PackQty == 0)
            {
                info.Item.PackQty = 1;
            }
            if (info.Item.Type.ID == "C")
            {
                try
                {
                    //获取医嘱备注  zhangyt
                    //Neusoft.HISFC.BizLogic.Order.OutPatient.Order outPatientOrderManager = new Neusoft.HISFC.BizLogic.Order.OutPatient.Order();
                    //Neusoft.HISFC.Models.Order.OutPatient.Order outPatientOrder = outPatientOrderManager.QueryOneOrder(info.OrderNO);
                    if (outPatientOrder != null)
                    {
                        info.Memo = outPatientOrder.Memo;
                    }
                }
                catch
                { }
                if (info.Memo == "")
                {
                    this.neuSpread1_Sheet1.Cells[iIndex, 0].Text = info.Item.Name;
                }
                else
                {
                    this.neuSpread1_Sheet1.Cells[iIndex, 0].Text = string.Format("{0}[{1}]", info.Item.Name, info.Memo);
                }
            }
            else
            {       //zhangyt 2011-02-22
                this.neuSpread1_Sheet1.Cells[iIndex, 0].Text = string.Format("{0}({1})[{2}]", info.Item.Name, dosageHelper.GetName(info.Item.DosageForm.ID), info.Item.Specs);
            }

            int minQty  = 0;
            int packQty = System.Math.DivRem((int)info.Operation.ApplyQty, (int)info.Item.PackQty, out minQty);

            if (minQty == 0)
            {
                this.neuSpread1_Sheet1.Cells[iIndex, 1].Text = string.Format("{0}{1}", packQty, info.Item.PackUnit);
            }
            else if (packQty == 0)
            {
                this.neuSpread1_Sheet1.Cells[iIndex, 1].Text = string.Format("{0}{1}", minQty, info.Item.MinUnit);
            }
            else
            {
                this.neuSpread1_Sheet1.Cells[iIndex, 1].Text = string.Format("{0}{1}{2}{3}", packQty, info.Item.PackUnit, minQty, info.Item.MinUnit);
            }
            //zhangyt 2011-02-23
            this.sendDrug.Text = string.Format("{0}", info.SendWindow);

            //zhangyt 2011-02-22
            this.neuSpread1_Sheet1.Cells[iIndex, 2].Text = outPatientOrder.DoseOnce.ToString() + outPatientOrder.DoseUnit;   //用量
            this.neuSpread1_Sheet1.Cells[iIndex, 3].Text = outPatientOrder.Frequency.ID;                                     //频次
            this.neuSpread1_Sheet1.Cells[iIndex, 4].Text = this.usageHelper.GetName(outPatientOrder.Usage.ID);               //用法
            string place_no = " ";

            place_no = info.PlaceNO;
            if (place_no == null)
            {
                place_no = " ";
            }

            this.neuSpread1_Sheet1.Cells[iIndex, 5].Text = place_no;
            //this.neuSpread1_Sheet1.Cells[iIndex, 2].Text = info.Item.PriceCollection.RetailPrice.ToString();
            //this.neuSpread1_Sheet1.Cells[iIndex, 3].Text = (System.Math.Round(info.Operation.ApplyQty / info.Item.PackQty * info.Item.PriceCollection.RetailPrice, 2)).ToString();

            //if (this.usageHelper != null)
            //{
            //    this.neuSpread1_Sheet1.Cells[iIndex, 4].Text = this.usageHelper.GetName(info.Usage.ID);
            //}
            //if ((this.neuSpread1_Sheet1.Cells[iIndex, 4].Text) == "")
            //    this.neuSpread1_Sheet1.Cells[iIndex, 4].Text = "遵医嘱";
            //}
            //catch
            //{ }
        }
Example #14
0
 /// <summary>
 /// 医嘱信息放入
 /// </summary>
 /// <param name="orderinfo"></param>
 private void AddAlreadyDetail(Neusoft.HISFC.Models.Order.OutPatient.Order orderinfo)
 {
     //能否根据医生,时间查询clinic_code
 }
        /// <summary>
        /// 设置新医嘱
        /// </summary>
        public virtual void SetOrder()
        {
            if (this.DesignMode)
            {
                return;
            }
            //定义个新医嘱对象
            this.order = new Neusoft.HISFC.Models.Order.OutPatient.Order();//重新设置医嘱

            dirty = false;
            try
            {
                if (this.ucInputItem1.FeeItem.ID == "999")//自己录的项目
                {
                    this.order.Item = this.ucInputItem1.FeeItem as Neusoft.HISFC.Models.Base.Item;
                }
                else
                {
                    //药品
                    if (this.ucInputItem1.FeeItem.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
                    {
                        if (pharmacyManager == null)
                        {
                            pharmacyManager = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();
                        }
                        this.order.Item        = pharmacyManager.GetItem(this.ucInputItem1.FeeItem.ID);
                        this.order.Item.User01 = this.ucInputItem1.FeeItem.User01;
                        this.order.Item.User02 = this.ucInputItem1.FeeItem.User02;//传递取药药房
                        this.order.Item.User03 = this.ucInputItem1.FeeItem.User03;
                    }
                    else//非药品
                    {
                        try
                        {
                            if (((Neusoft.HISFC.Models.Base.Item) this.ucInputItem1.FeeItem).PriceUnit != "[复合项]")
                            {
                                Neusoft.HISFC.Models.Fee.Item.Undrug itemTemp = null;
                                itemTemp = itemManager.GetItem(this.ucInputItem1.FeeItem.ID);

                                this.order.Item = itemTemp;

                                //执行科室赋值 开立项目同时赋值执行科室
                                //----Edit By liangjz 07-03
                                if (itemTemp.ExecDept != null && itemTemp.ExecDept != "")
                                {
                                    this.order.ExeDept.ID = itemTemp.ExecDept;
                                }
                                else
                                {
                                    this.order.ExeDept = this.order.Patient.PVisit.PatientLocation.Dept.Clone();
                                }
                                //-----

                                //检查要求是否为空 暂时由此判断该项目为检查还是检验
                                if (itemTemp.SysClass.ID.ToString() == "UL")
                                {
                                    //设置复合项目明细所属大项编码、样本类型/检查部位
                                    this.order.Sample.Name = itemTemp.CheckBody;
                                }
                                else
                                {
                                    this.order.CheckPartRecord = itemTemp.CheckBody;
                                }
                            }
                            else
                            {
                                Neusoft.HISFC.Models.Fee.Item.Undrug itemTemp = null;
                                itemTemp        = (Neusoft.HISFC.Models.Fee.Item.Undrug) this.ucInputItem1.FeeItem;
                                this.order.Item = itemTemp;
                                //检查要求是否为空 暂时由此判断该项目为检查还是检验
                                if (itemTemp.SysClass.ID.ToString() == "UL")
                                {
                                    //设置复合项目明细所属大项编码、样本类型/检查部位
                                    this.order.Sample.Name = itemTemp.CheckBody;
                                }
                                else
                                {
                                    this.order.CheckPartRecord = itemTemp.CheckBody;
                                }
                                this.order.Item.MinFee.ID = "fh";
                            }
                        }
                        catch { MessageBox.Show("转换出错!", "ucItemSelect"); }
                    }
                }
            }
            catch { return; }


            //显示给界面
            if (ReadOrder(this.order) == -1)
            {
                return;
            }

            //设置医嘱开立时间
            Neusoft.FrameWork.Management.DataBaseManger manager = new Neusoft.FrameWork.Management.DataBaseManger();
            DateTime dtNow = manager.GetDateTimeFromSysDateTime();

            this.order.MOTime         = dtNow; //开立时间
            this.order.BeginTime      = dtNow; //开始时间
            this.order.Item.PriceUnit = this.cmbUnit.Text;
            this.order.Unit           = this.cmbUnit.Text;

            this.order.ReciptDept = ((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).Dept.Clone(); //开立科室
            this.order.Oper.ID    = Neusoft.FrameWork.Management.Connection.Operator.ID;                                                 //录入人
            this.order.Oper.Name  = Neusoft.FrameWork.Management.Connection.Operator.Name;

            //医嘱类型
            //this.order.OrderType = this.cmbOrderType1.alItems[this.cmbOrderType1.SelectedIndex] as Neusoft.HISFC.Models.Order.OrderType;


            if (this.txtQTY.Enabled)
            {
                this.txtQTY.Focus();//focus
                this.txtQTY.Select(0, this.txtQTY.Value.ToString().Length);
            }
            else
            {
                this.ucOrderInputByType1.Focus();
            }
            if (this.cmbUnit.Items.Count > 0)
            {
                this.cmbUnit.SelectedIndex = 0;    //默认选择第一个。
            }
            this.ucOrderInputByType1.IsNew = true; //新的

            //初始化新项目信息 设置医嘱频次用法

            if (this.order.Item.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
            {
                //this.order.Frequency.ID = "PRN";
                this.order.Usage.ID   = (this.order.Item as Neusoft.HISFC.Models.Pharmacy.Item).Usage.ID;
                this.order.Usage.Name = Order.Classes.Function.HelperUsage.GetName(this.order.Usage.ID);
            }
            else
            {
                //this.order.Frequency.ID = "QD";
            }

            if (this.order.HerbalQty == 0)
            {
                this.order.HerbalQty = 1;                //更新草药付数
            }
            this.ucOrderInputByType1.Order = this.order; //传递给选择类型
            dirty = true;
            this.myOrderChanged(this.order, EnumOrderFieldList.Item);
        }
        public void Save()
        {
            #region 判断是否为修改原组套
            Neusoft.HISFC.Models.Base.Group    group;
            Neusoft.HISFC.Models.Base.Employee empl          = ((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).Clone();
            Neusoft.HISFC.Models.Base.Group    groupSelected = this.cmbGroupName.SelectedItem as Neusoft.HISFC.Models.Base.Group;
            if (groupSelected == null || groupSelected.ID == "")
            {
                groupSelected = new Neusoft.HISFC.Models.Base.Group();
            }
            if (this.rdo2.Checked)
            {
                for (int i = 0; i < this.alGroupAll.Count; i++)
                {
                    group = alGroupAll[i] as Neusoft.HISFC.Models.Base.Group;

                    if (groupSelected.ID == group.ID)
                    {
                        this.CurrentGroup = group;
                        this.IsAdd        = true;
                        break;
                    }
                    if (this.cmbGroupName.Text == group.Name && group.Dept.ID == empl.Dept.ID && group.Kind == Neusoft.HISFC.Models.Base.GroupKinds.Dept)
                    {
                        this.CurrentGroup = group;
                        this.IsAdd        = true;
                        break;
                    }
                }
            }
            else
            {
                if (this.rdo1.Checked)
                {
                    for (int i = 0; i < this.alGroupAll.Count; i++)
                    {
                        group = alGroupAll[i] as Neusoft.HISFC.Models.Base.Group;

                        if (groupSelected.ID == group.ID)
                        {
                            this.CurrentGroup = group;
                            this.IsAdd        = true;
                            break;
                        }
                        if (this.cmbGroupName.Text == group.Name && group.Doctor.ID == empl.ID && group.Kind == Neusoft.HISFC.Models.Base.GroupKinds.Doctor)
                        {
                            this.CurrentGroup = group;
                            this.IsAdd        = true;
                            break;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < this.alGroupAll.Count; i++)
                    {
                        group = this.alGroupAll[i] as Neusoft.HISFC.Models.Base.Group;

                        if (groupSelected.ID == group.ID)
                        {
                            this.CurrentGroup = group;
                            this.IsAdd        = true;
                            break;
                        }
                        if (this.cmbGroupName.Text == group.Name && group.Kind == Neusoft.HISFC.Models.Base.GroupKinds.All)
                        {
                            this.CurrentGroup = group;
                            this.IsAdd        = true;
                            break;
                        }
                    }
                }
            }
            #endregion

            if (this.CurrentGroup == null)//新的
            {
                CurrentGroup    = new Neusoft.HISFC.Models.Base.Group();
                CurrentGroup.ID = manager.GetNewGroupID();
                if (this.cmbGroupName.Text.Trim() == "")
                {
                    MessageBox.Show("请输入组套名称!");
                    CurrentGroup = null;
                    return;
                }
                if (Neusoft.FrameWork.Public.String.ValidMaxLengh(this.cmbGroupName.Text.Trim(), 30) == false)
                {
                    MessageBox.Show("组套名称超长!", "提示");
                    CurrentGroup = null;
                    return;
                }
                CurrentGroup.Name = this.cmbGroupName.Text;
                //CurrentGroup.UserType = Neusoft.HISFC.Models.Base.ServiceTypes.I;//住院
                CurrentGroup.UserType = this.inpatientType;
                Neusoft.HISFC.Models.Base.Employee ee = ((Neusoft.HISFC.Models.Base.Employee)manager.Operator).Clone();
                CurrentGroup.Dept.ID = ee.Dept.ID;
                if (this.rdo2.Checked)                  //科室
                {
                    CurrentGroup.Kind      = Neusoft.HISFC.Models.Base.GroupKinds.Dept;
                    CurrentGroup.Doctor.ID = "";
                }
                else
                {
                    if (this.rdo1.Checked)              //个人
                    {
                        CurrentGroup.Kind      = Neusoft.HISFC.Models.Base.GroupKinds.Doctor;
                        CurrentGroup.Doctor.ID = manager.Operator.ID;
                    }
                    else                                                                //全院组套
                    {
                        CurrentGroup.Kind = Neusoft.HISFC.Models.Base.GroupKinds.All;
                    }
                }
            }

            if (this.IsAdd == true && this.chkAdd.Checked == false)
            {
                DialogResult r = MessageBox.Show("是否要覆盖掉原来的组套,\n*不追加会丢失掉原来的数据!", "友情提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (r == DialogResult.No)
                {
                    return;
                }
            }
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(manager.Connection);
            //t.BeginTransaction();
            manager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            if (this.chkAdd.Checked == false)
            {
                if (manager.DeleteGroup(CurrentGroup) < 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("保存组套失败" + manager.Err);
                    return;
                }
                if (manager.DeleteGroupOrder(CurrentGroup) < 0)//删除明细
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("保存组套失败" + manager.Err);
                    return;
                }
            }
            if (manager.UpdateGroup(CurrentGroup) < 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("保存组套失败" + manager.Err);
                return;
            }
            if (this.chkAdd.Checked == false)
            {
                if (manager.DeleteGroupOrder(CurrentGroup) < 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show("保存组套失败" + manager.Err);
                    return;
                }
            }
            try
            {
                for (int i = 0; i < this.fpSpread1_Sheet1.Rows.Count; i++)
                {
                    if (this.inpatientType == Neusoft.HISFC.Models.Base.ServiceTypes.I)
                    {
                        Neusoft.HISFC.Models.Order.Inpatient.Order order = (this.fpSpread1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order).Clone();
                        //判断对开立时间的修改是否正确
                        order.BeginTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.fpSpread1_Sheet1.Cells[i, 13].Text);
                        if (order.BeginTime == DateTime.MinValue)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show(order.Item.Name + "医嘱开始时间设置错误 请重新设置");
                            return;
                        }
                        if (order.Item.SysClass.ID.ToString() == "UL" && order.Sample.Name != "")
                        {
                            order.CheckPartRecord = order.Sample.Name;
                        }
                        if (manager.UpdateGroupItem(CurrentGroup, order) < 0)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show(manager.Err);
                            return;
                        }
                    }
                    else
                    {
                        Neusoft.HISFC.Models.Order.OutPatient.Order order = (this.fpSpread1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Order.OutPatient.Order).Clone();
                        //判断对开立时间的修改是否正确
                        order.BeginTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.fpSpread1_Sheet1.Cells[i, 13].Text);
                        if (order.BeginTime == DateTime.MinValue)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show(order.Item.Name + "医嘱开始时间设置错误 请重新设置");
                            return;
                        }
                        if (order.Item.SysClass.ID.ToString() == "UL" && order.Sample.Name != "")
                        {
                            order.CheckPartRecord = order.Sample.Name;
                        }
                        if (manager.UpdateGroupItem(CurrentGroup, order) < 0)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
                            MessageBox.Show(manager.Err);
                            return;
                        }
                    }
                }
            }
            catch (Exception ex) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(ex.Message); }
            Neusoft.FrameWork.Management.PublicTrans.Commit();
            MessageBox.Show("保存成功!");
            this.tvDoctorGroup1.RefrshGroup();
            this.Close();
        }
Example #17
0
        protected ArrayList myGetItemOutPat(string sql)
        {
            if (this.ExecQuery(sql) == -1)
            {
                return(null);
            }
            ArrayList al = new ArrayList();

            #region 接口说明
            //0 组套内单项流水号,
            //1 项目代码, 2 医嘱类型 ,3 服药频次,    4 服药方法       5 每次服用剂量
            //6 剂量单位,自备药使用,7 开立数量,8 开立单位,自备项目使用,9 草药付数(周期)
            //10 组合流水号,11 主药标记,12 检查部位检体,13 执行科室,14 医嘱开始时间,15 医嘱结束时间
            //16 医嘱备注,17 药品组合医嘱备注
            #endregion

            while (this.Reader.Read())
            {
                Neusoft.HISFC.Models.Order.OutPatient.Order info = new Neusoft.HISFC.Models.Order.OutPatient.Order();
                try
                {
                    info.ID     = this.Reader[1].ToString();
                    info.User01 = this.Reader[0].ToString();
                    //info.OrderType.ID = this.Reader[2].ToString();
                    try
                    {
                        info.Frequency.ID = this.Reader[3].ToString();
                        info.Usage.ID     = this.Reader[4].ToString();
                    }
                    catch { }
                    try
                    {
                        info.DoseOnce = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[5].ToString());
                    }
                    catch { }
                    try
                    {
                        info.DoseUnit = this.Reader[6].ToString();
                    }
                    catch { }
                    try
                    {
                        info.Qty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[7].ToString());
                    }
                    catch { }
                    info.Unit = this.Reader[8].ToString();
                    try
                    {
                        info.HerbalQty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[9].ToString());
                    }
                    catch { }
                    info.Combo.ID         = this.Reader[10].ToString();
                    info.Combo.IsMainDrug = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[11].ToString());
                    info.CheckPartRecord  = this.Reader[12].ToString();
                    info.ExeDept.ID       = this.Reader[13].ToString();
                    info.BeginTime        = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[14].ToString());
                    info.EndTime          = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[15].ToString());
                    info.Memo             = this.Reader[16].ToString();
                    info.Combo.Memo       = this.Reader[17].ToString();
                    info.Usage.Name       = this.Reader[18].ToString();
                    info.ExeDept.Name     = this.Reader[19].ToString();
                    //info.OrderType.Name = this.Reader[20].ToString();
                    info.Name = this.Reader[21].ToString();
                    try//时间间隔
                    {
                        info.User03           = this.Reader[22].ToString();
                        info.Item.SysClass.ID = this.Reader[23].ToString();
                        info.Item.User01      = this.Reader[24].ToString();
                    }
                    catch { }
                    info.NurseStation.User03 = this.Reader[25].ToString();
                }
                catch { }
                al.Add(info);
            }
            this.Reader.Close();
            return(al);
        }
Example #18
0
        protected virtual int ModifyHytoResult()
        {
            int count = 0;

            for (int i = 0; i < this.neuSpread1_Sheet1.RowCount; i++)
            {
                bool isSelected = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[i, 0].Value);
                if (isSelected)
                {
                    count++;
                }
            }

            if (count == 0)
            {
                MessageBox.Show("请选择要修改的医嘱信息");
                return(-1);
            }

            Forms.frmHypoTest frmHypoTest = new Neusoft.HISFC.Components.Order.OutPatient.Forms.frmHypoTest();

            frmHypoTest.rb1.Enabled = false;
            //frmHypoTest.rb3.Enabled = false;
            //frmHypoTest.rb4.Checked = true;
            DialogResult r = frmHypoTest.ShowDialog();

            string hytoResult = frmHypoTest.Hypotest.ToString();

            Neusoft.FrameWork.Models.NeuObject obj = this.tvRegRecord.SelectedNode.Tag as Neusoft.FrameWork.Models.NeuObject;

            if (obj == null)
            {
                return(-1);
            }



            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            for (int i = 0; i < this.neuSpread1_Sheet1.RowCount; i++)
            {
                bool isSelected = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[i, 0].Value);
                if (isSelected)
                {
                    int intHytoResult = Neusoft.FrameWork.Function.NConvert.ToInt32(hytoResult);

                    Neusoft.HISFC.Models.Order.OutPatient.Order order = this.neuSpread1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Order.OutPatient.Order;


                    //校验医嘱有效性 防止并发

                    ArrayList alNowOrder = this.orderBizLogic.QueryOrderByKey(order.SeeNO, order.ID);

                    if (alNowOrder == null)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("查询医嘱当前状态出错");
                        this.ShowOutpatientOrder(obj.ID, obj.Name);
                        return(-1);
                    }

                    if (alNowOrder.Count == 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("没有查询到要修改皮试结果的医嘱信息");
                        this.ShowOutpatientOrder(obj.ID, obj.Name);
                        return(-1);
                    }

                    //转换当前医嘱信息
                    Neusoft.HISFC.Models.Order.OutPatient.Order nowOrder = alNowOrder[0] as Neusoft.HISFC.Models.Order.OutPatient.Order;
                    if (order.Status != 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("待修改医嘱中有的不是开立状态");
                        this.ShowOutpatientOrder(obj.ID, obj.Name);
                        return(-1);
                    }

                    int returnValue = this.orderBizLogic.UpdateOrderHyTest(hytoResult, this.GetHyteName(intHytoResult), order.ID, order.SeeNO);

                    if (returnValue < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("本次操作没有成功:更新医嘱[" + order.Item.Name + "]的皮试结果失败!" + this.orderBizLogic.Err);
                        this.ShowOutpatientOrder(obj.ID, obj.Name);
                        return(-1);
                    }

                    if (returnValue == 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("本次操作没有成功:更新医嘱[" + order.Item.Name + "]的皮试结果失败!" + this.orderBizLogic.Err);
                        this.ShowOutpatientOrder(obj.ID, obj.Name);
                        return(-1);
                    }
                    //order.HypoTest = intHytoResult;
                    //order.Memo = this.GetHyteName(intHytoResult);
                }
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            MessageBox.Show("修改成功");
            this.ShowOutpatientOrder(obj.ID, obj.Name);


            return(1);
        }
Example #19
0
        public int AlterOrder(Neusoft.HISFC.Models.Registration.Register patient, Neusoft.FrameWork.Models.NeuObject recipeDoc, Neusoft.FrameWork.Models.NeuObject recipeDept, ref Neusoft.HISFC.Models.Order.OutPatient.Order order)
        {
            if (order.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug)
            {
                Neusoft.HISFC.Models.Pharmacy.Item drugItem = order.Item as Neusoft.HISFC.Models.Pharmacy.Item;
                if (drugItem == null)
                {
                    return(0);
                }

                #region 多级单位(最小发药系数)
                if (order.Item.Qty == 0 || string.IsNullOrEmpty(order.Item.ID))
                {
                    return(0);
                }
                if (order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.PCC.ToString())
                {//草药算法根据现场版本情况单独处理
                    return(0);
                }
                decimal totQty;
                decimal resultTotQty;
                decimal packQty = drugItem.PackQty;

                if (order.Nurse.User03 == "0")
                {//包装单位
                    totQty = order.Qty * drugItem.PackQty;
                }
                else
                {//最小单位
                    totQty = order.Qty;
                }

                this.phaItemMgr.QuerySpeUnitForClinic(drugItem, totQty, out resultTotQty);

                if (order.NurseStation.User03 == "0")
                {                                                         //包装单位
                    totQty = System.Math.Ceiling(resultTotQty / packQty); //整包装上取整
                }
                else
                {//最小单位
                    totQty = System.Math.Ceiling(resultTotQty);
                }
                if (order.Qty != totQty)
                {
                    if (MessageBox.Show(order.Item.Name + "的最小发药量为" + totQty + ",是否修改?", "药房最小发药量", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        order.Qty = totQty;
                    }
                    else
                    {//目前此处并没有强制修改
                    }
                }
                #endregion
            }

            if (order.Item.Memo == "")
            {
                //string practicableSymptomText = "";
                //int returnValue = this.QueryItemByOutpatOrder(patient, order, ref practicableSymptomText);
                //switch (returnValue)
                //{
                //    case 0: //没有维护
                //        {
                //            //不处理

                //            break;
                //        }
                //    case 1: //有维护
                //        {
                //            DialogResult d = System.Windows.Forms.MessageBox.Show("该项目在适应症中有维护:\n" + practicableSymptomText + "\n" + "是否选择按照适应症收费", "提示", MessageBoxButtons.YesNoCancel);
                //            if (d == DialogResult.Cancel)
                //            {
                //                order.Item.Memo = "0";
                //                return 1;
                //            }
                //            else if (d == DialogResult.Yes)
                //            {

                //                //是否适应症置为1 借用order.Item.Memo
                //                order.Item.Memo = "1";
                //                return 1;
                //            }
                //            else
                //            {
                //                order.Item.Memo = "0";
                //                //不处理
                //            }

                //            break;
                //        }
                //    case -1: //出错
                //        {
                //            break;
                //        }

                //    default:
                //        break;
                //}
                return(1);
            }
            else
            {
                return(1);
            }
        }
Example #20
0
        /// <summary>
        /// 查询医嘱
        /// </summary>
        private void QueryOrder()
        {
            ArrayList alOrder     = new ArrayList();
            ArrayList alPRecipe   = new ArrayList();
            ArrayList alPCZRecipe = new ArrayList();
            ArrayList alPCCRecipe = new ArrayList();

            alOrder = orderManagement.QueryOrder(this.myRecipeNO);
            if (alOrder.Count <= 0 || alOrder == null)
            {
                return;
            }
            #region  处方号分下组先
            System.Collections.Generic.Dictionary <string, ArrayList> alRecipeNoOrder
                = new Dictionary <string, ArrayList>();
            while (alOrder.Count > 0)
            {
                string recepeNo = string.Empty;
                Neusoft.HISFC.Models.Order.OutPatient.Order o = alOrder[0] as Neusoft.HISFC.Models.Order.OutPatient.Order;
                if (o != null)
                {
                    recepeNo = o.ReciptNO.ToString();
                }
                if (alRecipeNoOrder.ContainsKey(recepeNo) == false)
                {
                    alRecipeNoOrder.Add(recepeNo, new ArrayList());
                }
                alRecipeNoOrder[recepeNo].Add(o);
                alOrder.RemoveAt(0);
            }
            foreach (ArrayList a in alRecipeNoOrder.Values)
            {
                foreach (Neusoft.HISFC.Models.Order.OutPatient.Order order in a)
                {
                    //if (order.Item.IsPharmacy)
                    if (order.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug)
                    {
                        if (order.Status != 3
                            // (order.Item as Neusoft.HISFC.Models.Pharmacy.Item).Quality.ID != "S" &&
                            //    (order.Item as Neusoft.HISFC.Models.Pharmacy.Item).Quality.ID != "P" &&))
                            )

                        {
                            if (order.Item.SysClass.ID.ToString() == "PCC")
                            {
                                alPCCRecipe.Add(order);
                            }
                            else
                            {
                                if (isSameRecipe)
                                {
                                    alPRecipe.Add(order);
                                }
                                else
                                {
                                    if (order.Item.SysClass.ID.ToString() == "P")
                                    {
                                        alPRecipe.Add(order);
                                    }
                                    else
                                    {
                                        alPCZRecipe.Add(order);
                                    }
                                }
                            }
                        }
                    }
                }
                this.PrintRecipe(alPRecipe, false);
                this.PrintRecipe(alPCZRecipe, false);
                this.PrintRecipe(alPCCRecipe, true);
            }

            #endregion
        }
Example #21
0
        /// <summary>
        /// 从对照表中查找维护适应症的项目
        /// </summary>
        /// <param name="patient"></param>
        /// <param name="order"></param>
        /// <param name="practicableSymptomText">适应症文本</param>
        /// <returns> -1 报错 0 没有维护 1 有维护</returns>
        private int QueryItemByOutpatOrder(Neusoft.HISFC.Models.Registration.Register patient, Neusoft.HISFC.Models.Order.OutPatient.Order order, ref string practicableSymptomText)
        {
            Neusoft.HISFC.BizLogic.Fee.Interface     myInterface = new Neusoft.HISFC.BizLogic.Fee.Interface();
            Neusoft.HISFC.Models.SIInterface.Compare myCompare   = new Neusoft.HISFC.Models.SIInterface.Compare();

            if (order != null || order.Patient.ID != "")
            {
                myInterface.GetCompareSingleItem(patient.Pact.ID, order.Item.ID, ref myCompare);
                if (myCompare.Ispracticablesymptom)
                {
                    practicableSymptomText = myCompare.Practicablesymptomdepiction;
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            if (order.Item.Memo != "1")
            {
                //从维护表中对照项目
            }
            return(0);
        }
Example #22
0
        //{D42BEEA5-1716-4be4-9F0A-4AF8AAF88988}
        protected int SetValue(ArrayList alHerbalOrder)
        {
            foreach (object obj in alHerbalOrder)
            {
                this.fpEnter1_Sheet1.AddRows(0, 1);
                if (obj.GetType().ToString() == "Neusoft.HISFC.Models.Order.OutPatient.Order") //门诊
                {
                    Neusoft.HISFC.Models.Order.OutPatient.Order order = obj as Neusoft.HISFC.Models.Order.OutPatient.Order;

                    Neusoft.HISFC.Models.Pharmacy.Item item = this.itemManager.GetItem(order.Item.ID);
                    if (item == null)
                    {
                        MessageBox.Show("获取药品信息失败!" + this.itemManager.Err);
                        return(-1);
                    }

                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColTradeName].Text = item.Name;  //obj.Name;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColSpecs].Text     = item.Specs; //item.Specs;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColPrice].Text     = item.PriceCollection.RetailPrice.ToString();
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColUnit].Text      = item.MinUnit;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColUsage].Text     = order.Usage.Name;
                    this.txtNum.Text  = order.HerbalQty.ToString();
                    this.cmbMemo.Text = order.Memo.ToString();//{F5BE708C-7A46-40f9-A534-A81B454538F2}
                    //{D42BEEA5-1716-4be4-9F0A-4AF8AAF88988}
                    //this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColNum].Text = order.Qty.ToString();
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColNum].Text       = (order.Qty / order.HerbalQty).ToString();
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColTradeName].Text = order.Item.Name;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColUsage].Tag      = order.Usage;
                    this.cmbFrequency.Text           = order.Frequency.ID;//执行科室
                    item.User02                      = order.StockDept.ID;
                    this.fpEnter1_Sheet1.Rows[0].Tag = item;
                }
                else
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order order = obj as Neusoft.HISFC.Models.Order.Inpatient.Order;

                    Neusoft.HISFC.Models.Pharmacy.Item item = this.itemManager.GetItem(order.Item.ID);
                    if (item == null)
                    {
                        MessageBox.Show("获取药品信息失败!" + this.itemManager.Err);
                        return(-1);
                    }

                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColTradeName].Text = item.Name;  //obj.Name;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColSpecs].Text     = item.Specs; //item.Specs;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColPrice].Text     = item.PriceCollection.RetailPrice.ToString();
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColUnit].Text      = item.MinUnit;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColUsage].Text     = order.Usage.Name;
                    this.txtNum.Text  = order.HerbalQty.ToString();
                    this.cmbMemo.Text = order.Memo.ToString();//{F5BE708C-7A46-40f9-A534-A81B454538F2}
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColNum].Text = order.Qty.ToString();
                    //this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColNum].Text = (order.Qty / order.HerbalQty).ToString();
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColTradeName].Text = order.Item.Name;
                    this.fpEnter1_Sheet1.Cells[0, (int)ColumnSet.ColUsage].Tag      = order.Usage;
                    this.cmbFrequency.Text           = order.Frequency.ID;//执行科室
                    item.User02                      = order.StockDept.ID;
                    this.fpEnter1_Sheet1.Rows[0].Tag = item;
                }
            }
            return(1);
        }
Example #23
0
        public int UpdateGroupItem(Neusoft.HISFC.Models.Base.Group info, Neusoft.HISFC.Models.Order.OutPatient.Order order)
        {
            string strUpdate = "", strInsert = "";

            if (this.Sql.GetSql("Manager.GroupItem.Update", ref strUpdate) == -1)
            {
                return(-1);
            }
            if (this.Sql.GetSql("Manager.GroupItem.Insert", ref strInsert) == -1)
            {
                return(-1);
            }
            try
            {
                #region 接口说明
                //<!--
                //0 : 组套流水号             1 : 组套内单项流水号            2 : 每次服用剂量
                //3 : 剂量单位,自备药使用        4 : 开立数量              5 : 开立单位,自备项目使用
                //6 : 草药付数(周期)         7 : 组合流水号                 8 : 主药标记
                //9 : 检查部位检体          10 : 执行科室                  11 : 医嘱开始时间
                //12 : 医嘱结束时间         13 : 医嘱备注                  14 : 药品组合医嘱备注
                //15 : 操作员               16 : 操作时间                  17 : 项目代码
                //18 : 医嘱类型             19 : 服药频次                  20 : 服药方法
                //21: 时间间隔              22 classcode 24 extcode
                //-->
                #endregion

                //====扩展编码用于存放药品的扣库科室========
                //{B9661764-2E06-462a-A9D9-05A3009D1F23}
                string stockDept = string.Empty;
                if (order.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug)
                {
                    stockDept = order.StockDept.ID;
                }

                strUpdate = string.Format(strUpdate, info.ID, order.ID, order.DoseOnce.ToString(),
                                          order.DoseUnit, order.Qty.ToString(), order.Unit,
                                          order.HerbalQty.ToString(), order.Combo.ID, Neusoft.FrameWork.Function.NConvert.ToInt32(order.Combo.IsMainDrug).ToString(),
                                          order.CheckPartRecord, order.ExeDept.ID, order.BeginTime.ToString(),
                                          order.EndTime.ToString(), order.Memo, order.Combo.Memo, this.Operator.ID, this.GetSysDateTime(), order.Item.ID,
                                          "MZ", order.Frequency.ID, order.Usage.ID, order.Item.Name, order.User03, order.Item.SysClass.ID, stockDept, order.NurseStation.User03);
                strInsert = string.Format(strInsert, info.ID, order.ID, order.DoseOnce.ToString(),
                                          order.DoseUnit, order.Qty.ToString(), order.Unit,
                                          order.HerbalQty.ToString(), order.Combo.ID, Neusoft.FrameWork.Function.NConvert.ToInt32(order.Combo.IsMainDrug).ToString(),
                                          order.CheckPartRecord, order.ExeDept.ID, order.BeginTime.ToString(),
                                          order.EndTime.ToString(), order.Memo, order.Combo.Memo, this.Operator.ID, this.GetSysDateTime(), order.Item.ID,
                                          "MZ", order.Frequency.ID, order.Usage.ID, order.Item.Name, order.User03, order.Item.SysClass.ID, stockDept, order.NurseStation.User03);
            }
            catch (Exception ex)
            {
                this.Err     = ex.Message;
                this.ErrCode = ex.Message;
                return(-1);
            }
            //先更新
            if (this.ExecNoQuery(strUpdate) <= 0)
            {
                //插入
                if (this.ExecNoQuery(strInsert) <= 0)
                {
                    return(-1);
                }
            }
            return(0);
        }