void tvGroup_SelectOrder(System.Collections.ArrayList alOrders)
        {
            //{D42BEEA5-1716-4be4-9F0A-4AF8AAF88988} //草药弹出草药开立界面
            ArrayList alHerbal = new ArrayList(); //草药

            foreach (Neusoft.HISFC.Models.Order.Inpatient.Order order in alOrders)
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order myorder = order.Clone();
                myorder.Patient.PVisit.PatientLocation.Dept.ID = ((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).Dept.ID;
                if (fillOrder(ref myorder) != -1)
                {
                    if (order.Item.SysClass.ID.ToString() == "PCC") //草药
                    {
                        alHerbal.Add(order);
                    }
                    else
                    {
                        if (myorder.OrderType.IsDecompose)
                        {
                            this.ucOrder1.AddNewOrder(myorder, 0);
                        }
                        else
                        {
                            this.ucOrder1.AddNewOrder(myorder, 1);
                        }
                    }
                }
            }

            if (alHerbal.Count > 0)
            {
                this.ucOrder1.AddHerbalOrders(alHerbal);
            }
            this.ucOrder1.RefreshCombo();
        }
Exemplo n.º 2
0
        private ArrayList GetItems()
        {
            if (this.cmbOrderType.SelectedItem == null)
            {
                return(null);
            }

            if (this.mySysClass == null || this.mySysClass == string.Empty)
            {
                return(null);
            }

            if (this.lvUndrugItems.CheckedItems.Count > 0)
            {
                ArrayList alItem = new ArrayList();
                foreach (ListViewItem item in this.lvUndrugItems.CheckedItems)
                {
                    Neusoft.FrameWork.Models.NeuObject         obj   = item.Tag as Neusoft.FrameWork.Models.NeuObject;
                    Neusoft.HISFC.Models.Order.Inpatient.Order order = new Neusoft.HISFC.Models.Order.Inpatient.Order();
                    order.ID               = this.billNO;
                    order.Memo             = "2";
                    order.OrderType.ID     = this.myOrderType;
                    order.OrderType.Name   = this.orderTypeHelper.GetName(this.myOrderType);
                    order.Item.SysClass.ID = this.mySysClass;
                    order.Item.ID          = obj.ID;
                    order.Item.Name        = obj.Name;
                    alItem.Add(order);
                }
                return(alItem);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 计算总量
        /// </summary>
        /// <param name="order"></param>
        /// <returns>0 成功 -1失败</returns>
        public static int CalTotal(Neusoft.HISFC.Models.Order.Inpatient.Order order, int days)
        {
            Neusoft.HISFC.Models.Pharmacy.Item item = order.Item as Neusoft.HISFC.Models.Pharmacy.Item;
            #region 获得时间点
            if (order.Frequency.Usage.ID == "")
            {
                order.Frequency.Usage = order.Usage.Clone();
            }
            //***************获得频次时间点(每天多少次)******************
            if (days == 0)
            {
                days = 1;
            }
            #endregion
            if (item.OnceDose == 0M)//一次剂量为零,默认显示基本剂量
            {
                order.Qty = order.Frequency.Times.Length * days;
            }
            else
            {
                order.Qty = item.OnceDose / item.BaseDose * order.Frequency.Times.Length * days;
            }

            return(0);
        }
        private int fillOrder(ref Neusoft.HISFC.Models.Order.Inpatient.Order order)
        {
            string err = "";

            //if (order.Item.IsPharmacy)
            if (order.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug)
            //if (order.Item.IsPharmacy)
            {
                //护士不允许开立药品 {5DE2C8F9-2E5D-43d6-9CAD-A5E0F60AC94B
                return(-1);
                //if (Neusoft.HISFC.BizProcess.Integrate.Order.FillPharmacyItemWithStockDept(null, ref order, out err) == -1)
                //{
                //    MessageBox.Show(err);
                //    return -1;
                //}
            }
            else
            {
                if (Neusoft.HISFC.BizProcess.Integrate.Order.FillFeeItem(null, ref order, out err) == -1)
                {
                    MessageBox.Show(err);
                    return(-1);
                }
            }
            //{A5409134-55B5-42d9-A264-25060169A64B}
            Neusoft.FrameWork.Models.NeuObject trueFrequency = this.frequencyHelper.GetObjectFromID(order.Frequency.ID);
            if (trueFrequency != null)
            {
                order.Frequency = trueFrequency as Neusoft.HISFC.Models.Order.Frequency;
            }

            return(0);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 执行单设置(批量导入用)
        /// 必须填写(objBill.Name 执行单名,objBill.Memo执行单类型,1药/2非药,objBill.user01 医嘱类型
        /// objBill.user02非药系统类别、药品类别 objBill.user03 药品用法)
        /// </summary>
        /// <param name="al"></param>
        /// <param name="nurseCode"></param>
        /// <returns></returns>
        public int SetExecBillNew(ArrayList al, Neusoft.FrameWork.Models.NeuObject objExecBill, string nurseCode, ref string billID)
        {
            Neusoft.FrameWork.Models.NeuObject obj         = new NeuObject();
            Neusoft.FrameWork.Models.NeuObject objExecInfo = objExecBill.Clone();
            if (al.Count == 0)
            {
                this.Err = Neusoft.FrameWork.Management.Language.Msg("没有维护详细项目!");
                return(-1);
            }

            if (this.SetExecBill(objExecInfo, nurseCode) == -1)
            {
                this.Err = Neusoft.FrameWork.Management.Language.Msg("执行单设置失败!") + this.Err;
                return(-1);
            }

            if (objExecInfo.Memo == "1")
            {
                for (int i = 0; i < al.Count; i++)
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order orderInfo = (Neusoft.HISFC.Models.Order.Inpatient.Order)al[i];
                    orderInfo.ID = objExecInfo.ID;
                    if (orderInfo.ID == "-1" || orderInfo.ID == "")
                    {
                        return(-1);
                    }
                    if (this.InsertExecBillItem(nurseCode, objExecInfo.ID, orderInfo.OrderType.ID, orderInfo.Item.SysClass.ID.ToString(), orderInfo.Item.ID, orderInfo.Item.Name) < 0)
                    {
                        this.Err = Neusoft.FrameWork.Management.Language.Msg("执行单设置失败!") + this.Err;
                        return(-1);
                    }
                }
            }
            else
            {
                for (int i = 0; i < al.Count; i++)
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order orderInfo = (Neusoft.HISFC.Models.Order.Inpatient.Order)al[i];
                    obj.ID     = objExecInfo.ID;
                    obj.User02 = orderInfo.Item.User01;
                    obj.User01 = orderInfo.OrderType.ID;
                    obj.User03 = orderInfo.Usage.ID;
                    obj.Memo   = "1";
                    if (obj.ID == "-1" || obj.ID == "")
                    {
                        return(-1);
                    }
                    if (InsertExecBill(obj, nurseCode) < 0)
                    {
                        this.Err = Neusoft.FrameWork.Management.Language.Msg("执行单设置失败!") + this.Err;
                        return(-1);
                    }
                }
            }
            billID = objExecInfo.ID;

            return(0);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获得执行单控制信息by执行单流水号
        /// </summary>
        /// <param name="billNo"></param>
        /// <returns></returns>
        public ArrayList QueryExecBillDetail(string billNo)
        {
            ArrayList al     = new ArrayList();
            string    strSql = "";

            //Order.ExecBill.SelectItem.2
            //传入:0  执行单流水号
            //传出:0  执行单流水号,1( 1药2非药)
            //2医嘱类型id 3 name 4非药系统类别/药品类别 5药品用法 id 6 name
            if (this.Sql.GetSql("Order.ExecBill.SelectItem.2", ref strSql) == 0)
            {
                try
                {
                      strSql = string.Format(strSql, billNo);
                }
                catch (Exception ex)
                {
                    this.Err     = ex.Message;
                    this.ErrCode = ex.Message;
                    this.WriteErr();
                    return(null);
                }
                if (this.ExecQuery(strSql) == -1)
                {
                    return(null);
                }
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order obj = new Neusoft.HISFC.Models.Order.Inpatient.Order();
                    obj.ID             = this.Reader[0].ToString();
                    obj.Memo           = this.Reader[1].ToString();           //药品非药品
                    obj.OrderType.ID   = this.Reader[2].ToString();
                    obj.OrderType.Name = this.Reader[3].ToString();
                    if (obj.Memo == "1")
                    {
                        obj.Item.User01 = this.Reader[4].ToString();
                    }
                    else
                    {
                        obj.Item.SysClass.ID = this.Reader[4].ToString();                    //系统类别
                    }
                    obj.Usage.ID   = this.Reader[5].ToString();
                    obj.Usage.Name = this.Reader[6].ToString();
                    #region addby xuewj 2010-9-2 {46983F5B-E184-4b8b-B819-AA1C34993F1B} 非药物执行单单项目维护
                    obj.Item.ID   = this.Reader[7].ToString();
                    obj.Item.Name = this.Reader[8].ToString();
                    #endregion
                    al.Add(obj);
                }
                this.Reader.Close();
            }
            else
            {
                return(null);
            }
            return(al);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 删除附材
 /// </summary>
 public int DelSubtbl(object order)
 {
     Neusoft.HISFC.Models.Order.Inpatient.Order myOrder = order as Neusoft.HISFC.Models.Order.Inpatient.Order;
     if (myOrder == null)
     {
         MessageBox.Show("删除附材过程中出错! 发生类型转换错误");
         return(-1);
     }
     if (myOrder.ID.Trim() != "")
     {
         if (myOrder.Status == 3)
         {
             MessageBox.Show("已停止医嘱无法更改附材");
             return(0);
         }
         if (myOrder.OrderType.Type == Neusoft.HISFC.Models.Order.EnumType.SHORT)
         {
             if (myOrder.Status != 0)
             {
                 MessageBox.Show("已审核/执行的临嘱不允许进行附材修改!");
                 return(0);
             }
         }
         if (MessageBox.Show("是否彻底删除附材" + myOrder.Item.Name, "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             if (myOrder.Status != 1 && myOrder.Status != 2)
             {
                 Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
                 //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
                 //t.BeginTransaction();
                 this.orderManagement.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                 //对未审核医嘱删除附材
                 if (this.orderManagement.DeleteOrder(myOrder) == -1)
                 {
                     Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                     MessageBox.Show("无法删除!" + this.orderManagement.Err);
                     return(-1);
                 }
                 Neusoft.FrameWork.Management.PublicTrans.Commit();
             }
             else
             {//对已审核、或执行医嘱停止附材
                 if (this.DCSub(myOrder) == -1)
                 {
                     return(-1);
                 }
             }
         }
         else
         {
             return(-1);
         }
     }
     return(1);
 }
Exemplo n.º 8
0
        private int SaveOtherItems()
        {
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            //执行单表操作
            Neusoft.HISFC.BizLogic.Order.ExecBill manager = new Neusoft.HISFC.BizLogic.Order.ExecBill();
            if (manager.InsertExecBillOtherItem(this.nurseID, this.billNO, this.myOrderType, this.mySysClass) == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            //DataSet操作
            DataTable dt = this.ucInputUndrug.DsUndrugItem.Tables[this.myOrderType];

            if (dt == null)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            ArrayList alItems = new ArrayList();
            string    filter  = "类别编码='" + this.mySysClass + "'";

            foreach (DataRow row in dt.Select(filter))
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order order = new Neusoft.HISFC.Models.Order.Inpatient.Order();
                order.ID               = this.billNO;
                order.Memo             = "2";
                order.OrderType.ID     = this.myOrderType;
                order.OrderType.Name   = this.orderTypeHelper.GetName(this.myOrderType);
                order.Item.SysClass.ID = this.mySysClass;
                order.Item.ID          = row["编码"].ToString();
                order.Item.Name        = row["名称"].ToString();
                alItems.Add(order);
                row.Delete();
            }

            //farpoint操作
            if (this.ItemOtherInsert != null)
            {
                if (this.ItemOtherInsert(alItems) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    return(-1);
                }
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            return(0);
        }
Exemplo n.º 9
0
 public void PassSetRecipeInfo(Neusoft.HISFC.Models.Order.Inpatient.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      = order.OrderType.ID;
             string orderDoctor    = order.Doctor.ID + "/" + order.Doctor.Name;
             PassSetRecipeInfo(applyNO, iD, name, singleDose, doseUnit, str6, startOrderDate, stopOrderDate, routeName, groupTag, orderType, orderDoctor);
         }
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// 设置医嘱默认频次
 /// </summary>
 /// <param name="o"></param>
 public static void SetDefaultFrequency(Neusoft.HISFC.Models.Order.Inpatient.Order o)
 {
     //药品 临时医嘱,频次为空,默认为需要时候服用prn
     //if (o.Item.IsPharmacy && o.OrderType.IsDecompose == false)
     if (o.Item.ItemType == EnumItemType.Drug && o.OrderType.IsDecompose == false)
     {
         o.Frequency.ID = "PRN";//药品临时医嘱默认为需要时执行
     }
     //else if (o.Item.IsPharmacy == false && o.OrderType.IsDecompose == false)
     else if (o.Item.ItemType != EnumItemType.Drug && o.OrderType.IsDecompose == false)
     {
         o.Frequency.ID = "QD";//非药品临时医嘱默认为每天一次
     }
 }
Exemplo n.º 11
0
        private int  fillOrder(ref Neusoft.HISFC.Models.Order.Inpatient.Order order)
        {
            string err = "";

            //if (order.Item.IsPharmacy)
            if (order.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug)
            //if (order.Item.IsPharmacy)
            {
                #region addby xuewj 2010-10-20 {BB852AD4-81CC-44aa-86F7-FD4C419DDFAC} 组套调医嘱时根据参数RemoveDept屏蔽发药药房--郑州用来处理临床营养药房
                Neusoft.FrameWork.Models.NeuObject stockDept = new Neusoft.FrameWork.Models.NeuObject();
                if (order.StockDept.ID != "")
                {
                    //stockDept = this.pharmacyMgr.GetStockDept(order.Patient.PVisit.PatientLocation.Dept.ID, order.Item.SysClass.ID.ToString(), order.Item.ID);//原来只适用与西药,中成药和草药会报错.不应该传sysClassID,要用药品类别
                    stockDept = this.pharmacyMgr.GetStockDept(order.Patient.PVisit.PatientLocation.Dept.ID, ((Neusoft.HISFC.Models.Pharmacy.Item)(order.Item)).Type.ID.ToString(), order.Item.ID);
                    if (stockDept == null)
                    {
                        MessageBox.Show(this.pharmacyMgr.Err);
                        return(-1);
                    }
                }
                if (Neusoft.HISFC.BizProcess.Integrate.Order.FillPharmacyItemWithStockDept(null, ref order, out err) == -1)
                {
                    MessageBox.Show(err);
                    return(-1);
                }
                if (stockDept.ID != "")
                {
                    order.StockDept.ID   = stockDept.ID;
                    order.StockDept.Name = stockDept.Name;
                }
                #endregion
            }
            else
            {
                if (Neusoft.HISFC.BizProcess.Integrate.Order.FillFeeItem(null, ref order, out err) == -1)
                {
                    MessageBox.Show(err);
                    return(-1);
                }
            }
            //{A5409134-55B5-42d9-A264-25060169A64B}
            Neusoft.FrameWork.Models.NeuObject trueFrequency = this.frequencyHelper.GetObjectFromID(order.Frequency.ID);
            if (trueFrequency != null)
            {
                order.Frequency = trueFrequency as Neusoft.HISFC.Models.Order.Frequency;
            }

            return(0);
        }
Exemplo n.º 12
0
        private void GetPrintOrder()
        {
            for (int i = 0; i < sheetLong.Rows.Count; i++)
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order ord = sheetLong.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order;

                alLongPrint.Add(ord);
            }
            for (int i = 0; i < sheetShort.Rows.Count; i++)
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order ord = sheetShort.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order;

                alShortPrint.Add(ord);
            }
        }
Exemplo n.º 13
0
 private void fpSpread1_SelectionChanged(object sender, FarPoint.Win.Spread.SelectionChangedEventArgs e)
 {
     Neusoft.HISFC.Models.Order.Inpatient.Order order = this.sheetView1.Rows[this.sheetView1.ActiveRowIndex].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order;
     if (order == null)
     {
         MessageBox.Show("获取医嘱实体信息时发生类型转换错误");
         return;
     }
     try
     {
         this.ucInputItem1.FeeItem = order.Item;
         this.txtQty.Text          = this.sheetView1.Cells[this.sheetView1.ActiveRowIndex, 4].Text;
         this.txtUnit.Text         = order.Unit;
     }
     catch
     { }
 }
Exemplo n.º 14
0
        private void AddObjecToLongOrderSheet(ArrayList arr)
        {
            sheetLong.Rows.Count = 0;
            alLongPrint.Clear();

            Neusoft.HISFC.Models.Order.Inpatient.Order ord = new Neusoft.HISFC.Models.Order.Inpatient.Order();
            for (int i = 0; i < arr.Count; i++)
            {
                sheetLong.Rows.Add(i, 1);
                ord = arr[i] as Neusoft.HISFC.Models.Order.Inpatient.Order;


                this.sheetLong.SetValue(i, 0, ord.BeginTime.Month.ToString() + "." + ord.BeginTime.Day.ToString());//.ToShortDateString());
                sheetLong.SetValue(i, 1, ord.BeginTime.ToShortTimeString());
                sheetLong.SetValue(i, 2, ord.Item.Name + "  " + ord.Frequency.Name + "  " + ord.Usage.Name);
                sheetLong.SetValue(i, 3, ord.ReciptDoctor.Name);
                sheetLong.SetValue(i, 4, ord.Nurse.Name);
                sheetLong.SetValue(i, 5, ord.ConfirmTime);
                //sheetLong.SetValue(i, 10, ord.Combo.ID);
                if (ord.EndTime != DateTime.MinValue)
                {
                    sheetLong.SetValue(i, 6, ord.EndTime.Month.ToString() + "." + ord.EndTime.Day.ToString());
                    sheetLong.SetValue(i, 7, ord.EndTime.ToShortTimeString());//.ExecOper.OperTime.ToShortTimeString());
                    sheetLong.SetValue(i, 8, ord.DCOper.Name);
                    sheetLong.SetValue(i, 9, ord.ExecOper.Name);
                    sheetLong.SetValue(i, 10, ord.ExecOper.OperTime.ToShortTimeString());
                }

                sheetLong.Rows[i].Tag = ord;
            }
            if (this.sheetLong.RowCount < this.intLineNum)
            {
                this.sheetLong.RowCount = intLineNum;
            }
            if (this.sheetLong.RowCount > intLineNum)
            {
                long longNum = 0;
                System.Math.DivRem(this.sheetLong.RowCount, intLineNum, out longNum);
                this.sheetLong.RowCount = this.sheetLong.RowCount - Neusoft.FrameWork.Function.NConvert.ToInt32(longNum) + intLineNum;
                //int page = this.sheetLong.RowCount / 21;
                //this.lblPage.Text =  page.ToString();
            }
            //Function.DrawCombo(sheetLong, 10, 4);
        }
Exemplo n.º 15
0
        private void AddObjecToShortOrderSheet(ArrayList arr)
        {
            sheetShort.Rows.Count = 0;
            Neusoft.HISFC.Models.Order.Inpatient.Order ord = new Neusoft.HISFC.Models.Order.Inpatient.Order();
            for (int i = 0; i < arr.Count; i++)
            {
                sheetShort.Rows.Add(i, 1);
                ord = arr[i] as Neusoft.HISFC.Models.Order.Inpatient.Order;
                this.sheetShort.SetValue(i, 0, ord.BeginTime.ToShortDateString());
                sheetShort.SetValue(i, 1, ord.BeginTime.ToShortTimeString());
                sheetShort.SetValue(i, 2, ord.Item.Name + "  " + ord.Frequency.Name + "  " + ord.Usage.Name);
                sheetShort.SetValue(i, 3, ord.ReciptDoctor.Name);
                sheetShort.SetValue(i, 4, ord.BeginTime);
                sheetShort.SetValue(i, 5, ord.ExecOper.Name);
                sheetShort.SetValue(i, 6, ord.EndTime.ToShortDateString());
                sheetShort.SetValue(i, 7, ord.EndTime.ToShortTimeString());

                //if (ord.EndTime != DateTime.MinValue)
                //{
                //    sheetShort.SetValue(i, 6, ord.EndTime.Month.ToString() + "-" + ord.EndTime.Day.ToString());
                //    sheetShort.SetValue(i, 7, ord.EndTime.ToShortTimeString());
                //    sheetShort.SetValue(i, 8, ord.ExecOper.Name);
                //}
                sheetShort.Rows[i].Tag = ord;
            }
            if (this.sheetShort.RowCount < intLineNum)
            {
                this.sheetShort.RowCount = intLineNum;
                //this.neuLabel24.Text = "1";
            }
            else if (this.sheetShort.RowCount > intLineNum)
            {
                long shortNum = 0;
                System.Math.DivRem(this.sheetShort.RowCount, intLineNum, out shortNum);
                this.sheetShort.RowCount = this.sheetShort.RowCount - Neusoft.FrameWork.Function.NConvert.ToInt32(shortNum) + intLineNum;

                //int page = this.sheetShort.RowCount / 21;
                //this.neuLabel24.Text =  page.ToString();
            }
            //Function.DrawCombo(sheetShort, 9, 3);
        }
Exemplo n.º 16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="i"></param>
 /// <param name="SheetIndex"></param>
 /// <param name="OrderManagement"></param>
 /// <returns></returns>
 public Neusoft.HISFC.Models.Order.Inpatient.Order GetObjectFromFarPoint(int i, int SheetIndex, Neusoft.HISFC.BizLogic.Order.Order OrderManagement)
 {
     Neusoft.HISFC.Models.Order.Inpatient.Order order = null;
     if (this.fpSpread1.Sheets[SheetIndex].Rows[i].Tag != null)
     {
         order = this.fpSpread1.Sheets[SheetIndex].Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order;
     }
     #region {1AF0EB93-27A8-462f-9A1E-E1A3ECA54ADE} 再从哈希表中取值
     else if (this.htOrder != null && this.htOrder.ContainsKey(this.fpSpread1.Sheets[SheetIndex].Cells[i, iColumns[2]].Text))
     {
         order = this.htOrder[this.fpSpread1.Sheets[SheetIndex].Cells[i, iColumns[2]].Text] as Neusoft.HISFC.Models.Order.Inpatient.Order;
     }
     #endregion
     else
     {
         #region 付值
         order = OrderManagement.QueryOneOrder(this.fpSpread1.Sheets[SheetIndex].Cells[i, iColumns[2]].Text);
         #endregion
     }
     return(order);
 }
Exemplo n.º 17
0
 /// <summary>
 /// 设置医嘱首次频次信息
 /// </summary>
 /// <param name="order"></param>
 public static void SetDefaultOrderFrequency(Neusoft.HISFC.Models.Order.Inpatient.Order order)
 {
     if (order.OrderType.IsDecompose || order.OrderType.ID == "CD" ||
         order.OrderType.ID == "QL")//默认为项目的频次
     {
         if (order.Item.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
         {
             order.Frequency      = (order.Item as Neusoft.HISFC.Models.Pharmacy.Item).Frequency.Clone();
             order.Frequency.Time = "25:00";//默认为25点,需要更新
         }
     }
     //else if (order.Item.IsPharmacy && order.OrderType.IsDecompose == false)//药品 临时医嘱,频次为空,默认为需要时候服用prn
     else if (order.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug && order.OrderType.IsDecompose == false) //药品 临时医嘱,频次为空,默认为需要时候服用prn
     {
         order.Frequency.ID = "PRN";                                                                                      //药品临时医嘱默认为需要时执行
     }
     //else if (order.Item.IsPharmacy == false && order.OrderType.IsDecompose == false)
     else if (order.Item.ItemType != EnumItemType.Drug && order.OrderType.IsDecompose == false)
     {
         //{7ED952A2-0516-40c5-A548-719DB81D9633} 非药品临嘱的默认频次 按系统类别,检查、检验默认ST,转科转床出院手术会诊默认为ST(以后可能会改), 剩下默认QD 20100909
         //order.Frequency.ID = "QD";//非药品临时医嘱默认为每天一次
         if (order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.UC.ToString() ||
             order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.UL.ToString())
         {
             order.Frequency.ID = "ST";
         }
         else if (order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.MRB.ToString() ||
                  order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.MRD.ToString() ||
                  order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.MRH.ToString() ||
                  order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.UO.ToString() ||
                  order.Item.SysClass.ID.ToString() == Neusoft.HISFC.Models.Base.EnumSysClass.MC.ToString())
         {
             order.Frequency.ID = "PRN";
         }
         else
         {
             order.Frequency.ID = "QD";//临时医嘱默认QD
         }
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// 如果已经审核或执行,则停止附材
        /// </summary>
        /// <returns></returns>
        public int DCSub(Neusoft.HISFC.Models.Order.Inpatient.Order order)
        {
            Neusoft.HISFC.BizLogic.Order.Order odManager = new Neusoft.HISFC.BizLogic.Order.Order();
            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(odManager.Connection);
            //t.BeginTransaction();
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            odManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            order.DCOper.ID     = this.Operator.ID;
            order.DCOper.Name   = this.Operator.Name;
            order.EndTime       = odManager.GetDateTimeFromSysDateTime();
            order.Status        = 3;
            order.DcReason.Name = "护士站审核查询停止";
            if (odManager.DcOneOrder(order) == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                MessageBox.Show("删除医嘱失败!" + odManager.Err);
                return(-1);
            }
            Neusoft.FrameWork.Management.PublicTrans.Commit();
            return(0);
        }
Exemplo n.º 19
0
        private void SaveGroup()
        {
            Neusoft.HISFC.Components.Common.Forms.frmOrderGroupManager group = new Neusoft.HISFC.Components.Common.Forms.frmOrderGroupManager();

            try
            {
                group.IsManager = (Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee).IsManager;
            }
            catch
            { }

            ArrayList al = new ArrayList();

            for (int i = 0; i < this.ucOrder1.fpSpread1.ActiveSheet.Rows.Count; i++)
            {
                if (this.ucOrder1.fpSpread1.ActiveSheet.IsSelected(i, 0))
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order order = this.ucOrder1.GetObjectFromFarPoint(i, this.ucOrder1.fpSpread1.ActiveSheetIndex).Clone();
                    if (order == null)
                    {
                        MessageBox.Show("获得医嘱出错!");
                    }
                    else
                    {
                        string s   = order.Item.Name;
                        string sno = order.Combo.ID;
                        //保存医嘱组套 默认开立时间为 零点
                        order.BeginTime = new DateTime(order.BeginTime.Year, order.BeginTime.Month, order.BeginTime.Day, 0, 0, 0);
                        al.Add(order);
                    }
                }
            }
            if (al.Count > 0)
            {
                group.alItems = al;
                group.ShowDialog();
                this.tvGroup.RefrshGroup();
            }
        }
Exemplo n.º 20
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;
 }
Exemplo n.º 21
0
        /// <summary>
        /// 打印
        /// </summary>
        //public void Print()
        //{
        //    Neusoft.FrameWork.WinForms.Classes.Print pf = new Neusoft.FrameWork.WinForms.Classes.Print();
        //    //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(ordManager.Connection);
        //    Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
        //    //t.BeginTransaction();

        //    //orderBillManager.SetTrans(t.Trans);
        //    orderBillManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

        //    if (this.tabControl1.SelectedIndex == 0)
        //    {
        //        pf.PageLabel = (Control)this.lblPage;
        //        this.SetLongRePrint(false);
        //        for (int i = 0; i < sheetLong.Rows.Count; i++)
        //        {
        //            int j = Neusoft.FrameWork.Function.NConvert.ToInt32(sheetLong.Rows.Count / this.intLineNum);

        //            Neusoft.HISFC.Models.Order.Inpatient.Order ord = sheetLong.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order;
        //            if (ord != null && ord.ID != null && ord.ID != "")
        //            {
        //                Neusoft.HISFC.Models.Order.OrderBill orderBill = new Neusoft.HISFC.Models.Order.OrderBill();
        //                orderBill = orderBillManager.GetOrderBillByOrderID(ord.ID);
        //                if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintFlag))
        //                {
        //                    this.sheetLong.SetValue(i, 0, "");
        //                    this.sheetLong.SetValue(i, 1, "");
        //                    this.sheetLong.SetValue(i, 2, "");
        //                    this.sheetLong.SetValue(i, 3, "");
        //                    this.sheetLong.SetValue(i, 4, "");
        //                    this.sheetLong.SetValue(i, 5, "");
        //                    this.sheetLong.SetValue(i, 6, "");
        //                    this.sheetLong.SetValue(i, 7, "");
        //                    this.sheetLong.SetValue(i, 8, "");
        //                    this.sheetLong.SetValue(i, 9, "");
        //                    this.sheetLong.SetValue(i, 10, "");
        //                }
        //                else
        //                {
        //                    int myLineNo = 0;
        //                    int myPageNo = 0;
        //                    int myPrnSeq = 0;
        //                    this.orderBillManager.GetLastOrderBillArg(this.pInfo.ID, orderBill.Order.OrderType.ID, out myPrnSeq, out myPageNo, out myLineNo);

        //                    if (myPageNo > 0)
        //                    {
        //                        if (i < this.intLineNum)
        //                        {
        //                            myLineNo = i + 1;

        //                        }
        //                        else
        //                        {
        //                            myLineNo = 1;
        //                            myPageNo = myPageNo + 1;
        //                            this.SetLongRePrint(true);
        //                        }
        //                    }
        //                    else
        //                    {
        //                        myLineNo = i + 1;
        //                        myPageNo = 1;
        //                        this.SetLongRePrint(true);
        //                    }
        //                    if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintDCFlag) && orderBill.PageNO > 0)
        //                    {
        //                        this.sheetLong.SetValue(i, 0, "");
        //                        this.sheetLong.SetValue(i, 1, "");
        //                        this.sheetLong.SetValue(i, 2, "");
        //                        this.sheetLong.SetValue(i, 3, "");
        //                        this.sheetLong.SetValue(i, 4, "");
        //                        this.sheetLong.SetValue(i, 5, "");
        //                    }
        //                    if (orderBill.PageNO == 0)
        //                    {
        //                        if (orderBillManager.UpdateLineNoPageNo(ord.ID, myLineNo, myPageNo) < 0)
        //                        {
        //                            //t.RollBack();
        //                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
        //                            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单行号、页码失败!" + orderBillManager.Err));
        //                            return;
        //                        }
        //                    }

        //                    if (orderBillManager.UpdatePrnFlag(ord.ID, "1") < 0)
        //                    {
        //                        //t.RollBack();
        //                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
        //                        MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单打印标志失败!" + orderBillManager.Err));
        //                        return;
        //                    }
        //                }
        //            }
        //            else
        //            {
        //                this.sheetLong.SetValue(i, 0, "");
        //                this.sheetLong.SetValue(i, 1, "");
        //                this.sheetLong.SetValue(i, 2, "");
        //                this.sheetLong.SetValue(i, 3, "");
        //                this.sheetLong.SetValue(i, 4, "");
        //                this.sheetLong.SetValue(i, 5, "");
        //                this.sheetLong.SetValue(i, 6, "");
        //                this.sheetLong.SetValue(i, 7, "");
        //                this.sheetLong.SetValue(i, 8, "");
        //                this.sheetLong.SetValue(i, 9, "");
        //                this.sheetLong.SetValue(i, 10, "");


        //            }
        //        }
        //        //this.neuLabel15.Text = "第";
        //        //this.neuLabel19.Text = "页";

        //        //if (this.sheetLong.RowCount < intLineNum)
        //        //{
        //        //    this.sheetLong.RowCount = intLineNum;

        //        //}
        //        //if (this.sheetLong.RowCount > intLineNum)
        //        //{
        //        //    long longNum = 0;
        //        //    System.Math.DivRem(this.sheetLong.RowCount, intLineNum, out longNum);
        //        //    this.sheetLong.RowCount = this.sheetLong.RowCount - Neusoft.FrameWork.Function.NConvert.ToInt32(longNum) + intLineNum;
        //        //}


        //        pf.PrintPreview(this.plLong);

        //    }
        //    else
        //    {
        //        pf.PageLabel = (Control)this.lblPages;
        //        this.SetShortRePrint(false);
        //        for (int i = 0; i < sheetShort.Rows.Count; i++)
        //        {

        //            Neusoft.HISFC.Models.Order.Inpatient.Order ord = sheetShort.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order;
        //            if (ord != null && ord.ID != null && ord.ID != "")
        //            {
        //                Neusoft.HISFC.Models.Order.OrderBill orderBill = new Neusoft.HISFC.Models.Order.OrderBill();
        //                orderBill = orderBillManager.GetOrderBillByOrderID(ord.ID);
        //                if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintFlag))
        //                {
        //                    this.sheetShort.SetValue(i, 0, "");
        //                    this.sheetShort.SetValue(i, 1, "");
        //                    this.sheetShort.SetValue(i, 2, "");
        //                    this.sheetShort.SetValue(i, 3, "");
        //                    this.sheetShort.SetValue(i, 4, "");
        //                    this.sheetShort.SetValue(i, 5, "");
        //                    this.sheetShort.SetValue(i, 6, "");
        //                    this.sheetShort.SetValue(i, 7, "");
        //                    this.sheetShort.SetValue(i, 8, "");
        //                }
        //                else
        //                {
        //                    int myLineNo = 0;
        //                    int myPageNo = 0;
        //                    int myPrnSeq = 0;
        //                    this.orderBillManager.GetLastOrderBillArg(this.pInfo.ID, orderBill.Order.OrderType.ID, out myPrnSeq, out myPageNo, out myLineNo);

        //                    if (myPageNo > 0)
        //                    {
        //                        if (i < this.intLineNum)
        //                        {
        //                            myLineNo = i + 1;

        //                        }
        //                        else
        //                        {
        //                            myLineNo = 1;
        //                            myPageNo = myPageNo + 1;
        //                            this.SetShortRePrint(true);
        //                        }
        //                    }
        //                    else
        //                    {
        //                        myLineNo = i + 1;
        //                        myPageNo = 1;
        //                        this.SetShortRePrint(true);
        //                    }
        //                    if (orderBill.PageNO == 0)
        //                    {
        //                        if (orderBillManager.UpdateLineNoPageNo(ord.ID, myLineNo, myPageNo) < 0)
        //                        {
        //                            //t.RollBack();
        //                            Neusoft.FrameWork.Management.PublicTrans.RollBack();
        //                            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单行号、页码失败!" + orderBillManager.Err));
        //                            return;
        //                        }
        //                    }
        //                    if (orderBillManager.UpdatePrnFlag(ord.ID, "1") < 0)
        //                    {
        //                        //t.RollBack();
        //                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
        //                        MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单打印标志失败!" + orderBillManager.Err));
        //                        return;
        //                    }
        //                }
        //            }
        //            else
        //            {
        //                this.sheetShort.SetValue(i, 0, "");
        //                this.sheetShort.SetValue(i, 1, "");
        //                this.sheetShort.SetValue(i, 2, "");
        //                this.sheetShort.SetValue(i, 3, "");
        //                this.sheetShort.SetValue(i, 4, "");
        //                this.sheetShort.SetValue(i, 5, "");
        //                this.sheetShort.SetValue(i, 6, "");
        //                this.sheetShort.SetValue(i, 7, "");
        //                this.sheetShort.SetValue(i, 8, "");

        //                this.SetShortRePrint(false);
        //            }
        //        }

        //        //if (this.sheetShort.RowCount < intLineNum)
        //        //{
        //        //    this.sheetShort.RowCount = intLineNum;
        //        //}
        //        //if (this.sheetShort.RowCount > intLineNum)
        //        //{
        //        //    long shortNum = 0;
        //        //    System.Math.DivRem(this.sheetShort.RowCount, intLineNum, out shortNum);
        //        //    this.sheetShort.RowCount = this.sheetShort.RowCount - Neusoft.FrameWork.Function.NConvert.ToInt32(shortNum) + intLineNum;
        //        //}

        //        pf.PrintPreview(this.plShort);

        //        //this.lblPage.Text = pf.PageLabel.Text;
        //    }
        //    //t.Commit();
        //    Neusoft.FrameWork.Management.PublicTrans.Commit();
        //    this.SetShortRePrint(true);
        //    this.SetLongRePrint(true);
        //    this.SetPatient(this.pInfo);
        //}
        /// <summary>
        /// 设置患者信息
        /// </summary>
        /// <param name="patientInfo"></param>
        public void SetPatient(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo)
        {
            this.intLineNum = this.controlManager.GetControlParam <int>("200008", false, 21);
            //打印标题

            //查询医嘱(暂时不支持续打)
            pInfo = patientInfo;
            string hospitalName = constant.GetHospitalName();

            if (string.IsNullOrEmpty(patientInfo.PVisit.PatientLocation.Room) && patientInfo.PVisit.PatientLocation.Bed != null)
            {//查询病房
                Neusoft.HISFC.Models.Base.Bed bed = this.bedMgr.GetBedInfo(patientInfo.PVisit.PatientLocation.Bed.ID);
                if (bed != null)
                {
                    patientInfo.PVisit.PatientLocation.Room = bed.SickRoom.ID;
                }
            }

            this.lbLongPatientNo.Text     = patientInfo.ID;
            this.lbLonglName.Text         = patientInfo.Name;
            this.lblShortInpatientNO.Text = patientInfo.ID;
            this.lblShortName.Text        = patientInfo.Name;
            this.neuLabel2.Text           = hospitalName;
            this.neuLabel10.Text          = hospitalName;

            if (patientInfo.Sex != null)
            {
                this.lblSex.Text  = patientInfo.Sex.Name;
                this.lblSexs.Text = patientInfo.Sex.Name;
            }
            if (patientInfo.Age != null)
            {
                this.lblAge.Text  = patientInfo.Age.ToString();
                this.lblAges.Text = patientInfo.Age;
            }
            if (patientInfo.PVisit.PatientLocation.Room != null)
            {
                this.lblRoom.Text  = patientInfo.PVisit.PatientLocation.Room.ToString();
                this.lblRooms.Text = patientInfo.PVisit.PatientLocation.Room;
            }
            if (patientInfo.PVisit.PatientLocation.Bed != null)
            {
                this.lblBed.Text  = patientInfo.PVisit.PatientLocation.Bed.ToString();
                this.lblBeds.Text = patientInfo.PVisit.PatientLocation.Bed.ToString();
            }
            if (patientInfo.PVisit.PatientLocation.Dept != null)
            {
                this.lblDept.Text  = patientInfo.PVisit.PatientLocation.Dept.Name.ToString();
                this.lblDepts.Text = patientInfo.PVisit.PatientLocation.Dept.Name;
            }

            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在查询显示医嘱信息,请稍候......");

            Application.DoEvents();

            ArrayList alAll = new ArrayList();

            try
            {
                //alAll = this.ordManager.QueryDcOrder(patientInfo.ID);
                alAll = this.ordManager.QueryPrnOrder(patientInfo.ID);
            }
            catch
            {
                Neusoft.FrameWork.WinForms.Classes.Function.MessageBox(ordManager.Err);
            }

            alLong.Clear();
            alShort.Clear();

            if (alAll != null)
            {
                foreach (object obj in alAll)
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order order = obj as Neusoft.HISFC.Models.Order.Inpatient.Order;
                    if (order.OrderType.Type == Neusoft.HISFC.Models.Order.EnumType.LONG)
                    {
                        //长期医嘱
                        alLong.Add(obj);
                    }
                    else
                    {
                        //临时医嘱
                        alShort.Add(obj);
                    }
                }
            }
            AddObjecToLongOrderSheet(alLong);
            AddObjecToShortOrderSheet(alShort);
            this.GetPrintOrder();
            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
        }
Exemplo n.º 22
0
        private void ucItem1_SelectedItem()
        {
            try
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order order = this.orderManagement.QueryOneOrder(this.orderID);
                if (this.orderID != "" && order == null)                        //医嘱流水号不为空且未获取有效order实体
                {
                    MessageBox.Show("获取医嘱信息出错!" + this.orderManagement.Err);
                    return;
                }
                if (order == null)
                {
                    return;
                }
                //{A94C1C0F-EEC1-471e-9CCE-3ED8DE582AB8}  医嘱类型处理
                if (!order.OrderType.IsCharge)
                {
                    if (order.OrderType.Type == Neusoft.HISFC.Models.Order.EnumType.LONG)
                    {
                        order.OrderType.ID       = "CZ";
                        order.OrderType.Name     = "长期医嘱";
                        order.OrderType.IsCharge = true;
                    }
                    else
                    {
                        order.OrderType.ID       = "LZ";
                        order.OrderType.Name     = "临时医嘱";
                        order.OrderType.IsCharge = true;
                    }
                }

                Neusoft.HISFC.Models.Base.Item item = this.ucInputItem1.FeeItem as Neusoft.HISFC.Models.Base.Item;
                if (item == null)
                {
                    MessageBox.Show("获取所选择的项目信息出错!");
                    return;
                }
                if (item.PriceUnit == "[组套]")           //处理对护士维护的套餐的开立
                {
                    //#region 添加护士维护的套餐
                    //Neusoft.HISFC.BizLogic.Manager.ComGroupTail group = new Neusoft.HISFC.BizLogic.Manager.ComGroupTail();
                    //ArrayList groupDetails = new ArrayList();
                    ////根据组套id获取组套明细
                    //groupDetails = group.GetComGroupTailByGroupID(item.ID);
                    //if (groupDetails == null || groupDetails.Count == 0) return;
                    //Neusoft.HISFC.Models.Order.Order info;
                    //for (int i = 0; i < groupDetails.Count; i++)
                    //{
                    //    Neusoft.HISFC.Models.Fee.ComGroupTail obj = groupDetails[i] as Neusoft.HISFC.Models.Fee.ComGroupTail;
                    //    if (obj == null)
                    //    {
                    //        MessageBox.Show("无法添加附材 获取套餐明细出错!");
                    //        return;
                    //    }
                    //    if (obj.drugFlag == "1")//药品
                    //    {
                    //        info = order.Clone();
                    //        //根据药品id获取药品实体
                    //        Neusoft.HISFC.Models.Pharmacy.Item drug = null;
                    //        Neusoft.HISFC.BizLogic.Pharmacy.Item drugManager = new Neusoft.HISFC.BizLogic.Pharmacy.Item();
                    //        drug = drugManager.GetItemForInpatient(patientInfo.PVisit.PatientLocation.Dept.ID, obj.itemCode);
                    //        if (drug == null || drug.ID == "") continue;
                    //        Neusoft.HISFC.Models.Base.Item drugBase = drug as Neusoft.HISFC.Models.Base.Item;
                    //        drugBase.isPharmacy = true;
                    //        drugBase.Amount = obj.qty;
                    //        info.Item = drugBase;
                    //        info.ID = "";
                    //        this.AddSubtbl(info, true);
                    //    }
                    //    else//非药品
                    //    {
                    //        info = order.Clone();
                    //        //根据非药品id获取非药品实体
                    //        Neusoft.HISFC.Models.Fee.Item undrug = null;
                    //        Neusoft.HISFC.BizLogic.Fee.Item undrugManager = new Neusoft.HISFC.BizLogic.Fee.Item();
                    //        undrug = undrugManager.GetItem(obj.itemCode);
                    //        if (undrug == null) continue;
                    //        //添加划价项目
                    //        Neusoft.HISFC.Models.Base.Item undrugBase = undrug as Neusoft.HISFC.Models.Base.Item;
                    //        undrugBase.isPharmacy = false;
                    //        undrugBase.Amount = obj.qty;//数量
                    //        info.Item = undrugBase;
                    //        info.ID = "";
                    //        this.AddSubtbl(info, true);
                    //    }
                    //}
                    //#endregion

                    return;
                }
                else
                {
                    order.Item = item.Clone();
                    order.ID   = "";                                                                            //医嘱流水号
                    this.AddSubtbl(order, true);
                }
            }
            catch
            {
                MessageBox.Show("获得医嘱出错!" + this.orderManagement.Err);
            }
            this.txtQty.Focus();
        }
Exemplo n.º 23
0
        /// <summary>
        /// 保存附材
        /// </summary>
        public int SaveSubtbl()
        {
            //如当前操作的为已停止医嘱则不允许更改附材
            if (this.isDCOrder)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("已停止医嘱不允许更改附材"));
                return(-1);
            }
            //保存本次所增加的附材
            try
            {
                if (this.addSubInfo == null)
                {
                    this.addSubInfo = new ArrayList();
                }
                else
                {
                    this.addSubInfo.Clear();
                }
                if (this.editSubInfo == null)
                {
                    this.editSubInfo = new ArrayList();
                }
                else
                {
                    this.editSubInfo.Clear();
                }
            }
            catch { }

            #region 事务声明
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(this.orderManagement.Connection);
            //t.BeginTransaction();
            this.orderManagement.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            #endregion

            Neusoft.HISFC.Models.Order.Inpatient.Order order;
            for (int i = 0; i < this.sheetView1.Rows.Count; i++)
            {
                if (this.sheetView1.Rows[i].Tag != null)
                {
                    try
                    {
                        #region 实体赋值
                        order = this.sheetView1.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.Order;
                        if (order == null)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                            MessageBox.Show("处理附材保存过程中出错! 发生类型转换错误");
                            return(-1);
                        }
                        try
                        {
                            order.Qty = System.Convert.ToDecimal(sheetView1.Cells[i, 4].Value); //数量
                        }
                        catch
                        {
                            order.Qty = 1;
                        }
                        if (order.Qty == 0)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                            MessageBox.Show(order.Item.Name + "数量应大于零!");
                            return(-1);
                        }

                        order.Unit        = order.Item.PriceUnit;                                                               //单位
                        order.ExtendFlag1 = this.sheetView1.Cells[i, 9].Text;                                                   //备注

                        #endregion

                        // 判断医嘱状态 处理并发
                        Neusoft.HISFC.Models.Order.Inpatient.Order od = this.orderManagement.QueryOneOrder(orderID);
                        if (od.Status == 3)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                            MessageBox.Show("医嘱状态已发生变化!已停止医嘱不允许更改附材");
                            return(-1);
                        }
                        //临时医嘱
                        if (od.OrderType.Type == Neusoft.HISFC.Models.Order.EnumType.SHORT)
                        {
                            if (od.Status != 0)
                            {
                                Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                                MessageBox.Show("对已审核/执行的临时医嘱不允许进行附材修改!");
                                return(-1);
                            }
                        }
                        //if (od.Item.IsPharmacy == false)//非药品
                        if (od.Item.ItemType != Neusoft.HISFC.Models.Base.EnumItemType.Drug)//非药品
                        {
                            order.ExeDept = order.Patient.PVisit.PatientLocation.Dept.Clone();
                        }
                        order.IsSubtbl = true; //附材标记

                        if (this.orderManagement.SetOrder(order) == -1)
                        {
                            Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                            MessageBox.Show(this.orderManagement.Err);
                            return(-1);
                        }

                        if (this.sheetView1.Cells[i, 11].Text == "1")                   //本次添加的附材
                        {
                            this.addSubInfo.Add(order);
                        }
                        else
                        {
                            this.editSubInfo.Add(order);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("保存错误!" + ex.Message);
                    }
                }
            }
            Neusoft.FrameWork.Management.PublicTrans.Commit();
            this.SetSubtblFlag("1", null);
            return(0);
        }
