Example #1
0
            public void Execute(InterpretationStep step, Staff executingStaff, List <InterpretationStep> linkInterpretations, IWorkflow workflow)
            {
                // if not assigned, assign
                if (step.AssignedStaff == null)
                {
                    step.Assign(executingStaff);
                }

                // put in-progress
                step.Start(executingStaff);

                // if a report has not yet been created for this step, create now
                if (step.ReportPart == null)
                {
                    var report     = new Report(step.Procedure);
                    var reportPart = report.ActivePart;

                    workflow.AddEntity(report);

                    step.ReportPart             = reportPart;
                    step.ReportPart.Interpreter = executingStaff;
                }

                // attach linked interpretations to this report
                foreach (var interpretation in linkInterpretations)
                {
                    interpretation.LinkTo(step);
                }
            }
Example #2
0
			public void Execute(InterpretationStep step, Staff executingStaff, List<InterpretationStep> linkInterpretations, IWorkflow workflow)
			{
				// if not assigned, assign
				if (step.AssignedStaff == null)
				{
					step.Assign(executingStaff);
				}

				// put in-progress
				step.Start(executingStaff);

				// if a report has not yet been created for this step, create now
				if (step.ReportPart == null)
				{
					var report = new Report(step.Procedure);
					var reportPart = report.ActivePart;

					workflow.AddEntity(report);

					step.ReportPart = reportPart;
					step.ReportPart.Interpreter = executingStaff;
				}

				// attach linked interpretations to this report
				foreach (var interpretation in linkInterpretations)
				{
					interpretation.LinkTo(step);
				}
			}
Example #3
0
            public List <InterpretationStep> Execute(ReportingProcedureStep step, Staff executingStaff, Staff assignStaff, IWorkflow workflow)
            {
                step.Discontinue();

                // cancel the report part if exists
                if (step.ReportPart != null)
                {
                    step.ReportPart.Cancel();
                }

                var interpretationSteps = new List <InterpretationStep>();

                if (!IsAddendumStep(step))
                {
                    var procedures = new HashedSet <Procedure> {
                        step.Procedure
                    };

                    // if there are linked procedures, schedule a new interpretation for each procedure being reported
                    if (step.ReportPart != null)
                    {
                        procedures.AddAll(step.ReportPart.Report.Procedures);
                    }

                    // schedule new interpretations
                    foreach (var procedure in procedures)
                    {
                        var interpretationStep = new InterpretationStep(procedure);

                        // Bug: #5128 - if the procedure is not document, do not schedule the replacement interpretation step,
                        // since interpretation steps aren't scheduled until documentation is complete.
                        if (procedure.IsDocumented)
                        {
                            interpretationStep.Schedule(procedure.PerformedTime);
                        }

                        if (assignStaff != null)
                        {
                            interpretationStep.Assign(assignStaff);
                        }

                        interpretationSteps.Add(interpretationStep);
                        workflow.AddEntity(interpretationStep);
                    }
                }
                return(interpretationSteps);
            }
Example #4
0
            public InterpretationStep Execute(PublicationStep step, Staff executingStaff, IWorkflow workflow)
            {
                // Discontinue the publication step
                step.Discontinue();

                // Create a new interpreatation step that uses the same report part
                var interpretationStep = new InterpretationStep(step);

                // Reset the verifier
                interpretationStep.ReportPart.Verifier = null;

                // Assign the new step back to me
                interpretationStep.Assign(executingStaff);
                interpretationStep.Schedule(Platform.Time);

                workflow.AddEntity(interpretationStep);
                return(interpretationStep);
            }
Example #5
0
            public InterpretationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
            {
                // Cancel the current step
                step.Discontinue();

                // Create a new interpreatation step that uses the same report part
                var interpretationStep = new InterpretationStep(step);

                // Reset the interpretator
                interpretationStep.ReportPart.Interpreter = executingStaff;

                // Assign the new step to the resident
                interpretationStep.Assign(executingStaff);
                interpretationStep.Start(executingStaff);

                workflow.AddEntity(interpretationStep);
                return(interpretationStep);
            }
Example #6
0
            public InterpretationStep Execute(ReportingProcedureStep step, IWorkflow workflow)
            {
                // Cancel the current step
                step.Discontinue();

                // Create a new interpreatation step that uses the same report part
                var interpretationStep = new InterpretationStep(step);

                // Reset the verifier
                interpretationStep.ReportPart.Verifier = null;

                // Assign the new step to the interpreter
                var interpreter = interpretationStep.ReportPart.Interpreter;

                interpretationStep.Assign(interpreter);
                interpretationStep.Schedule(Platform.Time);

                workflow.AddEntity(interpretationStep);
                return(interpretationStep);
            }
