locked
How to retrieve the data from health vault with stored date time RRS feed

  • Question

  • Hi

     I have successfully retrieved the data from HealthVault. But i dont know how to retrieve the data with stored date Time. Can you please help me in this regard.

     

    Thursday, February 17, 2011 4:36 AM

Answers

  • Hello,

    Are you looking for retrieving data with filtering based on created or modified date? If yes then the below properties of HealthVault .NET SDK will help you. Otherwise, please let me know.

    HealthRecordFilter Properties

    CreatedDateMax Gets or sets the maximum date the item was created. 
    CreatedDateMin Gets or sets the minimum date the item was created.
    UpdatedDateMax Gets or sets the maximum date of a returned updated item to return. 
    UpdatedDateMin Gets or sets the minimum date of an updated item to return.

    Please find more help in the Microsoft.Health.chm file which you can find in the SDK installation folder.

    Hope this helps,

    Thank you,


    Anish Ravindran
    • Proposed as answer by Anish Ravindran Thursday, February 17, 2011 5:15 AM
    • Marked as answer by Aneesh D Tuesday, March 8, 2011 9:22 PM
    Thursday, February 17, 2011 5:11 AM
  • Hello,

    I strongly recommend you to take Eric's HealthVault tutorial (http://blogs.msdn.com/b/ericgu/archive/2009/01/08/introduction-to-healthvault-development-1-introduction.aspx) which is really good for newbies in HealthVault Application development.

    Now I understood that you would like to retrieve the weight items along with its stored DateTime in HealthVault.

    HealthRecordItem.EffectiveDate will return the date and time that the health record item data was taken in HealthVault.

    You can update your sample code to retrieve the items with effective date as below.

    if (items != null && items.Count > 0)
    {
     List<Weight> weightList = new List<Weight>();
            foreach (HealthRecordItem item in items)
            {
             DateTime effectiveDate  = item.EffectiveDate;
              weightList.Add((Weight)item);
            }        
    }

    Hope this helps.

    Thank you,


    Anish Ravindran
    • Proposed as answer by Anish Ravindran Thursday, February 17, 2011 5:41 AM
    • Marked as answer by Aneesh D Tuesday, March 8, 2011 9:22 PM
    Thursday, February 17, 2011 5:41 AM
  • Hi,

    Unfortunately, there is no "Temperature" type to store temperature measurements in a user's HealthVault record directly. The best place to store temperatures would be the VitalSigns type.

    In your case, you need to use VitalSigns object. You can store multiple VitalSignsResultsType instances in this object. You need to store one instance of VitalSignsResultsType in the VitalSigns class for which the codeable value is set to Temperature. You can then store the temperature in Celsius.

    Please find the sample code given below:

    void AddTemperatureEntry()
        {
            HealthServiceDateTime currentDateTime = new HealthServiceDateTime(DateTime.Now);
            VitalSigns vitalSignEntry = new VitalSigns(currentDateTime);
            CodableValue temperature = new CodableValue("Temperature");
            VitalSignsResultType vitalSignsResultEntry = new VitalSignsResultType(temperature);
            vitalSignsResultEntry.Value = 37;
            vitalSignEntry.VitalSignsResults.Add(vitalSignsResultEntry);
            PersonInfo.SelectedRecord.NewItem(vitalSignEntry);
        }

    I see that you have already created a service request (ID 111021624247236) for this issue (adding temperature to HealthVault record) and a support engineer is already working on it. Please direct further queries through the service request for effective troubleshooting and tracking.

    Thanks,
    Piyali.
    • Proposed as answer by Piyali Sen Friday, February 18, 2011 5:37 AM
    • Marked as answer by Aneesh D Tuesday, March 8, 2011 9:22 PM
    Thursday, February 17, 2011 12:09 PM

