Producing Simplified C-CDA Data with BlueButton
The are just a few steps necessary:
- Download and Install Node.js
- Download the BlueButton library
- Using the eiConsole, create and configure a new Route
- Configure a “script.js” in your Route’s folder
- Add a “JSON Transformation Module” in your Route
- Start mapping!
1. Installing Node.js
2. Download BlueButton
You can download the BlueButton library at http://www.bluebuttonjs.com/
This library will be referenced via an absolute path, so put your copy of it (typically “bluebutton.js”) somewhere that can be easily located later.
3. Configure a New Route
Open the eiConsole and browse to an existing or new Working Directory where you’d like to work with the C-CDA format. In the Route File Management dialog, click the “Add New Route” button to add a Route, then double-click the added Route in the Route / Interface table to open it.
You can configure your Source (Listener, Processors) however you need to accept C-CDA documents, which are typically provided via FTP or via HTTP (SOAP or HTTP Post Listeners).
You should be able to download the “JSEvaluationProcessor.jar” file here, or it can be found on the PilotFish Interface Exchange (PIE). Once downloaded, you’ll need to add it to your new Route.
Select the Route menu and choose “Define Module Classes,” then click the “Add Module Library” button.
Browse to the “JSEvaluationProcessor.jar” file. The eiConsole will ask you a few questions about placement of this library. If you choose “Yes” for the first option, it will place it in the eiConsole’s runtime/lib folder. If you choose “Yes” for the second option, it will place it in a “lib” folder specific to your Route. If you’ve chosen “No” for both of these options, it will go into the current Working Directory “lib” folder.
5. Configure an Invocation Script
To invoke BlueButton, as well as to send C-CDA data to it and retrieve the results, you’ll need a script. You can write your own or download the “script.js” file here. You’ll need to save this file locally to the Route you just added. If your Working Directory is a “eip-root” folder and your Route is named “C-CDA”, you can expect to find a “route.xml” file at “eip-root/Routes/C-CDA”. You should place the invocation script within that folder.
6. Configure the Processor
There are two configuration items you’ll need to provide values for:
- Script File – This is the name of the invocation script you wrote in step #5.
For an OSX system, our “Command” value will be “/usr/local/bin/node” and the “Script File” will match the file name found here (“script.js”)
7. Configure a JSON Transformer
The added Processor should take transaction data, invoke BlueButton and pass the data to it. Whatever BlueButton produces should replace the transaction contents. Since BlueButton produces JSON, we’ll want to convert this to XML for general eiConsole use.
Add a Format to your Source Transform stage. “JSON to XML” is probably a suitable name as you shouldn’t require any other transformation steps.
Configure the Transformation Module by selecting the “JSON Transformer” from the drop-down.
8. Start Mapping!
You should now be able to switch to the eiConsole Testing Mode, pick up a sample C-CDA document and run it through your configured Stages. The output should now be XML, which you can treat like any other data or format in the Data Mapper.