/bluebutton.py

The Blue Button Python Library

Primary LanguagePythonOtherNOASSERTION

BlueButton.py: Blue Button Python Library

Build Status

BlueButton.py helps developers and non-developers alike to parse and extract information from C-CDA files without the need to understand the entire specification.

Example

The following code reads in a CCD and prints out the Patient's Name and Medications:

from bluebutton import BlueButton

with open('CCD.sample.xml') as fp:
   ccd = BlueButton(fp.read())

   ccd.type   # The document type ('ccda', 'c32', and such)
   ccd.source # The parsed source data (XML) with added querying methods
   ccd.data   # The final parsed document data

   name = ccd.data.demographics.name
   print name.prefix, name.given, name.family

   print 'Medications:'
   for medication in ccd.data.medications:
      print medication.product.name

Development

BlueButton.py is a port of BlueButton.js, the excellent Blue Button JavaScript Library. Many thanks go out to the Blue Button developer community! Currently, only parsing of C-CDA documents is ported.

It is an open-source project created by the the Clinical and Translational Science Informatics and Technology (CTS-IT) group at the University of Florida for the OneFlorida Clinical Research Consortium. See the AUTHORS.md file for more information.

BlueButton.py is covered by the Apache License, Version 2.0. More information can be found in the LICENSE file.

The source code is available on GitHub:

git clone https://github.com/ctsit/bluebutton.py

For instructions on setting up the developer's environment, run:

make develop

The Technical Specification can be found in docs/specs.md.

Additional Resources