locked
How to retrieve the CCD and CCR files from health vault RRS feed

  • Question

  • Hi

    I have Successfully uploaded one CCR and CCD Files to the HealthVault by using sample CCD and CCR files used in SDK . now i need to retrieve the CCD and CCR, and how to generate CCD and CCR  XML files, Can you please help me out to retrieve the stored CCD and CCR records from the HealthVault and also to generate the CCD and CCR files using our HealthRecord items. Can you pleae provide me a sample code to do this.

    Monday, March 14, 2011 10:00 AM

Answers

  • Hi,

    To download, CCR or CCD files stored in your HealthVault record, please follow the steps given below:

    1. Login to https://account.healthvault-ppe.com/default.aspx with your credentials.
    2. Click on the Health Information tab.
    3. Under the header "Files", you will find links for CCD and CCR files. The count of the CCR and CCD files uploaded into your record will be appended to the links.
    4. Click on either of the links. This will redirect you to a page with the list CCR or CCD files uploaded.
    5. Click on the "Details" link beside the file you want to download. The "Download" link will appear.
    6. Click the download link to get the CCR or CCD file downloaded on to your system.

    To do the same programmatically, please try the sample code given below:

        void FetchCCRRecords()
        {
            List<HealthRecordItem> ccrItems = GetValues<HealthRecordItem>(CCR_THING_GUID);
            int ccrItemCount = 0;
            String ccrFileName = String.Empty;
            foreach (HealthRecordItem item in ccrItems)
            {
                ccrItemCount = ccrItemCount + 1;
                ccrFileName = "CCR_" + ccrItemCount.ToString() + ".xml";
                XPathDocument document = (XPathDocument)item.TypeSpecificData;
                XPathNavigator documentNav = document.CreateNavigator();
                XmlTextWriter writer = new XmlTextWriter(Server.MapPath(ccrFileName), System.Text.Encoding.UTF8); 
                writer.WriteStartDocument(); 
                writer.WriteNode(documentNav, true); 
                writer.WriteEndDocument(); 
                writer.Close(); 
            }
        }


    Simply replace the CCR_THING_GUID with CCD_THING_GUID to download the CCD files.

    Do let me know if you have any queries.

    Thanks, Piyali.

    • Proposed as answer by Piyali Sen Tuesday, March 15, 2011 10:16 AM
    • Marked as answer by Eric Gunnerson Tuesday, March 15, 2011 4:10 PM
    Monday, March 14, 2011 1:26 PM

All replies

  • Hi,

    To download, CCR or CCD files stored in your HealthVault record, please follow the steps given below:

    1. Login to https://account.healthvault-ppe.com/default.aspx with your credentials.
    2. Click on the Health Information tab.
    3. Under the header "Files", you will find links for CCD and CCR files. The count of the CCR and CCD files uploaded into your record will be appended to the links.
    4. Click on either of the links. This will redirect you to a page with the list CCR or CCD files uploaded.
    5. Click on the "Details" link beside the file you want to download. The "Download" link will appear.
    6. Click the download link to get the CCR or CCD file downloaded on to your system.

    To do the same programmatically, please try the sample code given below:

        void FetchCCRRecords()
        {
            List<HealthRecordItem> ccrItems = GetValues<HealthRecordItem>(CCR_THING_GUID);
            int ccrItemCount = 0;
            String ccrFileName = String.Empty;
            foreach (HealthRecordItem item in ccrItems)
            {
                ccrItemCount = ccrItemCount + 1;
                ccrFileName = "CCR_" + ccrItemCount.ToString() + ".xml";
                XPathDocument document = (XPathDocument)item.TypeSpecificData;
                XPathNavigator documentNav = document.CreateNavigator();
                XmlTextWriter writer = new XmlTextWriter(Server.MapPath(ccrFileName), System.Text.Encoding.UTF8); 
                writer.WriteStartDocument(); 
                writer.WriteNode(documentNav, true); 
                writer.WriteEndDocument(); 
                writer.Close(); 
            }
        }


    Simply replace the CCR_THING_GUID with CCD_THING_GUID to download the CCD files.

    Do let me know if you have any queries.

    Thanks, Piyali.

    • Proposed as answer by Piyali Sen Tuesday, March 15, 2011 10:16 AM
    • Marked as answer by Eric Gunnerson Tuesday, March 15, 2011 4:10 PM
    Monday, March 14, 2011 1:26 PM
  • Hi Piyali

    Thank you so much for your help, You code helped me lot to retrieve the CCD and CCR files.Once again thanks for your help.

     

    Thanks, Shanmugapriya.

     

    Tuesday, March 15, 2011 4:08 AM