Case Study

Improving Health Scenario Modeling with Rhino for Health Policy Analysis

Bringing production-grade Shiny practices with {rhino} for complex scenario modeling.

astellas
Genmab
merck
johnson and johnson
World Health Organisation
Kenvue
Phuse
Pharmaverse
astellas
Genmab
merck
johnson and johnson
World Health Organisation
Kenvue
Phuse
Pharmaverse

Table of contents

Executive Summary

Health Policy Analysis (HPA), a consulting firm specializing in healthcare systems, needed to enhance their existing Shiny application to be enterprise-ready and support complex scenario modeling. Their R/Shiny team needed assistance with transitioning the app to the {rhino} framework and meeting enterprise standards.

This partnership resulted in an overhaul of HPA's application, implementing rigorous testing, continuous integration, and an improved user interface design. This resulted in significant performance improvements, better scalability to handle larger datasets, and interactive visualizations crucial for healthcare planning and decision-making.

Background

Health Policy Analysis developed a Shiny app for a Government Health Agency in Australia that facilitates informed decision-making and clinical service planning for health services.


The projections are produced for different jurisdictions in Australia based on population estimates and rates of hospital episodes per population for clinical and age groups. Additional parameters are modeled, allowing Health Planners to gain more insights from the data.

The app allows Health Planners to adjust underlying assumptions and observe how these modifications might impact future years. For instance, closing a hospital can drastically affect patient flow from different regions. Such changes can be modeled within the app, allowing Health Planners to analyze a variety of Scenarios.

Analyses conducted in the app by Health Planners help health services make decisions on how to adjust their services to accommodate projected changes. It helps them to plan new facilities or to see how many beds they need to meet the demand.

Problem

Health Policy Analysis built the app with the {golem} framework. As the app grew in complexity and became more difficult to manage, the complexity of user interactions and data manipulation proved challenging. 

The size of the underlying data required optimizations in the app for it to be able to provide smooth operation for its users. HPA refactored the app to use {rhino} instead of {golem} and reached out to Appsilon to help advance their app.

Key Initiatives

  1. Introduce and teach production-grade Shiny development practices:
  • Introduce code structure that will help HPA Team members and their Client maintain and extend the app on their own.
  • Introduce automated testing to ensure calculations yield correct results and that Health Planners can carry out their operations via the user interface.
  1. Implement a new process of creating database views. Views allow Health Planners to group data in ways that are most relevant to their specific context, further enhancing their capacity to interpret the data effectively.
  2. Create a persistent storage system to allow Health Planners to effectively work on the same context across multiple sessions.
  3. Improve the user interface to facilitate more robust database views and Scenario creation.

Solution

The application underwent a major refactoring. Introduction of a new process of creating database views triggered changes in both code architecture and the user interface. 

The focus was to split the app code into separate steps of the underlying business process that allows developers to work on pieces of the process in isolation. Such design also facilitates automated testing which was one of the goals of the cooperation.

Appsilon worked with HPA to build a framework used to define and implement Scenarios. Usage of automated testing facilitated discussions on how Scenarios should work. It helped to see if the implementation yielded correct results for different use cases, simulating how Health Planners will use this feature. 

This approach aided cooperation between both parties; the HPA Team provided the rules of business logic on how Scenarios should modify the data, and the Appsilon Team carried out the implementation and made them accessible via the user interface. 

To preserve data between sessions, users previously had to export data to Excel and reupload it on the next run. Appsilon leveraged Pins on Posit Connect to automatically save and restore all created database views and Scenarios for logged in users, simplifying the workflow.

Appsilon’s Team helped HPA deliver the app to the health agency with major usability improvements, and automated testing of the interface and business logic. 

The modularized codebase has a smaller lead time for changes. Personalized R/Shiny training provided by Appsilon further improved the confidence that the app can be maintained and extended by the HPA Team on their own.

Results

The collaboration between Health Policy Analysis (HPA) and Appsilon resulted in substantial improvements to their Shiny application. Some of these results include: 

  • Code Efficiency: Comprehensive code refactoring and a continuous integration process increased reliability, reducing bugs and downtime.
  • Enhanced Testing Protocols: Unit, module, and end-to-end testing led to a decrease in critical errors, creating a more stable release environment.
  • Data Accessibility: Health planners can now efficiently interact with specific regions of large databases. Using Pins and DuckDB improved data retrieval speeds, enhancing user productivity.
  • UI/UX Improvements: The redesigned UI/UX for creating views and modeling scenarios increased user engagement and satisfaction with a more intuitive, user-centric design.

Testimonial

Collaborating with Appsilon enabled us to leverage their expertise to make our app enterprise-ready. While the HPA team already possessed strong skills and a solid track record in Shiny development, this project elevated our capabilities to the next level. The Appsilon team was highly collaborative, responsive, and professional, making it a pleasure to work with them. Through this partnership, the HPA team gained substantial knowledge, and our clients are extremely satisfied with the final app.
- Jim Pearse, Director, HPA

Explore Possibilities

Share Your Data Goals with Us

From advanced analytics to platform development and pharma consulting, we craft solutions tailored to your needs.

Talk to our Experts