Extending BloodOxygenSaturation datatype and adding pulse rate data

Jul 20, 2011 at 7:17 PM

Hello,

Our Pulse Oximeter device gives two data types – SpO2 ( in percentage),Pulse Rate(beats per min).

I found this link : http://msdn.microsoft.com/en-us/healthvault/bb968876

which is very similar to what we want. Please suggest how to do this using java.

 

Thanks,

Amit Goyal

Coordinator
Jul 21, 2011 at 7:22 AM
Edited Jul 21, 2011 at 7:23 AM

Hi Amit,

If you are using the jaxb classes, you will find the extension point on:  Thing-->DataXml-->Common-->Extension.

You might want to propose your idea for the data on the healthvault msdn forums here.  You can get better best practice data advice over there.

--Rob

Jul 21, 2011 at 7:50 AM
Edited Jul 21, 2011 at 7:52 AM

Hello Rob,

Thanks for the reply. I am using jaxb classes. Can you give me a sample for how to extend the data type. I want to exend BloodOxygenSaturation data type.

Thanks,

Amit Goyal

Coordinator
Jul 21, 2011 at 9:16 AM

Hi Amit,

It would look something like this:

    Thing thing = new Thing();
    thing.setData(createValidBloodThingy());

    // Create Extension somehow using your favorite DOM paradigms   
    DocumentBuilder builder =
    DocumentBuilderFactory.newInstance().newDocumentBuilder();
     
    Document document = builder.parse(new InputSource(new StringReader("<myextension-goes-here/>")));
    Extension extension = new Extension();
    extension.setSource("mysource");
    extension.getAny().add(document.getDocumentElement());
       
    Common common = new Common();
    common.getExtension().add(extension);
       
    // Set the common node on the Thing
    thing.getDataXml().get(0).setCommon(common);
       
    PutThingsRequest request = new PutThingsRequest();
    request.getThing().add(thing);
       
    PutThingsResponse response = (PutThingsResponse)requestTemplate.makeRequest(request);

Jul 21, 2011 at 10:11 AM

Thanks Rob,

 

The code you provided worked and the data is being uploaded and also i can retreive that data. When I logged in to healthvault i can see the Blood Oxygen saturation value that i uploaded but where is this extension data value which i uploaded is being displayed in healthvault site. Can i show this extension data value on healthvault site?

 

Thanks,

Amit Goyal

Jul 28, 2011 at 8:59 PM

Hello.

I'm new to healthvault and some things are not very clear to me, maybe someone could help.

I have some questions regarding the upper example.

What has this "myextension-goes here" to look like? Is this a definition to be sent once oder is it the same request every time I store a value into this type?

And how do I provide a date for this new data type and thing?

Thanks in advance,

Sven

Coordinator
Jul 28, 2011 at 10:11 PM

Hi Sven,

The <myextension-goes-here/> can be any valid XML to attach to that specific thing instance. 

As far as the second part of your question, I'm not sure what date you are asking about.  Can you elaborate?

Thanks,
Rob

Jul 29, 2011 at 7:59 AM

Hi Rob.

So am I correct that the extionsion is just a XML snipplet attached to a "normal" thing like for example a heartrate value?

This is what I meant with that date question. When I store a heartrate value, I can (I actually have to ) give a date and time to that record (<when></when>). If the extension is just an appendix to a pre-defined thing, the date and time would be the same for both values (heartrate and let's say heartrate-variability), right?

So if I define an extension to heartrate, this extension can only be given a value when I save a heartrate itself, is this correct?

Thanks,

Sven

Jul 29, 2011 at 9:42 AM

Hi Rob.

Yet another question: What do I have to do to make my extension to be shown in the customers web portal (healthvault.com) or in my case, the german version (www.assignio.de)?

I found a sentence in the spec regarding the "xsl"-attribute of the <extension> element.

"Transform: If you want your extension data to be visible in applications that show data generically, such as the HealthVault.com data view, you can provide the URL of an SSL transform that can convert the XML into HTML."

I read this like this: I need to provide a SSL URL to an xsl stylesheet that transforms my extension XML snipplet into an HTML snipplet that is embedded into the healthvault.com website, right?

 

Thanks,

Sven

 

Coordinator
Jul 29, 2011 at 10:11 PM

Hi Sven,

The healthvault.com website won't use the stylesheet to transform and display the data.  This question is probably better posed on the HealthVault developer forums here.

Thanks,

Rob

Coordinator
Jul 31, 2011 at 8:28 PM

Hi Sven,

I think I missed your reply about the date (<when></when).  You are correct that extension simply adds extra data and belongs to an individual thing.

 

--Rob