Tuesday, October 9, 2012

In the Olden Days

In the olden days:

  1. Programming computers was something you learned in college.
  2. Software came in a box, with media and manuals.
  3. You purchased your compilers and IDE, and they weren't cheap.
  4. Spelling correction was something word processors did, not compilers or IDEs.
  5. The libraries you used to build software were something you created and/or paid for, and you knew where they came from.
  6. You often didn't have the source code to the libraries that you didn't create.
  7. Builds were performed by humans, or at the very least, the scripts were created by humans.
  8. Testing was performed after the code was written.
  9. Debugging was clunky and difficult.
  10. Architects understood each part of the system deeply.

These days,

  1. Many people learn to program computers before college, and some really good programmers never took a course in programming at the college level.
  2. Software is downloaded over the Internet.
  3. Many decent compilers and IDEs are free.
  4. IDEs do spelling correction.
  5. Many of the libraries are free, and you don't necessarily know where they came from.
  6. You frequently have access to the source for libraries you didn't create.
  7. Builds are performed by machines, and machines often create the build scripts.
  8. Tests are often written before a line of code.
  9. Debugging is pretty simple.
  10. Architects don't necessarily understand how all of the parts work.
My recent foray into building a component to demonstrate sending of a Direct message used completely free software, all of it downloaded from the Internet.  I had to struggle to find which libraries I needed, because I refused to download yet another component that does a bunch of stuff for me without telling me what I'm getting.  That was probably half of my time.  I still want to know what my dependencies are.  Testing, well, this was a throw-away project, so I didn't invest much in testing, but I certainly took advantage of tests that were included with the code I was using to verify I had installed certain things correctly.  Having access to the library source code was critical for understanding how things worked.  One of the challenges with documentation that comes with software these days is that it is often of poor to mediocre quality.  The loss of printed manuals also means that we lost things like editors and technical writers along the way who ensured that the documentation was of high quality.  I have a better idea than many how the parts of software that I use work, even though it comes from a variety of different sources, but only because I make it a point to learn.  Even so, there are times when I have to rely on the source code to figure it out.

Oh, and as for learning to program, I wrote my first decent computer game at the age of 13.

Overall, I think the changes between now and then (20 or so years ago), represent an overall improvement.  I do fear somewhat that the complexity of software is creeping beyond what many architects can reasonably handle.  While I think that most of the automation being developed is good, I still feel like some of it is a crutch.  I suppose eventually, I'll adopt more of it myself, if only because I want to use more of my gray cells for doing cool stuff, rather than understanding all of the details of the pieces I'm using to do it.

At one point in my life (more than a decade ago), I'd written a business plan to form a company that would do context sensitive spelling correction for compilers and IDEs.  Eventually, I discarded it.  Not because I thought it wouldn't work, or that I couldn't develop the software needed, but rather because I had already seen spelling correction as a business come and go in the business application market.  It simply seemed like the second time around, it would happen so much sooner, and I'd never have the time needed to capitalize on it in a way that would make me really successful.

Direct Transmission in Java : The Go-Cart Version

Over the weekend, John Moehrke wrote this post about View, Download and TRANSMIT, focusing specifically on the Transmit part, and how Direct plays a role.  He notes that Transmit can be implemented without a HISP.  I was curious to see how easy it would be to generate a fully Direct compliant message with as little work as possible in Java.  I've already got an e-mail certificate and key, and I already have John's public key and e-mail address.

So, I want to send him an Direct message.  What do I have to do to make that work?  Fortunately, a good deal of code to support this has already been created in the Direct Bare Metal Project.  You can download the necessary components from Google Code here.  The API Documentation on the Direct Wiki seems to be pretty decent, and if you dig around long enough, eventually, you can find the JavaDoc.

As I read it, what I need to be able to do is first construct a DefaultNHINDAgent, giving it a way to resolve my private certificate and key, and John's public certificate, and a way to understand that John's certificate is one I trust (comes from a Trust Anchor).  For simplicity sake, I'll put my certificate in a key store, John's in a trust store, and the CA issuing John's certificate in Trust Anchor.

The first challenge is finding everything I need.  I'm building a go-cart here.  I don't need (or want) James, Tomcat, and a bunch of other stuff.  This isn't Bare Metal.  It's a Soap box, some twine and bailing wire, and hope that it runs downhill.

