Exemplo n.º 1
0
        private async void GetActionPlans_OnClicked(object sender, EventArgs e)
        {
            PersonInfo personInfo = await _connection.GetPersonInfoAsync();

            IMicrosoftHealthVaultRestApi restClient = _connection.CreateMicrosoftHealthVaultRestApi(personInfo.SelectedRecord.Id);

            var actionPlansResponse = await restClient.ActionPlans.GetAsync();

            OutputLabel.Text = $"There are {actionPlansResponse.Plans.Count} action plans";
        }
        public override async Task OnNavigateToAsync()
        {
            await LoadAsync(async() =>
            {
                PersonInfo personInfo = await _connection.GetPersonInfoAsync();

                IMicrosoftHealthVaultRestApi restApi = _connection.CreateMicrosoftHealthVaultRestApi(personInfo.SelectedRecord.Id);
                var response = await restApi.ActionPlans.GetAsync();

                Plans = response.Plans.Where(p => p.Status == "Recommended" || p.Status == "InProgress");

                await base.OnNavigateToAsync();
            });
        }
Exemplo n.º 3
0
        public async Task SimpleActionPlans()
        {
            IHealthVaultSodaConnection connection = HealthVaultConnectionFactory.Current.GetOrCreateSodaConnection(Constants.Configuration);
            PersonInfo personInfo = await connection.GetPersonInfoAsync();

            HealthRecordInfo record = personInfo.SelectedRecord;

            var restClient = connection.CreateMicrosoftHealthVaultRestApi(record.Id);

            await RemoveAllActionPlansAsync(restClient);

            Guid objectiveId = Guid.NewGuid();
            await restClient.ActionPlans.CreateAsync(CreateWeightActionPlan(objectiveId));

            ActionPlansResponseActionPlanInstance plans = await restClient.ActionPlans.GetAsync();

            Assert.AreEqual(1, plans.Plans.Count);

            ActionPlanInstance planInstance = plans.Plans[0];

            Assert.AreEqual(objectiveId, planInstance.Objectives[0].Id);
            Assert.AreEqual(ObjectiveName, planInstance.Objectives[0].Name);
            Assert.AreEqual(PlanName, planInstance.Name);
        }