Exemplo n.º 24
0
        /// <summary>
        /// 添加一条附材
        /// </summary>
        protected void AddSubtbl(Neusoft.HISFC.Models.Order.Inpatient.Order order, bool isNew)
        {
            if (order == null)
            {
                return;
            }

            //对已停止附材不显示
            if (!isNew && order.Status == 3)
            {
                if (!this.isDCOrder)
                {
                    return;
                }
            }

            if (order.Item.Price == 0)
            {
                MessageBox.Show("价格为零,不符合附材条件!");
                return;
            }

            //更改执行科室为患者科室
            order.ExeDept           = order.Patient.PVisit.PatientLocation.Dept.Clone(); //this.Operator.Nurse.Clone();
            order.ReciptDept        = order.Patient.PVisit.PatientLocation.Dept.Clone(); //this.Operator.Nurse.Clone();
            order.Oper.ID           = this.Operator.ID;
            order.Oper.Name         = this.Operator.Name;
            order.ReciptDoctor.ID   = this.Operator.ID;
            order.ReciptDoctor.Name = this.Operator.Name;
            order.IsSubtbl          = true;

            //添加一行
            this.sheetView1.Rows.Add(0, 1);
            this.sheetView1.Cells[0, 0].Text = order.Item.ID;                   //编码
            this.sheetView1.Cells[0, 1].Text = order.Item.Name;                 //名称
            if (order.Item.Price == 0)
            {
                this.sheetView1.Cells[0, 3].Locked = false;                             //价格
            }
            else
            {
                this.sheetView1.Cells[0, 3].Locked = true;                              //价格
            }
            this.sheetView1.Cells[0, 3].Value = order.Item.Price;                       //价格
            if (order.Item.Qty == 0)
            {
                order.Item.Qty = 1;
            }
            this.sheetView1.Cells[0, 4].Value = order.Item.Qty;                 //数量
            this.txtQty.Text = order.Item.Qty.ToString();
            this.sheetView1.Cells[0, 5].Text = order.Item.PriceUnit;            //单位
            order.Unit        = order.Item.PriceUnit;
            this.txtUnit.Text = order.Item.PriceUnit;
            this.sheetView1.Cells[0, 6].Text = order.Frequency.ID;              //频次

            this.sheetView1.Cells[0, 7].Text = order.BeginTime.ToString();      //开始时间
            this.sheetView1.Cells[0, 8].Text = order.EndTime.ToString();        //结束时间
            this.sheetView1.Cells[0, 9].Text = order.Memo;                      //备注1
            Neusoft.HISFC.Models.Base.Department mydept = new Neusoft.HISFC.Models.Base.Department();
            mydept = this.deptManager.GetDepartment(order.ReciptDept.ID);
            this.sheetView1.Cells[0, 10].Text = mydept.Name;            //执行科室
            this.sheetView1.Cells[0, 11].Text = isNew ? "1" : "0";      //是否新增加的 0 由数据库检索的原附材 1 新附材
            this.sheetView1.Rows[0].Tag       = order;
        }
