Пример #1
0
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			// check if the document is already open
			if (ActivateIfAlreadyOpen(item))
				return true;

			ReportingWorklistItemSummary replacementItem = null;

			if (this.Context.GetOperationEnablement("ReviseResidentReport"))
			{
				Platform.GetService(
					delegate(IReportingWorkflowService service)
					{
						var response = service.ReviseResidentReport(new ReviseResidentReportRequest(item.ProcedureStepRef));
						replacementItem = response.ReplacementInterpretationStep;
					});
			}
			else if (this.Context.GetOperationEnablement("ReviseUnpublishedReport"))
			{
				Platform.GetService(
					delegate(IReportingWorkflowService service)
					{
						var response = service.ReviseUnpublishedReport(new ReviseUnpublishedReportRequest(item.ProcedureStepRef));
						replacementItem = response.ReplacementVerificationStep;
					});
			}

			OpenReportEditor(replacementItem);

			return true;
		}
Пример #2
0
		private void OpenProtocolEditor(ReportingWorklistItemSummary item)
		{
			if (ActivateIfAlreadyOpen(item))
				return;

			if (!ProtocollingSettings.Default.AllowMultipleProtocollingWorkspaces)
			{
				var documents = DocumentManager.GetAll<ProtocolDocument>();

				// Show warning message and ask if the existing document should be closed or not
				if (documents.Count > 0)
				{
					var firstDocument = CollectionUtils.FirstElement(documents);
					firstDocument.Open();

					var message = string.Format(SR.MessageProtocollingComponentAlreadyOpened, 
						ProtocolDocument.StripTitle(firstDocument.GetTitle()), 
						ProtocolDocument.StripTitle(ProtocolDocument.GetTitle(item)));
					if (DialogBoxAction.No == this.Context.DesktopWindow.ShowMessageBox(message, MessageBoxActions.YesNo))
						return;		// Leave the existing document open

					// close documents and continue
					CollectionUtils.ForEach(documents, document => document.SaveAndClose());
				}
			}

			// open the protocol editor
			var protocolDocument = new ProtocolDocument(item, GetMode(item), this.Context);
			protocolDocument.Open();

			var selectedFolderType = this.Context.SelectedFolder.GetType();
			protocolDocument.Closed += delegate { DocumentManager.InvalidateFolder(selectedFolderType); };
		}
Пример #3
0
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			if (item.ReportRef == null)
				return false;

			try
			{
				var title = string.Format(SR.FormatPrintReportMessage,
										  Formatting.MrnFormat.Format(item.Mrn),
										  Formatting.PersonNameFormat.Format(item.PatientName),
										  Formatting.AccessionFormat.Format(item.AccessionNumber));

				var component = new PrintReportComponent(item.OrderRef, item.ReportRef);
				ApplicationComponent.LaunchAsDialog(
					this.Context.DesktopWindow,
					component,
					title);
			}
			catch (Exception e)
			{
				ExceptionHandler.Report(e, this.Context.DesktopWindow);
			}

			// always return false - we didn't change any data
			return false;
		}
Пример #4
0
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			// check if the document is already open
			if (ActivateIfAlreadyOpen(item))
				return true;

			OpenProtocolEditor(item);

			return true;
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			Platform.GetService<ITranscriptionWorkflowService>(
				delegate(ITranscriptionWorkflowService service)
				{
					service.CompleteTranscription(new CompleteTranscriptionRequest(item.ProcedureStepRef));
				});

			this.Context.InvalidateFolders(typeof(Folders.Transcription.CompletedFolder));

			return true;
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			try
			{
				ExecuteHelper(item.ProcedureStepRef, null);
			}
			catch (FaultException<SupervisorValidationException>)
			{
				ExecuteHelper(item.ProcedureStepRef, GetSupervisorRef());
			}

			this.Context.InvalidateFolders(typeof(Folders.Reporting.CompletedProtocolFolder));

			return true;
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			try
			{
				ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
					this.Context.DesktopWindow,
					new ReassignComponent(item),
					SR.TitleReassignItem);

				return exitCode == ApplicationComponentExitCode.Accepted;
			}
			catch (Exception e)
			{
				ExceptionHandler.Report(e, this.Context.DesktopWindow);
				return false;
			}
		}
Пример #8
0
		public TranscriptionDocument(ReportingWorklistItemSummary worklistItem, IReportingWorkflowItemToolContext context)
			: base(worklistItem.ProcedureStepRef, context.DesktopWindow)
		{
			_worklistItem = worklistItem;
			_folderName = context.SelectedFolder.Name;

			if(context.SelectedFolder is TranscriptionWorkflowFolder)
			{
				_worklistRef = ((TranscriptionWorkflowFolder)context.SelectedFolder).WorklistRef;
				_worklistClassName = ((TranscriptionWorkflowFolder)context.SelectedFolder).WorklistClassName;
			}
			else
			{
				_worklistRef = null;
				_worklistClassName = null;
			}
		}