Example #7
0
            public InterpretationStep Execute(Procedure procedure, Staff executingStaff, IWorkflow workflow)
            {
                // the procedure passed in may be any one of the procedures that this report covers
                // ideally, the new interpretation step should be created on the procedure that the
                // publication step was linked to (and only one of the reported procedures should have a publication step)
                procedure = CollectionUtils.SelectFirst(
                    procedure.ActiveReport.Procedures,
                    p => CollectionUtils.Contains(
                        p.ReportingProcedureSteps,
                        ps => ps.Is <PublicationStep>() && ps.State == ActivityStatus.CM))

                            // but if there are no publication steps (i.e. imported data), then just use the procedure that was provided.
                            // See bug #3450
                            ?? procedure;

                var interpretation = new InterpretationStep(procedure);

                interpretation.Assign(executingStaff);
                interpretation.ReportPart             = procedure.ActiveReport.AddAddendum();
                interpretation.ReportPart.Interpreter = executingStaff;
                workflow.AddEntity(interpretation);
                return(interpretation);
            }
Example #8
0
			public InterpretationStep Execute(PublicationStep step, Staff executingStaff, IWorkflow workflow)
			{
				// Discontinue the publication step
				step.Discontinue();

				// Create a new interpreatation step that uses the same report part
				var interpretationStep = new InterpretationStep(step);

				// Reset the verifier
				interpretationStep.ReportPart.Verifier = null;

				// Assign the new step back to me
				interpretationStep.Assign(executingStaff);
				interpretationStep.Schedule(Platform.Time);

				workflow.AddEntity(interpretationStep);
				return interpretationStep;
			}
Example #9
0
			public InterpretationStep Execute(Procedure procedure, Staff executingStaff, IWorkflow workflow)
			{
				// the procedure passed in may be any one of the procedures that this report covers
				// ideally, the new interpretation step should be created on the procedure that the
				// publication step was linked to (and only one of the reported procedures should have a publication step)
				procedure = CollectionUtils.SelectFirst(
					procedure.ActiveReport.Procedures,
					p => CollectionUtils.Contains(
						p.ReportingProcedureSteps,
						ps => ps.Is<PublicationStep>() && ps.State == ActivityStatus.CM))

					// but if there are no publication steps (i.e. imported data), then just use the procedure that was provided.
					// See bug #3450
					?? procedure;

				var interpretation = new InterpretationStep(procedure);
				interpretation.Assign(executingStaff);
				interpretation.ReportPart = procedure.ActiveReport.AddAddendum();
				interpretation.ReportPart.Interpreter = executingStaff;
				workflow.AddEntity(interpretation);
				return interpretation;
			}
Example #10
0
			public InterpretationStep Execute(ReportingProcedureStep step, IWorkflow workflow)
			{
				// Cancel the current step
				step.Discontinue();

				// Create a new interpreatation step that uses the same report part
				var interpretationStep = new InterpretationStep(step);

				// Reset the verifier
				interpretationStep.ReportPart.Verifier = null;

				// Assign the new step to the interpreter
				var interpreter = interpretationStep.ReportPart.Interpreter;
				interpretationStep.Assign(interpreter);
				interpretationStep.Schedule(Platform.Time);

				workflow.AddEntity(interpretationStep);
				return interpretationStep;
			}
Example #11
0
			public InterpretationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
			{
				// Cancel the current step
				step.Discontinue();

				// Create a new interpreatation step that uses the same report part
				var interpretationStep = new InterpretationStep(step);

				// Reset the interpretator
				interpretationStep.ReportPart.Interpreter = executingStaff;

				// Assign the new step to the resident
				interpretationStep.Assign(executingStaff);
				interpretationStep.Start(executingStaff);

				workflow.AddEntity(interpretationStep);
				return interpretationStep;
			}
Example #12
0
			public List<InterpretationStep> Execute(ReportingProcedureStep step, Staff executingStaff, Staff assignStaff, IWorkflow workflow)
			{
				step.Discontinue();

				// cancel the report part if exists
				if (step.ReportPart != null)
					step.ReportPart.Cancel();

				var interpretationSteps = new List<InterpretationStep>();
				if (!IsAddendumStep(step))
				{
					var procedures = new HashedSet<Procedure> { step.Procedure };

					// if there are linked procedures, schedule a new interpretation for each procedure being reported
					if (step.ReportPart != null)
					{
						procedures.AddAll(step.ReportPart.Report.Procedures);
					}

					// schedule new interpretations
					foreach (var procedure in procedures)
					{
						var interpretationStep = new InterpretationStep(procedure);

						// Bug: #5128 - if the procedure is not document, do not schedule the replacement interpretation step,
						// since interpretation steps aren't scheduled until documentation is complete.
						if (procedure.IsDocumented)
							interpretationStep.Schedule(procedure.PerformedTime);

						if (assignStaff != null)
							interpretationStep.Assign(assignStaff);

						interpretationSteps.Add(interpretationStep);
						workflow.AddEntity(interpretationStep);
					}
				}
				return interpretationSteps;
			}