Friday, October 9, 2009

An HL7 Version 3 WSDL Generator

A couple of weeks ago I railed at HL7 because they don't provide the tools that my collegues and I need to build Version 3 interfaces.  To begin remedy that problem, I started on some of my own tools.  I needed to create a WSDL for an IHE profile.  Since I had already figured out that the problem could be automated, I decided to figure out how to do it.  A few hours (about 20 all told) later, I've got a solution, which is about 8-12 hours longer than it would have taken me to hand-craft the WSDL in the first place.  The ROI will show up the very next time I need a WSDL for something.

It's remarkably small too, about 1400 lines of Java and an XSL transform that lets me customize the way the WSDL is built. I spent about 15 of the 20 hours trying to figure out how to deal with the transmission infrastructure, before I gave up and punted.

The application uses the PubDB file created by the publishing facilitator for any given workgroup.  Principally what it extracts from that database are relationships between the application roles and the interactions.  These are then written to an XML document, which is finally transformed via an XSLT transform into the WSDL output.

There's probably a dozen places where I've done something wrong, have misunderstood the intent behind HL7 transmission infrastructure, the mapping between messages in HL7 Version 3, and elsewhere.  However, I think its a useful start.  Certainly it will save me some work in the future.  Who knows, maybe someday this tool will actually be used during the build process of the HL7 Version 3 Standards to generate WSDLs automatically.

If you are interested, the complete project is in HL7V3WSDL.zip.

HL7V3WSDLGenerator is a rather simple software application that is designed to automatically generate WSDL files from HL7 Version 3 artifacts. To use this software you need only two more things:
  1. A copy of the publication database for the domain you want to build a WSDL for
  2. A Java Virtual Machine that supports Java 1.5 or later.

Installing the sofware is simple, just unzip the file to your hard drive. Running it is equally simple.  From the folder where you installed the software, type in

 
java -cp . org.hl7.v3.wsdl.WSDLGenerator PubDB.mdb

 
Where PubDb.mdb is the location of a PubDB file.  Don't have one?  You can  find the ones used for each ballot cycle here:  http://www.hl7.org/v3ballot/html/ (Just click on Source Files for the appropriate cycle, then domains and finally download one of the database zip files you find there; see here for an example).

 
Source code and documentation are provided, however I must note that support is not:
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
I'm planning on moving this into HL7 G-Forge or OHT in the future.  I'm also going to update the stylesheet (actually provide an alternate) to support IHE style WSDL files using ITI Volume II Appendix V rules.  If you understood that, you need to get out more often.
 
 

2 comments:

  1. It is notable that if you need the x86 jdk or jre. x64 Java cannot load the 32bit ODBC drivers. I dont seem to have x64 versions of ODBC drivers on my PC and im guessing its not a common configuration.

    ReplyDelete
  2. Go it going, there was an error in the connection string and i needed to use the x86 version of the java runtime.

    ReplyDelete