What do you need:
  1. agent-1.5.2.jar The Direct Agent Library
  2. direct-common-1.1.1.jar The Direct Comment Library
  3. Apache Commons Logging (General Logging during Message Processing)
  4. Apache Commons IO 
  5. Apache Commons Codec (Base 64 Encoding)
  6. Bouncy Castle SMIME Library (Crypto)  [Release 140 for JDK 1.5]
  7. Bouncy Castle JCE Provider (Crypto) [Release 140 for JDK 1.5]
  8. mail.jar from the Java Mail Library
OK, now, where to get BC 140?  Well, where I got it from was from the version of James that comes with the Bare-Metal non-HISP Java Project.  You can find the necessary libraries in the direct/james/2.3.2/apps/james/SAR-INF/lib folder in this tarball that is in the Direct Google Code Library.  Download the tarball, unzip/tar it, and extract bcmail-jdk15-140.jar and bcprov-jdk15-140.jar to where you are putting the rest of your libraries.

Next, you'll need to follow the instructions to install the JCE (Java Cryptographic Extensions) for whichever JDK you are using.  Download them from here.  Then follow these instructions to install them.

Once you have all of that, you should be good to go.

We're going to do this in five steps.  

1: Configure JavaMail

The first step is to configure JavaMail to send from Google Mail, or another SMTP server you have access to.

Properties properties = new Properties();
properties.put("mail.smtp.host", "smtp.gmail.com");
properties.put("mail.smtp.auth", "true");
properties.setProperty( "mail.smtp.port", "587" );
properties.put("mail.smtp.starttls.enable", "true");
Session session = Session.getDefaultInstance(properties,
  new Authenticator() {
    public PasswordAuthentication getPasswordAuthentication() 
    {
return new PasswordAuthentication("account", "password");
    }  
  }
);

2: Configure the DirectAgent

The next step is to configure an NHINDirectAgent to do all of the work for us.

CertificateResolver certResolver = 
  new KeyStoreCertificateStore("private.jks", "password", "password");
KeyStoreCertificateStore certResolver2 = 
  new KeyStoreCertificateStore("public.jks", "password", "password");
TrustAnchorResolver trustAnchor = 
  new DefaultTrustAnchorResolver(certResolver2.getAllCertificates());
NHINDAgent agent = 
  new DefaultNHINDAgent("gmail.com", certResolver, certResolver2, trustAnchor);

I've created two files to work with this bit of code.  The first, private.jks contains the certificate and private key I use with my GMAIL Account to sign e-mails.  I got mine here for free.  I also created public.jks which contains the just the certificate for my G-mail account, and the certificates for mine and John Moehrke's e-mail accounts.  If I've ever sent you a signed e-mail, you have that too.  And if John's ever sent you signed e-mail, you also have that.  I exported my signing certificate and key from Outlook in PKCS12 format, and then converted to JKS using this little trick (as it turns out, I still had jetty in the same location).  I used keytool to import the various other certificates that I exported from Outlook into Base64 encoded format.  Oh, and to create public.jks from those files, just use keytool the same way you would to create a trust store.

For what I need, the trust method is this: If I have the certificate's anchor in my list of public keys, then it's trusted.  Otherwise it isn't. I had to dabble a bit with the right way to create the DefaultTrustAnchorResolver, but the code you see is what finally did it for me.

3: Create the Message

The next step is to create the message:

MimeMessage mx = new MimeMessage(session);
mx.addHeader("To", "keith.boone@ge.com");
mx.addHeader("From", "kwboone@gmail.com");
mx.addHeader("Date", new Date().toString());
mx.addHeader("Subject", "Hello");
mx.setText("Hello Again!");

4: Process Message

This step performs certificate resolution, trust resolution, and encryption, according to the Direct protocol.
Message msg = new Message(mx);
OutgoingMessage oMessage = new OutgoingMessage(msg);
OutgoingMessage processedMessage = agent.processOutgoing(oMessage);

5: Send the Message

The last step below grabs the content into a new MimeMessage configured to use the JavaMail session we started with in Step 1, and sends it.

MimeMessage mxo = new MimeMessage(session,
  new ByteArrayInputStream(

    processedMessage.serializeMessage().getBytes("UTF-8")));
Transport.send(mxo);

You'll note a couple of things:
  1. No HISPs were consulted in the construction or transmission of this message.
  2. Certificate lookup was very simple.  A more complex mechanism using LDAP could have been implemented.  You may need to consult with a number of locations to locate recipient certificates.
  3. Trust was also simple.  These are outbound messages only.  So long as they are, and the certificate is signed somewhere along the way by a trust anchor I care about, then it goes.
