예제 #1
0
 /// <summary>
 /// Adds the specified async request dispatcher.
 /// </summary>
 /// <param name="asyncRequestDispatcher">The async request dispatcher.</param>
 /// <param name="request">The request.</param>
 /// <returns>A <see cref="Agatha.Common.IAsyncRequestDispatcher"/></returns>
 public static IAsyncRequestDispatcher Add(
     this IAsyncRequestDispatcher asyncRequestDispatcher,
     Request request)
 {
     asyncRequestDispatcher.Add(request);
     return(asyncRequestDispatcher);
 }
예제 #2
0
        private void ExecuteSendC32()
        {
            if (_patientKey > 0)
            {
                IAsyncRequestDispatcher requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();
                requestDispatcher.Add(
                    new SendC32Request
                {
                    StaffKey      = _currentContext.Staff.Key,
                    PatientKey    = _patientKey,
                    ToDirectEmail = Mail.To,
                    Subject       = Mail.Subject,
                    Body          = Mail.Message
                });
                IsLoading = true;
                requestDispatcher.ProcessRequests(SendC32RequestDispatcherCompleted, HandleRequestDispatcherException);
            }
            else
            {
                //TODO: Handle This correctly
                IAsyncRequestDispatcher requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();
                requestDispatcher.Add(
                    new SendDirectMessageRequest
                {
                    StaffKey      = _currentContext.Staff.Key,
                    ToDirectEmail = Mail.To,
                    Subject       = Mail.Subject,
                    Body          = Mail.Message
                });
                IsLoading = true;
                requestDispatcher.ProcessRequests(SendC32RequestDispatcherCompleted, HandleRequestDispatcherException);

                FireEventAndClose();
            }
        }
예제 #3
0
 private void AddLookupRequests(IAsyncRequestDispatcher requestDispatcher)
 {
     requestDispatcher.AddLookupValuesRequest("PayorCoverageCacheType");
     requestDispatcher.AddLookupValuesRequest("PayorSubscriberRelationshipCacheType");
     requestDispatcher.AddLookupValuesRequest("StateProvince");
     requestDispatcher.AddLookupValuesRequest("AdministrativeGender");
 }
예제 #4
0
 /// <summary>
 /// Adds the specified async request dispatcher.
 /// </summary>
 /// <param name="asyncRequestDispatcher">The async request dispatcher.</param>
 /// <param name="requestsToAdd">The requests to add.</param>
 /// <returns>A <see cref="Agatha.Common.IAsyncRequestDispatcher"/></returns>
 public static IAsyncRequestDispatcher Add(
     this IAsyncRequestDispatcher asyncRequestDispatcher,
     params Request[] requestsToAdd)
 {
     asyncRequestDispatcher.Add(requestsToAdd);
     return(asyncRequestDispatcher);
 }
        private void DispatchGetHealthcareProvidersDirectoryEntriesRequest()
        {
            IAsyncRequestDispatcher dispatcher = _dispatcherFactory.CreateAsyncRequestDispatcher();

            dispatcher.Add(new GetHealthcareProviderDirectoryEntriesRequest());
            dispatcher.ProcessRequests(RequestCompleted, HandleRequestDispatcherException);
        }
예제 #6
0
 private void RequestLookups(IAsyncRequestDispatcher requestDispatcher)
 {
     requestDispatcher.AddLookupValuesRequest("CapacityType");
     requestDispatcher.AddLookupValuesRequest("ProgramCategory");
     requestDispatcher.AddLookupValuesRequest("AgeGroup");
     requestDispatcher.AddLookupValuesRequest("GenderSpecification");
     requestDispatcher.AddLookupValuesRequest("TreatmentApproach");
 }
예제 #7
0
 /// <summary>
 /// Adds the specified async request dispatcher.
 /// </summary>
 /// <typeparam name="TRequest">The type of the request.</typeparam>
 /// <param name="asyncRequestDispatcher">The async request dispatcher.</param>
 /// <param name="action">The action.</param>
 /// <returns>A <see cref="Agatha.Common.IAsyncRequestDispatcher"/></returns>
 public static IAsyncRequestDispatcher Add <TRequest> (
     this IAsyncRequestDispatcher asyncRequestDispatcher,
     Action <TRequest> action)
     where TRequest : Request, new ()
 {
     asyncRequestDispatcher.Add(action);
     return(asyncRequestDispatcher);
 }
