This document contains general guidelines for using the group membership data types. It does not cover all the information that is stored in the type – see the GroupMembership and GroupMembershipActivity documentation for more information.

The group membership types are used as a communication mechanism between an organization (such as an employer) who subsidizes membership in a specific program (such as weight-loss, fitness, etc.) and a provider of services (health club, nutritionist, etc.)

An individual’s membership in a group is recorded by a GroupMembership instance. The organization creates a GroupMembershipType instance, recording a series of group names and values.  The organization can also record a data when the membership expires.

The organization then writes the record the individual’s record.

A service provider can then retrieve the group membership instances from a user’s record, and see if any of them are the one that the organization and service provider agreed on. If such a record is found, the service provider then knows the user is a member of the group.

The GroupMembershipActivity type is used to provide information back to the sponsoring organization. When a user authorizes an application that has rights to create GroupMembershipActivity instances, the HealthVault platform will write a special instance of the GroupMembershipActivity to the user’s record, and set the Activity property to “RecordAuthorizedForApplication”.  The application may write additional instances of GroupMembershipActivity as desired.

To make sure that the list of group memberships are current, they are fetched by calling the GetValidGroupMemberships() method. This ensures that the sponsoring organization still has access to the user’s record.

A scenario

An employer offers a weight-loss program that provides a series of consultations with a nutritionist.

  1. A user goes to their employer’s portal, signs up for the program, and authorizes the portal to access their HealthVault record to write GroupMembership types and read GroupMembershipActivity types.
  2. The portal writes an entry of GroupMembership, with name=”WeightLoss”, value=”nutritionist”
  3. The user goes to an on-line nutritionist app.
  4. The user authorizes the app to read GroupMembership and write GroupMembershipActivity.
  5. The HealthVault platform writes a GroupMembershipActivity to the user’s record.
  6. The employer portal can query and find out that the user started the program.
  7. The nutritionist app writes additional GroupMembershipActivity instances to record the user’s visits.
  8. The portal reads these instances.