/// <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); }
/// <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)); }
/// <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)); }
protected override WorklistItemProjection GetProjectionCore(WorklistItemField timeField) { return WorklistItemProjection.GetDefaultProjection(timeField); }
/// <summary> /// Maps the <see cref="WorklistItemField"/> value to an <see cref="HqlSelect"/> object. /// </summary> private static HqlSelect MapWorklistItemFieldToHqlSelect(WorklistItemField itemField) { return HqlConstants.MapWorklistItemFieldToHqlSelect[itemField]; }
/// <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> /// Maps the <see cref="WorklistItemField"/> value to an <see cref="HqlSelect"/> object. /// </summary> private static HqlSelect MapWorklistItemFieldToHqlSelect(WorklistItemField itemField) { return(HqlConstants.MapWorklistItemFieldToHqlSelect[itemField]); }
protected override WorklistItemProjection GetProjectionCore(WorklistItemField timeField) { return(WorklistItemProjection.GetDefaultProjection(timeField)); }
/// <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); }
/// <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)); }