예제 #8
0
 /// <summary>
 /// Adds the lookup values request.
 /// </summary>
 /// <param name="asyncRequestDispatcher">The async request dispatcher.</param>
 /// <param name="lookupName">Name of the lookup.</param>
 /// <returns>A <see cref="Agatha.Common.IAsyncRequestDispatcher"/></returns>
 public static IAsyncRequestDispatcher AddLookupValuesRequest(
     this IAsyncRequestDispatcher asyncRequestDispatcher,
     string lookupName)
 {
     asyncRequestDispatcher.Add(lookupName, new GetLookupValuesRequest {
         Name = lookupName
     });
     return(asyncRequestDispatcher);
 }
예제 #9
0
 private void AddLookups(IAsyncRequestDispatcher requestDispatcher)
 {
     requestDispatcher.AddLookupValuesRequest("PatientContactType");
     requestDispatcher.AddLookupValuesRequest("LegalAuthorizationType");
     requestDispatcher.AddLookupValuesRequest("PatientContactRelationshipType");
     requestDispatcher.AddLookupValuesRequest("StateProvince");
     requestDispatcher.AddLookupValuesRequest("Gender");
     requestDispatcher.AddLookupValuesRequest("Country");
     requestDispatcher.AddLookupValuesRequest("CountyArea");
     requestDispatcher.AddLookupValuesRequest("PatientContactPhoneType");
 }
예제 #10
0
        private void ExecuteTestC32Command()
        {
            Results = string.Empty;
            IAsyncRequestDispatcher requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();

            requestDispatcher.Add(new SendDroolsTestRequest {
                XacmlText = XacmlText, C32Text = C32Text, DroolsServerAddress = DroolsServerAddress
            });
            requestDispatcher.ProcessRequests(HandleSentTestResponse, HandleError);
            IsLoading = true;
        }
예제 #11
0
        private void ExecuteSendNewMail()
        {
            if (_patientKey > 0)
            {
                //TODO: Handle This correctly

                IAsyncRequestDispatcher requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();
                requestDispatcher.Add(
                    new SendC32Request
                {
                    StaffKey      = _currentContext.Staff.Key,
                    PatientKey    = _patientKey,
                    ToDirectEmail = Mail.To,
                    Subject       = Mail.Subject,
                    Body          = Mail.Message
                });
                IsLoading = true;
                requestDispatcher.ProcessRequests(SendC32RequestDispatcherCompleted, HandleRequestDispatcherException);
            }
            else
            {
                byte[] attachmentData     = null;
                string attachmentFileName = null;

                if (SelectedFiles.Count > 0)
                {
                    var    selectedFile = SelectedFiles[0];
                    Stream stream       = selectedFile.OpenRead();
                    var    buffer       = new byte[stream.Length];
                    stream.Read(buffer, 0, (int)stream.Length);
                    stream.Dispose();
                    stream.Close();

                    attachmentData     = buffer;
                    attachmentFileName = selectedFile.Name;
                }

                IAsyncRequestDispatcher requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();
                requestDispatcher.Add(
                    new SendDirectMessageRequest
                {
                    StaffKey           = _currentContext.Staff.Key,
                    ToDirectEmail      = Mail.To,
                    Subject            = Mail.Subject,
                    Body               = Mail.Message,
                    AttachmentData     = attachmentData,
                    AttachmentFileName = attachmentFileName
                });

                IsLoading = true;
                requestDispatcher.ProcessRequests(SendC32RequestDispatcherCompleted, HandleRequestDispatcherException);
            }
        }
        private void RequestSentItemsContent(object sender, EventArgs e)
        {
            _retrieveSentTimer.Stop();

            Debug.WriteLine(string.Format("{0} - Send request to retrieve Sent Items", DateTime.Now.TimeOfDay.ToString()));

            IAsyncRequestDispatcher requestDispatcher = _dispatcherFactory.CreateAsyncRequestDispatcher();

            requestDispatcher.Add(
                "Sent Items",
                new GetImapFolderItemsRequest
            {
                FolderName = "Sent Items", LastId = SentMail.Select(sm => sm.Id).OrderByDescending(i => i).FirstOrDefault()
            });

            IsLoading = true;
            requestDispatcher.ProcessRequests(GetSentItemsCompleted, HandleRequestDispatcherException);
        }
예제 #13
0
 private void AddLookupRequests( IAsyncRequestDispatcher requestDispatcher )
 {
     requestDispatcher.AddLookupValuesRequest ( "PayorCoverageCacheType" );
     requestDispatcher.AddLookupValuesRequest ( "PayorSubscriberRelationshipCacheType" );
     requestDispatcher.AddLookupValuesRequest ( "StateProvince" );
     requestDispatcher.AddLookupValuesRequest ( "AdministrativeGender" );
 }