public override bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { if (step.State != ActivityStatus.SC && step.State != ActivityStatus.IP) { return(false); } if (step.State == ActivityStatus.IP && !Equals(step.PerformingStaff, currentUserStaff)) { return(false); } // scheduled items should should look like items submitted for review if (step.State == ActivityStatus.SC && (step.ReportPart.Transcriber == null || step.AssignedStaff == null)) { return(false); } // if it looks like an transcription submitted for review, but not to the current user. if (step.State == ActivityStatus.SC && step.ReportPart.Transcriber != null && !Equals(step.AssignedStaff, currentUserStaff)) { return(false); } return(true); }
public void Execute(TranscriptionStep step, Staff performingStaff) { step.Discontinue(); var transcriptionStep = new TranscriptionStep(step); transcriptionStep.Schedule(Platform.Time); }
public void Execute(TranscriptionStep step, Staff performingStaff, Staff supervisor) { step.Complete(); var transcriptionStep = new TranscriptionStep(step); transcriptionStep.Assign(supervisor); transcriptionStep.Schedule(Platform.Time); }
public void Test_Reassign() { InterpretationStep previousStep = new InterpretationStep(new Procedure()); TranscriptionStep procedureStep = new TranscriptionStep(previousStep); TranscriptionStep newStep = (TranscriptionStep)procedureStep.Reassign(new Staff()); Assert.AreEqual(procedureStep, newStep); Assert.IsInstanceOfType(typeof(TranscriptionStep), newStep); }
public void Test_Reassign() { InterpretationStep previousStep = new InterpretationStep(new Procedure()); TranscriptionStep procedureStep = new TranscriptionStep(previousStep); TranscriptionStep newStep = (TranscriptionStep)procedureStep.Reassign(new Staff()); Assert.AreEqual(procedureStep, newStep); Assert.IsInstanceOf(typeof(TranscriptionStep), newStep); }
public override bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { if (step.State != ActivityStatus.IP) return false; if (!Equals(step.PerformingStaff, currentUserStaff)) return false; return true; }
private static void SaveReportHelper(TranscriptionStep step, Dictionary <string, string> reportPartExtendedProperties) { if (reportPartExtendedProperties == null) { return; } var op = new TranscriptionOperations.SaveTranscription(); op.Execute(step, reportPartExtendedProperties); }
public override bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { if (!step.IsInitial || step.State == ActivityStatus.IP && !Equals(step.PerformingStaff, currentUserStaff)) return false; if (step.AssignedStaff != null && !Equals(step.AssignedStaff, currentUserStaff)) return false; return true; }
/// <summary> /// Get the supervisor, using the new supervisor if supplied, otherwise using an existing supervisor if found. /// </summary> /// <param name="step"></param> /// <param name="newSupervisorRef"></param> /// <returns></returns> private Staff ResolveSupervisor(TranscriptionStep step, EntityRef newSupervisorRef) { var supervisor = newSupervisorRef == null ? null : this.PersistenceContext.Load <Staff>(newSupervisorRef, EntityLoadFlags.Proxy); if (supervisor == null && step.ReportPart != null) { supervisor = step.ReportPart.TranscriptionSupervisor; } return(supervisor); }
public void Test_Complete_NullReportPart() { Procedure procedure = new Procedure(); Report report = new Report(procedure); ReportPart reportPart = new ReportPart(report, 0); Staff performer = new Staff(); InterpretationStep previousStep = new InterpretationStep(procedure); TranscriptionStep procedureStep = new TranscriptionStep(previousStep); procedureStep.Start(performer); procedureStep.Complete(); }
public void Test_Complete_NullReportPart() { Procedure procedure = new Procedure(); Report report = new Report(procedure); ReportPart reportPart = new ReportPart(report, 0); Staff performer = new Staff(); InterpretationStep previousStep = new InterpretationStep(procedure); TranscriptionStep procedureStep = new TranscriptionStep(previousStep); procedureStep.Start(performer); procedureStep.Complete(); }
public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow) { UpdateStep(step, executingStaff); // Ensure Supervisor and Reject reason from previous transcriptions of the same report part are // removed. step.ReportPart.ResetTranscription(); var transcriptionStep = new TranscriptionStep(step); transcriptionStep.Schedule(Platform.Time); workflow.AddEntity(transcriptionStep); return(transcriptionStep); }
public override bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { if (step.State != ActivityStatus.IP) { return(false); } if (!Equals(step.PerformingStaff, currentUserStaff)) { return(false); } return(true); }
public void Test_Complete() { Procedure procedure = new Procedure(); Report report = new Report(procedure); ReportPart reportPart = new ReportPart(report, 0); Staff performer = new Staff(); InterpretationStep previousStep = new InterpretationStep(procedure); previousStep.ReportPart = reportPart; TranscriptionStep procedureStep = new TranscriptionStep(previousStep); procedureStep.Start(performer); procedureStep.Complete(); Assert.AreEqual(performer, procedureStep.ReportPart.Transcriber); }
public override bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { if (!step.IsInitial || step.State == ActivityStatus.IP && !Equals(step.PerformingStaff, currentUserStaff)) { return(false); } if (step.AssignedStaff != null && !Equals(step.AssignedStaff, currentUserStaff)) { return(false); } return(true); }
public void Execute(TranscriptionStep step, Staff performingStaff) { if (step.State == ActivityStatus.SC) { step.Complete(performingStaff); } else { step.Complete(); } TranscriptionReviewStep transcriptionReviewStep = new TranscriptionReviewStep(step); step.Procedure.AddProcedureStep(transcriptionReviewStep); transcriptionReviewStep.Assign(step.ReportPart.Interpreter); transcriptionReviewStep.Schedule(Platform.Time); }
public void Test_Complete() { Procedure procedure = new Procedure(); Report report = new Report(procedure); ReportPart reportPart = new ReportPart(report, 0); Staff performer = new Staff(); InterpretationStep previousStep = new InterpretationStep(procedure); previousStep.ReportPart = reportPart; TranscriptionStep procedureStep = new TranscriptionStep(previousStep); procedureStep.Start(performer); procedureStep.Complete(); Assert.AreEqual(performer, procedureStep.ReportPart.Transcriber); }
public void Execute(TranscriptionStep step, Staff rejectedBy, TranscriptionRejectReasonEnum reason) { if (step.State == ActivityStatus.SC) { step.Complete(rejectedBy); } else { step.Complete(); } step.ReportPart.TranscriptionRejectReason = reason; TranscriptionReviewStep transcriptionReviewStep = new TranscriptionReviewStep(step); step.Procedure.AddProcedureStep(transcriptionReviewStep); transcriptionReviewStep.Assign(step.ReportPart.Interpreter); transcriptionReviewStep.Schedule(Platform.Time); transcriptionReviewStep.HasErrors = true; }
public void Execute(TranscriptionStep step, Staff performingStaff) { step.Discontinue(); var transcriptionStep = new TranscriptionStep(step); transcriptionStep.Schedule(Platform.Time); }
public void Execute(TranscriptionStep step, Staff performingStaff, Staff supervisor) { step.Complete(); var transcriptionStep = new TranscriptionStep(step); transcriptionStep.Assign(supervisor); transcriptionStep.Schedule(Platform.Time); }
public void Execute(TranscriptionStep step, Staff performingStaff) { step.Start(performingStaff); }
public void Execute(TranscriptionStep step, Dictionary <string, string> reportPartExtendedProperties) { ExtendedPropertyUtils.Update(step.ReportPart.ExtendedProperties, reportPartExtendedProperties); }
public override bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { if (step.State != ActivityStatus.SC && step.State != ActivityStatus.IP) return false; if (step.State == ActivityStatus.IP && !Equals(step.PerformingStaff, currentUserStaff)) return false; // scheduled items should should look like items submitted for review if (step.State == ActivityStatus.SC && (step.ReportPart.Transcriber == null || step.AssignedStaff == null)) return false; // if it looks like an transcription submitted for review, but not to the current user. if (step.State == ActivityStatus.SC && step.ReportPart.Transcriber != null && !Equals(step.AssignedStaff, currentUserStaff)) return false; return true; }
public virtual bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { return false; }
public void Execute(TranscriptionStep step, Staff performingStaff) { step.Start(performingStaff); }
public void Execute(TranscriptionStep step, Staff rejectedBy, TranscriptionRejectReasonEnum reason) { if (step.State == ActivityStatus.SC) step.Complete(rejectedBy); else step.Complete(); step.ReportPart.TranscriptionRejectReason = reason; TranscriptionReviewStep transcriptionReviewStep = new TranscriptionReviewStep(step); step.Procedure.AddProcedureStep(transcriptionReviewStep); transcriptionReviewStep.Assign(step.ReportPart.Interpreter); transcriptionReviewStep.Schedule(Platform.Time); transcriptionReviewStep.HasErrors = true; }
public virtual bool CanExecute(TranscriptionStep step, Staff currentUserStaff) { return(false); }
public void Execute(TranscriptionStep step, Dictionary<string, string> reportPartExtendedProperties) { ExtendedPropertyUtils.Update(step.ReportPart.ExtendedProperties, reportPartExtendedProperties); }
public void Execute(TranscriptionStep step, Dictionary <string, string> reportPartExtendedProperties, Staff supervisor) { this.Execute(step, reportPartExtendedProperties); step.ReportPart.TranscriptionSupervisor = supervisor; }
public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow) { UpdateStep(step, executingStaff); // Ensure Supervisor and Reject reason from previous transcriptions of the same report part are // removed. step.ReportPart.ResetTranscription(); var transcriptionStep = new TranscriptionStep(step); transcriptionStep.Schedule(Platform.Time); workflow.AddEntity(transcriptionStep); return transcriptionStep; }
public void Test_Name() { TranscriptionStep procedureStep = new TranscriptionStep(); Assert.AreEqual("Transcription", procedureStep.Name); }
public void Test_Name() { TranscriptionStep procedureStep = new TranscriptionStep(); Assert.AreEqual("Transcription", procedureStep.Name); }
private static void SaveReportHelper(TranscriptionStep step, Dictionary <string, string> reportPartExtendedProperties, Staff supervisor) { var op = new TranscriptionOperations.SaveTranscription(); op.Execute(step, reportPartExtendedProperties, supervisor); }
public void Execute(TranscriptionStep step, Dictionary<string, string> reportPartExtendedProperties, Staff supervisor) { this.Execute(step, reportPartExtendedProperties); step.ReportPart.TranscriptionSupervisor = supervisor; }
public void Execute(TranscriptionStep step, Staff performingStaff) { if(step.State == ActivityStatus.SC) step.Complete(performingStaff); else step.Complete(); TranscriptionReviewStep transcriptionReviewStep = new TranscriptionReviewStep(step); step.Procedure.AddProcedureStep(transcriptionReviewStep); transcriptionReviewStep.Assign(step.ReportPart.Interpreter); transcriptionReviewStep.Schedule(Platform.Time); }