For John's discussion about what you need for the Transmit portion of VDT, this Go-Cart could use a few more things to soup it up:  A motor (LDAP Certificate lookup), and a Roll-Cage (A little bit better trust model than a certificate from John or I, perhaps just list the common e-mail certificate signer anchors), and away you go.

  -- Keith

P.S.  And the short answer to what I need to do to make that work?  About a day of coding.



Friday, October 5, 2012

I'm not a data entry clerk either!

I saw a recent discussion over on linked in about PHR usage earlier today.  Yesterday I saw an article about physicians complaining about being data entry clerks.

Have you looked at what most PHR provide for patients today?  I'm no more a data entry clerk than my physician.  Yet, that is what most PHR's reduce me to.  I cannot wait for the day when I can download my data into the Application of MY choice, to do with it as I see fit.

I appreciate organizations that give me access in an App of their choice that has some useful features, but I don't want them to be choosing what apps I use.

   Keith

HL7 Offers Free Ambassador Webinar on the EHR and PHR System Functional Models on October 12, 2012

I'm in Rochester tomorrow morning to present my HL7 Ambassador presentation on HL7 Standards for Meaningful Use at the Rochester RHIO's CIO Breakfast. As the release below explains, these are short (30-60 minute) presentations which explain key facets of HL7 standards at a high level.   HL7 also delivers these by webinar, and the release below is the latest one.  These presentations are also recorded here, and occasionally, one even shows up on video (which is how I got this gig). More good, free stuff from HL7, cool.

  -- Keith


Health Level Seven® International
For Immediate Release
                                                                               
Contact: Andrea Ribick
+1 (734) 677-7777


HL7 Offers Free Ambassador Webinar on the Electronic Health Record and Personal Health Record System Functional Models on October 12, 2012

          Ann Arbor, Michigan, USA – October 4, 2012 – Health Level Seven® International (HL7®), the global authority for interoperability and standards in healthcare information technology with members in 55 countries, will present a complimentary Ambassador webinar on the HL7 Electronic Health Record System Functional Model (EHR-S FM) and the Personal Health Record System Functional Model (PHR-S FM) on Friday, October 12 from 12:00 pm – 1:00 pm EDT.
          The HL7 EHR-S Functional Model is an international standard approved by the International Organization for Standardization (ISO) and the American National Standards Institute (ANSI) that outlines the features and functions that should be contained in an EHR system. The current standard contains approximately 1,000 conformance criteria across more than 100 functions, including medication history, problem lists, orders, clinical decision support, and those supporting privacy and security. The function list is described from a user perspective and enables consistent expression of EHR system functionality. The model can be constrained through the development of profiles to represent a department (Emergency Medicine), a realm (The Netherlands), or other specialty (Behavioral Health).  The webinar will also cover the development of Release 2 of the standard—having recently been balloted internationally.
         The PHR-S Functional Model defines the functions for PHR systems and offers guidelines that facilitate health information exchange among different PHR systems and between PHR and EHR systems. The PHR-S Functional Model Release 1 is currently being balloted as an HL7 normative standard as well as with ISO. The Draft Standard for Trial Use (DSTU) version is available for vendors to use and incorporate the model’s requirements into their products.
Both models can be used as a basis for certification development and testing purposes.        
          The webinar will be presented by Pat Van Dyke, RN, director of information security, privacy and EDI representing The ODS Companies and Delta Dental Plans Association; co-chair of the HL7 Electronic Health Record Work Group; and HL7 ambassador. Ms. Van Dyke is also a practicing emergency room nurse. In addition, she helped develop both the EHR-S and PHR-S functional models and has participated in the development of functional profiles.
          This webinar is free and open to anyone interested in healthcare IT or standards development. To register for this free webinar, please visit http://www.hl7.org/events/ambassador20121012/.
          HL7 Ambassadors present standardized presentations about HL7 as speaker volunteers. They are available to present at local, regional or national conferences. Please contact HL7 at +1 (734) 677-7777 if you would like to schedule an HL7 Ambassador for an upcoming event.