Exemplo n.º 25
0
        //私有函数,查询医嘱信息
        private ArrayList myOrderQuery(string SQLPatient)
        {
            ArrayList al = new ArrayList();

            if (this.ExecQuery(SQLPatient) == -1)
            {
                return(null);
            }
            try
            {
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order objOrder = new Neusoft.HISFC.Models.Order.Inpatient.Order();
                    #region "患者信息"
                    //患者信息——
                    //			1 住院流水号   2住院病历号     3患者科室id      4患者护理id
                    try
                    {
                        objOrder.Patient.ID            = this.Reader[1].ToString();
                        objOrder.Patient.PID.PatientNO = this.Reader[2].ToString();
                        objOrder.Patient.PVisit.PatientLocation.Dept.ID = this.Reader[3].ToString();
                        objOrder.InDept.ID = this.Reader[3].ToString();
                        objOrder.Patient.PVisit.PatientLocation.NurseCell.ID = this.Reader[4].ToString();
                    }
                    catch (Exception ex)
                    {
                        this.Err = "获得患者基本信息出错!" + ex.Message;
                        this.WriteErr();
                        return(null);
                    }
                    #endregion
                    #region "项目信息"
                    //医嘱辅助信息
                    // ——项目信息
                    //	       5项目类别      6项目编码       7项目名称      8项目输入码,    9项目拼音码
                    //	       10项目类别代码 11项目类别名称  12药品规格     13药品基本剂量  14剂量单位
                    //         15最小单位     16包装数量,     17剂型代码     18药品类别  ,   19药品性质
                    //         20零售价       21用法代码      22用法名称     23用法英文缩写  24频次代码
                    //         25频次名称     26每次剂量      27项目总量     28计价单位      29使用天数
                    // 判断药品/非药品
                    //         25频次名称     26每次剂量      27项目总量     28计价单位      29使用天数
                    // 73 样本类型 名称
                    if (this.Reader[5].ToString() == "1")//药品
                    {
                        Neusoft.HISFC.Models.Pharmacy.Item objPharmacy = new Neusoft.HISFC.Models.Pharmacy.Item();
                        try
                        {
                            objPharmacy.ID          = this.Reader[6].ToString();
                            objPharmacy.Name        = this.Reader[7].ToString();
                            objPharmacy.UserCode    = this.Reader[8].ToString();
                            objPharmacy.SpellCode   = this.Reader[9].ToString();
                            objPharmacy.SysClass.ID = this.Reader[10].ToString();
                            //objPharmacy.SysClass.Name = this.Reader[11].ToString();
                            objPharmacy.Specs = this.Reader[12].ToString();
                            //							try
                            //							{
                            if (!this.Reader.IsDBNull(13))
                            {
                                objPharmacy.BaseDose = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[13].ToString());
                            }
                            //}
                            //							catch{}
                            objPharmacy.DoseUnit = this.Reader[14].ToString();
                            objPharmacy.MinUnit  = this.Reader[15].ToString();
                            //try
                            //{
                            if (!this.Reader.IsDBNull(16))
                            {
                                objPharmacy.PackQty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[16].ToString());
                            }
                            //}
                            //catch{}
                            objPharmacy.DosageForm.ID = this.Reader[17].ToString();
                            objPharmacy.Type.ID       = this.Reader[18].ToString();
                            objPharmacy.Quality.ID    = this.Reader[19].ToString();
                            //try
                            //{
                            if (!this.Reader.IsDBNull(20))
                            {
                                objPharmacy.PriceCollection.RetailPrice = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[20].ToString());
                            }
                            //}
                            //catch{}
                            objOrder.Usage.ID   = this.Reader[21].ToString();
                            objOrder.Usage.Name = this.Reader[22].ToString();
                            objOrder.Usage.Memo = this.Reader[23].ToString();
                        }
                        catch (Exception ex)
                        {
                            this.Err = "获得医嘱项目信息出错!" + ex.Message;
                            this.WriteErr();
                            return(null);
                        }
                        objOrder.Item = objPharmacy;
                    }
                    else if (this.Reader[5].ToString() == "2")//非药品
                    {
                        Neusoft.HISFC.Models.Fee.Item.Undrug objAssets = new Neusoft.HISFC.Models.Fee.Item.Undrug();
                        try
                        {
                            objAssets.ID          = this.Reader[6].ToString();
                            objAssets.Name        = this.Reader[7].ToString();
                            objAssets.UserCode    = this.Reader[8].ToString();
                            objAssets.SpellCode   = this.Reader[9].ToString();
                            objAssets.SysClass.ID = this.Reader[10].ToString();
                            //objAssets.SysClass.Name = this.Reader[11].ToString();
                            objAssets.Specs = this.Reader[12].ToString();
                            //							try
                            //							{
                            if (!this.Reader.IsDBNull(20))
                            {
                                objAssets.Price = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[20].ToString());
                            }
                            //}
                            //							catch{}
                            objAssets.PriceUnit = this.Reader[28].ToString();
                            //样本类型名称
                            objOrder.Sample.Name = this.Reader[73].ToString();
                        }
                        catch (Exception ex)
                        {
                            this.Err = "获得医嘱项目信息出错!" + ex.Message;
                            this.WriteErr();
                            return(null);
                        }
                        objOrder.Item = objAssets;
                    }


                    objOrder.Frequency.ID   = this.Reader[24].ToString();
                    objOrder.Frequency.Name = this.Reader[25].ToString();
                    //try
                    //{
                    if (!this.Reader.IsDBNull(26))
                    {
                        objOrder.DoseOnce = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[26].ToString());                           //}
                    }
                    //catch{}
                    //try
                    //{
                    if (!this.Reader.IsDBNull(27))
                    {
                        objOrder.Qty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[27].ToString());                           //}
                    }
                    //catch{}
                    objOrder.Unit = this.Reader[28].ToString();
                    //try
                    //{
                    if (!this.Reader.IsDBNull(29))
                    {
                        objOrder.HerbalQty = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[29].ToString());                           //}
                    }
                    //catch{}

                    #endregion
                    #region "医嘱属性"
                    // ——医嘱属性
                    //		   30医嘱类别代码 31医嘱类别名称  32医嘱是否分解:1长期/2临时     33是否计费
                    //		   34药房是否配药 35打印执行单    36是否需要确认
                    try
                    {
                        objOrder.ID             = this.Reader[0].ToString();
                        objOrder.ExtendFlag1    = this.Reader[78].ToString();//临时医嘱执行时间--自定义
                        objOrder.OrderType.ID   = this.Reader[30].ToString();
                        objOrder.OrderType.Name = this.Reader[31].ToString();
                        //try
                        //{
                        if (!this.Reader.IsDBNull(32))
                        {
                            objOrder.OrderType.IsDecompose = System.Convert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[32].ToString()));                           //}
                        }
                        //catch{}
                        //try
                        //{
                        if (!this.Reader.IsDBNull(33))
                        {
                            objOrder.OrderType.IsCharge = System.Convert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[33].ToString()));                           //}
                        }
                        //catch{}
                        //try
                        //{
                        if (!this.Reader.IsDBNull(34))
                        {
                            objOrder.OrderType.IsNeedPharmacy = System.Convert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[34].ToString()));                           //}
                        }
                        //catch{}
                        //try
                        //{
                        if (!this.Reader.IsDBNull(35))
                        {
                            objOrder.OrderType.IsPrint = System.Convert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[35].ToString()));                           //}
                        }
                        //是否打印过医嘱单
                        if (!this.Reader.IsDBNull(84))
                        {
                            objOrder.User03 = this.Reader[84].ToString();                           //}
                        }
                        //catch{}
                        //try
                        //{
                        if (!this.Reader.IsDBNull(36))
                        {
                            objOrder.OrderType.IsConfirm = System.Convert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[36].ToString()));                           //}
                        }
                        //catch{}
                    }
                    catch (Exception ex)
                    {
                        this.Err = "获得医嘱属性信息出错!" + ex.Message;
                        this.WriteErr();
                        return(null);
                    }
                    #endregion
                    #region "执行情况"
                    // ——执行情况
                    //		   37开立医师Id   38开立医师name  39开始时间      40结束时间     41开立科室
                    //		   42开立时间     43录入人员代码  44录入人员姓名  45审核人ID     46审核时间
                    //		   47DC原因代码   48DC原因名称    49DC医师代码    50DC医师姓名   51Dc时间
                    //         52执行人员代码 53执行时间      54执行科室代码  55执行科室名称
                    //		   56本次分解时间 57下次分解时间
                    try
                    {
                        objOrder.ReciptDoctor.ID   = this.Reader[37].ToString();
                        objOrder.ReciptDoctor.Name = this.Reader[38].ToString();
                        //try{
                        if (!this.Reader.IsDBNull(39))
                        {
                            objOrder.BeginTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[39].ToString());
                        }
                        //}
                        //catch{}
                        //try{
                        if (!this.Reader.IsDBNull(40))
                        {
                            objOrder.EndTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[40].ToString());
                        }
                        //}
                        //catch{}
                        objOrder.ReciptDept.ID = this.Reader[41].ToString();//InDept.ID
                        //try{
                        if (!this.Reader.IsDBNull(42))
                        {
                            objOrder.MOTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[42].ToString());
                        }
                        //}
                        //catch{}
                        objOrder.Oper.ID   = this.Reader[43].ToString();
                        objOrder.Oper.Name = this.Reader[44].ToString();
                        objOrder.Nurse.ID  = this.Reader[45].ToString();
                        //try{
                        if (!this.Reader.IsDBNull(46))
                        {
                            objOrder.ConfirmTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[46].ToString());
                        }
                        //}
                        //catch{}
                        objOrder.DcReason.ID   = this.Reader[47].ToString();
                        objOrder.DcReason.Name = this.Reader[48].ToString();
                        objOrder.DCOper.ID     = this.Reader[49].ToString();
                        objOrder.DCOper.Name   = this.Reader[50].ToString();
                        //try{
                        if (!this.Reader.IsDBNull(51))
                        {
                            objOrder.DCOper.OperTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[51].ToString());
                        }
                        //}
                        //catch{}
                        objOrder.ExecOper.ID = this.Reader[52].ToString();
                        //try{
                        if (!this.Reader.IsDBNull(53))
                        {
                            objOrder.ExecOper.OperTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[53].ToString());
                        }

                        objOrder.ExeDept.ID   = this.Reader[54].ToString();
                        objOrder.ExeDept.Name = this.Reader[55].ToString();

                        objOrder.ExecOper.Dept.ID   = this.Reader[54].ToString();
                        objOrder.ExecOper.Dept.Name = this.Reader[55].ToString();

                        if (!this.Reader.IsDBNull(56))
                        {
                            objOrder.CurMOTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[56].ToString());
                        }

                        if (!this.Reader.IsDBNull(57))
                        {
                            objOrder.NextMOTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[57].ToString());
                        }
                    }
                    catch (Exception ex)
                    {
                        this.Err = "获得医嘱执行情况信息出错!" + ex.Message;
                        this.WriteErr();
                        return(null);
                    }
                    #endregion
                    #region "医嘱类型"
                    // ——医嘱类型
                    //		   58是否婴儿(1是/2否)          59发生序号      60组合序号     61主药标记
                    //		   62是否附材'1'  63是否包含附材  64医嘱状态      65扣库标记     66执行标记1未执行/2已执行/3DC执行
                    //		   67医嘱说明                     68加急标记:1普通/2加急         69排列序号
                    //         70 批注       ,       71检查部位备注    ,72 整档标记,74 取药药房编码 81 是否皮试
                    try
                    {
                        if (!this.Reader.IsDBNull(58))
                        {
                            objOrder.IsBaby = Neusoft.FrameWork.Function.NConvert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[58].ToString()));
                        }

                        if (!this.Reader.IsDBNull(59))
                        {
                            objOrder.BabyNO = this.Reader[59].ToString();
                        }

                        objOrder.Combo.ID = this.Reader[60].ToString();

                        if (!this.Reader.IsDBNull(61))
                        {
                            objOrder.Combo.IsMainDrug = Neusoft.FrameWork.Function.NConvert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[61].ToString()));
                        }

                        if (!this.Reader.IsDBNull(62))
                        {
                            objOrder.IsSubtbl = Neusoft.FrameWork.Function.NConvert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[62].ToString()));
                        }

                        if (!this.Reader.IsDBNull(63))
                        {
                            objOrder.IsHaveSubtbl = Neusoft.FrameWork.Function.NConvert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[63].ToString()));
                        }

                        if (!this.Reader.IsDBNull(64))
                        {
                            objOrder.Status = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[64].ToString());
                        }

                        if (!this.Reader.IsDBNull(65))
                        {
                            objOrder.IsStock = Neusoft.FrameWork.Function.NConvert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[65].ToString()));
                        }


                        if (!this.Reader.IsDBNull(66))
                        {
                            objOrder.ExecStatus = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[66].ToString());
                        }

                        objOrder.Note = this.Reader[67].ToString();

                        if (!this.Reader.IsDBNull(68))
                        {
                            objOrder.IsEmergency = Neusoft.FrameWork.Function.NConvert.ToBoolean(Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[68].ToString()));
                        }

                        if (!this.Reader.IsDBNull(69))
                        {
                            objOrder.SortID = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[69]);
                        }

                        objOrder.Memo            = this.Reader[70].ToString();
                        objOrder.CheckPartRecord = this.Reader[71].ToString();
                        objOrder.Reorder         = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[72].ToString());
                        objOrder.StockDept.ID    = this.Reader[74].ToString();//取药药房编码
                        try
                        {
                            if (!this.Reader.IsDBNull(75))
                            {
                                objOrder.IsPermission = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[75]);                           //患者用药知情
                            }
                        }
                        catch { }
                        objOrder.Package.ID   = this.Reader[76].ToString();
                        objOrder.Package.Name = this.Reader[77].ToString();
                        objOrder.ExtendFlag2  = this.Reader[79].ToString();
                        objOrder.ExtendFlag3  = this.Reader[80].ToString();
                        try
                        {
                            if (!this.Reader.IsDBNull(81))
                            {
                                objOrder.HypoTest = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[81].ToString());//1 不需皮试 2 需皮试 3 阳 4 阴
                            }
                        }
                        catch
                        {
                            objOrder.HypoTest = 1;
                        }

                        objOrder.Frequency.Time = this.Reader[82].ToString(); //执行时间
                        objOrder.ExecDose       = this.Reader[83].ToString(); //特殊频次剂量
                    }
                    catch (Exception ex)
                    {
                        this.Err = "获得医嘱类型信息出错!" + ex.Message;
                        this.WriteErr();
                        return(null);
                    }
                    #endregion
                    al.Add(objOrder);
                }
            }
            catch (Exception ex)
            {
                this.Err     = "获得医嘱信息出错!" + ex.Message;
                this.ErrCode = "-1";
                this.WriteErr();
                return(null);
            }
            this.Reader.Close();
            return(al);
        }
