With A Little Help From My Friends

post-miscellaneous post-talks

Accompanying blog post for the Posit Community talk: “With A Little Help From My Friends: Tools and insights for developing and deploying in the hospital”.

Chloe Pou-Prom
2023-01-27

This is a summary of “With A Little Help From My Friends: Tools and insights for developing and deploying in the hospital”, a talk given on November 15, 2022 as part of the Posit Enterprise Community Meetup series. A recording of the talk is available here and a PDF of the accompanying slides can be found here.

A success story

Here at DSAA, we developed CHARTwatch, an early warning system for detecting patient deterioration. The system runs every hour:

Finally, on August 2020, CHARTwatch went live and we were able to deploy to the General Internal Medicine (GIM) ward!! Developing and deploying CHARTwatch was a difficult feat and wouldn’t have been possible without the help of a few friends…

Tools for development

Database connections

There are various data systems in the hospital, all with their own quirks and intricacies. In order to make it easier for the Advanced Analytics team to work with the different hospital databases, we developed chartdb, an internal R package.

con_a <- chartdb::connect_databaseA(username = ..., password = ...)
con_b <- chartdb::connect_databaseB(username = ..., password = ...)
con_edw <- chartdb::connect_edw(username = ..., password = ...)
con_soarian <- chartdb::connect_soarian(username = ..., password = ...)
con_mak <- chartdb::connect_mak(username = ..., password = ...)
con_syngo <- chartdb::connect_syngo(username = ..., password = ...)

A reproducible environment

A one-sentence horror story: “It works on my machine.”

Package-based development

Why write a package?

Environment! Environment! Environments

We typically work with 3 different environment.

An interlude

A multi-sentence horror story:

In earlier attempts to deploy CHARTwatch, we were using multiple CRON jobs… that called different bash scripts… which then called different Python/R/Java scripts. Oh, and we had no separate environments. Or rather, we only had one environment, where test environment = staging environment = production environment

Tools for deployment

Interlude over! Let’s looks the tools we need for deployment.

Authentication

We rely on Posit Connect for this. Posit Connect works with the hospital Active Directory, which enables administrators to manage permissions and access. What does this mean?

Scheduling

Posit Connect also gives us the ability to schedule scripts through their admin interface.

Downtime

Knowing when things don’t work is crucial for deployment.

A secure way to download internally-developed packages

We need to limit who can access the hospital network. Posit Package Manager is a repository package management that lets us download packages while being disconnected from the Internet.

An implementation plan

Deploying an early warning system in the hospital involves working with many different groups. All worked together to develop the implementation plan. Some takeaways from the implementation plan:

Find out more

This is a very very very very brief overview of CHARTwatch and how we develop and deploy models in the hospital. Check out the reading list below for more details.