About Health Level Seven International (HL7)
Founded in 1987, Health Level Seven International is the global authority for healthcare Information interoperability and standards with affiliates established in more than 30 countries. HL7 is a non-profit, ANSI accredited standards development organization dedicated to providing a comprehensive framework and related standards for the exchange, integration, sharing, and retrieval of electronic health information that supports clinical practice and the management, delivery and evaluation of health services. HL7’s more than 2,300 members represent approximately 700 corporate members, which include more than 90 percent of the information systems vendors serving healthcare. HL7 collaborates with other standards developers and provider, payer, philanthropic and government agencies at the highest levels to ensure the development of comprehensive and reliable standards and successful interoperability efforts.

HL7’s endeavors are sponsored, in part, by the support of its benefactors: Abbott; Accenture; Centers for Disease Control and Prevention; Duke Translational Medicine Institute; Epic; European Medicines Agency; the Food and Drug Administration; GE Healthcare Information Technologies; GlaxoSmithKline; IBM; Intel Corporation; InterSystems Corporation; Kaiser Permanente; Lockheed Martin; McKesson Provider Technology; Microsoft Corporation; NICTIZ National Healthcare; Novartis; Oracle Corporation; Partners HealthCare System, Inc.; Pfizer, Inc.; Philips Healthcare; Quest Diagnostics Inc.; Siemens Healthcare; Thomson Reuters; the U.S. Department of Defense, Military Health System; and the U.S. Department of Veterans Affairs.

Numerous HL7 Affiliates have been established around the globe including Argentina, Australia, Austria, Brazil, Canada, Chile, Colombia, Croatia, Czech Republic, Finland, Germany, Greece, Hong Kong, India, Italy, Japan, Korea, Luxembourg, The Netherlands, New Zealand, Norway, Romania, Russia, Singapore, Spain, Sweden, Switzerland, Taiwan, Turkey, United Kingdom, and Uruguay.

For more information, please visit: www.HL7.org

# # #

Thursday, October 4, 2012

A Bake Off

I've been working quite a bit on my ABBI Prototype lately.  It's nearly ready for demonstration.  At the same time I've been doing that, I've been looking at three different standards based formats for returning the results.

Right now, my preferred format is Atom, as I've specified it's use specifically for ABBI.  The nice thing about Atom is that it has a well defined separation of metadata and content.  An atom <entry> is mostly metadata.  The only thing that isn't appears inside the <content> element.  (The type and src attributes associated with the content element are also metadata about the content.).

