Application Programming Interfaces (APIs) appeal mostly to statisticians and researchers whose careers depend on access to data. But these programming tools are also a useful part of a Web that is becoming increasingly supple and sophisticated. I have written a series of articles about the use of APIs to share and run analytics on patient data, but today I’ll cover a cool use of an API developed by the Department of Health and Human Services for disseminating educational material.
The locus for this activity started with the wealth of information created by the Centers for Disease Control for doctors, public health workers, and the general public. Striving to help the public understand vaccinations, West Nile fever, Ebola (when that was a major public issue), and even everyday conditions such as diabetes, the CDC realized they had to make their content simple to embed in web sites for all those audiences.
The CDC also realized that it would be helpful to let outsiders quickly choose content along a number of dimensions. Not only would a particular web site be interested in a particular topic (diabetes, for instance), but they would want to filter the content to offer information to a particular audience in a particular language. One Web page might offer content aimed at doctors in English, while another might offer content for the general public in English and yet another offer content in Spanish. To allow all these distinctions, a RESTful API called from JavaScript allows each Web page to bring in just what is needed. Topics and languages are offered now, and filtering by audience will be supported soon. At some point, the API will even recognize ICD-10 codes and find any content related to those disease conditions.
We are all familiar with Web pages that embed dynamic content from other sites, such as videos from YouTube or Vimeo. Web developers embed the content by visiting the desired page, clicking on an Embed button, and copying some dense HTML to their own pages. The CDC offers several ways for visitors to syndicate content in this manner to their own web sites. If they are using a popular content management system (WordPress, Drupal, or Joomla!) they can install a plug-in that uses familiar practices to embed the content. Mobile app support is also provided. But the API developed by the CDC takes the process to a much more advanced level.
First, as already described, the API lets each page specify filters that extract content on the desired topic for the desired audience. Second, if a new video, e-card, or microsite is added to the CDC site, the API automatically picks it up when a user revisits the embedding page. Thus, without fussing with HTML, a site can integrate CDC content that’s tailored pretty precisely to its needs.
This API is also in use at the FDA–see for instance their Center for Tobacco Products–and at HHS more broadly. A community is starting to build around the code, which is open source, and soon it will be on GitHub, the most popular site for code sharing. A terse documentation page is available.
The API from Health and Human Services offers several lessons for health IT. First, communications can be improved by using the advanced features provided by the Web. (In addition to the API, the CDC tools make sophisticated use of HTML5 and iFrames to offer dynamic content in ways that fit in smoothly with the sites that choose to embed it.) Second, sites need to consider the people at the other end of the transaction in order to design tools that deliver an easy-to-use and easy-to-understand experience. And finally, releasing code as open source maximizes its value to the health care community. These trends need to be more widely adopted.