Exemplo n.º 26
0
        /// <summary>
        /// 打印
        /// </summary>
        private void PrintOrder()
        {
            Neusoft.FrameWork.WinForms.Classes.Print pf = new Neusoft.FrameWork.WinForms.Classes.Print();

            if (this.tabControl1.SelectedIndex == 0)
            {
                //pf.PageLabel = (Control)this.lblPage;
                this.SetLongRePrint(false);
                //this.sheetLong.RowCount = 0;
                int pageCount = Neusoft.FrameWork.Function.NConvert.ToInt32(alLongPrint.Count / this.intLineNum);
                for (int iPage = 0; iPage < pageCount; iPage++)
                {
                    Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

                    orderBillManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                    this.sheetLong.RowCount = 0;
                    bool needPrint = false;
                    for (int i = 0; i < intLineNum; i++)
                    {
                        sheetLong.Rows.Add(i, 1);
                        Neusoft.HISFC.Models.Order.Inpatient.Order ord = null;

                        try
                        {
                            ord = alLongPrint[i + iPage * intLineNum] as Neusoft.HISFC.Models.Order.Inpatient.Order;
                        }
                        catch
                        { }
                        if (ord != null && ord.ID != null && ord.ID != "")
                        {
                            Neusoft.HISFC.Models.Order.OrderBill orderBill = new Neusoft.HISFC.Models.Order.OrderBill();
                            orderBill = orderBillManager.GetOrderBillByOrderID(ord.ID);
                            if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintFlag))
                            {
                                this.sheetLong.SetValue(i, 0, "");
                                this.sheetLong.SetValue(i, 1, "");
                                this.sheetLong.SetValue(i, 2, "");
                                this.sheetLong.SetValue(i, 3, "");
                                this.sheetLong.SetValue(i, 4, "");
                                this.sheetLong.SetValue(i, 5, "");
                                this.sheetLong.SetValue(i, 6, "");
                                this.sheetLong.SetValue(i, 7, "");
                                this.sheetLong.SetValue(i, 8, "");
                                this.sheetLong.SetValue(i, 9, "");
                                this.sheetLong.SetValue(i, 10, "");
                            }
                            else
                            {
                                needPrint = true;
                                this.sheetLong.SetValue(i, 0, ord.BeginTime.Month.ToString() + "." + ord.BeginTime.Day.ToString());//.ToShortDateString());
                                sheetLong.SetValue(i, 1, ord.BeginTime.ToShortTimeString());
                                sheetLong.SetValue(i, 2, ord.Item.Name + "  " + ord.Frequency.Name + "  " + ord.Usage.Name);
                                sheetLong.SetValue(i, 3, ord.ReciptDoctor.Name);
                                sheetLong.SetValue(i, 4, ord.Nurse.Name);
                                sheetLong.SetValue(i, 5, ord.ConfirmTime);

                                if (ord.EndTime != DateTime.MinValue)
                                {
                                    sheetLong.SetValue(i, 6, ord.EndTime.Month.ToString() + "." + ord.EndTime.Day.ToString());
                                    sheetLong.SetValue(i, 7, ord.EndTime.ToShortTimeString());//.ExecOper.OperTime.ToShortTimeString());
                                    sheetLong.SetValue(i, 8, ord.DCOper.Name);
                                    sheetLong.SetValue(i, 9, ord.ExecOper.Name);
                                    sheetLong.SetValue(i, 10, ord.ExecOper.OperTime.ToShortTimeString());
                                }
                                else
                                {
                                    this.sheetLong.SetValue(i, 6, "");
                                    this.sheetLong.SetValue(i, 7, "");
                                    this.sheetLong.SetValue(i, 8, "");
                                    this.sheetLong.SetValue(i, 9, "");
                                    this.sheetLong.SetValue(i, 10, "");
                                }

                                int myLineNo = 0;
                                int myPageNo = 0;
                                int myPrnSeq = 0;
                                this.orderBillManager.GetLastOrderBillArg(this.pInfo.ID, orderBill.Order.OrderType.ID, out myPrnSeq, out myPageNo, out myLineNo);

                                if (myPageNo > 0)
                                {
                                    if (myLineNo < this.intLineNum)
                                    {
                                        myLineNo = i + 1;
                                    }
                                    else
                                    {
                                        myLineNo = i + 1;
                                        myPageNo = iPage + 1;
                                        this.SetLongRePrint(true);
                                    }
                                }
                                else
                                {
                                    myLineNo = i + 1;
                                    myPageNo = 1;
                                    this.SetLongRePrint(true);
                                }
                                if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintDCFlag) && orderBill.PageNO > 0)
                                {
                                    this.sheetLong.SetValue(i, 0, "");
                                    this.sheetLong.SetValue(i, 1, "");
                                    this.sheetLong.SetValue(i, 2, "");
                                    this.sheetLong.SetValue(i, 3, "");
                                    this.sheetLong.SetValue(i, 4, "");
                                    this.sheetLong.SetValue(i, 5, "");
                                }
                                if (orderBill.PageNO == 0)
                                {
                                    if (orderBillManager.UpdateLineNoPageNo(ord.ID, myLineNo, myPageNo) < 0)
                                    {
                                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                        MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单行号、页码失败!" + orderBillManager.Err));
                                        return;
                                    }
                                }

                                if (orderBillManager.UpdatePrnFlag(ord.ID, "1") < 0)
                                {
                                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单打印标志失败!" + orderBillManager.Err));
                                    return;
                                }
                            }
                        }
                        else
                        {
                            this.sheetLong.SetValue(i, 0, "");
                            this.sheetLong.SetValue(i, 1, "");
                            this.sheetLong.SetValue(i, 2, "");
                            this.sheetLong.SetValue(i, 3, "");
                            this.sheetLong.SetValue(i, 4, "");
                            this.sheetLong.SetValue(i, 5, "");
                            this.sheetLong.SetValue(i, 6, "");
                            this.sheetLong.SetValue(i, 7, "");
                            this.sheetLong.SetValue(i, 8, "");
                            this.sheetLong.SetValue(i, 9, "");
                            this.sheetLong.SetValue(i, 10, "");
                        }
                    }
                    //this.neuLabel15.Text = "第";
                    //this.neuLabel19.Text = "页";
                    this.lblPage.Text = "第" + (iPage + 1).ToString() + "页";
                    if (needPrint)
                    {
                        pf.PrintPreview(this.plLong);
                    }
                    Neusoft.FrameWork.Management.PublicTrans.Commit();
                }
            }
            else
            {
                //pf.PageLabel = (Control)this.lblPages;
                this.SetShortRePrint(false);
                this.sheetShort.RowCount = 0;
                int pageCount = Neusoft.FrameWork.Function.NConvert.ToInt32(alShortPrint.Count / this.intLineNum);
                for (int iPage = 0; iPage < pageCount; iPage++)
                {
                    Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

                    orderBillManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                    bool needPrint = false;
                    for (int i = 0; i < intLineNum; i++)
                    {
                        sheetShort.Rows.Add(i, 1);
                        Neusoft.HISFC.Models.Order.Inpatient.Order ord = null;

                        try
                        {
                            ord = alShortPrint[i + iPage * intLineNum] as Neusoft.HISFC.Models.Order.Inpatient.Order;
                        }
                        catch
                        { }

                        if (ord != null && ord.ID != null && ord.ID != "")
                        {
                            Neusoft.HISFC.Models.Order.OrderBill orderBill = new Neusoft.HISFC.Models.Order.OrderBill();
                            orderBill = orderBillManager.GetOrderBillByOrderID(ord.ID);
                            if (Neusoft.FrameWork.Function.NConvert.ToBoolean(orderBill.PrintFlag))
                            {
                                this.sheetShort.SetValue(i, 0, "");
                                this.sheetShort.SetValue(i, 1, "");
                                this.sheetShort.SetValue(i, 2, "");
                                this.sheetShort.SetValue(i, 3, "");
                                this.sheetShort.SetValue(i, 4, "");
                                this.sheetShort.SetValue(i, 5, "");
                                this.sheetShort.SetValue(i, 6, "");
                                this.sheetShort.SetValue(i, 7, "");
                                this.sheetShort.SetValue(i, 8, "");
                            }
                            else
                            {
                                needPrint = true;
                                sheetShort.Rows.Add(i, 1);
                                this.sheetShort.SetValue(i, 0, ord.BeginTime.ToShortDateString());
                                sheetShort.SetValue(i, 1, ord.BeginTime.ToShortTimeString());
                                sheetShort.SetValue(i, 2, ord.Item.Name + "  " + ord.Frequency.Name + "  " + ord.Usage.Name);
                                sheetShort.SetValue(i, 3, ord.ReciptDoctor.Name);
                                sheetShort.SetValue(i, 4, ord.BeginTime);
                                sheetShort.SetValue(i, 5, ord.ExecOper.Name);
                                sheetShort.SetValue(i, 6, ord.EndTime.ToShortDateString());
                                sheetShort.SetValue(i, 7, ord.EndTime.ToShortTimeString());

                                int myLineNo = 0;
                                int myPageNo = 0;
                                int myPrnSeq = 0;
                                this.orderBillManager.GetLastOrderBillArg(this.pInfo.ID, orderBill.Order.OrderType.ID, out myPrnSeq, out myPageNo, out myLineNo);

                                if (myPageNo > 0)
                                {
                                    if (i < this.intLineNum)
                                    {
                                        myLineNo = i + 1;
                                    }
                                    else
                                    {
                                        myLineNo = i + 1;
                                        myPageNo = iPage + 1;
                                        this.SetShortRePrint(true);
                                    }
                                }
                                else
                                {
                                    myLineNo = i + 1;
                                    myPageNo = 1;
                                    this.SetShortRePrint(true);
                                }
                                if (orderBill.PageNO == 0)
                                {
                                    if (orderBillManager.UpdateLineNoPageNo(ord.ID, myLineNo, myPageNo) < 0)
                                    {
                                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                        MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单行号、页码失败!" + orderBillManager.Err));
                                        return;
                                    }
                                }
                                if (orderBillManager.UpdatePrnFlag(ord.ID, "1") < 0)
                                {
                                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新医嘱单打印标志失败!" + orderBillManager.Err));
                                    return;
                                }
                            }
                        }
                        else
                        {
                            this.sheetShort.SetValue(i, 0, "");
                            this.sheetShort.SetValue(i, 1, "");
                            this.sheetShort.SetValue(i, 2, "");
                            this.sheetShort.SetValue(i, 3, "");
                            this.sheetShort.SetValue(i, 4, "");
                            this.sheetShort.SetValue(i, 5, "");
                            this.sheetShort.SetValue(i, 6, "");
                            this.sheetShort.SetValue(i, 7, "");
                            this.sheetShort.SetValue(i, 8, "");

                            this.SetShortRePrint(false);
                        }
                    }
                    this.lblPages.Text = "第" + (iPage + 1).ToString() + "页";
                    if (needPrint)
                    {
                        pf.PrintPreview(this.plShort);
                    }
                    Neusoft.FrameWork.Management.PublicTrans.Commit();
                }
            }

            this.SetShortRePrint(true);
            this.SetLongRePrint(true);
            this.SetPatient(this.pInfo);
        }
