/// <summary> /// Applies this filter to the specified criteria object. /// </summary> /// <param name="criteria"></param> /// <param name="worklistClass"></param> /// <param name="timeDirective"></param> /// <param name="wqc"></param> public void Apply(WorklistItemSearchCriteria criteria, Type worklistClass, Worklist.TimeDirective timeDirective, IWorklistQueryContext wqc) { var subCriteria = criteria.GetTimeFieldSubCriteria(timeDirective.TimeField); if (!(subCriteria is ISearchCondition)) { throw new ArgumentException("Specified worklist field does not seem to be a time field."); } var condition = subCriteria as ISearchCondition; // apply ordering if (timeDirective.HonourOrderPriority) { criteria.Order.PriorityRank.SortDesc(0); ApplyOrdering(timeDirective.Ordering, condition, 1); } else { ApplyOrdering(timeDirective.Ordering, condition, 0); } // apply range filtering, if supported by the worklist class, and not downtime recovery mode if (!wqc.DowntimeRecoveryMode) { var range = this.IsEnabled ? this.Value : timeDirective.DefaultRange; if (range != null) { range.Apply(condition, Platform.Time); } } }
/// <summary> /// Gets the criteria established by the worklist filters. /// </summary> /// <param name="wqc"></param> /// <returns></returns> protected virtual WorklistItemSearchCriteria[] GetFilterCriteriaCore(IWorklistQueryContext wqc) { var criteria = new WorklistItemSearchCriteria(); ApplyFilterCriteria(criteria, wqc); return(new[] { criteria }); }
/// <summary> /// Constructor. /// </summary> /// <param name="procedureStepClasses"></param> /// <param name="searchCriteria"></param> /// <param name="projection"></param> /// <param name="includeDegeneratePatientItems"></param> /// <param name="includeDegenerateProcedureItems"></param> public WorklistItemSearchArgs( Type[] procedureStepClasses, WorklistItemSearchCriteria[] searchCriteria, WorklistItemProjection projection, bool includeDegeneratePatientItems, bool includeDegenerateProcedureItems) : this(procedureStepClasses, searchCriteria, projection, includeDegeneratePatientItems, includeDegenerateProcedureItems, 0) { }
/// <summary> /// Modifies the specified criteria to represent the filters that are set for this worklist. /// </summary> /// <param name="criteria"></param> /// <param name="wqc"></param> protected void ApplyFilterCriteria(WorklistItemSearchCriteria criteria, IWorklistQueryContext wqc) { this.ProcedureTypeFilter.Apply(criteria.Procedure.Type, wqc); this.ProcedureTypeGroupFilter.Apply(criteria.Procedure.Type, wqc); this.FacilityFilter.Apply(criteria.Procedure.PerformingFacility, wqc); this.DepartmentFilter.Apply(criteria.Procedure.PerformingDepartment, wqc); this.OrderPriorityFilter.Apply(criteria.Order, wqc); this.PatientClassFilter.Apply(criteria.Visit, wqc); this.PatientLocationFilter.Apply(criteria.Visit, wqc); this.OrderingPractitionerFilter.Apply(criteria.Order.OrderingPractitioner, wqc); this.PortableFilter.Apply(criteria.Procedure, wqc); // note: the TimeFilter is treated as part of the invariant criteria, so it is not processed here }
/// <summary> /// Constructor. /// </summary> /// <param name="procedureStepClasses"></param> /// <param name="searchCriteria"></param> /// <param name="projection"></param> /// <param name="includeDegeneratePatientItems"></param> /// <param name="includeDegenerateProcedureItems"></param> /// <param name="threshold"></param> public WorklistItemSearchArgs( Type[] procedureStepClasses, WorklistItemSearchCriteria[] searchCriteria, WorklistItemProjection projection, bool includeDegeneratePatientItems, bool includeDegenerateProcedureItems, int threshold) { ProcedureStepClasses = procedureStepClasses; IncludeDegeneratePatientItems = includeDegeneratePatientItems; IncludeDegenerateProcedureItems = includeDegenerateProcedureItems; Threshold = threshold; SearchCriteria = searchCriteria; Projection = projection; }
/// <summary> /// Copy constructor. /// </summary> /// <param name="other"></param> protected WorklistItemSearchCriteria(WorklistItemSearchCriteria other) : base(other) { }
/// <summary> /// Gets the criteria established by the worklist filters. /// </summary> /// <param name="wqc"></param> /// <returns></returns> protected virtual WorklistItemSearchCriteria[] GetFilterCriteriaCore(IWorklistQueryContext wqc) { var criteria = new WorklistItemSearchCriteria(); ApplyFilterCriteria(criteria, wqc); return new[] { criteria }; }