Saturday, 30 June 2007

HL7 Standards and Message Mapping

For most of the last year I've been working on healthcare integration projects, involved in HL7 and related technologies. One of the biggest frustrations I've encountered is the HL7 standard itself, access to it (and related information) and the way the standard is published.

The HL7 (v2) standard was published as a body of Word documents, apparently without any machine-readable version. You might have expected that the standard would have originated as a database plus supporting commentary but it seems that the Word documents have always been the definitive standard.  You could of course write software to crawl over the documents and extract the standard but it looks to me as if this would be pretty painful; I haven't checked every document, but I'm not sure they are all consistently formatted.

Almost from the start I decide to write tools to help me with message profiles, mappings and transformations, but to do that effectively you really need to have the standard in a machine-readable form.

I did come across a German site which offered an Access DB version of the standard but this has now become an product (I believe it was originally unaffiliated but legal pressure was brought to bear...)

The fact that is a quasi-commercial entity irritates me: I don't mind special-interest bodies charging for 'value-added' things like books, papers and conferences, but making the standard itself proprietary and to restrict access to it just feels wrong.  Standards like this should be open to all.

What prompted this post was discovering this effort to capture HL7 segments, fields and tables in an Excel spreadsheet. Pity that the link to the file doesn't seem to work: Matthew, if you read this, please check the link in your post.

Thank goodness v3 is XML based. Presumably the specification will be driven from XSDs.  Reading the HL7 'statement of principles' (SOP) for v3 they appear to regard the v2 principle of starting from documents and deriving the technical artifacts as 'more direct', as 'one simply edits ... the appropriate word processing document'! Direct, certainly, but desirable?  The SOP indicates that a tool-chain will be used to derive documentation from 'computerized models' which sounds better. 

I was able to get access to the latest v3 standard draft, and part of this site contains the XSD but they're all linked separately, and as HTML! Why on Earth not provide a zip download of the whole thing?

Tuesday, 12 June 2007

Google Gears, Silverlight and the RIA

I use Google Docs and Google Reader all the time. With Google Gears, these are set to become even more useful because they'll work when I'm offline. The Reader already works this way (see this post for more), but not Docs + Spreadsheets yet. Rumour has it that this is coming. If they solve the sync problem properly, this will be seriously good: Docs is fine for note-taking and certainly good enough for blog posting. And of course they must extend Gears to GMail.

Web 2.0, Ajax + Gears (+ whatever server-side stuff you use to generate all this) may be good enough technology for building browser-applications which work offline, but underneath the covers it's still based on HTML, grinding out a ton of hard-to-debug JavaScript, and running inside the browser frame. For the poor developer, even though dedicated folk spend hours creating libraries like (and Google's own GWT ) the experience of creating these applications remains pretty dire. And the result of all this extraordinary effort is still something which doesn't even approach the sophistication of the equivalent desktop application. As I said, I really like Google Docs, but it isn't Word, and won't ever be.

Then there's Adobe Flash and ActionScript, which has been around for a long time, is well established and has been used to create quite complex browser-hosted applications, such as Gliffy, which is (a bit) like Visio in a browser frame. Flash is cross-platform, as well as cross-browser, but still there's quite a gap between developing for Flash, and developing for the desktop. Now Adobe Labs is promoting AIR (the technology formerly known as Apollo). This looks like a warmed-over Flash, and appears to be based still on JS and HTML.

When I first heard about Silverlight, I wondered why Microsoft appeared to be tilting at the Flash/ActionScript windmill? Why would they expect developers of browser-hosted, graphical presentations to switch away from Flash? But that's not really what Silverlight is about: this is about creating a platform for Rich Internet Applications (RIAs) based on the .NET platform, which makes this potentially much more interesting, especially if development can be done in C# using Visual Studio, rather than mashing together markup and script. The runtime appears to be a a slightly reduced version of the CLR, supporting WPF/XAML as well as the traditional HTML/JS mixture. Quite remarkable, in a 1.1MB download. Rather than repeat more technical details here, I'll refer you to the Silverlight architecture summary paper.

Silverlight already runs on Mac as well as Windows, and in all the popular browsers. Could it be ported to Linux/Unix? The Mono project has proved the portability of the runtime, so it doesn't sound like such an outrageous suggestion.

Wednesday, 6 June 2007

Google Docs for Blog Posting

I'm finding Google Docs more and more useful for note-taking online, and quickly bashing together an outline document. I've just discovered that it will also post to weblog engines: this post was created in Google docs, the published straight to WordPress, via the MovableType API. This appears to work quite well, except that the document title doesn't appear to make it across to the blog posting (Update: yes it does - keep reading). You can tag the document in Google, and these tags are supposed to carry over into the blog posting.

I'll use this posting to experiment a bit. First, if I insert a picture into the document, will that be uploaded and linked in the post? I'll insert the image directly below this line:

Well, that worked! The secret is to choose the metaWeblog API instead of the MovableType API, despite the fact that Google recommends the latter: WordPress supports both, but the metaWeblog API appears to be better supported. I tried using the MovableType API initially; the posting title wasn't carried over, and tags didn't work. Both work with metaWeblog.

This really is excellent, especially because of the image embedding. Now all I want is for Google to add support for Google Gears to Google Docs and Spreadsheets, and I'll be very happy indeed.

XMI from Assemblies

I was about to start writing a tool to do this when it occurred to me that someone else must have done this already. Googling located two solutions:

  1. DOTNET2UML from AgileFactor, see this page.

  2. Xmi4DotNet, see this page.

Of these, (1) seems to be out of date and doesn't handle .NET 2.0, so it's no good to me at all. Option (2) appeals the most because it's an addin for Reflector. Trouble is, the current version of Reflector won't load it! I haven't time to work out why, but looking in the Google code issue list for this project, someone has reported this error already. Would be nice to see this fixed. I'd quite like to write code to do the reflection + generation myself, but it's just a distraction I can't afford right now.

WordPress v2.2

Upgrading successfully from 2.0.2 to 2.2 was not as straightforward as it should have been.

I followed all the instructions, disabling all the plugins and setting the theme back to the original default, but when I ran the wp-admin/upgrade.php script I got a lot of database errors.  The blog worked, but the categories were missing and the admin pages which refer to them showed errors.

These seem to be due to database permissions issues.  Googling for a solution I found a reference or two (e.g. this one), so I restored the old DB (what a good thing I did the backup!) and used phpMyAdmin to change the db-user permissions to include ALTER.  This appeared to fix the problem because the upgrade script worked perfectly.

My main gripe is that despite the (tedious, manual) DB fix, most of my posts appeared to lose their category tags.  Eventually, these appeared again, but I'm not sure exactly why.

The upgrading process is irritating. WordPress is such a fine piece of work overall, it seems such a shame that upgrading should have been be so clumsy and buggy.