PIVL & IVL … new Everest 1.0 functionality demo

September 2nd, 2011

There are two interesting data types in the HL7v3 DT specification which can be used for describing sets of things, they are IVL (interval) and PIVL (periodic interval). In an attempt to make Everest data types even richer, we’ve added some functions that make dealing with these types easier.

First, lets deal with IVL. In Everest, the IVL class allows the specification of an Interval or range of values. For example, if I want to describe an interval with a range of 0 L to 10 L, I would use this code:

IVL<PQ> range = new IVL<PQ>(
     new PQ(0, "L"),
     new PQ(10, "L")
) { LowIncluded = true, HighIncluded = true };

Now, for example, let’s say I want to test if 1 L is a valid measure according to this range, I can use the new Contains() method:

PQ test = new PQ(1, "L");
bool isInRange = range.Contains(test); // result is true

New to Everest as well is the concept of IUnitConverters, an IUnitConverter implementation allows the PQ data type to convert values between units of measure. Since we didn’t want to infringe upon license issues we’re just including a simple SI Unit converter (that can only handle basic SI units like L, m, and g) with Everest 1.0 (that an PQ can natively convert dates/times). With an assigned unit converter, we can test if 100 mL is valid in this range:

PQ.UnitConverters.Add(new SimpleSiUnitConverter());
PQ test = new PQ(100, "mL");
bool isInRange = range.Contains(test); // result is true because 0.1 L is in range

This functionality is also extended to another quite useful class, PIVL. Before I describe PIVL, I should mention that the Contains() method on PIVL requires that the phase be translatable by the period (ie: The template parameter T must implement IPqTranslatable<T>).

PIVL allows us to repeat an interval over a specified period. This is best illustrated with time, so lets do a simple PIVL that describes Fridays between 9:00 am and 5:00 pm:

IVL<TS> nineToFive = new IVL<TS>(
    DateTime.Parse("2011-09-02 09:00 AM"),
    DateTime.Parse("2011-09-02 05:00 PM")
);
PIVL<TS> repeated = new PIVL<TS>(
    nineToFive,
    new PQ(1, "wk")
);

Notice to get the “every Friday 9 - 5″, I repeat a Friday (Fri Sept 2, 2011) every week. Now, lets test if 11:30 AM on Saturday January 1, 2000 meets the criteria of the PIVL:

TS y2kLunch = DateTime.Parse("2000-01-01 11:30 AM");
bool isIncluded = repeated.Contains(y2kLunch ); // Returns false

To get TRUE from the contains method, we’d need to pick a Friday (any Friday) in the time range specified. I’ve picked 2:15 PM on Friday, December 29, 1989:

TS randomFriday = DateTime.Parse("1989-12-29 2:15 PM");
bool b = repeated.Contains(randomFriday); // returns true

We think that by putting these functions into Everest, we’re making it more useful for developers to interact with some of the more complex data types.

One last note, the conversion functions for time were actually tricky in the PQ type. The conversions are based on the number of Ticks in each of the time units. The reason this decision was made is that a PQ instance may have no knowledge of “which” time period it is bound to (for example “1 mon” may mean 28, 30 or 31 days).

This means that PQ’s convert method is reliable for any unit where ticks are predictable (us, ms, s, min, hr, d, and wk). When ticks aren’t predictable we’ve used very basic math (example: mon = a / 12). The A (annum) value is fixed to 315,569,260,000,000 ticks (the number of ticks in a non-leap year) which means there is some drifting when calculating over very long periods of time.

Of course, it is always possible to write a better IUnitConverter for time ;)

Author: Justin Categories: Uncategorized Tags:

Everest QA - The Tests Expand

August 12th, 2011

Some news from the Everest front, finally got the new unit tests working and covering more features in Everest. We’re over to 7,200 tests that cover roughly 60-70% of functionality (depending on which assembly we instrument).

