locked
No image data when retrieving PersonalImage RRS feed

  • Question

  • I just uploaded a PersonalImage to an record on the ppe.

    When I go to https://account.healthvault-ppe.com select add, view or edit information and then PersonalImage I can see there is a Personal Image entered at
    9/23/2008 9:12:18 AM. When I click on that entry I get the right image.

    I use the following code (based on HelloWorld example in the SDK):

            PersonalImage p_image = GetSingleValue<PersonalImage>(PersonalImage.TypeId);
            if (p_image != null)
            {
                using (System.IO.Stream currentImageStream = p_image.ReadImage())
                {
                    if (currentImageStream != null)
                    {
                        byte[] imageBytes = new byte[currentImageStream.Length];
                        currentImageStream.Read(imageBytes, 0, (int)currentImageStream.Length);

                        using (System.IO.FileStream outputImage = System.IO.File.OpenWrite("./images/tmp.gif"))
                        {
                            outputImage.Write(imageBytes, 0, imageBytes.Length);
                        }
                    }
                }
            }

    p_image seems to get the correct information at first sight ({EffectiveDate = {23-09-2008 9:12:18}}), however this is not true (OtherData = null). As a result p_image.ReadImage() returns null and the rest does not work.

    Any ideas on what is the problem?

    Thanks, Johan
    Tuesday, September 23, 2008 4:52 PM

Answers

  • The Image data will be returned in the OtherData.

     

    If OtherData is null it is probably because you are not specifying the HealthRecordItemSections in the search correctly.

     

    By default OtherData wil not be returned unless you specify HealthRecordItemSections.OtherData flag or HealthRecordItemSections.All flag on the search

     

    Hope this helps

     

     

    Tuesday, September 23, 2008 5:41 PM

All replies

  • The Image data will be returned in the OtherData.

     

    If OtherData is null it is probably because you are not specifying the HealthRecordItemSections in the search correctly.

     

    By default OtherData wil not be returned unless you specify HealthRecordItemSections.OtherData flag or HealthRecordItemSections.All flag on the search

     

    Hope this helps

     

     

    Tuesday, September 23, 2008 5:41 PM
  • Thanks,

    This helped a lot
    Wednesday, September 24, 2008 2:44 PM