コード例 #1
0
        public void Test_Complete_NullReport()
        {
            Procedure          procedure     = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            procedureStep.Complete();
        }
コード例 #2
0
        public void Test_Constructor_Procedure()
        {
            Procedure          procedure     = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            Assert.IsNull(procedureStep.ReportPart);
        }
コード例 #3
0
        public void Test_Name()
        {
            Procedure          procedure     = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            Assert.AreEqual("Interpretation", procedureStep.Name);
        }
コード例 #4
0
		/// <summary>
		/// Obtains a set of interpretation steps that are candidates for linked reporting to the specified interpretation step.
		/// </summary>
		/// <param name="step"></param>
		/// <param name="interpreter"></param>
		/// <returns></returns>
		public IList<InterpretationStep> GetLinkedInterpretationCandidates(InterpretationStep step, Staff interpreter)
		{
			var q = this.GetNamedHqlQuery("linkedInterpretationCandidates");
			q.SetParameter(0, step);
			q.SetParameter(1, interpreter);
			return q.List<InterpretationStep>();
		}
コード例 #5
0
        public void Test_LinkTo_NullReport()
        {
            InterpretationStep ps1 = new InterpretationStep(new Procedure());
            InterpretationStep ps2 = new InterpretationStep(new Procedure());

            ps1.LinkTo(ps2);
        }
コード例 #6
0
        public void Test_Constructor_Procedure()
        {
            Procedure procedure = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            Assert.IsNull(procedureStep.ReportPart);
        }
コード例 #7
0
        public void Test_Name()
        {
            Procedure procedure = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            Assert.AreEqual("Interpretation", procedureStep.Name);
        }
コード例 #8
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);
                }
            }
コード例 #9
0
        private InterpretationStep GetPendingInterpretationStep(Procedure procedure)
        {
            // bug #3859: don't want to create an interpretation step for a completed procedure
            // (migrated data may not have any interpretation steps even for a completed procedure)
            if (procedure.IsTerminated)
            {
                return(null);
            }

            var interpretationSteps = CollectionUtils.Select(
                procedure.ProcedureSteps,
                ps => ps.Is <InterpretationStep>());

            // no interp step, so create one
            if (interpretationSteps.Count == 0)
            {
                var interpretationStep = new InterpretationStep(procedure);
                this.PersistenceContext.Lock(interpretationStep, DirtyState.New);
                return(interpretationStep);
            }

            // may be multiple interp steps (eg maybe one was started and discontinued), so find the one that is scheduled
            var pendingStep = CollectionUtils.SelectFirst(
                interpretationSteps,
                ps => ps.State == ActivityStatus.SC);

            return(pendingStep == null ? null : pendingStep.As <InterpretationStep>());
        }
コード例 #10
0
ファイル: Operations.cs プロジェクト: nhannd/Xian
			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);
				}
			}
コード例 #11
0
        public void Test_Constructor_PreviousStep()
        {
            InterpretationStep previousStep = new InterpretationStep(new Procedure());
            PublicationStep    newStep      = new PublicationStep(previousStep);

            Assert.AreEqual(0, newStep.FailureCount);
            Assert.IsNull(newStep.LastFailureTime);
        }
コード例 #12
0
        /// <summary>
        /// Obtains a set of interpretation steps that are candidates for linked reporting to the specified interpretation step.
        /// </summary>
        /// <param name="step"></param>
        /// <param name="interpreter"></param>
        /// <returns></returns>
        public IList <InterpretationStep> GetLinkedInterpretationCandidates(InterpretationStep step, Staff interpreter)
        {
            var q = this.GetNamedHqlQuery("linkedInterpretationCandidates");

            q.SetParameter(0, step);
            q.SetParameter(1, interpreter);
            return(q.List <InterpretationStep>());
        }
コード例 #13
0
ファイル: PublicationStepTests.cs プロジェクト: nhannd/Xian
        public void Test_Constructor_PreviousStep()
        {
            InterpretationStep previousStep = new InterpretationStep(new Procedure());
            PublicationStep newStep = new PublicationStep(previousStep);

            Assert.AreEqual(0, newStep.FailureCount);
            Assert.IsNull(newStep.LastFailureTime);
        }
コード例 #14
0
        public void Test_Reassign()
        {
            InterpretationStep      previousStep = new InterpretationStep(new Procedure());
            TranscriptionReviewStep reviewStep   = new TranscriptionReviewStep(previousStep);

            TranscriptionReviewStep newStep = (TranscriptionReviewStep)reviewStep.Reassign(new Staff());

            Assert.AreEqual(reviewStep, newStep);
            Assert.IsInstanceOfType(typeof(TranscriptionReviewStep), newStep);
        }
コード例 #15
0
        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);
        }
コード例 #16
0
        public void Test_Reassign()
        {
            Procedure          procedure     = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            InterpretationStep newStep = (InterpretationStep)procedureStep.Reassign(new Staff());

            Assert.AreEqual(procedureStep, newStep);
            Assert.IsInstanceOfType(typeof(InterpretationStep), newStep);
        }
コード例 #17
0
        public void Test_Reassign()
        {
            InterpretationStep previousStep  = new InterpretationStep(new Procedure());
            PublicationStep    procedureStep = new PublicationStep(previousStep);

            PublicationStep newStep = (PublicationStep)procedureStep.Reassign(new Staff());

            Assert.AreEqual(procedureStep, newStep);
            Assert.IsInstanceOf(typeof(PublicationStep), newStep);
        }
