示例#1
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            if (DataContext == null)
            {
                DataContext = new ViewModel();
            }
            var model = DataContext as ViewModel;

            model.Waiting.Clear();
            model.Expecting.Clear();
            Dispatcher.Invoke(async() =>
            {
                await model.Initialize(Dispatcher);

                // Start the FHIR server
                FhirAppointmentReader.OnStarted      += MessageProcessing_OnStarted;
                FhirAppointmentReader.OnStopped      += MessageProcessing_OnStopped;
                FhirAppointmentReader.OnVisitStarted += MessageProcessing_OnVisitStarted;
                FhirAppointmentReader.StartServer(model.Settings.ExamplesServer, model.Settings.PMSProfileName, model.Settings.PMSLicenseKey);

                model.serverStatuses.Oridashi.Status = ServerStatusEnum.Starting;
                model.serverStatuses.Oridashi.Start  = new ServerStatusCommand(model.serverStatuses.Oridashi, ServerStatusEnum.Stopped, () =>
                {
                    model.serverStatuses.Oridashi.Status = ServerStatusEnum.Starting;
                    FhirAppointmentReader.StartServer(model.Settings.ExamplesServer, model.Settings.PMSProfileName, model.Settings.PMSLicenseKey);
                });
                model.serverStatuses.Oridashi.Stop = new ServerStatusCommand(model.serverStatuses.Oridashi, ServerStatusEnum.Running, async() =>
                {
                    model.serverStatuses.Oridashi.Status = ServerStatusEnum.Stopping;
                    await FhirAppointmentReader.StopServer();
                });
            });
        }
 public void Initialize()
 {
     // Start the FHIR Server
     FhirAppointmentReader.StartServer(true, "", "");
 }