|
HL7 JAVA SIG Co-Chair Dr. Peter Hendler 是我的一个朋友。Dr. Hendler 本人是Kaiser Permanente的医生。以下是他为下周HL7 San Diego 大会准备的一份简介。 参加大会的朋友,如果感兴趣的话,您可以直接到JAVA SIG 去找Peter. 其他朋友如有兴趣,我也可以进一步帮忙搭桥。谢谢。
<br>
<br>
<br>
<br>Java SIG README for demo release, September 9, 2005
<br>
<br>About the Java API to HL7 Version 3 RIM
<br>---------------------------------------
<br>
<br>HL7 Version 3 messages are all derived from the object-oriented data model called the RIM
<br>(Reference Information Model).
<br>
<br>There are a few dozen base RIM objects including ACT, PARTICIPATION, ROLE, and ENTITY.
<br>The data model also includes various complex data types that are classes themselves with
<br>methods as well as data.
<br>
<br>Every domain (pharmacy, lab, clinical notes, administration) is free to subclass the main
<br>RIM classes into more specialized "clone classes". For example, a blood glucose is a clone
<br>of observation which itself is a clone of ACT.
<br>
<br>Because the number of clone classes is extremely large and growing all the time, it would
<br>not be practical for an API to include all of them.
<br>
<br>The Java SIG made an early decision to limit our data model to the base RIM classes.
<br>Any clone classes can be represented by their parent in the RIM. This allows our data model
<br>to be stable without the need for endless updates or an unmanageably large data model.
<br>
<br>When an HL7 domain committee such as Laboratory or Orders and Observations wants to create
<br>a new message, for example glucose measurement, it creates a model of this message using
<br>the classes and data types defined in the RIM. Then, using special tooling, it can generate
<br>a definition of the message. Currently there are two formats for the meta-information that
<br>defines a message type. The older one is called an HMD (Hierarchical Message Definition),
<br>and the new one is called a MIF file (Message Information File). The HMD is being deprecated,
<br>so our API is also changed to focus mainly on MIF files.
<br>
<br>In order to convert a RIM model to its corresponding HL7 XML message instance, you need to
<br>know the order of serialization of the classes, as well as the data types and values.
<br>
<br>Similarly, in order to convert an HL7 V3 message instance into a RIM representation
<br>(which we call a RIM graph), you need the meta-information included in the HMD or the MIF files.
<br>
<br>There are two approaches to implementing these tasks. On the one hand, if your application
<br>will rely on only one or a very few message types, then you can hard-code the meta-information
<br>into your application. This is easy and fast but has the disadvantage of working only on the
<br>few message types for which the application has been written.
<br>
<br>On the other hand, a more versatile but more complex approach is to build a generic API that
<br>can be fed both MIF files and message instances. In this approach an application can
<br>intelligently know how to handle the message and thus load it into memory in its RIM graph
<br>representation. Additionally -- and most usefully -- this information, once in memory, can
<br>automatically be "persisted" into a database; no real-world applications deal only with
<br>temporary data in memory that disappears as soon as the application exits.
<br>
<br>So an ideal API for dealing with HL7 V3 XML messages should have the following features:
<br>
<br>- It can handle any new or unknown type of message as long as the MIF file were available.
<br>- It can transform an incoming XML message into a RIM graph representation in memory so that
<br> the application can perform any required business logic.
<br>- It can persist the RIM graphs to a database.
<br>- In reverse, it can reconstruct the RIM graph from the database.
<br>- It can create a new HL7 V3 XML message from the in-memory representation.
<br>
<br>The Java SIG's project, the Java API to HL7 Version 3 RIM, has been in development since 2002.
<br>This README introduces a demo version of our API. The API has all five of these features.
<br>
<br>The object-to-relational database mapping is accomplished with the open-source Hibernate technology.
<br>
<br>Running the Java API to HL7 Version 3 RIM Demo
<br>----------------------------------------------
<br>
<br>In order to run this demo, you must have ant and Java 1.5 pre-installed on your computer,
<br>and you must set the environmental variables ANT_HOME and JAVA_HOME. (Naturally, you must be
<br>somewhat familiar with Java and with ant.)
<br>
<br>There are two demos in this package. One of them consists of the following ant targets:
<br>
<br>loadDataMif
<br>loadDataMif3
<br>loadDataMif4
<br>
<br>The first one, loadDataMif, parses an XML message into memory and then persists the message
<br> into a database (Hypersonic database included with this demo). It then reverses the process
<br> by re-creating the message from the database and outputting it to the screen.
<br>
<br>As soon as this target has finished running, you can inspect the database by running a GUI tool.
<br>Bring up the tool by running this ant target:
<br>
<br>hsqldbManager
<br>
<br>When the SQL manager starts up in its GUI window, select File->Connect. Then in the URL field
<br>replace
<br>
<br>jdbc:hsqldb:mem:.
<br>
<br>with
<br>
<br>jdbc:hsqldb:demohibernate
<br>
<br>You may then enter an SQL statement such as this:
<br>
<br>SELECT * FROM _ACT
<br>
<br>Then click the "Execute SQL Statement" button. Note that it is not case-sensitive, and you do
<br>not need trailing semicolons.
<br>
<br>Once you have inspected the result, close the SQL manager GUI to free the connection to the database.
<br>
<br>Thereafter, when you run loadDataMif3 or loadDataMif4 (or both), you append data to the database.
<br>This simulates a real-life clinical situation such as appending lab data to a patient object in a
<br>medical record system. Once you have appended the new data with these ant targets, you can bring up
<br>hsqldbManage again and browse the database to see the new data.
<br>
<br>The second demo illustrates how the Java API to HL7 Version 3 RIM can handle any type of message.
<br>The second demo is actually a CDA document, which is based on the RIM, so it is simply just another
<br>flavor of HL7 message.
<br>
<br>The ant target to run for this demo is called
<br>
<br>demoCDAMif207
<br>
<br>It reads a CDA document and constructs the related RIM graph in memory. At this point it opens a
<br>small GUI window that allows you to inspect this memory object. The GUI shows many Java internals
<br>in addition to the CDA-related data, so this ant target provides only a crude way to inspect the
<br>objects in memory (like a debugger).
<br>
<br>At this point the program execution is suspended. When you close the GUI, the demo proceeds to the
<br>next stage, in which the in-memory RIM graph is persisted via Hibernate to the database. Once this
<br>has happened, the demo continues and reverses the process: it gets the data out of the database,
<br>re-creates the in-memory RIM graph, and then re-creates the CDA document from the in-memory
<br>representation.
<br>
<br>Note that the re-created message is not quite the same as the original. This is because the API may
<br>add some default values. (It may also be because not all the kinks have been worked out! This is a
<br>demo, not a release.) Once this target has finished, then you may open the SQL tool as described
<br>above and browse the CDA data in the database.
<br>
<br>Final Words
<br>-----------
<br>
<br>The five features of the "ideal" API listed above are necessary for any significant clinical
<br>application that is based on HL7 V3 messaging. There are significant person-years of effort
<br>invested to bring the API to its current state. For developers who are more interested in
<br>developing the specific functionality of a clinical application, and less in spending years
<br>of effort building the "plumbing" of HL7 V3 messaging, using this API instead of trying to
<br>duplicate its functionality from scratch should make their efforts noticeably more productive.
<br>
<br>We believe that the Java API to HL7 Version 3 RIM is mature enough to release this demo, but
<br>it still requires code clean-up and quality testing before it is ready to use "as is" to
<br>develop a production application.
<br>
<br>We are releasing this demo in order to introduce the functions and purpose of the API and,
<br>if we're lucky, to recruit a few more committed developers who would like to contribute to
<br>this effort.
<br>
<br>Thank you for your interest.
<br>
<br> eter Hendler
<br>Todd Freter
<br>Java SIG co-chairs
<br>September 9, 2005 |
|