none
Export CCD using xml method

    Question

  • We are hoping to export a user's data in a CCD, but not through the .NET SDK nor the user interface. Our app is written in java (custom, not the hv java). But I do not see an exposed xml method for this task.

    Am I missing something? Is this possible?

    Monday, May 03, 2010 10:33 PM

Answers

  • You should be able to do this. Basically, it involves creating a bit of XML that contains all of the healthvault data items in it, and then running a transform over those items. That's what the SDK does.

    I recommend using the HealthRecordExporter class source as a guide. That will show you the format of the xml. You can find it in the source .zip file in the SDK.

    The transform that you want to use is accessible from the platform using the following URL:

    https://platform.healthvault-ppe.com/platform/xsl/toccd.xsl

    Monday, May 03, 2010 11:20 PM
  • Exporting a whole record is a different scenario than transforming to/from CCR and CCD. There are a number of HealthVault types that don't exist in those standards, and many others where the mapping is not 1:1.

    We've talked about doing export/import, but haven't got beyond the talking stage yet.

    For an application to do this, it would have to request access to all types and a user would have to grant that access. The scenario would have to be pretty compelling for that sort of access to be allowed during our go live review.

    Wednesday, May 12, 2010 4:37 PM
  • There currently is no simple way to ask for everything. Since everything could easily be thousands of items, that would take a long time and doesn't seem terribly useful in the scenarios I know of. Can you explain why you want to do this?

    The CCR and CCD transforms only work with a subset of types, so there are a lot of types where you could pass them to the transform and the transform will just ignore them. It generally works better to start with a small number of types and make sure everything is working for those before adding additional ones.

    As for fetching the values, you can get them all with a single filter by something like:

     

    HealthRecordFilter filter = new HealthRecordFilter();
    filter.TypeIds.Add(
    Condition.TypeId);
    filter.TypeIds.Add(
    Immunization.TypeId);

     

    Thursday, May 06, 2010 2:56 PM

All replies

  • You should be able to do this. Basically, it involves creating a bit of XML that contains all of the healthvault data items in it, and then running a transform over those items. That's what the SDK does.

    I recommend using the HealthRecordExporter class source as a guide. That will show you the format of the xml. You can find it in the source .zip file in the SDK.

    The transform that you want to use is accessible from the platform using the following URL:

    https://platform.healthvault-ppe.com/platform/xsl/toccd.xsl

    Monday, May 03, 2010 11:20 PM
  • Hi Eric,

    as am on my way to export the record into both, CCR and CCD, I found your hints for HealthRecordExporter very helpful. However, when I put the following code:

     

    static Guid personId = new Guid("c7792d8e-1835-46bc-9555-ffc160e7e59e");
        static Guid recordId = new Guid("c5e4092e-964c-4c97-ae0f-9996ddfd968c");
    
    OfflineWebApplicationConnection offlineConn = new OfflineWebApplicationConnection(personId);
          offlineConn.Authenticate();
          HealthRecordAccessor accessor = new HealthRecordAccessor(offlineConn, recordId);
          HealthRecordSearcher searcher = accessor.CreateSearcher();
    
    PersonInfo personInfo = offlineConn.GetPersonInfo();      HealthRecordInfo record = personInfo.SelectedRecord;      HealthRecordExporter exporter = new HealthRecordExporter(record);
    string exportItems = exporter.ExportItems();
    I got the following exception.

     

    "A filter must have at least one valid property, ItemId or ItemKey present to search for items"

    Then, I tried to populate the filters the same way HealthRecordExporter does, but it didn't work too as Filter is not a valid type or class:

     

    .
    .
    .
    PersonInfo personInfo = offlineConn.GetPersonInfo();
    HealthRecordInfo record = personInfo.SelectedRecord;
    HealthRecordSearcher searcher = new HealthRecordSearcher(record);
    for (int index = 0; index < Filters .Count; ++index)
    {
    searcher.Filters .Add(Filters[index]);
    }

     

    The only way I could still try is to iterate through all ItemTypes and add them to filter manually, but this is tedious, isn't it?

    HealthRecordFilter filter = new HealthRecordFilter(Person.TypeId);
          searcher.Filters.Add(filter);
    HealthRecordFilter filter = new HealthRecordFilter(Height.TypeId);
          searcher.Filters.Add(filter);

    Do we have any generic approach to export all item types efficiently?

    Thanks in Advance

     


    Mustafa Al-Durra, B.Sc Computer Engineering, MCP, MCDBA, MCAD.NET, SoftHealth Inc. (President/CEO)
    Thursday, May 06, 2010 12:49 AM
  • There currently is no simple way to ask for everything. Since everything could easily be thousands of items, that would take a long time and doesn't seem terribly useful in the scenarios I know of. Can you explain why you want to do this?

    The CCR and CCD transforms only work with a subset of types, so there are a lot of types where you could pass them to the transform and the transform will just ignore them. It generally works better to start with a small number of types and make sure everything is working for those before adding additional ones.

    As for fetching the values, you can get them all with a single filter by something like:

     

    HealthRecordFilter filter = new HealthRecordFilter();
    filter.TypeIds.Add(
    Condition.TypeId);
    filter.TypeIds.Add(
    Immunization.TypeId);

     

    Thursday, May 06, 2010 2:56 PM
  • Thanks for comments Eric,

    my interests in exporting all the artifact are simply triggered by the HealthVault UI shell. I come acroos that when trying to simulate the export programmatically. From the user perspectives, I suspect, it is pretty common that they should be able to export the complete record. As such, the HealthRecordExporter class seems to be just the right one to do the job, but I didn't manage to get it working.

     

    Indeed and when implementing the filter approach, the code should iterate through all (CCD Exportable) ItemTypes and export them. We know that the CCD subset is still being updated, and potentials are good that in the next term, more itemtypes will be supported, which causes me to update my code accordingly every time for new CCD release.

    Having a generic method to export all (whatever CCD supported) ItemTypes will eventually saves me and other developers reviewing that piece of code after new releases!

     

    Thanks again for you reply!.

     


    Mustafa Al-Durra, B.Sc Computer Engineering, MCP, MCDBA, MCAD.NET, SoftHealth Inc. (President/CEO)
    Tuesday, May 11, 2010 11:47 PM
  • Exporting a whole record is a different scenario than transforming to/from CCR and CCD. There are a number of HealthVault types that don't exist in those standards, and many others where the mapping is not 1:1.

    We've talked about doing export/import, but haven't got beyond the talking stage yet.

    For an application to do this, it would have to request access to all types and a user would have to grant that access. The scenario would have to be pretty compelling for that sort of access to be allowed during our go live review.

    Wednesday, May 12, 2010 4:37 PM