Building the Cleared Quiz Machine

20192022

video poster
Quiz Machine demo, February 2020

Cleared quizzes have many features: HIPPA compliance, conditional flows, product recommendations, analytics and more. We wanted a CMS that would support such rich quizzes and allow our product team to easily create ones: enter Capable Health.

Capable Health offers a survey product that allows our product team to log-in and create new quizzes on-demand. Our frontend then takes the quizzes created in Capable Health and renders them using the Cleared design language.

Two great benefits of Capable Health are product recommendations based on quiz responses (ie. If a user answer Yes to question 2, recommend treatment X) and quiz analytics. Both of these features are not provided in a typical CMS, especially quiz analytics. Setting up an easy-to-use dashboard of quiz stats and metrics was easy. This information is great for our marketing team to investigate things like the drop-off on each quiz.

Extending Capable Health, we were able to implement condition flows that allow quizzes to be dynamic based on users answers.

In the world of digital health, physicians need an Electronic Health Record (EHR) to manage sensitive patient data, handle patient cases and prescribe medications in a HIPAA compliant manner. We chose MDIntegrations as our new EHR replacing a legacy system.

One of the key benefits of MDIntegrations is webhooks. With webhooks, we no longer have to maintain our own system of cron jobs to periodically query the API. This is very useful for keeping synchronization between our server and our EHR system, saving the time of our doctors. When events reach our server in real time we can process cases without delay, meaning our doctors can approve medications, wait for payment and transmit the prescriptions all in one sitting. We also built a queue system to make the webhooks even more reliable. This adds the extra reliability of an events endpoint over webhooks.

MDIntegrations is an API based EHR. Being able to tightly integrate lets us reflect actions taken by doctors within the EHR in the Cleared portal. Doctors can recommend medications to a patient at any time without leaving MDIntegrations and a cart will automatically be created on the Cleared portal ready for the patient to checkout.

Our ExpressJS server coordinates between the frontend and all our services like MDIntegrations, Capable Health, and Stripe. Users interact directly with the Cleared frontend, while doctors can work within the tools they’re familiar with and handle cases entirely through MDIntegrations and the product team can create and modify quizzes in Capable Health.

Picking and then integrating with the right services for the quiz machine (ie. MDintegrations, Capable Health, and Stripe) was a large obstacle. In hindsight, we know exactly what is required to get the Quiz Machine working but making the right decisions among many different service options was a big challenge. One of the most important things we did during this period was developing close working relationships with the dev teams of MDIntegrations and Capable Health. Inevitably, things broke. And then we worked together to fix them. In using their product, we helped them scale their offering, and we got something that better suited our needs.

Here are some additional obstacles:

The Quiz Machine has been a great improvement to the Cleared Stack but it isn’t finished yet. There are improvements to make and features to add. Here are some of the projects are team plans to work on in the future:

While invention is fun, it only continues to exist if it’s maintainable. We did a good job of planning ahead for feature additions and maintenance in future by choosing to build base-level primitives (such as standardized query parameters). Whatever design decisions we made, we made with the intention of writing code that was as easy to understand—and extend or delete—as possible.