Took a while to get them all working but it was worth it! We found and corrected lots of new juicy bugs (see: http://te.marc-hi.ca/issue/default.aspx?project=af66d54e-d41e-4ac1-8b44-d0d3ca6cabf0&showall=true for more info). Many of the additional unit tests are designed to test the new formatter architecture in the new version of Everest but there are some in there testing improved data type functionality as well. The tests work out (rougly) to:

Formatter Tests ~ 6,000
Data Types ~ 1,000
Other Features ~ 200

I’ve left a screen shot of our build log to show just how much work has gone into QA for the upcoming release of Everest!

Unit Test

Author: Justin Categories: Uncategorized Tags:

Everest 1.0 Data Type Operations

July 28th, 2011

We’ve been busy updating the Everest datatypes in preparation of Everest 1.0, and have decided to take the route of implementing operators over some of the suggested R2 operations (who really wants to call num1.Add(num2.Multiply(num3)) instead of num1 + num2 * num3)?

To illustrate some of the new functionality, I’ve decided to write some simple programs illustrating the operators in use. For the first example, I’ve redone the 1st year computer science undergrad “birthday” program:

TS now = DateTime.Now;
Console.WriteLine("How old are you?");
PQ age = Console.ReadLine();
Console.WriteLine("You were born in {0}", now - age);

The program illustrates subtracting a PQ from a TS, as long as a valid PQ (with a valid unit of time) is input, we should get a timestamp output. Pretty simple but illustrates some of the functionality. Here is some sample output:

How old are you?
21 a
You were born in 19900728112451.050-0400

We can also do other units of measure for time such as weeks:

How old are you?
32 wk
You were born in 20101216173201.726-0400

We can also use these operators to do scalar operations on PQ types, for example, this basic parimeter of a circle program:

REAL pi = Math.PI;
Console.WriteLine("What is the radius of the circle?");
PQ rad = Console.ReadLine();
Console.WriteLine("Perimeter of the circle is {0}", 2 * pi * rad);

The program assigns Math.PI to a REAL and then multiples that by the entered radius to get the perimeter:

What is the radius of the circle?
30 m
Perimeter of the circle is 188.495559215388 m

Or, with different units:

What is the radius of the circle?
30 [ft_i]
Perimeter of the circle is 188.495559215388 [ft_i]

 Much more to come!

Author: Justin Categories: Uncategorized Tags:

Everest Update - Summer 2011

June 29th, 2011

We’re back focused on our HL7v3 API Framework called Everest again this summer in the MARC-HI lab.

Now at over 1,333+ unique downloaders, we have had quite a lot of interest in Everest in the past 2 years since it’s release. We are currently working on the top three requested features for Everest - HL7v3 Universal Support for NE2010, Native Java Platform Support, and HL7v3 Datatypes R2 support.

The current release of Everest (1.0 RC2 — available here) already includes support for the Universal Version of HL7v3 (UV release NE2008) and support for IHE PIXV3 and PDQV3 profiles ( http://www.ihe.net/Technical_Framework/upload/IHE_ITI_Suppl_PIX_PDQ_HL7v3_Rev2-1_TI_2010-08-10.pdf ). Included in the latest Everest Release are examples on how to execute those transactions. We have even field-tested that functionality with multiple vendors at the eHealth Interoperability showcase.

As of this week we have an alpha build of the native Java Platform edition of Everest (we have been calling it “jEverest” — hey we’re software engineers not marketers). We’re hoping to do the initial public release of this expanded platform for testing by September, with a production quality release in the late fall of this year (say October / November). Cathedral vs. Bazaar arguments accepted….

Everest has been designed from the beginning to handle “plug and play” XML formatting, Datatypes, Communications channels, etc. As Canada Health Infoway has now announced the planned adoption of HL7v3 Datatypes R2, we will include this functionality in our fall release.

Some interesting Everest statistics as of June 2011:

- approximate lines of code: 83,000

- approximate number of unique classes: 1004

- approximate number of unit tests: 3267

- estimated code coverage of unit tests: 72%

- approximate man-hours of design, development and testing: 18,000 hours

- approximate investment so far: USD$900,000

- license type: Apache 2 Open Source

Author: benderd Categories: Uncategorized Tags:

Happy Birthday Everest!!!

June 28th, 2011

Wow - it feels like only yesterday that Everest was just a gleam in the eye of a young Justin Fyfe, but it was 3 years ago today that he committed the first version of the design document for Everest (our HL7v3 API Framework) into our version control system. We celebrated that magical event today in our lab with a pizza party and cake (candles were confiscated by College security). Here’s to 3 more years, Everest!

 

Happy Birthday Everest!

Happy Birthday Everest!

Apps for Health 2011 at Mohawk College

April 9th, 2011

Apps for Health 2011 at Mohawk College

The Mohawk Applied Research Centre for Health Informatics hosts Apps for Health 2011 May 27-28 in the Mohawk Learning Exchange at the Fennell Campus. The two-day challenge will feature teams of students from Canadian colleges and universities finding technological solutions to health care problems. Students will make their pitch to a panel of judges and compete for prizes. Apps for Health is sponsored by iDeaWORKS, Mohawk College and NSERC.

To learn more, head over to www.appsforhealth.ca

XML Schema Tool

January 15th, 2010

Here at the lab we deal quite a bit with XML Schemas and run into a few (very annoying) problems. To help these problems we developed a simple, lightweight tool for working with XML Schemas called the SchemaTool (available at http://142.222.45.21/downloads/pub/bin/schematool-1.2.exe).

Schema tool includes a few utilities that make is a great tool for looking at any schema (even if they aren’t health care related).

  1. Schema Diff - Shows the structural differences between two schemas.
  2. Schema View - Shows a “structural” view of any xml schema (without DTD information).
  3. Schema Copy - Copies a schema and all of the dependent schemas to the specified directory (this is extremely useful for large, complex standards with lots of xs:include and xs:import where you want only one schema)
  4. XPath Builder - This is a build in feature of the SchemaViewer. As you click nodes in the schema structure an XPath to the current node will be build (shortcut is right-click -> copy xpath).

Screenshot of the differencing is below:

SchemaTool Interface

SchemaTool Interface

Author: Justin Categories: Uncategorized Tags: , , , ,

HL7v3 Model Collapsing Algorithms

November 20th, 2009

We’ve been experimenting with ways of simplifying HL7v3 Models into more compact, simplified structures without the loss of any data. We are doing this as background work to better understand the challenges of the XML ITS in the HL7 version 3 standard. Assuming the MIF files as a starting point, here are the first 4 algorithms we could come up with:

1) The “recycler”

This algorithm identifies classes that seem to be duplicates of other classes in the models, removes them and replaces them with a generic version of the class. We identify matches based on the content attributes of the classes (they must be a 100% match of name and type), and we also do a simple class name comparison to improve the accuracy further. For example, if the Class B’s name is SHR_Author_Identified_Confirmable and Class C’s name is LAB_Author_Identified_Confirmable and therefore only differ by the first few characters we declare a match and substitute in a generic Author_Identified_Confirmable class. This algorithm also helps identify where more rigorous composition could have been used during the modeling phase and has the potential to be used in a design feedback cycle to improve modelling in the future.

classcombine 

 

2) “Cat-cars”

This algorithm identifies simple classes that can be rolled into their parent classes. This algorithm is probably the most controversial since we are simplifying the hierarchy at the expense of possibly altering the semantics of the model. For example if Class A was a Cat and Class B was a Car, this algorithm would create Cat-Cars, which is probably not what the modellers intended. However, there is a significant reduction in complexity of the generated code and schemas, and in the XML or IDE enviroments the resulting structures are much more understandable and simple to use.

 

classcollapsea

3) The “shrink-ray”

