<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reviving The Health Revolution</title>
	<atom:link href="http://healthblog.vitraag.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://healthblog.vitraag.com</link>
	<description>A view from inside the HealthVault</description>
	<lastBuildDate>Fri, 09 Dec 2011 00:10:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Soliciting Ideas for WiseVoter .org</title>
		<link>http://healthblog.vitraag.com/2011/12/soliciting-ideas-for-wisevoter-org/</link>
		<comments>http://healthblog.vitraag.com/2011/12/soliciting-ideas-for-wisevoter-org/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 23:03:20 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[HealthVault]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/2011/12/soliciting-ideas-for-wisevoter-org/</guid>
		<description><![CDATA[In 2009, WiseVoter made it to headlines in Indian news media. With a few volunteers we are trying to bring this non-profit citizen empowering site to US for the improving the health of 2012 elections! If you have features suggestions/ ideas please share them below.
]]></description>
			<content:encoded><![CDATA[<p>In 2009, <a href="http://thekarkhana.vitraag.com/2009/04/introducing-wisevoter/">WiseVoter</a> made it to headlines in Indian news media. With a few volunteers we are trying to bring this non-profit citizen empowering site to US for the improving the health of 2012 elections! If you have features suggestions/ ideas please share them below.</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/12/soliciting-ideas-for-wisevoter-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing Method_Missing in C#</title>
		<link>http://healthblog.vitraag.com/2011/10/implementing-method_missing-in-c/</link>
		<comments>http://healthblog.vitraag.com/2011/10/implementing-method_missing-in-c/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 18:14:03 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[meta-programming]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/2011/10/implementing-method_missing-in-c/</guid>
		<description><![CDATA[Heart of the ruby on rails magic in creating a very expressive and eloquent web development framework is the use of ruby’s method_missing.
Following is an example of method_missing in action :
class Roman
  def romanToInt(str)
    # ...
  end
  def method_missing(methId)
    str = methId.id2name
    romanToInt(str)
 [...]]]></description>
			<content:encoded><![CDATA[<p>Heart of the <em>ruby on rails</em> magic in creating a very expressive and eloquent web development framework is the use of ruby’s <a href="http://ruby-doc.org/docs/ProgrammingRuby/html/ref_c_object.html#Object.method_missing">method_missing</a>.</p>
<p>Following is an example of method_missing in action :</p>
<pre class="csharpcode">class Roman
  def romanToInt(str)
    # ...
  end
  def <span style="color: #ff0000;"><strong>method_missing</strong></span>(methId)
    str = methId.id2name
    romanToInt(str)
  end
end</pre>
<p><!--.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --><strong><span id="more-363"></span>Results:</strong></p>
<pre class="csharpcode"><strong>r = Roman.new
r.iv
»
4
r.xxiii
»
23
r.mm</strong></pre>
<p><!--.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>Following is a C# 4.0 equivalent using the <strong><span style="color: #ff0000;">dynamic</span></strong> keyword.</p>
<pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Dynamic;
<span class="kwrd">namespace</span> Vitraag.MetaProgramming
{
    <span class="kwrd">class</span> Program
    {
        <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
        {
            <span style="color: #ff0000;">dynamic</span> Caesar = <span class="kwrd">new</span> Roman();
            Console.WriteLine(Caesar.IV);
            Console.ReadKey();
        }
    }

    <span class="kwrd">class</span> Roman: <strong><span style="color: #ff0000;">DynamicObject</span></strong>
    {
        <span class="kwrd">int</span> StringToRoman(<span class="kwrd">string</span> s)
        {
            <span class="rem">// Simple logic needs a better function</span>
            <span class="kwrd">switch</span> (s)
            {
                <span class="kwrd">case</span> <span class="str">"I"</span> : <span class="kwrd">return</span> 1;
                <span class="kwrd">case</span> <span class="str">"IV"</span>: <span class="kwrd">return</span> 4;
                <span class="rem">// Should add more cases</span>
                <span class="kwrd">default</span>: <span class="kwrd">return</span> 0;
            }
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> <strong><span style="color: #ff0000;">TryGetMember</span></strong>(GetMemberBinder binder,
             <span class="kwrd">out</span> <span class="kwrd">object</span> result)
        {
            result = StringToRoman(binder.Name);
            <span class="rem">// This logic could be improved</span>
            <span class="kwrd">if</span> ((<span class="kwrd">int</span>)result != 0)
            {
                <span class="kwrd">return</span> <span class="kwrd">true</span>;
            }
            <span class="kwrd">return</span> <span class="kwrd">false</span>;
        }
    }
}</pre>
<p><!--.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>Running the above code gives us the result as: <strong>4</strong></p>
<p>I’ll be adding more thoughts in coming weeks around meta-programming and having an extensible type and formatting system. Please feel free to share your best reads or comments on the topic below!</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/10/implementing-method_missing-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seattle Quantified Self Show &amp; Tell</title>
		<link>http://healthblog.vitraag.com/2011/10/seattle-quantified-self-show-tell/</link>
		<comments>http://healthblog.vitraag.com/2011/10/seattle-quantified-self-show-tell/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 17:02:50 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[hvposh]]></category>
		<category><![CDATA[quantified-self]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/2011/10/seattle-quantified-self-show-tell/</guid>
		<description><![CDATA[Yesterday was the third Seattle Quantified Self Show &#38; Tell.
For those new to the idea, Quantified Self is a forum for users and tool makers to interact and share knowledge, experiences, tips &#38; tricks to enable better self discovery through tracking. The Seattle chapter of this forum is managed by great folks at Habitlabs (Buster [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday was the <a href="http://www.meetup.com/Quantified-Self-Seattle/events/36589652/">third</a> Seattle Quantified Self Show &amp; Tell.</p>
<p>For those new to the idea, <a href="http://quantifiedself.com/">Quantified Self</a> is a forum for users and tool makers to interact and share knowledge, experiences, tips &amp; tricks to enable better self discovery through tracking. The Seattle chapter of this forum is managed by great folks at <a href="http://habitlabs.com/">Habitlabs</a> (Buster &amp; Amelia) and <a href="http://limeade.com/">Limeade</a> (David).</p>
<p><span id="more-362"></span>With over 20 people joining the conversation it was great to see energy in self-tracking and self-improvement. Most people seem to share the problem of not knowing what to do with the data they have. It was interesting to see Amelia to talk about <a href="http://www.ginkgoprintshop.com/2011/02/life-design-experiments.html">positive effect</a> of just tacking a 10-day running average of her weight. Robby gave a great presentation on his <a href="http://vis.robbymacdonell.com/transportation-infographic/">month long project</a> to track transportation costs, and the conclusion to use a bicycle.</p>
<p>I’m looking forward to hear more this community. I have been trying to use <a href="http://healthblog.vitraag.com/2011/10/healthvault-powershell-module-the-beginnings/">HealthVault PowerShell</a> and excel with <a href="http://www.microsoft.com/bi/en-us/solutions/pages/powerpivot.aspx">power-pivot</a> to track and visualize few properties of Health data.</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/10/seattle-quantified-self-show-tell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Understanding International Statistical Classification of Diseases (ICD)</title>
		<link>http://healthblog.vitraag.com/2011/10/understanding-international-statistical-classification-of-diseases-icd/</link>
		<comments>http://healthblog.vitraag.com/2011/10/understanding-international-statistical-classification-of-diseases-icd/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 17:29:18 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[Vocabularies]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/2011/10/understanding-international-statistical-classification-of-diseases-icd/</guid>
		<description><![CDATA[This a next installment of the Understanding terminologies series.
I’ll try to keep this post short, give a general overview of International Statistical classification of Disease (ICD), talk a little about ICD-9 &#38; ICD-10 and leave your folks will links to practical advise on converting from ICD-9 to ICD-10, and SNOMED-CT to ICD-10.
What is ICD?
Attempts to [...]]]></description>
			<content:encoded><![CDATA[<p>This a next installment of the Understanding terminologies <a href="http://healthblog.vitraag.com/topics/vocabularies/">series</a>.</p>
<p>I’ll try to keep this post short, give a general overview of International Statistical classification of Disease (ICD), talk a little about ICD-9 &amp; ICD-10 and leave your folks will links to practical advise on converting from ICD-9 to ICD-10, and SNOMED-CT to ICD-10.</p>
<p><strong><span id="more-361"></span>What is ICD?</strong></p>
<p>Attempts to classify diseases started in 17th century. The prime driver of this classification was to gather statistics around cause of death could across countries. Over 19th century the list of international diseases rapidly versioned, the sixth version was published in 1946, ninth in 1975 and 10th in 1990! The revision 9th and 10th are most common and referred as ICD-9 and ICD-10 respectively.</p>
<p>Overtime many countries started using ICD codes for insurance re-imbursements with a slight modification (clinical modification &#8211; CM), and that is a prime reason why these code have become so prominent in the Health-IT industry.</p>
<p>The ICD code is an alpha-numeric code which tracks a diagnosis, symptoms and cause of death.</p>
<p><strong>So what’s ICD-9-CM, ICD-10-CM?</strong></p>
<p><strong>ICD-9-CM </strong>stands for the 9th revision of ICD with clinical modifications. This is most prevalent code used in the US healthcare industry for insurance re-imbursements. Following are few examples of how this code looks -</p>
<table border="1" cellspacing="0" cellpadding="2" width="686">
<tbody>
<tr>
<td width="133" valign="top"><strong>Code</strong></td>
<td width="284" valign="top"><strong>Long Description</strong></td>
<td width="267" valign="top"><strong>Short Desc</strong></td>
</tr>
<tr>
<td width="133" valign="top"><em>001.0</em></td>
<td width="284" valign="top">Cholera; due to Vibrio cholerae</td>
<td width="267" valign="top">CHOLERA D/T VIB CHOLERAE</td>
</tr>
<tr>
<td width="133" valign="top"><em>01.15</em></td>
<td width="284" valign="top">Biopsy of skull<em></em></td>
<td width="267" valign="top">Skull biopsy</td>
</tr>
</tbody>
</table>
<p>Fig 1. ICD-9-CM codes</p>
<p>Note the format. <strong>AAA.BB</strong>. AAA stands for category and BB stands for etiology, anatomical site or manifestation.</p>
<p><strong>ICD-10-CM </strong>is the 10th revision of ICD with clinical manifestation. All the US hospitals are mandated to use these code, starting 2013 only these codes will be re-imbursed by the payers / insurance providers. Following are few examples of how this code looks -</p>
<table border="1" cellspacing="0" cellpadding="2" width="686">
<tbody>
<tr>
<td width="133" valign="top"><strong>Code</strong></td>
<td width="284" valign="top"><strong>Long Description</strong></td>
<td width="267" valign="top"><strong>Short Desc</strong></td>
</tr>
<tr>
<td width="133" valign="top"><em>A00.0</em></td>
<td width="284" valign="top">Cholera; due to Vibrio cholerae</td>
<td width="267" valign="top">CHOLERA D/T VIB CHOLERAE</td>
</tr>
<tr>
<td width="133" valign="top"><em>S61.011A</em></td>
<td width="284" valign="top">Laceration without FB, Right<em></em></td>
<td width="267" valign="top">Laceration w/o FB, Rt</td>
</tr>
</tbody>
</table>
<p>Fig 2. ICD-10-CM codes</p>
<p>Note ICD-10 is of the format – <strong>ZAA.BBBC</strong></p>
<p>Z is supposed to Alphabetic. AA are numeric. Together ZAA make the category.<br />
BBB is alpha-numeric and together they make etiology, anatomical site or manifestation<br />
C is stands for code revision or extension</p>
<p><strong>How do I convert from ICD-9 to ICD-10? </strong></p>
<p>Shahid has a very good <a href="http://www.healthcareguy.com/2011/10/17/guest-article-actionable-advice-on-how-to-make-tangible-progress-in-icd-9-to-icd-10-migration/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+HealthcareGuy+%28The+Healthcare+IT+Guy%29">blog-post</a> on practical advise for converting ICD-9 to ICD-10.</p>
<p>Following are interesting tools for the conversion -</p>
<p>1. ICD-9 data converter &#8211; <a href="http://www.icd10data.com/Convert">http://www.icd10data.com/Convert</a><br />
2. Who online training &#8211; <a href="http://apps.who.int/classifications/apps/icd/ICD10Training/">http://apps.who.int/classifications/apps/icd/ICD10Training/</a></p>
<p><strong>And what about mapping ICD-10 to SNOMED-CT?</strong></p>
<p>As you have noticed ICD is more simplistic than SNOMED, rightfully since its original intent was to help with cause of death statistics. Overtime the ICD codes have been used in billing and increasing they have gotten specialized that they need to represent the diseases accurately. Naturally they have moving closer towards <a href="http://healthblog.vitraag.com/2009/10/understanding-snomed-ct/">SNOMED-CT</a>.</p>
<p>WHO has a <a href="http://www.who.int/classifications/icd/snomedCTToICD10Maps/en/index.html">preview release</a> mapping some SNOMED-CT codes to ICD-10-CM.</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/10/understanding-international-statistical-classification-of-diseases-icd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Healthcare Startup Incubators</title>
		<link>http://healthblog.vitraag.com/2011/10/healthcare-startup-incubators/</link>
		<comments>http://healthblog.vitraag.com/2011/10/healthcare-startup-incubators/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 17:07:41 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[HealthIT]]></category>
		<category><![CDATA[Market Watch]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/?p=359</guid>
		<description><![CDATA[Inspired by success of the likes of Y-combinator, a number of incubators have sprung up in last few years. Its encouraging to see that some have chosen to focus on Healthcare. With a trillion dollar market and a dire need for innovation seems like a right way to go. There has been a lot of [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by success of the likes of <a href="http://ycombinator.com/index.html">Y-combinator</a>, a number of incubators have sprung up in last few years. Its encouraging to see that some have chosen to focus on Healthcare. With a trillion dollar market and a dire need for innovation seems like a right way to go. There has been a lot of <a href="http://jaeselle.com/2011/01/2011-health-it-vc-investement-predictions/">optimism</a> on an increased VC presence in healthcare IT.!</p>
<p>Few notable incubators -<span id="more-359"></span></p>
<ol>
<li><a href="http://www.healthboxaccelerator.com/">Healthbox</a> – Chicago based incubator, powered by Sandbox <a href="http://www.healthboxaccelerator.com/blog/">industries</a>.</li>
<li><a href="http://www.blueprinthealth.org/index.php">Blueprint</a> – NYC based incubator started by Brad Weinberg founder of <a href="http://www.shapeup.com/">Shapeup</a>. Blueprint is focused more on enterprise startups</li>
<li><a href="http://rockhealth.com/">Rock health</a> – A San Francisco based incubator. Most of the startups in the program are consumer focused.</li>
</ol>
<p><strong>Why are healthcare startups hard?</strong><br />
I’ll highlight few of very well known facts about the health industry that serve as a big barriers for the startups &#8211;</p>
<ol>
<li>Regulations – There are a plethora of law’s regulating the industry – HIPAA, FDA etc.; and that in turn puts a lot of tax on a healthcare startup.</li>
<li>Long sale cycles – Enterprise sales in the industry have very long sales cycles.</li>
<li>Complicated economy – Someone has to give-up a dollar for startup to make one, its very hard to “generate” wealth in the Healthcare economy; it’s a very much a zero-sum economy. Additionally, the payer equation many times doesn’t align up well with other players in the system.</li>
</ol>
<p><strong>So what are the characteristics of the winners?</strong><br />
Lets take example of very of the well-established healthcare startups and see if there are themes for success.</p>
<ol>
<li>Disruptors – <a href="http://www.patientslikeme.com/">Patients like me</a> fundamentally challenges the current curing methodologies and introduces the social aspect to finding effective treatments using the power of social interaction.</li>
<li>Enablers – <a href="http://www.zocdoc.com/">Zocdoc</a> enables convenience for scheduling appointments and finding physicians. The service has seen a great uptake owing to fact that most folks like the ease of online scheduling.</li>
<li>Cost Savers – Given that the health care economy is zero-sum a lot of companies fit this bill. Most enterprise companies playing in the re-admission management, pre-registration, public health reporting, meaningful use etc. play in this realm.</li>
</ol>
<p>Dear reader &#8212; anything else you as an obvious wining characteristics? Please comment below..</p>
<p>Most of the above incubators are still taking applications for their next set of companies, and if you have been pursuing a health care venture what better time to apply!! Act on your innovative ideas..</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/10/healthcare-startup-incubators/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HealthVault PowerShell Module &#8211; The beginnings.</title>
		<link>http://healthblog.vitraag.com/2011/10/healthvault-powershell-module-the-beginnings/</link>
		<comments>http://healthblog.vitraag.com/2011/10/healthvault-powershell-module-the-beginnings/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 06:38:00 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[HealthVault]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[hvposh]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/2011/10/healthvault-powershell-module-the-beginnings/</guid>
		<description><![CDATA[Let me show you some awesomeness, and then I’ll explain what’s going on!
PS C:\Users\vaibhavb\Desktop&#62; Import-Module HvPosh
PS C:\Users\vaibhavb\Desktop&#62; Grant-HVaccess
Is auth done?
Is Auth done &#8211; (Y)?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is &#8220;Y&#8221;):y
PS C:\Users\vaibhavb\Desktop&#62; Get-Things weight &#124; Format-Table
When        Value       Key         TypeId      TypeName    EffectiveDa       State       Flags  IsPersonal IsDownVersi
te                                                     [...]]]></description>
			<content:encoded><![CDATA[<p>Let me show you some awesomeness, and then I’ll explain what’s going on!<span id="more-356"></span></p>
<p><span style="font-family: Consolas;"><span style="font-size: x-small;">PS C:\Users\vaibhavb\Desktop&gt; <strong><span style="font-size: small;">Import-Module HvPosh</span></strong><br />
PS C:\Users\vaibhavb\Desktop&gt; </span><span style="font-size: small;"><strong>Grant-HVaccess</strong></span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;">Is auth done?<br />
Is Auth done &#8211; (Y)?<br />
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help<br />
(default is &#8220;Y&#8221;):y</span></p>
<p><span style="font-family: Consolas;"><span style="font-size: x-small;">PS C:\Users\vaibhavb\Desktop&gt;<strong> <span style="font-size: small;">Get-Things weight | Format-Table</span></strong></span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;">When        Value       Key         TypeId      TypeName    EffectiveDa       State       Flags  IsPersonal IsDownVersi<br />
te                                                     oned<br />
&#8212;-        &#8212;&#8211;       &#8212;         &#8212;&#8212;      &#8212;&#8212;&#8211;    &#8212;&#8212;&#8212;&#8211;       &#8212;&#8211;       &#8212;&#8211;  &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211;<br />
10/12/2011  175 pounds  f7931e43&#8230; 3d34d87e&#8230; Weight M&#8230; 10/12/20&#8230;      Active        None       False       False<br />
10/12/2011  385         d4b2e3ab&#8230; 3d34d87e&#8230; Weight M&#8230; 10/12/20&#8230;      Active        None       False       False<br />
8/5/2011&#8230; 160         382e9e1f&#8230; 3d34d87e&#8230; Weight M&#8230; 8/5/2011&#8230;      Active        None       False       False<br />
7/7/2010&#8230; 250 pounds  1a76d859&#8230; 3d34d87e&#8230; Weight M&#8230; 7/7/2010&#8230;      Active        None       False       False<br />
…</span></p>
<p><span style="font-family: Consolas; font-size: x-small;">PS C:\Users\vaibhavb\Desktop&gt; </span><span style="font-family: Consolas;"><span style="font-size: x-small;"><strong><span style="font-size: small;">Add-Things weight 170</span><br />
</strong>PS C:\Users\vaibhavb\Desktop&gt; </span><span style="font-size: small;"><strong>Get-Things weight | Format-Table</strong></span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;">When        Value       Key         TypeId      TypeName    EffectiveDa       State       Flags  IsPersonal IsDownVersi<br />
te                                                     oned<br />
&#8212;-        &#8212;&#8211;       &#8212;         &#8212;&#8212;      &#8212;&#8212;&#8211;    &#8212;&#8212;&#8212;&#8211;       &#8212;&#8211;       &#8212;&#8211;  &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211;<br />
</span><span style="font-family: Consolas;"><span style="font-size: x-small;"><span style="background-color: #ffff00;">10/13/2011  170 pounds  45abc16d&#8230; 3d34d87e&#8230; Weight M&#8230; 10/13/20&#8230;      Active        None       False       False<br />
</span>10/12/2011  175 pounds  f7931e43&#8230; 3d34d87e&#8230; Weight M&#8230; 10/12/20&#8230;      Active        None       False       False<br />
10/12/2011  385         d4b2e3ab&#8230; 3d34d87e&#8230; Weight M&#8230; 10/12/20&#8230;      Active        None       False       False<br />
8/5/2011&#8230; 160         382e9e1f&#8230; 3d34d87e&#8230; Weight M&#8230; 8/5/2011&#8230;      Active        None       False       False</span></span></p>
<p>So what is the cool thing going on above? Well in <span style="font-family: Consolas; font-size: small;"><strong>five commands</strong></span> we are able to authenticate, get and put weight readings in to HealthVault!</p>
<p>This is all possible owing to the magic of <a href="http://en.wikipedia.org/wiki/Windows_PowerShell">powershell</a>, and a powershell HealthVault module (<a href="https://github.com/vaibhavb/HvPosh">HvPosh</a>). This is just a start, there all kinds of nerd scenarios this HealthVault command line shell can do! Think about command line automation for getting in all that data in to HealthVault, working with test data, understanding the healthvault xml, and doing all sorts of quantization on your personal health data!! The possibilities are limit-less, well at least for the command line nerds <img src='http://healthblog.vitraag.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p><strong>So what is HvPosh?</strong></p>
<p>HvPosh is a HealthVault powershell module currently running as a desktop client application. The source for this module is up on <a href="https://github.com/vaibhavb/HvPosh">github</a> and you are welcome to contribute more functions, cmdlets, test data or infact various analysis modules!</p>
<p>Take HvPosh for a spin, and yep! this is right out of oven so be gentle!</p>
<p><a href="http://healthblog.vitraag.com/wp-content/uploads/2011/10/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://healthblog.vitraag.com/wp-content/uploads/2011/10/image_thumb.png" border="0" alt="image" width="359" height="287" /></a></p>
<p>Fig 1. HvPosh On <a href="https://github.com/vaibhavb/HvPosh">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/10/healthvault-powershell-module-the-beginnings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source Convention (OSCON) 2011</title>
		<link>http://healthblog.vitraag.com/2011/07/open-source-convention-oscon-2011/</link>
		<comments>http://healthblog.vitraag.com/2011/07/open-source-convention-oscon-2011/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 07:47:23 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/2011/07/open-source-convention-oscon-2011/</guid>
		<description><![CDATA[Myself and my esteemed colleague, Ali Emami will be at OSCON starting tomorrow. The healthcare track this year is packed with great content, we will be touching on HealthVault and Microsoft’s participation in the Direct project.
Last year I talked about Programming Healthcare Silos, the Direct project is an innovative way to bridge the silos in [...]]]></description>
			<content:encoded><![CDATA[<p>Myself and my esteemed colleague, <a href="http://www.oscon.com/oscon2011/profile/124027">Ali Emami</a> will be at <a href="http://www.oscon.com/oscon2011">OSCON</a> starting tomorrow. The <a href="http://www.oscon.com/oscon2011/public/schedule/topic/Healthcare">healthcare track</a> this year is packed with great content, we will be touching on <a href="http://www.oscon.com/oscon2011/public/schedule/detail/19573">HealthVault and Microsoft’s participation in the Direct project</a>.</p>
<p>Last year I talked about <a href="http://www.oscon.com/oscon2010/public/schedule/detail/15292">Programming Healthcare Silos</a>, the Direct project is an innovative way to bridge the silos in Healthcare and provide a secure provider to provider and provider to patient mode of data exchange.</p>
<p><span id="more-349"></span>If you are around stop by for the talk or come grab us of any relevant questions. We&#8217;ll post the slides online after the talk.</p>
<p>I’m looking forward to the conference, and particularly to the talk on <a href="http://www.oscon.com/oscon2011/public/schedule/detail/20081">personal data locker project</a> and more. It has been a <a href="http://ramblings.vitraag.com/2008/09/where-is-my-data-can-i-use-it-and-can-it-help-me/">pet peeve</a> of mine to build some akin to that, with the locker talk and more <a href="http://www.oscon.com/oscon2011/public/schedule/share/2a147fb7251577f134c7fbe2e27abd56">awesomeness</a> hopefully I’ll get to hacking on it soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/07/open-source-convention-oscon-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Graphing for Windows Phone 7&#8211; Mood Tracker #6</title>
		<link>http://healthblog.vitraag.com/2011/07/graphing-for-windows-phone-7-mood-tracker-6/</link>
		<comments>http://healthblog.vitraag.com/2011/07/graphing-for-windows-phone-7-mood-tracker-6/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 00:41:25 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[MoodTracker]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/?p=347</guid>
		<description><![CDATA[Wishing every one a happy independence day!
In the last post we enabled Mood Tracker to enter new data in to HealthVault.&#160; Before I start this post in details of adding graphing layer let me motivate it by showing what the graph for Mood Tracker looks like -

Fig 1. Graphing Over the 7 days
The interesting aspect [...]]]></description>
			<content:encoded><![CDATA[<p>Wishing every one a happy independence day!</p>
<p>In the last post we <a href="http://healthblog.vitraag.com/2011/06/entering-new-data-with-mood-tracker-5/">enabled</a> Mood Tracker to enter new data in to HealthVault.&#160; Before I start this post in details of adding graphing layer let me motivate it by showing what the graph for Mood Tracker looks like -</p>
<p><a href="http://healthblog.vitraag.com/wp-content/uploads/2011/07/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://healthblog.vitraag.com/wp-content/uploads/2011/07/image_thumb.png" width="223" height="369" /></a></p>
<p>Fig 1. Graphing Over the 7 days</p>
<p>The interesting aspect here is that we are tracking Mood, Stress and Wellbeing over a period of one week, and looking for patterns in terms of mood, stress and wellbeing correlations. There are better ways to do graphing for this data but this is a simplistic approach.</p>
<p>In order to be able to get data from HealthVault for a specific time period we will have to update the implementation of our <a href="https://github.com/vaibhavb/moodtracker/blob/master/MoodTracker/HealthVaultMethods.cs">GetThings</a> method to allow for a filter for effective date max and min. Notice the interesting formatting we need to do to make DateTime serializable.</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">string</span> EffDateMinXml(DateTime? effDateMin)
{
    <span class="kwrd">if</span> (effDateMin != <span class="kwrd">null</span>)
        <span class="kwrd">return</span>
            <span class="kwrd">string</span>.Format(<span class="str">@&quot;&lt;eff-date-min&gt;{0}&lt;/eff-date-min&gt;&quot;</span>,
                effDateMin.Value.ToString(<span class="str">&quot;yyyy-MM-ddTHH:mm:ss.FFFZ&quot;</span>,
                            CultureInfo.InvariantCulture)
                );
    <span class="kwrd">else</span> <span class="kwrd">return</span> <span class="str">&quot;&quot;</span>;
}</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Once we are powered with a way to selectively get information from HealthVault we can simply make use of the awesome open-source amCharts library. Infact I added it to the project with one-click using <a href="http://www.nuget.org/List/Packages/amChartsQuickCharts">NuGet Package manager</a> (note to self: may be post a version of HealthVault Windows Phone library on NuGet). Here is a snippet of how I configured the SerialChart.</p>
<pre class="csharpcode">

<span class="kwrd">&lt;</span><span class="html">amq:SerialChart</span> <span class="attr">x:Name</span><span class="kwrd">=&quot;EmotionsChart&quot;</span>
                <span class="attr">BorderThickness</span><span class="kwrd">=&quot;1&quot;</span>
                <span class="attr">DataSource</span><span class="kwrd">=&quot;{Binding EmotionList}&quot;</span>
                <span class="attr">CategoryValueMemberPath</span><span class="kwrd">=&quot;FormattedWhen&quot;</span>
                <span class="attr">AxisForeground</span><span class="kwrd">=&quot;White&quot;</span>
                <span class="attr">PlotAreaBackground</span><span class="kwrd">=&quot;Black&quot;</span>
                <span class="attr">GridStroke</span><span class="kwrd">=&quot;DarkGray&quot;</span> <span class="attr">Height</span><span class="kwrd">=&quot;463&quot;</span> <span class="attr">Width</span><span class="kwrd">=&quot;450&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">amq:SerialChart.Graphs</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">amq:LineGraph</span> <span class="attr">ValueMemberPath</span><span class="kwrd">=&quot;Mood&quot;</span>
                        <span class="attr">Title</span><span class="kwrd">=&quot;Mood&quot;</span> <span class="attr">Brush</span><span class="kwrd">=&quot;Blue&quot;</span>
                        <span class="attr">StrokeThickness</span><span class="kwrd">=&quot;6&quot;</span>
                        <span class="attr">BorderBrush</span><span class="kwrd">=&quot;Cornsilk&quot;</span><span class="kwrd">/&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">amq:LineGraph</span> <span class="attr">ValueMemberPath</span><span class="kwrd">=&quot;Stress&quot;</span>
                        <span class="attr">Title</span><span class="kwrd">=&quot;Stress&quot;</span> <span class="attr">Brush</span><span class="kwrd">=&quot;#8000FF00&quot;</span>
                        <span class="attr">StrokeThickness</span><span class="kwrd">=&quot;8&quot;</span> <span class="kwrd">/&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">amq:LineGraph</span> <span class="attr">ValueMemberPath</span><span class="kwrd">=&quot;Wellbeing&quot;</span>
                        <span class="attr">Title</span><span class="kwrd">=&quot;Wellbeing&quot;</span>
                        <span class="attr">StrokeThickness</span><span class="kwrd">=&quot;2&quot;</span>
                        <span class="attr">Brush</span><span class="kwrd">=&quot;#80FF0000&quot;</span><span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">amq:SerialChart.Graphs</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">amq:SerialChart</span><span class="kwrd">&gt;</span>

<span class="kwrd"></span>&#160;
</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Note that the formatting for the X-Axis is derived by a special property we added to the <a href="https://github.com/vaibhavb/moodtracker/blob/master/MoodTracker/EmotionalStateModel.cs">EmotionalStateModel</a>, it probably is not the right place to add that property.</p>
<p>Over last few days I have implemented an interesting idea to make entering emotional state information easier similar in themes as the original mood tree but more focused on making data entry fun , I call it vMudi.</p>
<p>So next time w’ll look at vMudi.</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/07/graphing-for-windows-phone-7-mood-tracker-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Entering new data with Mood Tracker #5</title>
		<link>http://healthblog.vitraag.com/2011/06/entering-new-data-with-mood-tracker-5/</link>
		<comments>http://healthblog.vitraag.com/2011/06/entering-new-data-with-mood-tracker-5/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 01:18:14 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[HealthVault]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[MoodTracker]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/?p=343</guid>
		<description><![CDATA[In the last post, we discussed how one can display the data retrieved from HealthVault Emotional State data-type.
I showed an interesting LINQ query which sort the HealthVault items returned from a getthings. Well actually turns out that we can do this more efficiently by using the max attribute on group filter in the getthings. The [...]]]></description>
			<content:encoded><![CDATA[<p>In the last <a href="http://healthblog.vitraag.com/2011/06/adding-a-healthvault-datatype-to-moodtracker-4/">post</a>, we discussed how one can display the data retrieved from HealthVault Emotional State data-type.</p>
<p>I showed an interesting LINQ query which sort the HealthVault items returned from a getthings. Well actually turns out that we can do this more efficiently by using the max attribute on group filter in the getthings. The items returned by HealthVault are sorted by eff-date and if we get the first one it should be the latest item!</p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<pre class="csharpcode">        <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> GetThings(<span class="kwrd">string</span> typeId, <span class="kwrd">int</span> maxItems,
            EventHandler&lt;HealthVaultResponseEventArgs&gt; responseCallback)
        {
            <span class="kwrd">string</span> thingXml = @&quot;
            &lt;info&gt;
                &lt;group max=<span class="str">'{0}'</span>&gt;
                    &lt;filter&gt;
                        &lt;type-id&gt;{1}&lt;/type-id&gt;
                        &lt;thing-state&gt;Active&lt;/thing-state&gt;
                    &lt;/filter&gt;
                    &lt;format&gt;
                        &lt;section&gt;core&lt;/section&gt;</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Before we get to the topic of this post and discuss how we can put new items in to HealthVault, here a screen shot of how the application looks like once we have enabled the put and prettied up the last reading a little bit &#8211;</p>
<p><a href="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image_thumb6.png" width="203" height="341" /></a></p>
<p>Fig 1. MoodTracker with put enabled!</p>
<p>We can see that for each of the states i.e mood, stress and wellbeing we have a nice slider which lets the user capture their state and we can want this information uploaded with current time stamp once the user hits Save!</p>
<pre class="csharpcode">        <span class="rem">// Save the reading to HealthVault</span>
        <span class="kwrd">private</span> <span class="kwrd">void</span> button1_Click(<span class="kwrd">object</span> sender, RoutedEventArgs e)
        {
            EmotionalStateModel model = <span class="kwrd">new</span> EmotionalStateModel();
            model.Mood = (Mood)c_MoodSlider.Value;
            model.Stress = (Stress)c_StressSlider.Value;
            model.Wellbeing = (Wellbeing)c_WellbeingSlider.Value;
            model.When = DateTime.Now;
            HealthVaultMethods.PutThings(model, PutThingsCompleted);
            SetProgressBarVisibility(<span class="kwrd">true</span>);
        }</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Lets get a bit deeper in how the PutThings call works. It fetches the relevant information from the base object and submits that to HealthVault. The design in this case might be a little wary since the put parameters are coming from the <a href="https://github.com/vaibhavb/moodtracker/blob/master/MoodTracker/EmotionalStateModel.cs">emotional state</a> object as well.</p>
<pre class="csharpcode">        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// PutThings Method</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name=&quot;item&quot;&gt;The health item to upload&lt;/param&gt;</span>
        <span class="rem">/// &lt;param name=&quot;responseCallback&quot;&gt;Function to resolve callback&lt;/param&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> PutThings(HealthRecordItemModel item,
            EventHandler&lt;HealthVaultResponseEventArgs&gt; responseCallback)
        {
            XElement info = XElement.Parse(item.GetXml());
            HealthVaultRequest request = <span class="kwrd">new</span> HealthVaultRequest(<span class="str">&quot;PutThings&quot;</span>, <span class="str">&quot;2&quot;</span>, info, responseCallback);
            App.HealthVaultService.BeginSendRequest(request);
        }</pre>
<p>Voila!! We have an application which can read and update information to HealthVault!</p>
<p><strong>Next Time:</strong> We will focus on adding the History or Charting aspects of this application!</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/06/entering-new-data-with-mood-tracker-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding A HealthVault DataType to MoodTracker #4</title>
		<link>http://healthblog.vitraag.com/2011/06/adding-a-healthvault-datatype-to-moodtracker-4/</link>
		<comments>http://healthblog.vitraag.com/2011/06/adding-a-healthvault-datatype-to-moodtracker-4/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 05:58:52 +0000</pubDate>
		<dc:creator>vaibhavb</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[MoodTracker]]></category>

		<guid isPermaLink="false">http://healthblog.vitraag.com/?p=339</guid>
		<description><![CDATA[Last time we figured out how to associate our application with HealthVault. In this post we will focus on reading data from HealthVault.     
So the data type we settled on was EmotionalState, we can find a sample xml for this type on the HealthVault Developer Center. 
Out first goal is to [...]]]></description>
			<content:encoded><![CDATA[<p>Last time we figured out how to <a href="http://healthblog.vitraag.com/2011/06/associating-mood-tracker-with-healthvault-3/">associate our application with HealthVault</a>. In this post we will focus on reading data from HealthVault.     </p>
<p>So the data type we settled on was EmotionalState, we can find a <a href="http://developer.healthvault.com/pages/types/viewsamplexml.aspx?name=Emotional%20State&amp;id=4b7971d6-e427-427d-bf2c-2fbcf76606b3">sample xml</a> for this type on the HealthVault Developer Center. </p>
<p>Out first goal is to be able to display this type in our application. We need test data for emotional state so we add test information to our developer account from <a href="http://developer.healthvault.com/pages/types/types.aspx">type samples</a>.</p>
<p><a href="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image_thumb3.png" width="699" height="36" /></a></p>
<p>Fig 1. Adding Emotional State sample to HealthVault record.</p>
<p>Please note: You need to be signed in to developer.healthvault.com to add the above sample.</p>
<p>We can verify that this sample is added to our record by using the <a href="http://developer.healthvault.com/pages/view/things.aspx">HealthExplorer</a>.</p>
<p><a href="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image_thumb4.png" width="403" height="130" /></a></p>
<p>Fig 2. Emotional State Samples in developer account.</p>
<p>The easiest way to get-things from HealthVault is using the GetThings version 3 method. A Get on things can be performed using various filters for the purposes of this application which just retrieve all the active things of type Emotional State.</p>
<pre class="csharpcode">                HealthVaultMethods.GetThings(EmotionalStateModel.TypeId, GetThingsCompleted);</pre>
<p>To make it easier to work with GetThings I implemented a simple abstraction on the method in <a href="https://github.com/vaibhavb/moodtracker/blob/master/MoodTracker/HealthVaultMethods.cs">HealthVaultMethods</a> class.</p>
<p>Now once we can get thing emotional state things we need to perform two things on the client side.</p>
<p>1. Sort them in the date order and pick the latest one</p>
<p>For this item Linq to XML comes in very handy, just in three lines we can make this query work!</p>
<pre class="csharpcode"> <span class="rem">// using linq to get the latest reading of emotional state</span>
 XElement latestEmotion = (from thingNode <span class="kwrd">in</span> responseNode.Descendants(<span class="str">&quot;thing&quot;</span>)
         orderby Convert.ToDateTime(thingNode.Element(<span class="str">&quot;eff-date&quot;</span>).Value) descending
         select thingNode).FirstOrDefault&lt;XElement&gt;();</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>2. Parse them for the mood, stress and wellbeing data.</p>
<p>We can achieve this my creating a <a href="https://github.com/vaibhavb/moodtracker/blob/master/MoodTracker/EmotionalStateModel.cs">model</a> for Emotional State. Have a good model makes if super easy to parse the XElement to the object we need &#8211;</p>
<pre class="csharpcode"> EmotionalStateModel emotionalState =
     <span class="kwrd">new</span> EmotionalStateModel();
     emotionalState.Parse(latestEmotion.Descendants(<span class="str">&quot;data-xml&quot;</span>).Descendants(<span class="str">&quot;emotion&quot;</span>).Single());</pre>
<p>XElement and lazy evaluation makes our job super-simple, compared to XPathNavigator -</p>
<pre class="csharpcode">

 <span class="kwrd">public</span> <span class="kwrd">void</span> Parse(XElement emotionalState)
 {

        <span class="kwrd">this</span>.Mood = (Mood) System.Enum.Parse(<span class="kwrd">typeof</span>(Mood),
           ((XElement)emotionalState.Element(<span class="str">&quot;mood&quot;</span>)).Value, <span class="kwrd">true</span>);
        <span class="kwrd">this</span>.Stress = (Stress) System.Enum.Parse(<span class="kwrd">typeof</span>(Stress),
            ((XElement)emotionalState.Element(<span class="str">&quot;stress&quot;</span>)).Value, <span class="kwrd">true</span>);
        <span class="kwrd">this</span>.Wellbeing = (Wellbeing) System.Enum.Parse(<span class="kwrd">typeof</span>(Wellbeing),
            ((XElement)emotionalState.Element(<span class="str">&quot;wellbeing&quot;</span>)).Value, <span class="kwrd">true</span>);
 }

&#160;

Now we are ready to show the latest emotional state reading!!

&#160;

<a href="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://healthblog.vitraag.com/wp-content/uploads/2011/06/image_thumb5.png" width="199" height="332" /></a>
</pre>
<p>Fig 3. Latest Emotional State Reading in Mood Tracker!</p>
<p><strong>Next Time: </strong>We will look at how we can enter new data with Mood Tracker!</p>
]]></content:encoded>
			<wfw:commentRss>http://healthblog.vitraag.com/2011/06/adding-a-healthvault-datatype-to-moodtracker-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