Last night, I put together similar output using the IHE Mobile Access to Health Documents profile (I think I have the official name right now).  And this morning, I threw together some output using the newly defined /XdsEntry FHIR resource (It will be done in about 20 more minutes, and I've spent about 40 on it so far).

I don't like the MHD format.  Perhaps because it's JSON, but more likely because of the disconnect between metadata and content, and the fact that MHD right now doesn't have a way to get both.  The same is true of FHIR, but, I've already proposed the addition of an optional attachment element that could be used to contain the content.

One of the things that we've learned over the years in IHE is that there are use cases where people want the metadata AND the content in one network transaction, and other cases where they want the metadata in one transaction, and will get individual contents in subsequent transactions as needed.  Some of these use cases are being driven by regulatory requirements.  Servers for some folks need to be totally stateless and storage free so that they are doing nothing other than acting as a gateway for data.  That gets them out of certain regulatory or legal requirements for consent.  In other cases, they cannot afford to accept huge packets of data (e.g., because of device limitations), and so would like the transactions split up.  In other cases, they know they'll be grabbing everything, so why should they have to generate umpteen transactions to get what they want, when in fact, the server has all the data to begin with.

There's no easy solution to pick a single way that meets everyone's needs.

In any case, almost all of the infrastructure that I've put together for ABBI allows me to test out each of these content formats in a bake off.  At the end of it all, I expect, we'll all converge to one format.  I think I'd like for it to be an intermediate between what FHIR specifies, and what I already did for ABBI.  In fact, all I'm doing is just adding Atom fields to the specified FHIR output, so it's not really incompatible with FHIR in any way.

If I'm lucky, I should have my demonstration server working online by early next week, so you can compare the results for yourself.  I've already got Tomcat running in the cloud to test this out ("UR cloud iz my sandbox"), so it's just a matter of bundling up and deploying the WAR file once I've got it tested well enough for casual users.

As I think about it: If there can be only one, perhaps bake-off isn't the right phrase.  It's more like a sword fight.


Wednesday, October 3, 2012

Think Globally, Act Locally

One of the challenges in standards development is staying connected to the end users.  That's why I try every year to write some code using the standards that I or someone else has worked on.  It keeps me connected. For the same reason, I also try to participate in local healthcare related events.

I spent this morning at my local Community Health Network Alliance meeting.  In Massachusetts, there are 27 of these organizations.  They are funded by a "tax" on healthcare capital spending in the region.  This is the second quarterly meeting I've attended.  I had to miss out on the last one due to some international activity (I think it was HL7 or IHE).

This is a great way to connect with what is happening in healthcare in my community, and also a great place to network with community leaders.  Among the attendees of this mornings meeting were a number of people in local school systems and advocacy agencies that could help me push forward this idea.

The organization will be putting forth grant opportunities in the early part of next year, and I intend to put together a coalition working on my personal pet project.  There are two kinds of grants: Community Engagement grants ($1K - 3.5K), and Impact grants (up to $10K).  I'll be looking at developing a project that will have two phases:

Phase 1 will likely seek a Community Engagement Grant to:

  1. Identify community middle and high schools interested in developing and piloting a health system literacy education program.
  2. Developing pilot course materials.
  3. Develop a community engagement program around the course materials.
  4. Pilot the materials and engagement program in one or more of those schools.
If phase 1 is successful, phase 2 will look at how to roll this out across more communities in the state.

The timing is challenging.  Grant applications are due in May, which means that we'd have a very short period to put together materials that could be piloted in schools by September.  I'm hoping most of the real development work would be volunteer efforts, and that funding could go towards getting a patient activist to present at the community engagement event.  It's possible also that one or more of the advocacy organizations would be willing to chip in.

Someone asked me how I'd do this, and if I had the spare time.  For this, I'd make the spare time.  A program like this could go viral.

Tuesday, October 2, 2012

Think like the Customer

I got a call from my mother last night.  She was in the hospital.  Apparently, she woke up in the middle of the night with chest discomfort.  When she woke up later in the morning, she still had discomfort, so she took herself off to the hospital about a mile away.  She'd already talked to my brother (who lives about an hour away).  She called me to let me know where she was, and what she knew thus far.

They did an EKG (fine) and took some blood tests (Cardiac Enzymes -- also fine), and so they suspect this is just a bout of gastric reflux.  When she talked to me, I asked her details about what tests they had done (she knew they did blood tests, but not what kind).  Because women who complain about heart attack symptoms don't always get taken seriously, I wanted to double check that she was getting the right kind of care.

She handed me over to her nurse, and he and I conversed briefly about what tests they had done, and how the results came back.  I was reassured that they had taken her complaint seriously, and had done the necessary things.  Then I explained to him that I wasn't a doctor, just had a bit of education, and he was vaguely surprised that I knew to ask about what tests they had done.

My brother called me this morning so we could compare notes.  He had contacted a friend of Mom's who is a nurse, and explained to her what he knew.  She had talked to mom as well, and folks at the hospital.  So, everything seems to be OK, and mom will probably be going home today, and everyone seems to be satisfied (for now) that it was just reflux.  Mom will follow up with her regular provider.

What I learned from this experience is that even in a good facility (and this one is brand spanking new), with good people, telling the patient what they need to know about what tests are being performed and why is still not a big focus.  Fortunately for my mother, she's got a network of family and friends who know what to ask, and where to go for more information.  But there are plenty of folks out there who don't.

I recall my days in computer repair, and also my interactions with other folks who work on technology for me (like my car).  I always want to know what they are doing, why, and what each diagnostic they've done tells them.  I loved to teach customers what I was doing, how I figured out what was wrong, and what I had done to resolve the problem for them.  Often, I included information about how to avoid a future occurrence.  It made my customers very happy, and often answered questions they didn't know how to ask.  When dealing with repairmen these days, if they cannot or will not explain to me, I'm dissatisfied.

Why is it, when we keep talking about making healthcare better, we so often leave the most influential person  out of the communications loop?  There's a simple way to address this.  As a healthcare provider, answer the questions you would ask if you were in the patient's shoes.  And do so in a way that the patient can understand.  Arguably, this isn't an easy skill to develop or teach.  In fact, nobody ever taught it to me.  However, I've learned that it's probably the singular skill that makes this blog the most effective, and quite a bit of the rest of my work.

To provide effective care, or create implementable standards, you have to do two things:  Think like the customer, and like a highly skilled expert.  Melding those two skills well is how you provide the best care, or the best standards.

Now, back to more implementation.