locked
How to add my contact information to health vault account RRS feed

  • Question

  • Hi,

    I am trying to add my address, email etc in my health vault account.
    I have tried using Person Itemtype, but then i found it is not having set property for contact info.
    So kindly let me know how can i update all the my contact info.


    I have one more doubt in HealthRecordItem.OtherData.
    I am not clear on how to use this otherdata type.
    If you could explain me, it would be helpful for me



    Thanks
    Sathya N
    Monday, December 22, 2008 12:29 PM

Answers


  • The person object may not be the correct type for your usage.
    You should use the Contact type to add the contact information of the person who owns the record.
    The Person object is used to add contact information of others (like an emergency contact) for the record.

    Even though the Contact.ContactInformation does not expose a Set method, you can add values to the collections that it contains.

    Contact  p =  <obtain the instance>;
    Email e = new Email();
    //set properties on email
    p.ContactInformation.Email.Add(e);

    (Note that I typed the above code directly just to explain and may not compile directly)

    HTH

    Raj


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, December 23, 2008 3:28 AM

All replies


  • The person object may not be the correct type for your usage.
    You should use the Contact type to add the contact information of the person who owns the record.
    The Person object is used to add contact information of others (like an emergency contact) for the record.

    Even though the Contact.ContactInformation does not expose a Set method, you can add values to the collections that it contains.

    Contact  p =  <obtain the instance>;
    Email e = new Email();
    //set properties on email
    p.ContactInformation.Email.Add(e);

    (Note that I typed the above code directly just to explain and may not compile directly)

    HTH

    Raj


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, December 23, 2008 3:28 AM
  • Hi Sathya,

    I may translate the code of rajeshckr in the following which will adds a phone number, 2 emails and an address to your PersonInfo type:

    Contact contact = GetSingleValue<Contact>(Contact.TypeId);

    contact.ContactInformation.Phone.Add(new Phone("01233456", "Mobile", false));

    contact.ContactInformation.Email.Add(

    new Email("adfasdfa@dfd.ce","PrivateEmail", true);

    contact.ContactInformation.Email.Add(
                            new Email ("adfasdfa@dfd.de","BusinessEmail", false);

    contact.ContactInformation.Address.Add(

    new Address("MyCity","MyCountry","MyPostalCode"));

    PersonInfo.SelectedRecord.UpdateItem(contact);


    Cheers!

    Tuesday, April 14, 2009 6:26 PM