/// <summary>
		/// Initialize this worklist item from the specified procedure step and related entities.
		/// </summary>
		/// <param name="step"></param>
		/// <param name="timeField"></param>
		/// <remarks>
		/// This method is not efficient for generating a large number of worklist items from a large set of procedure steps,
		/// because it causes a large number of secondary references and collections to be initiliazed.
		/// Use <see cref="WorklistItem.InitializeFromTuple"/> instead.
		/// </remarks>
		public override void InitializeFromProcedureStep(ProcedureStep step, WorklistItemField timeField)
		{
			var reportingStep = step.As<ReportingProcedureStep>();
			if (reportingStep != null && reportingStep.ReportPart != null)
			{
				this.ReportRef = reportingStep.ReportPart.Report.GetRef();
				this.ReportPartIndex = reportingStep.ReportPart.Index;
				this.HasErrors = reportingStep.Is<TranscriptionReviewStep>()
					? reportingStep.As<TranscriptionReviewStep>().HasErrors : false;
			}

			base.InitializeFromProcedureStep(step, timeField);
		}
        /// <summary>
        /// Initialize this worklist item from the specified procedure step and related entities.
        /// </summary>
        /// <param name="step"></param>
        /// <param name="timeField"></param>
        /// <remarks>
        /// This method is not efficient for generating a large number of worklist items from a large set of procedure steps,
        /// because it causes a large number of secondary references and collections to be initiliazed.
        /// Use <see cref="WorklistItem.InitializeFromTuple"/> instead.
        /// </remarks>
        public override void InitializeFromProcedureStep(ProcedureStep step, WorklistItemField timeField)
        {
            var reportingStep = step.As <ReportingProcedureStep>();

            if (reportingStep != null && reportingStep.ReportPart != null)
            {
                this.ReportRef       = reportingStep.ReportPart.Report.GetRef();
                this.ReportPartIndex = reportingStep.ReportPart.Index;
                this.HasErrors       = reportingStep.Is <TranscriptionReviewStep>()
                                        ? reportingStep.As <TranscriptionReviewStep>().HasErrors : false;
            }

            base.InitializeFromProcedureStep(step, timeField);
        }
		/// <summary>
		/// Maps the specified set of protocolling steps to a corresponding set of reporting worklist items.
		/// </summary>
		/// <param name="protocollingSteps"></param>
		/// <param name="timeField"></param>
		/// <returns></returns>
		public IList<ReportingWorklistItem> GetWorklistItems(IEnumerable<ProtocolProcedureStep> protocollingSteps, WorklistItemField timeField)
		{
			var worklistItemCriteria =
				CollectionUtils.Map(protocollingSteps,
				delegate(ProtocolProcedureStep ps)
				{
					var criteria = new ReportingWorklistItemSearchCriteria();
					criteria.ProcedureStep.EqualTo(ps);
					return criteria;
				}).ToArray();

			var projection = WorklistItemProjection.GetDefaultProjection(timeField);
			var args = new SearchQueryArgs(typeof (ProtocolProcedureStep), worklistItemCriteria, projection);
			var query = this.BuildWorklistSearchQuery(args);
			return DoQuery<ReportingWorklistItem>(query, this.WorklistItemQueryBuilder, args);
		}
Пример #4
0
        /// <summary>
        /// Overridden to provide custom processing of the specified field.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="field"></param>
        /// <returns></returns>
        protected virtual object PreProcessResultField(object value, WorklistItemField field)
        {
            // special handling of this field, because Name is not a persistent property
            if (field == WorklistItemField.ProcedureStepName)
            {
                return(((ProcedureStep)value).Name);
            }

            // convert entities to entity refs
            if (field.IsEntityRefField)
            {
                return(GetEntityRef(value));
            }

            // no special processing required
            return(value);
        }
        /// <summary>
        /// Gets the value for the specified time field from the specified procedure step or its associated entities.
        /// </summary>
        /// <param name="step"></param>
        /// <param name="timeField"></param>
        /// <returns></returns>
        protected override DateTime?GetTimeValue(ProcedureStep step, WorklistItemField timeField)
        {
            var reportingStep = step.As <ReportingProcedureStep>();

            if (reportingStep != null)
            {
                if (timeField == WorklistItemField.ReportPartPreliminaryTime)
                {
                    return(reportingStep.ReportPart.PreliminaryTime);
                }

                if (timeField == WorklistItemField.ReportPartCompletedTime)
                {
                    return(reportingStep.ReportPart.CompletedTime);
                }
            }

            return(base.GetTimeValue(step, timeField));
        }
Пример #6
0
        /// <summary>
        /// Maps the specified set of protocolling steps to a corresponding set of reporting worklist items.
        /// </summary>
        /// <param name="protocollingSteps"></param>
        /// <param name="timeField"></param>
        /// <returns></returns>
        public IList <ReportingWorklistItem> GetWorklistItems(IEnumerable <ProtocolProcedureStep> protocollingSteps, WorklistItemField timeField)
        {
            var worklistItemCriteria =
                CollectionUtils.Map(protocollingSteps,
                                    delegate(ProtocolProcedureStep ps)
            {
                var criteria = new ReportingWorklistItemSearchCriteria();
                criteria.ProcedureStep.EqualTo(ps);
                return(criteria);
            }).ToArray();

            var projection = WorklistItemProjection.GetDefaultProjection(timeField);
            var args       = new SearchQueryArgs(typeof(ProtocolProcedureStep), worklistItemCriteria, projection);
            var query      = this.BuildWorklistSearchQuery(args);

            return(DoQuery <ReportingWorklistItem>(query, this.WorklistItemQueryBuilder, args));
        }
Пример #7
0
		protected override WorklistItemProjection GetProjectionCore(WorklistItemField timeField)
		{
			return WorklistItemProjection.GetDefaultProjection(timeField);
		}
Пример #8
0
		/// <summary>
		/// Maps the <see cref="WorklistItemField"/> value to an <see cref="HqlSelect"/> object.
		/// </summary>
		private static HqlSelect MapWorklistItemFieldToHqlSelect(WorklistItemField itemField)
		{
			return HqlConstants.MapWorklistItemFieldToHqlSelect[itemField];
		}
Пример #9
0
		/// <summary>
		/// Overridden to provide custom processing of the specified field.
		/// </summary>
		/// <param name="value"></param>
		/// <param name="field"></param>
		/// <returns></returns>
		protected virtual object PreProcessResultField(object value, WorklistItemField field)
		{
			// special handling of this field, because Name is not a persistent property
			if (field == WorklistItemField.ProcedureStepName)
				return ((ProcedureStep) value).Name;

			// convert entities to entity refs
			if (field.IsEntityRefField)
				return GetEntityRef(value);

			// no special processing required
			return value;
		}
Пример #10
0
 /// <summary>
 /// Maps the <see cref="WorklistItemField"/> value to an <see cref="HqlSelect"/> object.
 /// </summary>
 private static HqlSelect MapWorklistItemFieldToHqlSelect(WorklistItemField itemField)
 {
     return(HqlConstants.MapWorklistItemFieldToHqlSelect[itemField]);
 }
Пример #11
0
 protected override WorklistItemProjection GetProjectionCore(WorklistItemField timeField)
 {
     return(WorklistItemProjection.GetDefaultProjection(timeField));
 }
Пример #12
0
		/// <summary>
		/// Gets the value for the specified time field from the specified procedure step or its associated entities.
		/// </summary>
		/// <param name="step"></param>
		/// <param name="timeField"></param>
		/// <returns></returns>
		protected override DateTime? GetTimeValue(ProcedureStep step, WorklistItemField timeField)
		{
			var reportingStep = step.As<ReportingProcedureStep>();
			if(reportingStep != null)
			{
				if(timeField == WorklistItemField.ReportPartPreliminaryTime)
					return reportingStep.ReportPart.PreliminaryTime;

				if(timeField == WorklistItemField.ReportPartCompletedTime)
					return reportingStep.ReportPart.CompletedTime;
			}

			return base.GetTimeValue(step, timeField);
		}
Пример #13
0
		/// <summary>
		/// Gets the setter for the specified field.
		/// </summary>
		/// <param name="field"></param>
		/// <returns></returns>
		protected override WorklistItemFieldSetterDelegate GetFieldSetter(WorklistItemField field)
		{
			WorklistItemFieldSetterDelegate updater;
			return _fieldSetters.TryGetValue(field, out updater) ? updater : base.GetFieldSetter(field);
		}
        /// <summary>
        /// Gets the setter for the specified field.
        /// </summary>
        /// <param name="field"></param>
        /// <returns></returns>
        protected override WorklistItemFieldSetterDelegate GetFieldSetter(WorklistItemField field)
        {
            WorklistItemFieldSetterDelegate updater;

            return(_fieldSetters.TryGetValue(field, out updater) ? updater : base.GetFieldSetter(field));
        }