Exemplo n.º 1
0
 private void ExecuteGoToActivityCommand(VisitActivityDto visitActivityDto)
 {
     if (visitActivityDto != null && visitActivityDto.ActivityTypeWellKnownName != null)
     {
         if (visitActivityDto.VisitStatusWellKnownName != VisitStatus.CheckedIn)
         {
             _userDialogService.ShowDialog(
                 "This activity is associated with a Visit that is not 'Checked-In' so the Activity will be in read-only mode.",
                 string.Empty,
                 UserDialogServiceOptions.Ok);
         }
         var viewName = _activityTypeToViewMapper.GetViewNameFromActivityType(visitActivityDto.ActivityTypeWellKnownName);
         _popupService.ShowPopup(
             viewName,
             "EditActivity",
             string.Empty,
             new[]
         {
             new KeyValuePair <string, string> ("VisitStatusWellKnownName", visitActivityDto.VisitStatusWellKnownName),
             new KeyValuePair <string, string> ("IsCurrentActivity", "true"),
             new KeyValuePair <string, string> ("ActivityKey", visitActivityDto.ActivityKey.ToString()),
             new KeyValuePair <string, string> ("PatientKey", visitActivityDto.PatientKey.ToString())
         },
             true);
     }
 }
Exemplo n.º 2
0
        private void HandleGetVisitByKeyCompleted(ReceivedResponses receivedResponses)
        {
            var response = receivedResponses.Get <DtoResponse <VisitDto> > ();

            var activities = response.DataTransferObject.Activities.OrderBy(a => a.ActivityType.Key);

            // Load the views inside Activity Region based on the list of activities for the current visit.
            foreach (var activity in activities)
            {
                var activityViewName = _activityTypeToViewMapperService.GetViewNameFromActivityType(activity.ActivityType.WellKnownName);

                // Current activity denotes one that caused navigation to the this view model.
                // For example, via a Dashboard double click on a grid row denoting the activity and subsequent ExecuteGoToVisitCommand execution.
                var isCurrentActivity = activity.Key == _currentActivityKey;

                if (!string.IsNullOrWhiteSpace(activityViewName))
                {
                    _navigationService.Navigate(
                        RegionManager,
                        "VisitRegion",
                        activityViewName,
                        "EditActivity",
                        new[]
                    {
                        new KeyValuePair <string, string> ("IsCurrentActivity", isCurrentActivity.ToString()),
                        new KeyValuePair <string, string> ("ActivityKey", activity.Key.ToString()),
                        new KeyValuePair <string, string> ("PatientKey", _patientKey.ToString())
                    });
                }
            }

            Visit       = response.DataTransferObject;
            ProblemList = Visit.Problems;
            IsLoading   = false;

            CheckStatus();
        }