All replies

  • Hello,

    Are you looking for retrieving data with filtering based on created or modified date? If yes then the below properties of HealthVault .NET SDK will help you. Otherwise, please let me know.

    HealthRecordFilter Properties

    CreatedDateMax Gets or sets the maximum date the item was created. 
    CreatedDateMin Gets or sets the minimum date the item was created.
    UpdatedDateMax Gets or sets the maximum date of a returned updated item to return. 
    UpdatedDateMin Gets or sets the minimum date of an updated item to return.

    Please find more help in the Microsoft.Health.chm file which you can find in the SDK installation folder.

    Hope this helps,

    Thank you,


    Anish Ravindran
    • Proposed as answer by Anish Ravindran Thursday, February 17, 2011 5:15 AM
    • Marked as answer by Aneesh D Tuesday, March 8, 2011 9:22 PM
    Thursday, February 17, 2011 5:11 AM
  • Hello Anish

    Yes. I am looking for what you provide me. But can you please explain with sample code. I am new to this HealthVault Application. With HealthRecordFilter Properties How can i return the Weight data and its stored DateTime.

    Thursday, February 17, 2011 5:16 AM
  • Hello,

    I strongly recommend you to take Eric's HealthVault tutorial (http://blogs.msdn.com/b/ericgu/archive/2009/01/08/introduction-to-healthvault-development-1-introduction.aspx) which is really good for newbies in HealthVault Application development.

    Now I understood that you would like to retrieve the weight items along with its stored DateTime in HealthVault.

    HealthRecordItem.EffectiveDate will return the date and time that the health record item data was taken in HealthVault.

    You can update your sample code to retrieve the items with effective date as below.

    if (items != null && items.Count > 0)
    {
     List<Weight> weightList = new List<Weight>();
            foreach (HealthRecordItem item in items)
            {
             DateTime effectiveDate  = item.EffectiveDate;
              weightList.Add((Weight)item);
            }        
    }

    Hope this helps.

    Thank you,


    Anish Ravindran
    • Proposed as answer by Anish Ravindran Thursday, February 17, 2011 5:41 AM
    • Marked as answer by Aneesh D Tuesday, March 8, 2011 9:22 PM
    Thursday, February 17, 2011 5:41 AM
  • Hello Anish

    Thankyou so much for your Help. you saved my time.

     

    Thursday, February 17, 2011 6:23 AM
  • Hello Anish

    Can you please Provide me the sample code to retrieve and  store the Temperature value in the HealthVault.

     

    ThankYou

     

    Thursday, February 17, 2011 6:44 AM
  • Hi,

    Unfortunately, there is no "Temperature" type to store temperature measurements in a user's HealthVault record directly. The best place to store temperatures would be the VitalSigns type.

    In your case, you need to use VitalSigns object. You can store multiple VitalSignsResultsType instances in this object. You need to store one instance of VitalSignsResultsType in the VitalSigns class for which the codeable value is set to Temperature. You can then store the temperature in Celsius.

    Please find the sample code given below:

    void AddTemperatureEntry()
        {
            HealthServiceDateTime currentDateTime = new HealthServiceDateTime(DateTime.Now);
            VitalSigns vitalSignEntry = new VitalSigns(currentDateTime);
            CodableValue temperature = new CodableValue("Temperature");
            VitalSignsResultType vitalSignsResultEntry = new VitalSignsResultType(temperature);
            vitalSignsResultEntry.Value = 37;
            vitalSignEntry.VitalSignsResults.Add(vitalSignsResultEntry);
            PersonInfo.SelectedRecord.NewItem(vitalSignEntry);
        }

    I see that you have already created a service request (ID 111021624247236) for this issue (adding temperature to HealthVault record) and a support engineer is already working on it. Please direct further queries through the service request for effective troubleshooting and tracking.

    Thanks,
    Piyali.
    • Proposed as answer by Piyali Sen Friday, February 18, 2011 5:37 AM
    • Marked as answer by Aneesh D Tuesday, March 8, 2011 9:22 PM
    Thursday, February 17, 2011 12:09 PM