Ejemplo n.º 1
0
        public override void Stop()
        {
            if (_bannerHost != null)
            {
                _bannerHost.StopComponent();
                _bannerHost = null;
            }

            if (_rightHandComponentContainerHost != null)
            {
                _rightHandComponentContainerHost.StopComponent();
                _rightHandComponentContainerHost = null;
            }

            if (_transcriptionEditorHost != null)
            {
                _transcriptionEditorHost.StopComponent();

                if (_transcriptionEditorHost is IDisposable)
                {
                    ((IDisposable)_transcriptionEditorHost).Dispose();
                    _transcriptionEditor = null;
                }
            }

            base.Stop();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called by the host to initialize the application component.
        /// </summary>
        public override void Start()
        {
            this.Validation.Add(new ValidationRule("Supervisor",
                                                   delegate
            {
                var ok = _supervisor != null || SubmitForReviewVisible == false;
                return(new ValidationResult(ok, SR.MessageChooseRadiologist));
            }));

            //// create supervisor lookup handler, using filters supplied in application settings
            var filters    = TranscriptionSettings.Default.SupervisorStaffTypeFilters;
            var staffTypes = string.IsNullOrEmpty(filters)
                                ? new string[] { }
                                : CollectionUtils.Map <string, string>(filters.Split(','), s => s.Trim()).ToArray();

            _supervisorLookupHandler = new StaffLookupHandler(this.Host.DesktopWindow, staffTypes);

            StartTranscribingWorklistItem();

            _bannerHost = new ChildComponentHost(this.Host, new BannerComponent(this.WorklistItem));
            _bannerHost.StartComponent();

            _rightHandComponentContainer = new TabComponentContainer
            {
                ValidationStrategy = new AllComponentsValidationStrategy()
            };

            _orderComponent = new ReportingOrderDetailViewComponent(this.WorklistItem.PatientRef, this.WorklistItem.OrderRef);
            _rightHandComponentContainer.Pages.Add(new TabPage("Order", _orderComponent));

            _rightHandComponentContainerHost = new ChildComponentHost(this.Host, _rightHandComponentContainer);
            _rightHandComponentContainerHost.StartComponent();

            // check for a report editor provider.  If not found, use the default one
            var transcriptionEditorProvider = CollectionUtils.FirstElement <ITranscriptionEditorProvider>(
                new TranscriptionEditorProviderExtensionPoint().CreateExtensions());

            _transcriptionEditor = transcriptionEditorProvider == null
                                ? new TranscriptionEditorComponent(new TranscriptionEditorContext(this))
                                : transcriptionEditorProvider.GetEditor(new TranscriptionEditorContext(this));
            _transcriptionEditorHost = new ChildComponentHost(this.Host, _transcriptionEditor.GetComponent());
            _transcriptionEditorHost.StartComponent();
            _transcriptionEditorHost.Component.ModifiedChanged += ((sender, args) => this.Modified = this.Modified || _transcriptionEditorHost.Component.Modified);

            base.Start();
        }