コード例 #18
0
        public void Test_Suspend()
        {
            Procedure          procedure     = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            Assert.AreEqual(ActivityStatus.SC, procedureStep.State);

            procedureStep.Suspend();

            Assert.AreEqual(ActivityStatus.SU, procedureStep.State);
        }
コード例 #19
0
 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();
 }
コード例 #20
0
        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();
        }
コード例 #21
0
        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);
        }
コード例 #22
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);
            }
コード例 #23
0
        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);
        }
コード例 #24
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);
            }
コード例 #25
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);
            }
コード例 #26
0
        public void Test_Complete()
        {
            Procedure  procedure  = new Procedure();
            Report     report     = new Report(procedure);
            ReportPart reportPart = new ReportPart(report, 0);

            // This modality procedure step is created such that when the procedure tries to update its status
            // the detection of no ModalityProcedureSteps makes any procedure trying to update its status set itself
            // to discontinued, which for this test, is undesirable, this situation will probably never happen
            // in practice.
            ModalityProcedureStep modalityStep = new ModalityProcedureStep(procedure, "New modality.", new Modality());

            InterpretationStep previousStep = new InterpretationStep(procedure);

            previousStep.ReportPart = reportPart;
            PublicationStep procedureStep = new PublicationStep(previousStep);

            procedureStep.Start(new Staff());

            Assert.AreEqual(ActivityStatus.IP, procedureStep.State);
            Assert.AreEqual(0, procedureStep.ReportPart.Index);
            Assert.AreEqual(ReportPartStatus.D, procedureStep.ReportPart.Status);
            Assert.IsTrue(procedureStep.AllProcedures.TrueForAll(
                              delegate(Procedure p)
            {
                return(p.Status == ProcedureStatus.IP);
            }));

            procedureStep.Complete();

            Assert.AreEqual(ActivityStatus.CM, procedureStep.State);
            Assert.AreEqual(ReportPartStatus.F, procedureStep.ReportPart.Status);
            Assert.IsTrue(procedureStep.AllProcedures.TrueForAll(
                              delegate(Procedure p)
            {
                return(p.Status == ProcedureStatus.CM);
            }));
            Assert.IsTrue(procedureStep.AllProcedures.TrueForAll(
                              delegate(Procedure p)
            {
                return(p.EndTime == procedureStep.EndTime);
            }));
        }
コード例 #27
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);
            }
コード例 #28
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);
            }
コード例 #29
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;
			}
コード例 #30
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;
			}
コード例 #31
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;
			}
コード例 #32
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;
			}
コード例 #33
0
        public void Test_Suspend()
        {
            Procedure procedure = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);
            Assert.AreEqual(ActivityStatus.SC, procedureStep.State);

            procedureStep.Suspend();

            Assert.AreEqual(ActivityStatus.SU, procedureStep.State);
        }
コード例 #34
0
        public void Test_Complete_NullReport()
        {
            Procedure procedure = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            procedureStep.Complete();
        }
コード例 #35
0
        public void Test_Reassign()
        {
            Procedure procedure = new Procedure();
            InterpretationStep procedureStep = new InterpretationStep(procedure);

            InterpretationStep newStep = (InterpretationStep)procedureStep.Reassign(new Staff());

            Assert.AreEqual(procedureStep, newStep);
            Assert.IsInstanceOfType(typeof (InterpretationStep), newStep);
        }
コード例 #36
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;
			}
コード例 #37
0
ファイル: PublicationStepTests.cs プロジェクト: nhannd/Xian
        public void Test_Complete()
        {
            Procedure procedure = new Procedure();
            Report report = new Report(procedure);
            ReportPart reportPart = new ReportPart(report, 0);

            // This modality procedure step is created such that when the procedure tries to update its status
            // the detection of no ModalityProcedureSteps makes any procedure trying to update its status set itself
            // to discontinued, which for this test, is undesirable, this situation will probably never happen
            // in practice.
            ModalityProcedureStep modalityStep = new ModalityProcedureStep(procedure, "New modality.", new Modality());

            InterpretationStep previousStep = new InterpretationStep(procedure);
            previousStep.ReportPart = reportPart;
            PublicationStep procedureStep = new PublicationStep(previousStep);
            
            procedureStep.Start(new Staff());

            Assert.AreEqual(ActivityStatus.IP, procedureStep.State);
            Assert.AreEqual(0, procedureStep.ReportPart.Index);
            Assert.AreEqual(ReportPartStatus.D, procedureStep.ReportPart.Status);
            Assert.IsTrue(procedureStep.AllProcedures.TrueForAll(
                delegate(Procedure p)
                {
                    return p.Status == ProcedureStatus.IP;
                }));

            procedureStep.Complete();

            Assert.AreEqual(ActivityStatus.CM, procedureStep.State);
            Assert.AreEqual(ReportPartStatus.F, procedureStep.ReportPart.Status);
            Assert.IsTrue(procedureStep.AllProcedures.TrueForAll(
                delegate(Procedure p)
                {
                    return p.Status == ProcedureStatus.CM;
                }));
            Assert.IsTrue(procedureStep.AllProcedures.TrueForAll(
                delegate(Procedure p)
                {
                    return p.EndTime == procedureStep.EndTime;
                }));
        }
コード例 #38
0
 public void Test_LinkTo_NullReport()
 {
     InterpretationStep ps1 = new InterpretationStep(new Procedure());
     InterpretationStep ps2 = new InterpretationStep(new Procedure());
     ps1.LinkTo(ps2);
 }