Beispiel #1
0
        public override List <LabOrder> GetAllFilterd(Entities.Common.IFilter filter)
        {
            var laborders = Filter(o => o.LocationId == filter.LocationId && o.DeleteFlag == filter.DeleteFlag);

            LabOrderFilter _filter = (LabOrderFilter)filter;

            if (_filter.PatientId.HasValue)
            {
                laborders = laborders.Where(o => o.Client.Id == _filter.PatientId.Value);
            }
            if (!string.IsNullOrEmpty(_filter.ReferenceNumber))
            {
                laborders = laborders.Where(o => o.OrderNumber == _filter.ReferenceNumber);
            }
            if (_filter.DateFrom.HasValue && _filter.DateTo.HasValue)
            {
                laborders = laborders.Where(o => o.OrderDate >= _filter.DateFrom.Value && o.OrderDate <= _filter.DateTo.Value);
            }
            if (!string.IsNullOrEmpty(_filter.OrderStatus))
            {
                if (_filter.OrderStatus == "Pending")
                {
                    laborders = laborders.Where(o => o.OrderStatus == _filter.OrderStatus || o.OrderStatus == "Partially Completed");
                }
            }
            return(laborders.ToList());
        }
Beispiel #2
0
        public List <LabOrder> GetAll(Entities.Common.IFilter orderFilters)
        {
            LabOrderRepository repo = new LabOrderRepository();

            if (orderFilters != null)
            {
                return(repo.GetAllFilterd(orderFilters));
            }
            else
            {
                return(repo.GetAll().ToList());
            }
        }
        public List <Entities.Pharmacy.Prescription> GetAll(Entities.Common.IFilter orderFilters)
        {
            PrescriptionRepository repo = new PrescriptionRepository();

            if (orderFilters != null)
            {
                return(repo.GetAllFilterd(orderFilters));
            }
            else
            {
                return(repo.GetAll().ToList <Prescription>());
            }
        }
        /// <summary>
        /// Gets all filterd.
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <returns></returns>
        public override List <Prescription> GetAllFilterd(Entities.Common.IFilter filter)
        {
            var prescriptions = Filter(o => o.LocationId == filter.LocationId);

            PrescriptionFilter _filter = (PrescriptionFilter)filter;

            if (_filter.PatientId.HasValue)
            {
                prescriptions = prescriptions.Where(o => o.Client.Id == _filter.PatientId.Value);
            }
            if (!string.IsNullOrEmpty(_filter.ReferenceNumber))
            {
                prescriptions = prescriptions.Where(o => o.PrescriptionNumber == _filter.ReferenceNumber);
            }
            if (_filter.DateFrom.HasValue && _filter.DateTo.HasValue)
            {
                prescriptions = prescriptions.Where(o => o.PrescriptionDate >= _filter.DateFrom.Value && o.PrescriptionDate <= _filter.DateTo.Value);
            }
            //if (!string.IsNullOrEmpty(_filter.OrderStatus))
            //{
            //    prescriptions = prescriptions.Where(o => o.OrderStatus == _filter.OrderStatus);
            //}
            return(prescriptions.ToList <Prescription>());
        }