コード例 #1
0
        /// <summary>
        /// 重设当前可显示的内容,为各项内容间加上空格
        /// </summary>
        protected override void ResetDisplayTexts()
        {
            InitBaseDisplayTexts();

            // 顺序为:项目 数量单位 [用法] [频次] [嘱托]
            if (Item == null) // 如果没有项目,则默认为显示内容为空
            {
                return;
            }

            string tail = ""; // 长度大于1表示已经有结尾了,已便于在各项内容间插入空格

            if (!String.IsNullOrEmpty(EntrustContent))
            {
                Texts.Insert(0, new OutputInfoStruct(EntrustContent.Trim()
                                                     , OrderOutputTextType.EntrustContent));
                tail = " ";
            }
            // 长期医嘱才显示频次
            if ((ParentOrder == null) || (ParentOrder.GetType() == typeof(LongOrder)))
            {
                if ((ItemFrequency != null) && (ItemFrequency.KeyInitialized))
                {
                    Texts.Insert(0, new OutputInfoStruct(ItemFrequency.ToString().Trim() + tail
                                                         , OrderOutputTextType.ItemFrequency));
                    if (tail.Length == 0)
                    {
                        tail = " ";
                    }
                }
            }
            if ((ItemUsage != null) && (ItemUsage.KeyInitialized))
            {
                Texts.Insert(0, new OutputInfoStruct(ItemUsage.ToString().Trim() + tail
                                                     , OrderOutputTextType.ItemUsage));
                if (tail.Length == 0)
                {
                    tail = " ";
                }
            }

            // 要根据项目的显示控制属性来决定显示的内容
            ChargeItem chargeItem = Item as ChargeItem;

            if ((chargeItem.PrintAttributes & ItemPrintAttributeFlag.NotShowAmount) == 0)
            {
                Texts.Insert(0
                             //, new OutputInfoStruct(Amount.ToString("#.##", CultureInfo.CurrentCulture) + CurrentUnit.Name.Trim() + tail
                             , new OutputInfoStruct(Amount.ToString() + CurrentUnit.Name.Trim() + tail
                                                    , OrderOutputTextType.ItemAmount));
                if (tail.Length == 0)
                {
                    tail = " ";
                }
            }

            Texts.Insert(0, new OutputInfoStruct(Item.Name.Trim() + tail
                                                 , OrderOutputTextType.ItemName));
        }
コード例 #2
0
        /// <summary>
        /// 重设当前可显示的内容,为各项内容间加上空格
        /// </summary>
        protected override void ResetDisplayTexts()
        {
            InitBaseDisplayTexts();

            // 顺序为:项目 数量单位 [用法] [频次] [嘱托]
            if (Item == null) // 如果没有项目,则默认为显示内容为空
            {
                return;
            }

            string tail = ""; // 长度大于1表示已经有结尾了,已便于在各项内容间插入空格

            if ((Attributes & OrderAttributeFlag.Provide4Oneself) > 0)
            {
                Texts.Insert(0, new OutputInfoStruct("自备", OrderOutputTextType.SelfProvide));
                tail = " ";
            }
            if (!String.IsNullOrEmpty(EntrustContent))
            {
                Texts.Insert(0, new OutputInfoStruct(EntrustContent.Trim(), OrderOutputTextType.EntrustContent));
                tail = " ";
            }
            // 长期医嘱才显示频次
            if ((ParentOrder == null) || (ParentOrder.GetType() == typeof(LongOrder)))
            {
                if ((ItemFrequency != null) && (ItemFrequency.KeyInitialized))
                {
                    Texts.Insert(0, new OutputInfoStruct(ItemFrequency.ToString().Trim() + tail, OrderOutputTextType.ItemFrequency));
                    if (tail.Length == 0)
                    {
                        tail = " ";
                    }
                }
            }
            if ((ItemUsage != null) && (ItemUsage.KeyInitialized))
            {
                Texts.Insert(0, new OutputInfoStruct(ItemUsage.ToString().Trim() + tail, OrderOutputTextType.ItemUsage));
                if (tail.Length == 0)
                {
                    tail = " ";
                }
            }

            Texts.Insert(0, new OutputInfoStruct(Amount.ToString() + CurrentUnit.Name.Trim() + tail, OrderOutputTextType.ItemAmount));

            Texts.Insert(0, new OutputInfoStruct(Item.ToString().Trim() + " ", OrderOutputTextType.ItemName));
        }
コード例 #3
0
        /// <summary>
        /// 重设当前可显示的内容,为各项内容间加上空格
        /// </summary>
        protected override void ResetDisplayTexts()
        {
            InitBaseDisplayTexts();

            // 顺序为:项目 数量单位 [用法] [频次] 天数 [嘱托]
            if (Item == null) // 如果没有项目,则默认为显示内容为空
            {
                return;
            }

            string tail = ""; // 长度大于1表示已经有结尾了,已便于在各项内容间插入空格

            if ((Attributes & OrderAttributeFlag.Provide4Oneself) > 0)
            {
                Texts.Insert(0, new OutputInfoStruct("自备", OrderOutputTextType.SelfProvide));
                tail = " ";
            }
            if (!String.IsNullOrEmpty(EntrustContent))
            {
                Texts.Insert(0, new OutputInfoStruct(EntrustContent.Trim(), OrderOutputTextType.EntrustContent));
                tail = " ";
            }
            Texts.Insert(0, new OutputInfoStruct(ExecuteDays.ToString("#'天'", CultureInfo.CurrentCulture), OrderOutputTextType.ItemDays));
            if (tail.Length == 0)
            {
                tail = " ";
            }

            if ((ItemFrequency != null) && (ItemFrequency.KeyInitialized))
            {
                Texts.Insert(0, new OutputInfoStruct(ItemFrequency.ToString().Trim() + tail, OrderOutputTextType.ItemFrequency));
            }
            if ((ItemUsage != null) && (ItemUsage.KeyInitialized))
            {
                Texts.Insert(0, new OutputInfoStruct(ItemUsage.ToString().Trim() + tail, OrderOutputTextType.ItemUsage));
            }

            Texts.Insert(0, new OutputInfoStruct(Amount.ToString("#.##", CultureInfo.CurrentCulture) + CurrentUnit.Name.Trim() + tail, OrderOutputTextType.ItemAmount));

            Texts.Insert(0, new OutputInfoStruct(Item.ToString().Trim() + tail, OrderOutputTextType.ItemName));
        }