<?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>Hacking at 0300 &#187; Medical Informatics</title>
	<atom:link href="http://bililite.com/blog/category/medical/feed/" rel="self" type="application/rss+xml" />
	<link>http://bililite.com/blog</link>
	<description>Thoughts on web design and programming from a very occasional volunteer webmaster</description>
	<lastBuildDate>Fri, 23 Jul 2010 09:00:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A real pain scale</title>
		<link>http://bililite.com/blog/2010/03/25/a-real-pain-scale/</link>
		<comments>http://bililite.com/blog/2010/03/25/a-real-pain-scale/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 20:48:55 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1184</guid>
		<description><![CDATA[I usually don't blog about medical stuff here, but Allie Brosh's comments about the Wong-Baker pain scale are perfectly on-target. The Joint Commission accredits health care organizations and comes up with intrusive, well-intended but largely pointless standards that the rest of us have to uphold. A sort of "unfounded mandate." One of these is the [...]]]></description>
			<content:encoded><![CDATA[<p>I usually don't blog about medical stuff here, but <a href="http://hyperboleandahalf.blogspot.com/">Allie Brosh</a>'s <a href="http://hyperboleandahalf.blogspot.com/2010/02/boyfriend-doesnt-have-ebola-probably.html">comments</a> about the <a href="http://www.sjbhealth.org/documents/Pain%20Scale.pdf">Wong-Baker pain scale</a> <a href="http://hyperboleandahalf.blogspot.com/2010/02/boyfriend-doesnt-have-ebola-probably.html">are perfectly on-target</a>. The <a href="http://www.jointcommission.org/">Joint Commission</a> accredits health care organizations and comes up with intrusive, well-intended but largely pointless standards that the rest of us have to uphold. A sort of "unfounded mandate." One of these is the requirement that we document pain levels in every patient on a scale of one to ten. For pediatric patients, we have this "FACES" scale that starts from a big smile and doesn't even get to a frown until number six. I like Allie's much better.</p>
<p>And her comment about not eating red food when you're sick is absolutely right. Never give your kid red popsicles when they've got a stomach bug; you'll just rush into the ER worried that they're throwing up blood.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2010/03/25/a-real-pain-scale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Engauge Digitizer Tutorial</title>
		<link>http://bililite.com/blog/2010/01/14/engauge-digitizer-tutorial/</link>
		<comments>http://bililite.com/blog/2010/01/14/engauge-digitizer-tutorial/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:58:49 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1152</guid>
		<description><![CDATA[A simple walkthrough to use the Engauge Digitizer to pull values off a "printed" graph There's a far more complete manual that comes with the download, but these are the steps I used to generate the data for the webservices graphs. It assumes you've got a black and white image of the graph, with continuous [...]]]></description>
			<content:encoded><![CDATA[<h3>A simple walkthrough to use the <a href="http://digitizer.sourceforge.net/">Engauge Digitizer</a> to pull values off a "printed" graph</h3>
<p>There's a far more complete manual that comes with the download, but these are the steps I used to generate the data for the
<a href="/webservices">webservices</a> graphs. It assumes you've got a black and white image of the graph, with continuous lines for the
data and orthogonal gridlines, and linear axes.</p><span id="more-1152"></span>
<p>We'll use the bilirubin risk levels from the <a href="http://aappolicy.aappublications.org/cgi/content/full/pediatrics;114/1/297">AAP bilirubin guidelines</a>:</p>
<a href="/images/bili.jpg"><img style="display: block; height: 20em" src="/images/bili.jpg" /></a>
<ol>
<li><h4>Open the digitizer</h4>
<p>You can't use <code>Open with...</code> from the context menu because the program expects filenames as part of the options;
you can read the manual to see how to modify the context menu. Click <code>Import</code>
on the toolbar:  <img src="/images/digitizer-import.png" alt="Import icon" /> and select your image file:</p>
<a href="/images/graph1.png"><img style="display: block; height: 20em" src="/images/graph1.png" alt="graph imported"/></a>
<p>Save your work (it's a <code>.dig</code> file) often. You don't need me to remind you.</p>
</li>
<li><h4>Set the axes</h4>
<p>Click <code>Axis Point</code> in the toolbar: <img src="/images/digitizer-axis.png" alt="Axis icon" /> and click on the origin
(lower left corner) of the graph and enter the x,y values for the origin in the units of the graph (not pixels!). Usually that's (0,0)
but can be anything. Click on the maximum of the y-axis (upper left corner), then the maximum  of the x-axis (lower right corner).</p>
<li><h4>Remove the grid</h4>
<p>Select <code>Grid Removal...</code> from the <code>Settings</code> menu. Select "Remove thin lines parallel to the axes" and play with
the "Minimum line thickness" until the gridlines are gone from the preview on the bottom but the real curves are still there.</p>
<a href="/images/removegrid.png"><img style="display: block" src="/images/removegrid.png" alt="remove grid window" /></a>
<p>Now the grid is gone and digitizing the curves will be easy:</p>
<a href="/images/gridremoved.png"><img style="display: block; height: 20em" src="/images/gridremoved.png" alt="graph without grid"/></a>
</li>
<li><h4>Create curves</h4>
<p>Select <code>Curves...</code> from the <code>Settings</code> menu. Create as many curves as you need (we have three). Give them descriptive
names if you like:</p>
<a href="/images/curves.png"><img style="display: block;" src="/images/curves.png" alt="curve window"/></a>
</li>
<li><h4>Digitize each curve</h4>
<p>Click <code>Segment Fill</code> in the toolbar: <img src="/images/digitizer-segment.png" alt="Segment icon" />. For each curve, select it
from the curve menu: <img src="/images/digitizer-curvemenu.png" alt="Axis icon" /> and click the points on the graph for that curve until
it is covered with points. There's no undo command. If a wrong point is included, use the <code>Select</code> tool:
<img src="/images/digitizer-select.png" alt="Select icon" /> to select the bad points and use the <code>Delete</code> key. To add individual points,
use the <code>Curve Point</code> tool: <img src="/images/digitizer-point.png" alt="Curve Point icon" />. In a few clicks, you have the fully
digitized graph:</p>
<a href="/images/curvesdigitized.png"><img style="display: block;height: 20em;" src="/images/curvesdigitized.png" alt="curve window"/></a>
</li>
<li><h4>Set up the export</h4>
<p>If you exported the data now, you'd have lots of points; probably far more than is justified from the original graph. Decide which x-axis
values should be exported (the program will interpolate appropriately if the digitized points don't land exactly). Select
<code>Grid Display...</code> from the <code>Settings</code> menu:</p>
<a href="/images/gridmesh.png"><img style="display: block;" src="/images/gridmesh.png" alt="grid window"/></a>
<p>The values to be specified are related by <code>count = (stop - start)/step</code> so you only need to specify three; select the one you
<em>don't</em> want to specify from the <code>Disable</code> dropdown menu. Make sure that the start and stop values are actually in the curve;
the program will happily extrapolate off the curve but it's probably not scientifically legitimate. Ignore the y axis grid lines.</p>
<p>Select <code>Export Setup...</code> from the <code>Settings</code> menu. In the <code>Points Selection</code> section, select
<code>Intepolate Y's at gridline X's</code>.</p>
<a href="/images/exportsettings.png"><img style="display: block;" src="/images/exportsettings.png" alt="grid window"/></a>
</li>
<li><h4>Export</h4>
<p>Click the <code>Export</code> icon in the toolbar: <img src="/images/digitizer-export.png" alt="Export icon" />. Pick a name and you now have a
<a href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a> file with your data. Simple, no?</p>
</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2010/01/14/engauge-digitizer-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Digitizing graphs</title>
		<link>http://bililite.com/blog/2010/01/10/digitizing-graphs/</link>
		<comments>http://bililite.com/blog/2010/01/10/digitizing-graphs/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 02:55:04 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1138</guid>
		<description><![CDATA[I wanted to add Down Syndrome growth charts to the bililite.com webservices, but as far as I can tell, the charts are available only as images in the AAP's guidelines (and the original paper; subscription only). The often-cited growthcharts.com has charts, and Greg Richards was generous enough to share his data with me. However, some [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to add <a href="http://en.wikipedia.org/wiki/Down_syndrome">Down Syndrome</a> growth charts to the <a href="/webservices/">bililite.com webservices</a>, but as far as I can tell, the charts are available only as images in the <a href="http://aappolicy.aappublications.org/cgi/content/full/pediatrics;107/2/442"><abbr title="American Academy of Pediatrics">AAP</abbr>'s guidelines</a> (and the <a href="http://pediatrics.aappublications.org/cgi/reprint/81/1/102">original paper</a>; subscription only). The often-cited <a href="http://growthcharts.com/charts/DS/charts.htm">growthcharts.com</a> has charts, and Greg Richards was generous enough to share his data with me. However, some of the data are from a different study, and he got his data from the original charts the old-fashioned way: with pencil, ruler, and a blown-up copy of the paper. Nothing wrong with that; that's how I got my numbers for the <a href="/webservices/bili">bilirubin chart</a>, but I wanted all my charts to match the AAP's.</p>
<p>So how to get the numbers off the graph? I emailed the lead author of the original paper, but haven't gotten any answer. I can pull the graphs as gif's from the PDF of the paper (thanks to <a href="http://www.openoffice.org/">OpenOffice.org</a> and <a href="http://extensions.services.openoffice.org/project/pdfimport">Sun's PDF importer</a>; Adobe's reader seems to get more limited with each upgrade). I was afraid I would have to digitize the graph by hand; I read the cool article on <a href="http://sudokugrab.blogspot.com/2009/07/how-does-it-all-work.html">Sudoku recognition</a> and figured I could learn about <a href="http://en.wikipedia.org/wiki/Hough_transform">Hough transforms</a> to get the graph, and <a href="http://en.wikipedia.org/wiki/Discrete_Fourier_transform#Multidimensional_DFT">2-D Fourier transforms</a> to remove the gridlines, then <a href="http://en.wikipedia.org/wiki/Blob_detection">blob detection</a> to find the lines. Turning pixels into measurements would be the trivial last step. Sounds like fun, if I had an infinite amount of free time.</p>
<p>Luckily, I found <a href="http://digitizer.sourceforge.net/">Engauge Digitizer</a>. With almost no time reading the manual, I had it removing gridlines, digitizing the curves on the graph, and exporting values at x-values that I selected into CSV files. It was close to easy. Not quite automated, but with only 4 graphs to digitize, I was done in half an hour. Highly recommended. With my remaining free time, I'll write a quick tutorial so I don't forget what I did.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2010/01/10/digitizing-graphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bililite.com webservices</title>
		<link>http://bililite.com/blog/2009/12/31/bililite-com-webservices/</link>
		<comments>http://bililite.com/blog/2009/12/31/bililite-com-webservices/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 03:51:48 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1120</guid>
		<description><![CDATA[I've been spending my project time learning how to manipulate images in PHP to let me create custom growth charts and the like, with a RESTful interface that would allow them to be used as the source of &#60;img&#62; elements. I like the way things turned out; they are available at bililite.com/webservices/. It includes height,weight, [...]]]></description>
			<content:encoded><![CDATA[<p>I've been spending my project time learning how to manipulate images in PHP to let me create custom growth charts and the like, with a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> interface that would allow them to be used as the source of &lt;img&gt; elements. I like the way things turned out; they are available at <a href="/webservices/">bililite.com/webservices/</a>. It includes height,weight, head circumference, peak expiratory flow (for managing asthma), blood pressure and bilirubin levels. While it took a fair amount of trial-and-error to get things to work, I don't think there's much that's innovative enough programming-wise to write a tutorial.</p>
<p>I want to get it to parse the Accept: header, so  users can leave out the file extensions, but it looks like <a href="http://www.newmediacampaigns.com/page/browser-rest-http-accept-headers">browsers don't implement that correctly</a>, so I'll have to keep using extensions as well.</p>
<p>I still need to learn more about caching and effectively using eTags and all the headers that go with it. It always makes my brain hurt.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/12/31/bililite-com-webservices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diving into OpenOffice.org</title>
		<link>http://bililite.com/blog/2009/09/08/diving-into-openoffice-org/</link>
		<comments>http://bililite.com/blog/2009/09/08/diving-into-openoffice-org/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:41:38 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>
		<category><![CDATA[OpenOffice.org]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1070</guid>
		<description><![CDATA[My hospital isn't fully electronic yet; they use a hybrid system where doctors notes and orders are written on paper, to be scanned into the electronic chart at the end of the patient's stay. Everything else (nurse's notes, labs, radiology results) are electronic. It actually works pretty well, with most of the advantages of an [...]]]></description>
			<content:encoded><![CDATA[<p>My hospital isn't fully electronic yet; they use a hybrid system where doctors notes and orders are written on paper, to be scanned into the electronic chart at the end of the patient's stay. Everything else (nurse's notes, labs, radiology results) are electronic. It actually works pretty well, with most of the advantages of an <abbr title="Electronic Medical Record">EMR</abbr> (Electronic Medical Record) without forcing the older doctors to use the computer. That's coming, of course, but it won't be pretty.</p>
<p>But those of us for whom the computer is mother's milk, and whose handwriting is somewhere between <a href="http://www.cartoonstock.com/cartoonview.asp?catref=jdin372">chicken scratch</a> and <a href="http://en.wikipedia.org/wiki/Linear_A">Linear A</a>, we'd rather do it all online. I've been writing my admission notes for a few years with a Microsoft Word template, printing them out and putting them in the chart, with nary a problem. And the medical records department clearly used PDF's for the pages, both the blank order sheets and the preprinted, fill-in-the-blanks "standard orders" since they were available on the hospital intranet. So let's create PDF's with actual editable text boxes and check boxes (these are mockups, but they look right):</p>
<p><a href="/blog/blogfiles/orders.pdf"><img src="/blog/blogfiles/orders.png" alt="physician order sheet" title="Blank Physician Order Sheet" /></a><a href="/blog/blogfiles/gastro.pdf"><img src="/blog/blogfiles/gastro.png" alt="gastroenteritis order sheet" title="Gastroenteritis Order Sheet" /></a></p>
<span id="more-1070"></span>
<p>The response from medical records: not an option. It's too hard, inserting all those textboxes by hand on all those lines, and they don't "possess the very expensive software that makes this possible." They had to go to the graphic arts department to use their copy of Pagemaker. And any change means having to put all those controls back in the form again, by hand.</p>
<p>Never tell me something on the computer is impossible. I have <a href="http://en.wikipedia.org/wiki/Script_kiddies">teh l33t hax0r ski1z</a>! The expensive software problem is easy to solve; <a href="http://www.openoffice.org/">OpenOffice.org Writer</a> can generate PDF's, and a little experimentation shows that form elements are preserved. The "too hard" problem should be solvable, too; Writer is <a href="http://dlc.sun.com/pdf//817-1826/817-1826.pdf">scriptable</a> and I've scripted Microsoft Word with VBA often enough; how hard could it be?</p>
<p>Famous last words.</p>
<p>Scripting Microsoft Office is like pulling teeth; Basic is verbose and tedious, and the documentation for the object model is sparse. But scripting OpenOffice.org is like pulling teeth with your eyes closed. The documentation (the bane of all open source software) is virtually nonexistent; the macro recorder (so useful for Microsoft Office) records the user interface interactions, not the underlying object model; and there is no object browser to explore the methods and properties of each object (there is the <a href="http://wiki.services.openoffice.org/wiki/Extensions_development_basic#X-Ray_tool">xray tool</a> to look at objects one at a time as part of a macro).</p>
<p>So I just went to the <a href="http://wiki.services.openoffice.org/wiki/Documentation">documentation wiki</a> and dived in, spending a few hours browsing, trying to find a place to start. I'd recommend the <a href="http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide">BASIC guide</a> and the <a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Introduction">Introduction to UNO</a>, which is Sun's answer to Microsoft's <a href="http://en.wikipedia.org/wiki/Component_Object_Model">COM</a> and the basis for the OpenOffice.org document object model, then the <a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Basic/OpenOffice.org_Basic">BASIC Binding chapter</a> to put them together. The <a href="http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html">documentation of the object model</a> is near impossible to find but it's there.</p>
<p>You really need to be able to read Java to understand the rest of the documentation, since both the examples and the underlying concepts are in that language. I wouldn't use anything but Basic, though, since it abstracts away all the underlying interface querying and dispatching and type casting.</p>
<p>The code I developed is <a href="/blog//blogfiles/createPDFForm.bas.txt">here</a>;  I'll blog about the things I learned as I get the time.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/09/08/diving-into-openoffice-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
