Ejemplo n.º 1
0
        private void lbOrders_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (null == lbOrders.SelectedItem)
            {
                return;
            }

            OrdersModel ord = (OrdersModel)lbOrders.SelectedItem;

            this.clearOrders();

            if (string.IsNullOrWhiteSpace(ord.RecipeID))
            {
                return;
            }

            if (ord.IsTPN)
            {
                this.tpnView.showRecipeTPN(ord.RecipeID);
                loadOrderChkResut();
            }
        }
Ejemplo n.º 2
0
        private void updateChkResult(OrdersModel _recipe)
        {
            if (!AppConst.db.ExecSQL(string.Format(SQL.UP_MNTRESULT, _recipe.RecipeID)))
            {
                BLPublic.Dialogs.Error("更新审方结果等级失败:" + AppConst.db.Error);
                return;
            }

            IDataReader dr = null;

            if (!AppConst.db.GetRecordSet(string.Format(SQL.SEL_CHKLEVEL, _recipe.RecipeID), ref dr))
            {
                BLPublic.Dialogs.Error("获取审方结果等级失败:" + AppConst.db.Error);
                return;
            }

            if (dr.Read())
            {
                _recipe.CheckLevel = dr.GetInt32(0);
                lbOrders.Items.Refresh();
            }

            dr.Close();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 显示医嘱
        /// </summary>
        private void listOrders()
        {
            lbOrders.Items.Clear();
            lvTPNItems.Items.Clear();

            if (null == this.tblOrders)
            {
                return;
            }

            this.tpnMnt.loadConfig();

            string rowFilter = "";

            if (true == cbOnlyTPN.IsChecked)
            {
                rowFilter = "OrdersLabel=4";
            }

            this.tblOrders.DefaultView.RowFilter = rowFilter;

            int         tpnLvl       = -1;
            bool        isTPN        = false;
            bool        hadNotChk    = false;
            string      prveRecipeID = "";
            OrdersModel odrModel     = null;

            foreach (DataRow row in this.tblOrders.DefaultView.ToTable().Rows)
            {
                if (!prveRecipeID.Equals(row["RecipeID"].ToString()))
                {
                    prveRecipeID = row["RecipeID"].ToString();
                    isTPN        = "4".Equals(row["OrdersLabel"].ToString());
                    if (row.IsNull("TPNLevel"))
                    {
                        tpnLvl    = -1;
                        hadNotChk = true;
                    }
                    else
                    {
                        tpnLvl = Convert.ToInt32(row["TPNLevel"].ToString());
                    }

                    if (0 > (double)row["Capacity"])
                    {
                        row["Capacity"] = this.tpnMnt.ordersCapacity(row["RecipeID"].ToString());
                    }

                    odrModel = new OrdersModel
                    {
                        RecipeID = prveRecipeID,

                        OrderTime  = ComClass.getDateTimeFmt(Convert.ToDateTime(row["StartTime"].ToString())),
                        StopTime   = row.IsNull("StopTime") ? "--" : ComClass.getDateTimeFmt(Convert.ToDateTime(row["StopTime"].ToString())),
                        UseRoute   = row["UsageCode"].ToString(),
                        FreqCode   = row["FreqCode"].ToString(),
                        Remark     = row["Remark"].ToString(),
                        Capacity   = row["Capacity"].ToString(),
                        GroupNo    = row["GroupNo"].ToString(),
                        CheckLevel = tpnLvl,
                        IsTPN      = isTPN,
                        IsStop     = false,
                        CanMod     = this.canModType
                    };

                    if (isTPN)
                    {
                        if (-1 == tpnLvl)
                        {
                            odrModel.State = "未审方";
                        }
                        else if (0 == tpnLvl)
                        {
                            odrModel.State = "通过";
                        }
                        else
                        {
                            odrModel.State = "未通过";
                        }
                    }
                    else
                    {
                        odrModel.State = "--";
                    }

                    if (!row.IsNull("StopTime"))
                    {
                        odrModel.IsStop = true;
                    }
                    else if ("-1" == row["NowStatus"].ToString())
                    {
                        odrModel.StopTime = "已退方";
                        odrModel.IsStop   = true;
                    }

                    lbOrders.Items.Add(odrModel);
                }

                odrModel.Drugs.Add(new OrdersDrugModel(row["DrugCode"].ToString(), row["DrugName"].ToString(),
                                                       row["DrugSpec"].ToString(),
                                                       BLPublic.Utils.trimZero(row["Dosage"].ToString()),
                                                       row["DosageUnit"].ToString(),
                                                       row["Quantity"].ToString()));
            }

            if (hadNotChk && (null != this.patient))
            {
                this.patient.HadNotCheckOrders = true;
                if (null != this.onRefParent)
                {
                    this.onRefParent();
                }
            }
        }