Esempio n. 1
0
		public CompleteInterpretationAndVerifyResponse CompleteInterpretationAndVerify(CompleteInterpretationAndVerifyRequest request)
		{
			var interpretation = this.PersistenceContext.Load<ReportingProcedureStep>(request.ReportingStepRef, EntityLoadFlags.CheckVersion);
			var supervisor = ResolveSupervisor(interpretation, request.SupervisorRef);

			SaveReportHelper(request.ReportPartExtendedProperties, interpretation, supervisor, true);
			UpdatePriority(interpretation, request.Priority);

			ValidateReportTextExists(interpretation);

			var op = new Operations.CompleteInterpretationAndVerify();
			var nextStep = op.Execute(interpretation, this.CurrentUserStaff, new PersistentWorkflow(this.PersistenceContext));

			this.PersistenceContext.SynchState();
			return new CompleteInterpretationAndVerifyResponse
					{
						InterpretationStepRef = interpretation.GetRef(),
						PublicationStepRef = nextStep.GetRef()
					};
		}
		private void ExecuteHelper(string procedureStepName, EntityRef procedureStepRef, EntityRef supervisorRef)
		{
			if (procedureStepName == StepType.Interpretation || procedureStepName == StepType.TranscriptionReview)
			{
				Platform.GetService<IReportingWorkflowService>(
					delegate(IReportingWorkflowService service)
					{
						CompleteInterpretationAndVerifyRequest request = new CompleteInterpretationAndVerifyRequest(procedureStepRef);
						request.SupervisorRef = supervisorRef;
						service.CompleteInterpretationAndVerify(request);
					});
			}
			else if (procedureStepName == StepType.Verification)
			{
				Platform.GetService<IReportingWorkflowService>(
					delegate(IReportingWorkflowService service)
					{
						CompleteVerificationRequest request = new CompleteVerificationRequest(procedureStepRef);
						request.SupervisorRef = supervisorRef;
						service.CompleteVerification(request);
					});
			}
		}