LCOI-API Series: Features – JSON and on… 1

Editor’s Note: In 2015, leadership of the LCOI-API was transitioned to TrialReach. You can learn more about their continuing work in innovation in clinical trial matching at TrialReach.com.

This is the second in a series of blog posts introducing the LCOI-API.   We’ll be looking at a couple of its features, encouraging its use by developers to create solutions in the spirit of clinical open innovation.  Read the first post of this series here.

You may have read a few days ago that we launched version 1.0 of our LillyCOI-API.  We mentioned that the genesis of an Open Clinical Intelligence Network (OCIN) means that developers, informaticists and others will be able to create their own applications to Collect, Consume, Curate and Connect around digitized clinical objects.

As you know, V1.0 initially sources data from clinicaltrials.gov and transforms it into a format that web app developers can work with.  It is currently read-only, but we wanted to highlight a couple of the ways our LCOI-API accomplishes that transformation.

First, we elected to use JSON and Exhibit JSON data notation.  Clinicaltrials.gov uses XML for data handling, but XML requires the developer to go through more steps to reach the same result, and is not easily web-ready.

JSON notation makes it easy for JavaScript in a web page to download and process the data.  Using a library such as jQuery makes it even easier.  Here’s a quick example that shows how to get the list of intervention categories using our API:


  Interventions
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script type="text/javascript">// <![CDATA[
    $(document).ready(function() {
      $.getJSON("https://api.lillycoi.com/v1/studytopics/categories/interventions?callback=?", function(data) {
        var items = [];
        $.each(data.results, function(key, val) {
          items.push("

	<li id='" + val.id + "'>" + val.label + "</li>

");
        });
        $("<ul/>", {
          html: items.join("")
        }).appendTo("#interventions");
      });
    });

// ]]></script></pre>
<h2>Interventions</h2>
<div id="interventions"></div>
<pre>

So this small bit of code, when saved to your local machine and then opened with your browser, will seamlessly call the API and deliver the intervention categories list.  You can click on this link to see it in action: Intervention Categories.

This is the output of the example above.

For the purposes of clinical trial collection, curation, consumption and community, we find JSON – a readable, standard, language-independent data format – translates most easily across the Internet.

Our API also provides links within the data that are easily recognizable and accessible to the developer.  Because the links are built in, there is no need for programmers to take the time to re-construct URLs.

Study Topics and Pagination are good examples of these accessibility improvements.  Study Topics can be found on the Clinicalcollections.org site and are essentially categories, such as Medical Condition or Drug Intervention, that assist in locating relevant trial data.  The LCOI-API includes them in the data set, giving developers taxonomy capabilities for smoother categorical/filtering routes into the trial data.  As a result, users get relevant search results faster.  We have also included these data in a separate section of our API.

Speaking of better results, pagination, which allows search results to be presented incrementally as opposed to all at once, is essential when developing an API, but because clinicaltrials.gov alone contains almost 130,000 individual trials, our API allots these data in usable, consumable chunks.

In future blogs, we’ll be sharing more of the capabilities of the LCOI-API as our series continues.  We will also be introducing you to our team of developers so you can connect on a more personal level.

We see the release of the LCOI-API as the first step to providing open resources and tools to support developers, and want you to feel free to use and share the open LCOI-API.   We’re interested in your feedback and ideas, and are here to answer questions you might have.  Drop us a comment, contact us or follow us on Twitter @Lilly COI to keep in touch.

One comment

  1. Pingback: Patient Engagement App Challenge « lillycoi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s