Exemplo n.º 1
0
        /// <summary>
        /// 出院患者使用抗菌药物总品种数,出院患者使用药物总费用,出院患者使用抗菌药物费用
        /// </summary>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public ActionResult InPatientDrugMessageIndex(DateTime startTime, DateTime endTime)
        {
            ViewBag.startTime = startTime;
            ViewBag.endTime   = endTime.AddDays(1).AddMilliseconds(-1);
            endTime           = endTime.AddDays(1);
            var viewModel = new InPatientDrugMessage();

            try
            {
                viewModel = new InPatientDrugMessage
                {
                    AntibioticCategoryNumber = this.DomainFactory.CreateInPatientAntibioticCategoryNumber().GetAntibioticCategoryNumber(startTime, endTime),
                    AntibioticCost           = this.DomainFactory.CreateInPatientAntibioticCost().GetInPatientAntibioticCost(startTime, endTime),
                    TotalDrugCost            = this.DomainFactory.CreateInPatientDrugCost().GetPatientCost(startTime, endTime),
                    UnionAntibioticPerson    = this.DomainFactory.CreateUnionAntibioticPerson().GetUnionAntibioticPerson(startTime, endTime)
                };
            }
            catch (Exception)
            {
                viewModel = new InPatientDrugMessage
                {
                    AntibioticCategoryNumber = -1,
                    AntibioticCost           = -1,
                    TotalDrugCost            = -1,
                    UnionAntibioticPerson    = -1
                };
            }
            return(PartialView("_GetInPatientDrugMessage", viewModel));
        }
Exemplo n.º 2
0
        public InPatientDrugMessage GetInPatientDrugMessage(DateTime startTime, DateTime endTime)
        {
            var result = new InPatientDrugMessage();

            try
            {
                result = new InPatientDrugMessage
                {
                    AntibioticCategoryNumber = this.DomainFactory.CreateInPatientAntibioticCategoryNumber().GetAntibioticCategoryNumber(startTime, endTime),
                    AntibioticCost           = this.DomainFactory.CreateInPatientAntibioticCost().GetInPatientAntibioticCost(startTime, endTime),
                    TotalDrugCost            = this.DomainFactory.CreateInPatientDrugCost().GetPatientCost(startTime, endTime),
                    UnionAntibioticPerson    = this.DomainFactory.CreateUnionAntibioticPerson().GetUnionAntibioticPerson(startTime, endTime)
                };
            }
            catch (Exception e)
            {
                throw new InvalidOperationException(String.Format("读取数据库出错! {0}", e.Message));
            }
            return(result);
        }