Пример #9
0
		public ReportDocument(ReportingWorklistItemSummary worklistItem, bool shouldOpenImages, IReportingWorkflowItemToolContext context)
			: base(worklistItem.ProcedureStepRef, context.DesktopWindow)
		{
			_worklistItem = worklistItem;
			_folderName = context.SelectedFolder.Name;
			_shouldOpenImages = shouldOpenImages;

			if (context.SelectedFolder is ReportingWorkflowFolder)
			{
				_worklistRef = ((ReportingWorkflowFolder)context.SelectedFolder).WorklistRef;
				_worklistClassName = ((ReportingWorkflowFolder)context.SelectedFolder).WorklistClassName;
			}
			else
			{
				_worklistRef = null;
				_worklistClassName = null;
			}
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			TranscriptionRejectReasonComponent component = new TranscriptionRejectReasonComponent();
			if (this.Context.DesktopWindow.ShowDialogBox(component, SR.TitleReason) == DialogBoxAction.Ok)
			{
				Platform.GetService<ITranscriptionWorkflowService>(
					delegate(ITranscriptionWorkflowService service)
					{
						service.RejectTranscription(new RejectTranscriptionRequest(
							item.ProcedureStepRef, 
							component.Reason,
							CreateAdditionalCommentsNote(component.OtherReason)));
					});

				this.Context.InvalidateFolders(typeof (Folders.Transcription.CompletedFolder));
			}
			return true;
		}
Пример #11
0
		public ProtocolDocument(ReportingWorklistItemSummary item, IContinuousWorkflowComponentMode mode, IReportingWorkflowItemToolContext context)
			: base(item.OrderRef, context.DesktopWindow)
		{
			_item = item;
			_mode = mode;
			_folderName = context.SelectedFolder.Name;

			if (context.SelectedFolder is ReportingWorkflowFolder)
			{
				_worklistRef = ((ReportingWorkflowFolder)context.SelectedFolder).WorklistRef;
				_worklistClassName = ((ReportingWorkflowFolder)context.SelectedFolder).WorklistClassName;
			}
			else
			{
				_worklistRef = null;
				_worklistClassName = null;
			}
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			Platform.GetService<IReportingWorkflowService>(
				delegate(IReportingWorkflowService service)
				{
					service.PublishReport(new PublishReportRequest(item.ProcedureStepRef));
				});

			return true;
		}
Пример #13
0
		private static bool ActivateIfAlreadyOpen(ReportingWorklistItemSummary item)
		{
			var document = DocumentManager.Get<ProtocolDocument>(item.OrderRef);
			if (document != null)
			{
				document.Open();
				return true;
			}
			return false;
		}
Пример #14
0
		/// Execute need not be implemented since no actions delegate to the Apply method on the <see cref="WorkflowItemTool{TItem,TContext}"/> 
		/// base class.
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			throw new Exception("The method or operation is not implemented.");
		}
Пример #15
0
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			// check if the document is already open
			if (ActivateIfAlreadyOpen(item))
			{
				// if we want to load images, and the document was already open, ensure the images are visible
				if (_loadImages)
				{
					var document = DocumentManager.Get<ReportDocument>(item.ProcedureStepRef);
					var component = document != null ? document.GetComponent() as ReportingComponent : null;
					if (component != null) component.EnsureImagesAreVisible();
				}
				return true;
			}

			// open the report editor
			OpenReportEditor(item, _loadImages);

			return true;
		}
 public ReviseResidentReportResponse(ReportingWorklistItemSummary replacementInterpretationStep)
 {
     this.ReplacementInterpretationStep = replacementInterpretationStep;
 }
		public ReviseUnpublishedReportResponse(ReportingWorklistItemSummary replacementVerificationStep)
		{
			this.ReplacementVerificationStep = replacementVerificationStep;
		}
Пример #18
0
		private IContinuousWorkflowComponentMode GetMode(ReportingWorklistItemSummary item)
		{
			if (item == null)
				return ProtocollingComponentModes.Review;

			if (CanCreateProtocol(item))
				return ProtocollingComponentModes.Assign;
			
			return CanEditProtocol(item) 
				? ProtocollingComponentModes.Edit 
				: ProtocollingComponentModes.Review;
		}
