Esempio n. 1
0
        public IEnumerable <OrderSummary> Select(int startRowIndex, int maximumRows)
        {
            if (maximumRows == 0 || Partition == null)
            {
                return(new List <OrderSummary>());
            }

            OrderSelectCriteria criteria = GetSelectCriteria();

            IList <Order> studyList = _searchController.GetRangeOrders(criteria, startRowIndex, maximumRows);

            _list = new List <OrderSummary>();

            foreach (Order study in studyList)
            {
                _list.Add(OrderSummaryAssembler.CreateOrderSummary(HttpContext.Current.GetSharedPersistentContext(), study));
            }

            if (OrderFoundSet != null)
            {
                OrderFoundSet(_list);
            }

            return(_list);
        }
Esempio n. 2
0
        private OrderSelectCriteria GetSelectCriteria()
        {
            var criteria = new OrderSelectCriteria();

            // only query for device in this partition
            criteria.ServerPartitionKey.EqualTo(Partition.Key);

            QueryHelper.SetGuiStringCondition(criteria.PatientId, PatientId);
            QueryHelper.SetGuiStringCondition(criteria.PatientsName, PatientName);

            QueryHelper.SetGuiStringCondition(criteria.AccessionNumber, AccessionNumber);

            if (!String.IsNullOrEmpty(ToStudyDate) && !String.IsNullOrEmpty(FromStudyDate))
            {
                var toKey   = DateTime.ParseExact(ToStudyDate, DateFormats, null);
                var fromKey = DateTime.ParseExact(FromStudyDate, DateFormats, null);
                criteria.ScheduledDateTime.Between(fromKey, toKey.AddHours(24));
            }
            else if (!String.IsNullOrEmpty(ToStudyDate))
            {
                var toKey = DateTime.ParseExact(ToStudyDate, DateFormats, null);
                criteria.InsertTime.LessThanOrEqualTo(toKey.AddHours(24));
            }
            else if (!String.IsNullOrEmpty(FromStudyDate))
            {
                var fromKey = DateTime.ParseExact(FromStudyDate, DateFormats, null);
                criteria.ScheduledDateTime.MoreThanOrEqualTo(fromKey);
            }

            if (!string.IsNullOrEmpty(ReferringPhysiciansName))
            {
                var staffCriteria = new StaffSelectCriteria();
                QueryHelper.SetGuiStringCondition(staffCriteria.Name, ReferringPhysiciansName);
                criteria.ReferringStaffRelatedEntityCondition.Exists(staffCriteria);
            }

            if (Statuses != null && Statuses.Length > 0)
            {
                if (Statuses.Length == 1)
                {
                    criteria.OrderStatusEnum.EqualTo(OrderStatusEnum.GetEnum(Statuses[0]));
                }
                else
                {
                    var statusList = Statuses.Select(OrderStatusEnum.GetEnum).ToList();
                    criteria.OrderStatusEnum.In(statusList);
                }
            }

            criteria.ScheduledDateTime.SortDesc(0);

            if (QCExpected.HasValue)
            {
                criteria.QCExpected.EqualTo(QCExpected.Value);
            }

            return(criteria);
        }
        private Order FindOrderForStudy()
        {
            var select = new OrderSelectCriteria();

            select.ServerPartitionKey.EqualTo(_study.ServerPartitionKey);
            select.AccessionNumber.EqualTo(_study.AccessionNumber);
            select.PatientId.EqualTo(_study.PatientId);

            var broker = UpdateContext.GetBroker <IOrderEntityBroker>();

            return(broker.FindOne(select));
        }
Esempio n. 4
0
        public int SelectCount()
        {
            if (Partition == null)
            {
                return(0);
            }

            OrderSelectCriteria criteria = GetSelectCriteria();

            ResultCount = _searchController.GetOrderCount(criteria);

            return(ResultCount);
        }
Esempio n. 5
0
 public int GetOrderCount(OrderSelectCriteria criteria)
 {
     return(_adaptor.GetCount(criteria));
 }
Esempio n. 6
0
 public IList <Order> GetRangeOrders(OrderSelectCriteria criteria, int startIndex, int maxRows)
 {
     return(_adaptor.GetRange(criteria, startIndex, maxRows));
 }
Esempio n. 7
0
 public IList <Order> GetOrders(OrderSelectCriteria criteria)
 {
     return(_adaptor.Get(criteria));
 }