This algorithm looks for classes that contain subclasses that only contain a single property. It replaces the subclasses with the properties themselves.

classcollapseb

 

4) The “short-circuit”

This algorithm detects and collapses classes whose only purpose is to act as a structural connector to an underlying class.

classcollapsec

 

We have implemented these algorithms as pipeline extensions to GPMR - our General Purpose MIF Rendering Tool, the output format being simplified XSDs. We will be analyzing some test cases in the next few weeks where we compare the original panCanadian standard XSDs vs. the ones we can generate from our tool and plan to post some results here.

Author: benderd Categories: Uncategorized Tags:

HL7v3 API “Everest” Released to OHT

October 30th, 2009

Today we released a “community technology preview” edition of our HL7v3 API we call the Everest Framework to Open Health Tools. This work was sponsored by the Natural Science and Engineering Research Council of Canada and Canada Health Infoway. The version of the API we released is a messaging-oriented set of structures that map 1:1 to the panCanadian HL7v3 messages. It is intended to be used as a basis for creating higher-level APIs that encapsulate the business case functionality of the EHRS. Feel free to browse the Everest support site or contact Duane for more information on the API and how it can be used to build HL7v3 applications.

Author: benderd Categories: Uncategorized Tags:

An overview of the MARC-HI NSERC Project

July 1st, 2009

Some people have asked me what the NSERC project money is for, so I thought I would briefly describe the NSERC project here today.

The official title of the project application is “Building the Canadian Electronic Health Records Solution Reference Implementation” and I think that pretty much sums it up. If you are not familiar with the Canadian EHRS, more information can be found by heading over to the Canada Health Infoway site at www.infoway.ca (free reg required)and searching for the “EHRS Blueprint”, of which there are a few versions with different levels of detail available (if you have a hard time finding it, email me at duane.bender@mohawkcollege.ca for a direct link).

Essentially the EHRS is the provincial (or jurisdictional or regional) healthcare IT infrastructure that implements the electronic healthcare record. It contains the major repositories for healthcare data (lab results, imaging, observations, referrals, etc.). It is not a replica of all data, it is simply the “information which is suitable to be shared” between providers.

The NSERC project timeline is 5 years (2009-2014) with a staff of about 10 people involved at various commitment levels (students, faculty, project managers, etc.). The project activity breaks down into 4 main areas:

1) building a reference implementation of the EHRS “from scratch” - this will be released as open source software (BTW this was started in Aug 2007 and was about 20% complete when NSERC funding was provided to take this to completion)

2) integrating and testing common off the shelf applications and vendor solutions in the EHRS environment

3) experimenting with (optimizing and simplifying) HL7v3 messaging and protocols

4) developing an API that will allow POS applications to easily connect to the EHRS

Along with the NSERC research, our lab does contract-directed research on a cost-recovery basis, mainly for software vendors wishing to experiment in an EHRS environment. We have a public HIAL on the Internet with approximately 20% of the Canadian EHRS functionality available. Above the HIAL we have many vendor applications that can be deployed for specific testing scenarios.

If you have a project inquiry, please feel free to contact me directly duane.bender@mohawkcollege.ca

Author: Duane Categories: Uncategorized Tags: