Ejemplo n.º 1
0
        public async void DiscardEncounter(EncounterTemplate encounterTemplate)
        {
            try
            {
                var result = await _dialogService.ConfirmAction("Are you sure ?", "Delete this Encounter");

                if (result)
                {
                    if (_dashboardService.CanRemoveEncounter(encounterTemplate.Id, Client.Id,
                                                             encounterTemplate.EncounterTypeId))
                    {
                        // validate Encounter
                        _dashboardService.RemoveEncounter(encounterTemplate.Id);
                        Parent.Modules = _dashboardService.LoadModules();
                    }
                    else
                    {
                        if (Terms.PreTest == encounterTemplate.EncounterTypeId)
                        {
                            _dialogService.Alert("Please Delete Testing Encounters first", "Encounter");
                        }
                        if (Terms.Testing == encounterTemplate.EncounterTypeId)
                        {
                            _dialogService.Alert("Please Delete Referral and Linkage Encounters first", "Encounter");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MvxTrace.Error(e.Message);
                _dialogService.Alert(e.Message, "Delete this Encounter");
            }
        }
        public async void RemoveRelationship(RelationshipTemplate template)
        {
            try
            {
                var result = await _dialogService.ConfirmAction("Are you sure ?", "Remove Relationship");

                if (result)
                {
                    _dashboardService.RemoveRelationShip(template.Id);
                    Client = _dashboardService.LoadClient(Client.Id);
                }
            }
            catch (Exception e)
            {
                MvxTrace.Error(e.Message);
                _dialogService.Alert(e.Message, "Remove Relationship");
            }
        }
Ejemplo n.º 3
0
        public async void DeleteTrace(ObsPartnerTraceResult test)
        {
            if (null != test)
            {
                var result = await _dialogService.ConfirmAction("Are you sure ?", "Delete this Trace");

                if (result)
                {
                    _tracingService.DeleteTest(test, Client.Id, IndexClient.Id);
                    Referesh(test.EncounterId);
                }
            }
        }
Ejemplo n.º 4
0
        public async void DeleteTest(ObsTestResult testResult)
        {
            if (null != testResult)
            {
                var result = await _dialogService.ConfirmAction("Are you sure ?", "Delete this Test");

                if (result)
                {
                    _testingService.DeleteTest(testResult, Parent.Client.Id);
                    Parent.Referesh(testResult.EncounterId);
                }
            }
        }
Ejemplo n.º 5
0
        public async void DeleteTrace(ObsTraceResult testResult)
        {
            if (null != testResult)
            {
                var result = await _dialogService.ConfirmAction("Are you sure ?", "Delete this Trace");

                if (result)
                {
                    _linkageService.DeleteTest(testResult, ParentViewModel.Client.Id);
                    Referesh(testResult.EncounterId);
                }
            }
        }