Implementing an API that aids cancer diagnosis
A RESTful API that suggests treatments for cancer patients

In September of 2017, ColoredCow began working on an application for cancer specialists. The application enabled cancer specialists to store and share clinical information in a HIPPA compliant fashion with other specialists. Groups of specialists called tumour-boards would meet to discuss these cases further.

Apart from tumour-board meetings, for patient diagnosis, specialists would often visit ClinicalTrials.gov to search for studies happening around the world based on clinical data of patients. Creators of the application wanted to build a REST API that would suggest most appropriate studies for the cases. Using the API the application would suggest studies during tumour-board meetings and could be further licensed to other applications.

Their requirements were abstract and the founders weren’t sure of their investment plan or the value it would add to their business. Another concern was whether this API can be marketed as a separate product to other applications in healthcare.

Launching MVP in Laravel

Based on the business constraints we figured that the cost of launching the first version would be low where as the cost of supporting the API and building future versions relatively higher. The real requirements would come from the feedbacks users give after launching the MVP. Given the timeline and requirements of the API, we suggested that it should be built on Laravel 5.5. You can read more about why we suggested Laravel over RoR and Codeigniter.

The Laravel framework has been great for building web applications. The recent updates in version 5.5 have made it our favourite for building REST APIs. We successfully built the MVP of the API and integrated it with the application in a two-week timeline, by the end of September 2017. The existing application was built in CodeIgniter and required some tweaks to integrate with the API.

The SSL certificate was set up with Let’s Encrypt. To avoid manually renewing it we set up automated renewal checks with the Laravel scheduler. API Licensing and implementing authentication was built with Laravel Passport.

Evolving the API with feedbacks

The evolution of the API depends on the feedback from end users ie. the cancer specialities. We set up a process to get feedbacks and improvise the API algorithm. On the technology front, the algorithm was implemented with Laravel Eloquent to obtain the best and most relevant studies for cancer cases. With the feedbacks, we fine-tuned the algorithm and added support for all cancer types (the beta version only supported breast cancer).

Scalable infrastructure to power the API

It was expected that the computational complexity and usage would grow with time as the algorithm evolves and userbase of the API grows. We went for cloud infrastructure that can be scaled as per need. We set up boxes on Amazon Web Services with the EC2, Route53 and RDS service. We’ve been continuing to support regular maintenance and operation of these servers since the launch.

Periodic data updates

For the MVP, we worked with publicly available CTTI database. The next step was to enable the API database to periodically update itself from CTTI and other valid sources. Another step was to let hospitals and applications add their data. Once verified their studies would start showing up in the API responses.

We used Laravel’s API Resources with Eloquent to update our DB with data from other applications and periodically visit CTTI to update itself with the latest studies.

The API today

After launching the MVP in September, the API today is consumed by the application and used by cancer specialists and tumour boards on a daily basis. It has reached a stable ver1 and empowers a more resourceful cancer diagnosis. In hindsight, choosing Laravel as the framework was pivotal in building the API in a short span of time and then letting it grow iteratively with each version.

CHALLENGE

Launching a beta version under a timeline with a process to improvise with every use.

OUTCOME

We successfully launched and integrated the API into the application in 2 weeks success.

TECHNOLOGY

Laravel 5.5
AWS
Let’s Encrypt
Valet
Postman

Choice of technologies and frameworks is key to success of a MVP

Nishanth Kaladharan
Next case study