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); }
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)); }
public int SelectCount() { if (Partition == null) { return(0); } OrderSelectCriteria criteria = GetSelectCriteria(); ResultCount = _searchController.GetOrderCount(criteria); return(ResultCount); }
public int GetOrderCount(OrderSelectCriteria criteria) { return(_adaptor.GetCount(criteria)); }
public IList <Order> GetRangeOrders(OrderSelectCriteria criteria, int startIndex, int maxRows) { return(_adaptor.GetRange(criteria, startIndex, maxRows)); }
public IList <Order> GetOrders(OrderSelectCriteria criteria) { return(_adaptor.Get(criteria)); }