Пример #19
0
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			ProtocolReasonComponent component = new ProtocolReasonComponent();
			if (this.Context.DesktopWindow.ShowDialogBox(component, "Reason") == DialogBoxAction.Ok)
			{
				try
				{
					ExecuteHelper(item.ProcedureStepRef, component.Reason, component.OtherReason, null);
				}
				catch (FaultException<SupervisorValidationException>)
				{
					ExecuteHelper(item.ProcedureStepRef, component.Reason, component.OtherReason, GetSupervisorRef());
				}

				this.Context.InvalidateFolders(typeof (Folders.Reporting.RejectedProtocolFolder));
			}
			return true;
		}
Пример #20
0
		private bool CanCreateProtocol(ReportingWorklistItemSummary item)
		{
			return this.Context.GetOperationEnablement("StartProtocol");
		}
Пример #21
0
		public static string GetTitle(ReportingWorklistItemSummary item)
		{
			return string.Format("Transcription - {0} - {1}", PersonNameFormat.Format(item.PatientName), MrnFormat.Format(item.Mrn));
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			if (ActivateIfAlreadyOpen(item))
				return true;

			ReportingWorklistItemSummary interpretationWorklistItem = null;

			Platform.GetService<IReportingWorkflowService>(
				delegate(IReportingWorkflowService service)
				{
					CreateAddendumResponse response = service.CreateAddendum(new CreateAddendumRequest(item.ProcedureRef));
					interpretationWorklistItem = response.ReportingWorklistItem;
				});

			this.Context.InvalidateFolders(typeof(Folders.Reporting.DraftFolder));

			if (ActivateIfAlreadyOpen(interpretationWorklistItem))
				return true;

			OpenReportEditor(interpretationWorklistItem);

			return true;
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			// show PD dialog if required
			//return PreliminaryDiagnosis.ShowDialogOnVerifyIfRequired(item, this.Context.DesktopWindow,
			//	delegate
			//	{
					//try
					//{
						try
						{
							ExecuteHelper(item.ProcedureStepName, item.ProcedureStepRef, null);
						}
						catch (FaultException<SupervisorValidationException>)
						{
							ExecuteHelper(item.ProcedureStepName, item.ProcedureStepRef, GetSupervisorRef());
						}
					//}
					//catch (Exception e)
					//{
					//    ExceptionHandler.Report(e, this.Context.DesktopWindow);
					//}

					this.Context.InvalidateFolders(typeof(Folders.Reporting.VerifiedFolder));
			//	});
			return true;
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			string msg = item.IsAddendumStep ? SR.MessageConfirmDiscardSelectedAddendum : SR.MessageConfirmDiscardSelectedReport;

			if (this.Context.DesktopWindow.ShowMessageBox(msg, MessageBoxActions.OkCancel)
				== DialogBoxAction.Cancel)
				return false;


			Platform.GetService<IReportingWorkflowService>(
				delegate(IReportingWorkflowService service)
				{
					service.CancelReportingStep(new CancelReportingStepRequest(item.ProcedureStepRef, null));
				});

			// no point in invalidating "to be reported" folder because its communal

			return true;
		}
Пример #25
0
		private bool CanEditProtocol(ReportingWorklistItemSummary item)
		{
			// there is no specific workflow operation for editing a previously created draft,
			// so we enable the tool if it looks like a draft and SaveReport is enabled
			return this.Context.GetOperationEnablement("SaveProtocol") && item.ActivityStatus.Code == StepState.InProgress;
		}
Пример #26
0
		public ReviseResidentReportResponse(ReportingWorklistItemSummary replacementInterpretationStep)
		{
			this.ReplacementInterpretationStep = replacementInterpretationStep;
		}
Пример #27
0
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			Platform.GetService((IReportingWorkflowService service) =>
				service.ReturnToInterpreter(new ReturnToInterpreterRequest(item.ProcedureStepRef)));

			return true;
		}
Пример #28
0
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			if (this.Context.DesktopWindow.ShowMessageBox(SR.MessageConfirmDiscardSelectedProtocol, MessageBoxActions.OkCancel)
				== DialogBoxAction.Cancel)
				return false;

			Platform.GetService<IProtocollingWorkflowService>(
				delegate(IProtocollingWorkflowService service)
				{
					service.DiscardProtocol(new DiscardProtocolRequest(item.ProcedureStepRef));
				});

			return true;
		}
		protected override bool Execute(ReportingWorklistItemSummary item)
		{
			// check if the document is already open
			if (ActivateIfAlreadyOpen(item))
				return true;

			// open the report editor
			OpenTranscriptionEditor(item);

			return true;
		}
Пример #30
0
 public ReviseUnpublishedReportResponse(ReportingWorklistItemSummary replacementVerificationStep)
 {
     this.ReplacementVerificationStep = replacementVerificationStep;
 }
		public ReviseSubmittedProtocolResponse(ReportingWorklistItemSummary replacementStep)
		{
			this.ReplacementStep = replacementStep;
		}