Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VisitEventArgs"/> class.
 /// </summary>
 /// <param name="visitDto">The visit dto.</param>
 public VisitEventArgs( VisitDto visitDto )
 {
     VisitDto = visitDto;
 }
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 ();
        }
Exemplo n.º 3
0
        private void HandleSaveVisitDtoCompleted( ReceivedResponses receivedResponses )
        {
            IsLoading = false;

            var response = receivedResponses.Get<DtoResponse<VisitDto>> ();
            var currentVisit = response.DataTransferObject;

            Visit = currentVisit;
            RaiseVisitChanged ();
        }
Exemplo n.º 4
0
        private void ClearVisitInfo()
        {
            if (RegionManager.Regions.ContainsRegionWithName("VisitRegion"))
            {
                var activitiesRegion = RegionManager.Regions["VisitRegion"];

                // Retain a reference to the Context before removing the View from the Region.
                // This is necessary because Prism sets the Region Context to null when a view is removed from it.
                var regionContext = activitiesRegion.Context;

                foreach ( var view in activitiesRegion.Views )
                {
                    if ( view is FrameworkElement && ( view as FrameworkElement ).DataContext is IActivityViewModel )
                    {
                        activitiesRegion.Remove ( view );
                    }
                }

                activitiesRegion.Context = regionContext;
            }

            Visit = null;
            ProblemList = null;
            _statusQuestionAsked = false;
        }