The NHIN Direct Project is a secure email specification (based on S/MIME) for healthcare providers to exchange patient information in a secure and HIPAA compliant manner. It provides a simple mechanism for patients and clincians to send protected health information from one system (e.g., a hospital patient portal) to another (e.g., a personal health record). Microsoft HealthVault is a pioneer in implementing the Direct protocol.
This project provides a easy API to send Direct secure messages using a generic SMTP service. The Quick Start demonstrates how to use GMail (or Google Apps) accounts to send records into HealthVault's staging environment. Support for more SMTP providers can be easily added via community contribution.
This project does NOT provide a fully featured email server to receive Direct secure email messages from another provider. For a fully featured Direct email gateway, please refer to this project: http://code.google.com/p/nhin-d/
Add a few JARs to your local maven repo: (I could not find those two JARs in official Mavne repos. If you can please contact me)
mvn install:install-file -DgroupId=javamail.crypto.bouncycastle -DartifactId=smime -Dversion=060622 -Dpackaging=jar -Dfile=bin/smime_060622.jar mvn install:install-file -DgroupId=javamail -DartifactId=crypto -Dversion=060622 -Dpackaging=jar -Dfile=bin/crypto_060622.jar
Build the binary:
mvn clean mvn package cp target/sender-1.0.jar bin/ cd bin
Run the tester app:
java -jar sender-1.0.jar gmail "email@example.com" password "firstname.lastname@example.org" "email@example.com" "test subject" "test message from Google apps"
You need password on the command line to send email through firstname.lastname@example.org. We change this password often. Email the administrator of this project for the current one.
You must have an account at http://direct.healthvault-stage.com/ in order to view the message.
To use your own GMail or Google Apps address
Create a public / private key pair for the email address, and export the key pair to a yourname.p12 file. On the Mac this can be easily done via Keychain Assistant.
Export a digital certificate for the public key from the p12 key pair, and email that to email@example.com to set it up on HealthVault staging server.
Copy yourname.p12 to src/main/resources
Edit Tester.java to reflect your p12 file name, private key name, keystore passcode, as well as GMail account name and password.
Build and run. Notice that the GMail account username must match the FROM address.
The library is designed so that it can use any SMTP gateway provider to send NHIN Direct messages. We are showing how to use it in GMail here. Your contribution for other providers are wlecome here!
The library can send message to any NHIN Direct enabled Perosnal Health Record and Patient Portal. We are only using Microsoft HealthVault Stage server as an example here.