Exemplo n.º 27
0
        /// <summary>
        /// 生成化疗医嘱
        /// </summary>
        /// <returns></returns>
        private int SaveAssayCure()
        {
            DateTime currentTime = this.OrderMgr.GetDateTimeFromSysDateTime();//当前系统时间

            DateTime tempOrder = this.dtpBeginDate.Value;

            //取医嘱时间
            List <Neusoft.HISFC.Models.Base.OperEnvironment> listDays = this.GetOrderDate(this.txtDays.Text, tempOrder);

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

            System.Collections.ArrayList al = new System.Collections.ArrayList();
            Neusoft.HISFC.Models.Order.Inpatient.Order order = null;
            string comboID       = string.Empty;
            string preComboID    = string.Empty;
            string preNewComboID = string.Empty;

            foreach (Neusoft.HISFC.Models.Base.OperEnvironment dt in listDays)
            {
                if (dt.OperTime.Date < currentTime.Date)
                {
                    MessageBox.Show("化疗时间不能小于当前时间", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(-1);
                }


                int rowIndex = 0;//肿瘤医院提的需求,在一组药里面只有第一条医嘱加上备注

                foreach (Neusoft.HISFC.Models.Order.Inpatient.Order obj in this.orders)
                {
                    order        = obj.Clone();
                    order.SortID = 0;
                    if (obj.Combo.ID == preComboID)
                    {
                        order.Combo.ID = preNewComboID;
                    }
                    else
                    {
                        comboID        = this.OrderMgr.GetNewOrderComboID();//嗯那
                        preComboID     = obj.Combo.ID;
                        preNewComboID  = comboID;
                        order.Combo.ID = comboID;
                    }
                    order.BeginTime     = dt.OperTime;
                    order.Oper.OperTime = dt.OperTime;
                    order.ID            = string.Empty;
                    if (rowIndex == 0)
                    {
                        order.Memo += dt.ID;
                        rowIndex++;
                    }
                    else
                    {
                        if (order.Memo == "")
                        {
                            order.Memo = string.Empty;
                        }
                    }

                    al.Add(order);//一条一条的搞啊,是不
                }
            }

            if (this.MakeSuccessed != null)
            {
                this.MakeSuccessed(al);
            }

            return(1);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 设置患者的医嘱信息
        /// </summary>
        /// <param name="inPatientNo"></param>
        public void SetPatientOrderListToCheck(string inPatientNo, ref ArrayList orderList)
        {
            orderList = this.orderManagement.QueryOrder(inPatientNo);
            if (orderList == null)
            {
                MessageBox.Show("获取【" + inPatientNo + "】的医嘱信息失败 " + this.orderManagement.Err);
                return;
            }

            int i = 0;

            foreach (object obj in orderList)
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order order = obj as Neusoft.HISFC.Models.Order.Inpatient.Order;

                if (order == null)
                {
                    continue;
                }

                if (order.Status == 3)          //不显示作废/停止医嘱
                {
                    continue;
                }
                this.fpMedicine_Sheet1.Rows.Add(i, 1);

                #region 医嘱名称

                if (order.Item.Specs == null || order.Item.Specs.Trim() == "")
                {
                    this.fpMedicine_Sheet1.Cells[i, 2].Value = order.Item.Name;
                }
                else
                {
                    //加入商品名称  {fff989e6-8b66-4375-953b-d727ece2bd71} added by guoly
                    if (order.Item.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
                    {
                        Neusoft.HISFC.Models.Pharmacy.Item objitem = itemManager.GetItem(order.Item.ID);
                        this.fpMedicine_Sheet1.Cells[i, 2].Value = order.Item.Name + (string.IsNullOrEmpty(objitem.NameCollection.RegularName) == true ? "" : "(" + objitem.NameCollection.RegularName + ")") + "[" + order.Item.Specs + "]";
                    }
                    else
                    {
                        this.fpMedicine_Sheet1.Cells[i, 2].Value = order.Item.Name + "[" + order.Item.Specs + "]";
                    }
                }
                //医保用药
                if (order.IsPermission)
                {
                    this.fpMedicine_Sheet1.Cells[i, 2].Value = "√" + this.fpMedicine_Sheet1.Cells[i, 2].Value;
                }
                #endregion

                #region 医嘱类型
                this.fpMedicine_Sheet1.Cells[i, 1].Value = order.OrderType.Name;
                #endregion

                #region 每次量、单位、付数
                if (order.Item.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
                {
                    Neusoft.HISFC.Models.Pharmacy.Item objItem = order.Item as Neusoft.HISFC.Models.Pharmacy.Item;
                    this.fpMedicine_Sheet1.Cells[i, 7].Value = order.DoseOnce.ToString();
                    this.fpMedicine_Sheet1.Cells[i, 8].Value = objItem.DoseUnit;
                    this.fpMedicine_Sheet1.Cells[i, 9].Value = order.HerbalQty;
                    //row["主药"] = System.Convert.ToInt16(order.Combo.IsMainDrug);	//6
                }
                #endregion

                #region 其他
                this.fpMedicine_Sheet1.Cells[i, 5].Value = order.Qty;


                this.fpMedicine_Sheet1.Cells[i, 6].Value  = order.Unit;
                this.fpMedicine_Sheet1.Cells[i, 10].Value = order.Frequency.ID;
                this.fpMedicine_Sheet1.Cells[i, 11].Value = order.Frequency.Name;
                //row["用法编码"] = order.Usage.ID;
                this.fpMedicine_Sheet1.Cells[i, 12].Value = order.Usage.Name;
                this.fpMedicine_Sheet1.Cells[i, 13].Value = order.Item.SysClass.Name;
                this.fpMedicine_Sheet1.Cells[i, 14].Value = order.BeginTime;
                this.fpMedicine_Sheet1.Cells[i, 17].Value = order.ExeDept.Name;

                this.fpMedicine_Sheet1.Cells[i, 19].Value = order.CheckPartRecord;
                this.fpMedicine_Sheet1.Cells[i, 20].Value = order.Sample;
                //row["扣库科室编码"] = order.StockDept.ID;
                this.fpMedicine_Sheet1.Cells[i, 21].Value = deptHelper.GetName(order.StockDept.ID);

                this.fpMedicine_Sheet1.Cells[i, 4].Value = order.Memo;
                //row["录入人编码"] = order.Oper.ID;

                this.fpMedicine_Sheet1.Cells[i, 22].Value = order.Oper.Name;
                //if (order.ReciptDept.Name == "" && order.ReciptDept.ID != "") order.ReciptDept.Name = this.GetDeptName(order.ReciptDept);
                this.fpMedicine_Sheet1.Cells[i, 16].Value = order.ReciptDoctor.Name;
                this.fpMedicine_Sheet1.Cells[i, 23].Value = order.ReciptDept.Name;
                this.fpMedicine_Sheet1.Cells[i, 24].Value = order.MOTime.ToString();

                if (!order.EndTime.ToString().Contains("0001"))
                {
                    this.fpMedicine_Sheet1.Cells[i, 15].Value = order.EndTime;
                }

                this.fpMedicine_Sheet1.Cells[i, 25].Value = order.DCOper.Name;

                this.fpMedicine_Sheet1.Cells[i, 0].Value  = order.SortID;
                this.fpMedicine_Sheet1.Cells[i, 26].Value = order.HypoTest;



                //row["期效"] = System.Convert.ToInt16(order.OrderType.Type);			//0

                this.fpMedicine_Sheet1.Cells[i, 3].Value  = order.ID;           //3
                this.fpMedicine_Sheet1.Cells[i, 4].Value  = order.Status;       //12 新开立,审核,执行
                this.fpMedicine_Sheet1.Cells[i, 18].Value = order.Combo.ID;     //5
                #endregion
            }
        }
Exemplo n.º 29
0
        private DataRow AddObjectToRow(object obj, DataTable table)
        {

            DataRow row = table.NewRow();

            string strTemp = "";
            Neusoft.HISFC.Models.Order.Inpatient.Order order = null;
            order = obj as Neusoft.HISFC.Models.Order.Inpatient.Order;

            if (order.Item.GetType() == typeof(Neusoft.HISFC.Models.Pharmacy.Item))
            {
                Neusoft.HISFC.Models.Pharmacy.Item objItem = order.Item as Neusoft.HISFC.Models.Pharmacy.Item;
                row["主药"] = System.Convert.ToInt16(order.Combo.IsMainDrug);	//6
                row["每次量"] = order.DoseOnce.ToString();					//10
                row["单位"] = objItem.DoseUnit;								//0415 2307096 wang renyi
                row["付数"] = order.HerbalQty;								//11
            }
            else if (order.Item.GetType() == typeof(Neusoft.HISFC.Models.Fee.Item.Undrug))
            {
                //Neusoft.HISFC.Models.Fee.Item objItem = order.Item as Neusoft.HISFC.Models.Fee.Item;
            }

            row["医嘱类型"] = order.OrderType.Name;								//2
            row["医嘱流水号"] = order.ID;										//3
            row["医嘱状态"] = order.Status;										//12 新开立,审核,执行
            row["组合号"] = order.Combo.ID;	//5

            if (order.Item.Specs == null || order.Item.Specs.Trim() == "")
            {
                row["医嘱名称"] = order.Item.Name;
            }
            else
            {
                row["医嘱名称"] = order.Item.Name + "[" + order.Item.Specs + "]";
            }

            //医保用药
            if (order.IsPermission) row["医嘱名称"] = "√" + row["医嘱名称"];

            row["总量"] = order.Qty;
            row["总量单位"] = order.Unit;
            row["频次编码"] = order.Frequency.ID;
            row["频次"] = order.Frequency.Name;
            row["用法"] = order.Usage.Name;
            row["大类"] = order.Item.SysClass.Name;
            row["开始时间"] = order.BeginTime;
            if (order.ExeDept.Name == "" && order.ExeDept.ID != "") order.ExeDept.Name = this.GetDeptName(order.ExeDept);
            row["执行科室"] = order.ExeDept.Name;
            if (order.IsEmergency)
            {
                strTemp = "是";
            }
            else
            {
                strTemp = "否";
            }
            row["加急"] = strTemp;
            row["检查部位"] = order.CheckPartRecord;
            row["样本类型"] = order.Sample;
            row["扣库科室"] = deptHelper.GetName(order.StockDept.ID);

            row["备注"] = order.Memo;
            row["录入人"] = order.Oper.Name;
            if (order.ReciptDept.Name == "" && order.ReciptDept.ID != "") order.ReciptDept.Name = this.GetDeptName(order.ReciptDept);
            row["开立医生"] = order.ReciptDoctor.Name;
            row["开立科室"] = order.ReciptDept.Name;
            row["开立时间"] = order.MOTime.ToString();
            row["停止时间"] = order.EndTime;
            row["停止人"] = order.DCOper.Name;
            row["皮试标志"] = order.HypoTest;
            row["附材标志"] = order.IsSubtbl;
            return row;
        }
Exemplo n.º 30
0
        /// <summary>
        /// 判断组合医嘱
        /// </summary>
        /// <param name="fpSpread1"></param>
        /// <returns></returns>
        public int ValidComboOrder(Neusoft.HISFC.BizLogic.Order.Order orderManagement)
        {
            Neusoft.HISFC.Models.Order.Frequency frequency = null;
            Neusoft.FrameWork.Models.NeuObject   usage     = null;
            Neusoft.FrameWork.Models.NeuObject   exeDept   = null;
            string   sample     = "";
            decimal  amount     = 0;
            int      sysclass   = -1;
            string   sysClassID = string.Empty;
            DateTime dtBegin    = new DateTime();

            for (int i = 0; i < fpSpread1.ActiveSheet.Rows.Count; i++)
            {
                if (fpSpread1.ActiveSheet.IsSelected(i, 0))
                {
                    Neusoft.HISFC.Models.Order.Inpatient.Order o = this.GetObjectFromFarPoint(i, fpSpread1.ActiveSheetIndex, orderManagement);

                    if (o.Status != 0)
                    {
                        MessageBox.Show(string.Format("不符合组合条件,项目{0}状态不允许修改,请重新选择!", o.Item.Name));
                        return(-1);
                    }
                    if (frequency == null)
                    {
                        frequency  = o.Frequency.Clone();
                        usage      = o.Usage.Clone();
                        sysclass   = o.Item.SysClass.ID.GetHashCode();
                        sysClassID = o.Item.SysClass.ID.ToString();
                        exeDept    = o.ExeDept.Clone();
                        sample     = o.Sample.Name;
                        amount     = o.Qty;
                        dtBegin    = o.BeginTime;
                    }
                    else
                    {
                        o.BeginTime = dtBegin;
                        if (o.Frequency.ID != frequency.ID)
                        {
                            MessageBox.Show("频次不同,不可以组合用!");
                            return(-1);
                        }
                        //if (o.Item.IsPharmacy)		//只对药品判断用法是否相同
                        if (o.Item.ItemType == Neusoft.HISFC.Models.Base.EnumItemType.Drug)             //只对药品判断用法是否相同
                        {
                            if (o.Item.SysClass.ID.ToString() != "PCC" && o.Usage.ID != usage.ID)
                            {
                                MessageBox.Show("用法不同,不可以组合用!");
                                return(-1);
                            }
                            #region {B423CB4A-8E22-4aad-B847-76AAC7F9AD74}
                            if (sysClassID == "PCC")
                            {
                                if (o.Item.SysClass.ID.ToString() != sysClassID)
                                {
                                    MessageBox.Show("草药不可以和其他药品组合用!");
                                    return(-1);
                                }
                            }
                            else
                            {
                                if (o.Item.SysClass.ID.ToString() == "PCC")
                                {
                                    MessageBox.Show("草药不可以和其他药品组合用!");
                                    return(-1);
                                }
                            }
                            #endregion
                        }
                        else
                        {
                            if (o.Item.SysClass.ID.ToString() == "UL")//检验
                            {
                                if (o.Qty != amount)
                                {
                                    MessageBox.Show("检验数量不同,不可以组合用!");
                                    return(-1);
                                }
                                if (o.Sample.Name != sample)
                                {
                                    MessageBox.Show("检验样本不同,不可以组合用!");
                                    return(-1);
                                }
                            }
                        }


                        if (o.ExeDept.ID != exeDept.ID)
                        {
                            MessageBox.Show("执行科室不同,不能组合使用!", "提示");
                            return(-1);
                        }
                    }
                }
            }
            return(0);
        }