none
Adding more information to application specific item type RRS feed

  • Question

  • Hi All,

    I have added a custom type by making a class extending HealthRecordItem

    it is working fine but it is adding only limited information, which is
    application id, format tag, when, summary

    by making use of the code


    public override void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("app-specific");
            {
                writer.WriteStartElement("format-appid");
                writer.WriteValue("MyAppName");
                writer.WriteEndElement();

                writer.WriteStartElement("format-tag");
                writer.WriteValue("PeakZone");
                writer.WriteEndElement();

                m_when = new HealthServiceDateTime();
                m_when.WriteXml("when", writer);

                writer.WriteStartElement("summary");
                writer.WriteValue("This is summary being writtern in writeXML tag");
                writer.WriteEndElement();


                writer.WriteStartElement("PeakZone");
                writer.WriteAttributeString("RedOrangeBoundary", m_redOrangeBoundary.ToString());
                writer.WriteAttributeString("OrangeYellowBoundary", m_orangeYellowBoundary.ToString());
                writer.WriteAttributeString("YellowGreenBoundary", m_yellowGreenBoundary.ToString());
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }


    how can i add more information in the same item which will be uploaded and displayed at HealthVault.
    Any help will be highly appreciated.

    Thanks and Regards,
    Dheeraj Bansal
    Thursday, August 6, 2009 11:53 AM

Answers

  • It wont be visible in the UI on shell because it wont know how to interpret your data.  Like I said earlier, no other application will be able to use this data.

    Shell may display when and summary since it a part of schema of the "Application specific type".  But any xml you add apart from the following nodes are IGNORED by shell.

    format-appid
    format-tag
    when
    summary


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Thursday, August 6, 2009 12:48 PM

  • To specifically answer your question:
    To add more information, add more xml nodes representing that information in the xml you are constructing - for ex: after the PeakZone node. It is upto your application to write any xml and parse it back when using Application specific data type. HealthVault Platform wont validate the xml nodes you add in this type against any schema.

    But note that any instances that you add in a HealthVault record of type "Application Specific type" is not visible to any other application in the HealthVault ecosystem.  Think of it as something that only your application can see and NO OTHER APP.  Needless to say you should not be using this type to store data that has value in being shared - ex: Medical data.  Ideally you should only store custom application specific information which is of no use to other applications in this type.  So you should NOT use this type to display data in HealthVault.
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Thursday, August 6, 2009 12:23 PM
  • Yes, the info is uploaded and you can cross check it by requesting the item by giving the ItemKey and looking at the xml you get back.
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Thursday, August 6, 2009 1:02 PM

All replies


  • To specifically answer your question:
    To add more information, add more xml nodes representing that information in the xml you are constructing - for ex: after the PeakZone node. It is upto your application to write any xml and parse it back when using Application specific data type. HealthVault Platform wont validate the xml nodes you add in this type against any schema.

    But note that any instances that you add in a HealthVault record of type "Application Specific type" is not visible to any other application in the HealthVault ecosystem.  Think of it as something that only your application can see and NO OTHER APP.  Needless to say you should not be using this type to store data that has value in being shared - ex: Medical data.  Ideally you should only store custom application specific information which is of no use to other applications in this type.  So you should NOT use this type to display data in HealthVault.
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Thursday, August 6, 2009 12:23 PM
  • Hi Rajesh,

    I did tried to add another field in between summary and peakZone but it is not displayed at UI in my account. Is it compulsory to add the field after peakZone tag. My new XMl is

        public override void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("app-specific");
            {
                writer.WriteStartElement("format-appid");
                writer.WriteValue("MyAppName");
                writer.WriteEndElement();

                writer.WriteStartElement("format-tag");
                writer.WriteValue("PeakZone");
                writer.WriteEndElement();

                m_when = new HealthServiceDateTime();
                m_when.WriteXml("when", writer);

                writer.WriteStartElement("summary");
                writer.WriteValue("This is summary being writtern in writeXML tag");
                writer.WriteEndElement();

                writer.WriteStartElement("test");
                writer.WriteValue("This is test being writtern in writeXML tag");
                writer.WriteEndElement();


                writer.WriteStartElement("PeakZone");
                writer.WriteAttributeString("RedOrangeBoundary", m_redOrangeBoundary.ToString());
                writer.WriteAttributeString("OrangeYellowBoundary", m_orangeYellowBoundary.ToString());
                writer.WriteAttributeString("YellowGreenBoundary", m_yellowGreenBoundary.ToString());
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }


    But this one is not working.
    please help.

    Thanks and Regards,
    Dheeraj Bansal
    Thursday, August 6, 2009 12:26 PM
  • It wont be visible in the UI on shell because it wont know how to interpret your data.  Like I said earlier, no other application will be able to use this data.

    Shell may display when and summary since it a part of schema of the "Application specific type".  But any xml you add apart from the following nodes are IGNORED by shell.

    format-appid
    format-tag
    when
    summary


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Thursday, August 6, 2009 12:48 PM
  • Hi Rajesh,

    So does it mean that information is uploaded and I can access it as I am accessing other info. It's just not displayed at UI.

    Thanks and Regards,
    Dheeraj Bansal
    Thursday, August 6, 2009 1:00 PM
  • Yes, the info is uploaded and you can cross check it by requesting the item by giving the ItemKey and looking at the xml you get back.
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Thursday, August 6, 2009 1:02 PM
  • Hi Rajesh,

    Sorry to dig up an old topic, but could you please be as so kind, to propose a different solution to storing a medical data type that isn't present in the currently available data types...

    If I'm not mistaking some HealthVault blog or documentation says something like we should use the app-specific in such a case and if it proves that the data type has a real value it might be added as a new type in the future...or do you have another data type we should be using?

    Wednesday, July 5, 2017 11:53 AM
  • Can you describe the medical data type you are looking for? Other option is to use extension of existing data type, if there is a close one. 

    https://docs.microsoft.com/en-us/healthvault/concepts/data/extending-data-types 


    Takashi Moriyama | Senior Program Manager | Microsoft Health

    Friday, July 7, 2017 3:44 PM
    Moderator