GetClient() public static method

public static GetClient ( ) : Microsoft.Health.HealthClientApplication
return Microsoft.Health.HealthClientApplication
Ejemplo n.º 1
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();
            ServiceInfo             s         = clientApp.ApplicationConnection.GetServiceDefinition();

            WriteObject(s);
        }
Ejemplo n.º 2
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();

            List <PersonInfo> authorizedPeople = new List <PersonInfo>(clientApp.ApplicationConnection.GetAuthorizedPeople());

            // Create an authorized connection for each person on the
            //   list.
            HealthClientAuthorizedConnection authConnection = clientApp.CreateAuthorizedConnection(
                authorizedPeople[0].PersonId);

            // Use the authorized connection to read the user's default
            //   health record.
            HealthRecordAccessor access = new HealthRecordAccessor(
                authConnection, authConnection.GetPersonInfo().GetSelfRecord().Id);

            // Search the health record for basic demographic
            //   information.
            //   Most user records contain an item of this type.
            HealthRecordSearcher search = access.CreateSearcher();
            HealthRecordFilter   filter = new HealthRecordFilter(
                HvShellUtilities.NameToTypeId(Type));

            search.Filters.Add(filter);

            foreach (Object o in search.GetMatchingItems()[0])
            {
                WriteObject(o);
            }
        }
Ejemplo n.º 3
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();

            if (clientApp.GetApplicationInfo() != null)
            {
                List <PersonInfo> authorizedPeople =
                    new List <PersonInfo>(clientApp.ApplicationConnection.GetAuthorizedPeople());
                WriteObject(authorizedPeople);
            }
        }
Ejemplo n.º 4
0
 protected override void ProcessRecord()
 {
     if (string.IsNullOrEmpty(ThingType))
     {
         HealthClientApplication clientApp = HvShellUtilities.GetClient();
         WriteObject(clientApp.ApplicationConnection.GetVocabulary("thing-types"));
     }
     else
     {
         WriteObject(
             ItemTypeManager.GetHealthRecordItemTypeDefinition(
                 new Guid(ThingType), HvShellUtilities.GetClient().ApplicationConnection)
             );
     }
 }
Ejemplo n.º 5
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp        = HvShellUtilities.GetClient();
            List <PersonInfo>       authorizedPeople = new List <PersonInfo>
                                                           (clientApp.ApplicationConnection.GetAuthorizedPeople());
            // Create an authorized connection for each person on the
            //   list.
            HealthClientAuthorizedConnection authConnection = clientApp.CreateAuthorizedConnection(
                authorizedPeople[0].PersonId);

            // Use the authorized connection to read the user's default
            //   health record.
            HealthRecordAccessor access = new HealthRecordAccessor(
                authConnection, authConnection.GetPersonInfo().GetSelfRecord().Id);

            Weight weight = new Weight();

            weight.Value = new WeightValue(Value / 2.2,
                                           new DisplayValue(Value, "pounds"));

            access.NewItem(weight);
        }
Ejemplo n.º 6
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp        = HvShellUtilities.GetClient();
            List <PersonInfo>       authorizedPeople = new List <PersonInfo>
                                                           (clientApp.ApplicationConnection.GetAuthorizedPeople());

            // Create an authorized connection for each person on the
            //   list.
            HealthClientAuthorizedConnection authConnection = clientApp.CreateAuthorizedConnection(
                authorizedPeople[0].PersonId);

            // Use the authorized connection to read the user's default
            //   health record.
            HealthRecordAccessor accessor = new HealthRecordAccessor(
                authConnection, authConnection.GetPersonInfo().GetSelfRecord().Id);

            HealthServiceRequest request =
                new HealthServiceRequest(accessor.Connection, "PutThings", 2, accessor);

            // Read the input file
            request.Parameters = System.IO.File.ReadAllText(Path.GetFullPath(FileName));
            request.Execute();
        }
Ejemplo n.º 7
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();

            WriteObject(clientApp.ApplicationConnection.GetVocabularyKeys());
        }