Exemple #1
0
        /// <summary>
        /// 该挂号信息包含的所有药物种类需计数为+1的药品种类集合.
        /// </summary>
        /// <param name="startTime">The start time.</param>
        /// <param name="endTime">The end time.</param>
        /// <returns>List&lt;System.String&gt;.</returns>
        public List <string> AllDrugCategoryNumberPositiveList(DateTime startTime, DateTime endTime)
        {
            List <string> result = new List <string>();
            //获取在startTime之前的所有药物种类总金额==0的集合,
            //并且获取在endTime之前的所有药物种类总金额 >0的集合

            var preStartTimeList = OutPatientPrescriptions.SelectMany(opp => opp.GetAllDrugMessage(this.ChargeTime, startTime)).ToList()
                                   .GroupBy(g => g.ProductNumber).Where(w => w.Sum(su => su.Cost) == 0).Select(s => s.Key).ToList();
            var preStartTimeGreaterZeroList = OutPatientPrescriptions.SelectMany(opp => opp.GetAllDrugMessage(this.ChargeTime, startTime)).ToList()
                                              .GroupBy(g => g.ProductNumber).Where(w => w.Sum(su => su.Cost) > 0).Select(s => s.Key).ToList();
            var preEndTimeList = OutPatientPrescriptions.SelectMany(opp => opp.GetAllDrugMessage(this.ChargeTime, endTime)).ToList()
                                 .GroupBy(g => g.ProductNumber).Where(w => w.Sum(su => su.Cost) > 0).Select(s => s.Key).ToList();

            //preStartTimeList  preEndTimeList 的交集,即为该挂号信息中有效的药品种类
            if (preStartTimeGreaterZeroList.Count > 0 && preEndTimeList.Count > 0)
            {
                //返回空,计数0
            }
            else if (preStartTimeList.Count > 0 && preEndTimeList.Count > 0)
            {
                result = preEndTimeList.Intersect(preEndTimeList).ToList();
            }
            else if (preStartTimeList.Count == 0 && preEndTimeList.Count > 0)
            {
                result = preEndTimeList;
            }
            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 抗菌药物费用
        /// </summary>
        /// <returns>Decimal.</returns>
        public Decimal AntibioticCost()
        {
            Decimal cost = 0;

            cost = OutPatientPrescriptions.Sum(opp => opp.AntibioticCost());

            return(cost);
        }
Exemple #3
0
        /// <summary>
        /// 获取该挂号信息包含的所有抗菌药物编码列表.
        /// </summary>
        /// <param name="startTime">The start time.</param>
        /// <param name="endTime">The end time.</param>
        /// <returns>HashSet&lt;System.String&gt;.</returns>
        /// <remarks>取定时间段的抗菌药费用是否大于0,大于0说明需计数,再取对应的抗菌药品种</remarks>
        public List <string> AntibioticCategoryNumberList(DateTime startTime, DateTime endTime)
        {
            List <string> result = new List <string>();

            result = this.AntibioticPersonPositive(startTime, endTime) > 0
                ? OutPatientPrescriptions.SelectMany(opp => opp.AntibioticCategoryNumberList(startTime, endTime)).Distinct().ToList()
                : result;
            return(result);
        }
Exemple #4
0
        /// <summary>
        /// 取定时间内,病人药品总费用
        /// </summary>
        /// <param name="startTime">The start time.</param>
        /// <param name="endTime">The end time.</param>
        /// <returns>Decimal.</returns>
        /// <remarks>
        /// 取定的时间段内由处方表中的时间决定
        /// </remarks>
        public Decimal DrugCost(DateTime startTime, DateTime endTime)
        {
            Decimal cost = 0;

            //在选定时间段内,由处方表中的时间决定
            //if (DateTime.Compare(ChargeTime, startTime) >= 0 && DateTime.Compare(ChargeTime, endTime) < 0)
            //{
            //    cost = DrugCost();
            //}
            cost = OutPatientPrescriptions.Sum(opp => opp.DrugCost(startTime, endTime));

            return(cost);
        }
Exemple #5
0
        /// <summary>
        /// 该挂号信息包含的基本药物种类需计数为-1的药品种类集合.
        /// </summary>
        /// <param name="startTime">The start time.</param>
        /// <param name="endTime">The end time.</param>
        /// <returns>List&lt;System.String&gt;.</returns>
        internal List <string> DrugCategoryNumberNegativeList(DateTime startTime, DateTime endTime, EnumDrugCategories drugCategory)
        {
            List <string> result = new List <string>();
            //获取在startTime之前的基本药物种类总金额==0的集合,
            //并且获取在endTime之前的基本药物种类总金额 >0的集合

            var preStartTimeList = OutPatientPrescriptions.SelectMany(opp => opp.GetEssentialDrugMessage(this.ChargeTime, startTime)).ToList()
                                   .GroupBy(g => g.ProductNumber).Where(w => w.Sum(su => su.Cost) > 0).Select(s => s.Key).ToList();
            var preEndTimeList = OutPatientPrescriptions.SelectMany(opp => opp.GetEssentialDrugMessage(this.ChargeTime, endTime)).ToList()
                                 .GroupBy(g => g.ProductNumber).Where(w => w.Sum(su => su.Cost) == 0).Select(s => s.Key).ToList();

            //preStartTimeList  preEndTimeList 的交集,即为该挂号信息中有效的药品种类
            if (preStartTimeList.Count > 0 && preEndTimeList.Count > 0)
            {
                result = preEndTimeList.Intersect(preEndTimeList).ToList();
            }
            return(result);
        }
Exemple #6
0
 public bool IsInDuration(DateTime startTime, DateTime endTime)
 {
     return(OutPatientPrescriptions.Any(opp => opp.IsInDuration(startTime, endTime)));
 }
Exemple #7
0
 /// <summary>
 /// 病人药品总费用.
 /// </summary>
 /// <returns>Decimal.</returns>
 public Decimal DrugCost()
 {
     return(OutPatientPrescriptions.Sum(opp => opp.DrugCost()));
 }
Exemple #8
0
 public bool IsMatchAntibiotic(DateTime startTime, DateTime endTime)
 {
     return(OutPatientPrescriptions.Sum(c => c.AntibioticCost(startTime, endTime)) == 0);
 }
Exemple #9
0
 public bool IsContainAntibiotic(DateTime startTime, DateTime endTime)
 {
     return(OutPatientPrescriptions.Any(opp => opp.IsContainAntibiotic(startTime, endTime)));
 }
Exemple #10
0
 public bool IsContainAntibiotic()
 {
     //对应的所有Prescriptions中至少有一个含有抗菌药物,即认为含有抗菌药物
     return(OutPatientPrescriptions.Any(opp => opp.IsContainAntibiotic()));
 }