コード例 #1
0
            public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
            {
                UpdateStep(step, executingStaff);

                var verificationStep = new VerificationStep(step);

                verificationStep.Assign(executingStaff);
                verificationStep.Complete(executingStaff);
                workflow.AddEntity(verificationStep);

                var publicationStep = CreateScheduledPublicationStep(executingStaff, verificationStep);

                workflow.AddEntity(publicationStep);

                return(publicationStep);
            }
コード例 #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);
                }
            }
コード例 #3
0
            public PublicationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
            {
                // this operation is legal even if the step was never started, therefore need to supply the performer
                step.Complete(executingStaff);

                var publicationStep = CreateScheduledPublicationStep(executingStaff, step);

                workflow.AddEntity(publicationStep);

                return(publicationStep);
            }
コード例 #4
0
            public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
            {
                UpdateStep(step, executingStaff);

                var verificationStep = new VerificationStep(step);

                // supervisor can be null, in which case the verification step is unassigned.
                verificationStep.Assign(step.ReportPart.Supervisor);

                workflow.AddEntity(verificationStep);
                return(verificationStep);
            }
コード例 #5
0
        public ModalityPerformedProcedureStep Execute(IList <ModalityProcedureStep> modalitySteps, DateTime?startTime, Staff technologist, IWorkflow workflow)
        {
            if (modalitySteps.Count == 0)
            {
                throw new WorkflowException("At least one procedure step is required.");
            }

            // validate that each mps being started is being performed on the same modality
            if (!CollectionUtils.TrueForAll(modalitySteps, step => step.Modality.Equals(modalitySteps[0].Modality)))
            {
                throw new WorkflowException("Procedure steps cannot be started together because they are not on the same modality.");
            }

            // create an mpps
            var mpps = new ModalityPerformedProcedureStep(technologist, startTime);

            workflow.AddEntity(mpps);

            foreach (var mps in modalitySteps)
            {
                mps.Start(technologist, startTime);
                mps.AddPerformedStep(mpps);

                //note: this feature was disabled by request (see #2138) - they want to enforce explicit check-in
                //AutoCheckIn(mps.Procedure, startTime);
            }

            // Create Documentation Step for each RP that has an MPS started by this service call
            foreach (var step in modalitySteps)
            {
                if (step.Procedure.DocumentationProcedureStep == null)
                {
                    ProcedureStep docStep = new DocumentationProcedureStep(step.Procedure);
                    docStep.Start(technologist, startTime);
                    workflow.AddEntity(docStep);
                }
            }

            return(mpps);
        }
コード例 #6
0
            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);
            }
コード例 #7
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);
            }
コード例 #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);
            }
コード例 #9
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);
            }
コード例 #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);
            }
コード例 #11
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);
            }
コード例 #12
0
ファイル: Operations.cs プロジェクト: nhannd/Xian
		public ModalityPerformedProcedureStep Execute(IList<ModalityProcedureStep> modalitySteps, DateTime? startTime, Staff technologist, IWorkflow workflow)
		{
			if (modalitySteps.Count == 0)
				throw new WorkflowException("At least one procedure step is required.");

			// validate that each mps being started is being performed on the same modality
			if (!CollectionUtils.TrueForAll(modalitySteps, step => step.Modality.Equals(modalitySteps[0].Modality)))
			{
				throw new WorkflowException("Procedure steps cannot be started together because they are not on the same modality.");
			}

			// create an mpps
			var mpps = new ModalityPerformedProcedureStep(technologist, startTime);
			workflow.AddEntity(mpps);

			foreach (var mps in modalitySteps)
			{
				mps.Start(technologist, startTime);
				mps.AddPerformedStep(mpps);

				//note: this feature was disabled by request (see #2138) - they want to enforce explicit check-in
				//AutoCheckIn(mps.Procedure, startTime);
			}

			// Create Documentation Step for each RP that has an MPS started by this service call
			foreach (var step in modalitySteps)
			{
				if (step.Procedure.DocumentationProcedureStep == null)
				{
					ProcedureStep docStep = new DocumentationProcedureStep(step.Procedure);
					docStep.Start(technologist, startTime);
					workflow.AddEntity(docStep);
				}
			}

			return mpps;
		}
コード例 #13
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
			{
				UpdateStep(step, executingStaff);

				var verificationStep = new VerificationStep(step);

				// supervisor can be null, in which case the verification step is unassigned.
				verificationStep.Assign(step.ReportPart.Supervisor);

				workflow.AddEntity(verificationStep);
				return verificationStep;
			}
コード例 #14
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			public ReportingProcedureStep Execute(ReportingProcedureStep step, Staff executingStaff, IWorkflow workflow)
			{
				UpdateStep(step, executingStaff);

				var verificationStep = new VerificationStep(step);
				verificationStep.Assign(executingStaff);
				verificationStep.Complete(executingStaff);
				workflow.AddEntity(verificationStep);

				var publicationStep = CreateScheduledPublicationStep(executingStaff, verificationStep);
				workflow.AddEntity(publicationStep);

				return publicationStep;
			}
コード例 #15
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			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;
			}
コード例 #16
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			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;
			}
コード例 #17
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			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;
			}
コード例 #18
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			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);
				}
			}
コード例 #19
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			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;
			}
コード例 #20
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			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;
			}
コード例 #21
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			public PublicationStep Execute(VerificationStep step, Staff executingStaff, IWorkflow workflow)
			{
				// this operation is legal even if the step was never started, therefore need to supply the performer
				step.Complete(executingStaff);

				var publicationStep = CreateScheduledPublicationStep(executingStaff, step);
				workflow.AddEntity(publicationStep);

				return publicationStep;
			}
コード例 #22
0
ファイル: Operations.cs プロジェクト: m-berkani/ClearCanvas
			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;
			}