Resources

Andy Choens | R in Epidemiology | Posit

Connecting Primary Care Providers to their own data Presentation by Andy Choens The Electronic Health Record, or EHR, is a digital replacement for traditional paper medical charts. And while today's EHRs are an effective replacement for digital records and have increased clinical data sharing, they do not provide the level of comprehensive clinical decision support envisioned by early proponents. Acuitas is a consulting firm that works with providers to unlock the hidden value in their EHRs. From helping providers manage chronic diseases, succeeding in value-based payment plans, and responding to crises such as Covid 19, Acuitas helps providers succeed by connecting the data in the EHR to claims, Hixny (the local HIE), and other crucial data sources. To help providers "connect the dots", Acuitas provides custom reports inside of and outside of the EHR. Some of these reports are patient-specific. Others are at the level of their practice or specific populations of interest such as patients with diabetes. Acuitas is able to do this by using an agile, dynamic process and a collection of largely open-source tools including R and Python

Nov 19, 2021
1h 6min

image: thumbnail.jpg

Transcript#

This transcript was generated automatically and may contain errors.

Yeah, the topic that I'm going to speak to today is connecting providers to their patient data. And as I'm watching people, I've got the chat pulled up and I'm watching people saying, someone just said that they were from France. I saw Nigeria, Canada, my old hometown of Atlanta, Georgia.

I'm up here in upstate New York, but yes, I am a rambling wreck from Georgia Tech. Thank you for joining us today. Given the fact that, obviously healthcare is a highly, we all have, healthcare is the same everywhere in that we're all always treating people. We are trying to make people healthy. Yet the business of healthcare is highly localized.

And I was very much, when I was putting the slides together, I will confess I was sort of thinking of the concept of US national level thing. So I'm gonna try to be very conscientious as I'm going through some of these topics and I start throwing out terminology because epidemiology, healthcare, et cetera, is just rife with terminology. So I'm gonna try to not drown everyone in lingo.

Also when I just have to, because it's healthcare and we need more acronyms, I will try to make sure that I am backing up and kind of trying to at least give where that acronym comes from.

Ambulatory care and Acuitas Health

I wanna also start with connecting providers to their patient data. So what am I talking about there and who rather? Specifically, I'm talking about in today's discussion, ambulatory providers. A lot of times when we start talking about healthcare, a lot of the papers you'll read, et cetera, they're about hospitals. Providers, a doctor in a hospital doing a surgery, providing us a care, providing an intervention.

Well, the world that I live in is actually the other side of the coin. It's when the patients go home. I work with providers all over upstate New York that are providing care in the ambulatory setting. It's a mix of both primary care and specialist care. But the point of it is that all the providers that I work with are what we call ambulatory providers, which means you can ambulate in, you talk to the doctor and you ambulate out. This is not inpatient. This is not emergency department care.

This is going in for your annual physical, trying to maintain and deal with chronic diseases like chronic heart failure, what have you. This is not the stuff that we always see on the news in the evening. You know, you watch your local news, it's like, oh, the emergency department is reporting this or that. That's a little bit different than what we're talking about here today.

All right, so with that, what is Acuitas Health? The terminology we like to use is that we are a population health services company. We help providers make that transition to, in America, we are making the transition from a world of fee-for-service. So you, patient walks in, patient is given some care, it is charged, health insurance pays for it. The American healthcare system is moving away from this fee-for-service model into this value-based payment model, which is more about trying to codify and document the conditions that people are dealing with and provide a mechanism to empower providers to really treat people holistically and to try to make sure that we're actually dealing with all of the needs that patients have.

This is a sea change in how healthcare is provided because most medical office models are based around the idea of, have patients come in, we will do something for them. We give them an X-ray, we do whatever. The patient walks out, we get paid. Value-based payment is a completely different world.

And so what Acuitas does, and I've got a picture up on the screen of prior to COVID-19, the office that we occupied. Hello, River Street in Troy, New York. And that is the Rice Building in Troy, New York. It's a lovely building that goes back to the 19th century, which I have not been inside of for more than a few minutes at a time and longer than I care to admit.

Across the bottom there, so who are we more broadly? We are this independent population health services company. We work with and are owned by CDPHP, which is a regional healthcare provider here in upstate New York. And one of our service vendors that we work with very closely that I need to make sure I acknowledge their role in what we do is Health Catalyst. So those are the three logos that you see across the bottom because what we are doing, the position that Acuitas sort of occupies is trying to get everyone to work together.

And I'll talk about that more in just a moment. But before I do, okay, so who am I? I like to joke that I am the pirate captain. I lead the data science team here at Acuitas Health. I personally have a background in program evaluation and program improvement. I've worked in areas such as ambulatory care, child welfare, elder care, and other human services domains.

Rumor has it, although this is just a rumor and remains to be seen, but rumor has it I am a fan of the 18th letter of the English alphabet. And yes, I did actually choose this picture very, very, very consciously. So on Slack and in Zoom, I use a picture of the pirate captain. If you are fans of British humor, you know this show. If you don't know this show, you need to know this show. Go watch it, it's hysterical. Charles Darwin has never been so much fun.

But the pirate captain only succeeds. He only survives literally to the end of the show because of his crew. So the reason I chose this picture is because, sure, I'm the one you're talking today, but this isn't really my work. The thing that I wanna make sure that I'm really transparent about is that this is the work of a large group of professionals that I have the pleasure of working with. And they have come together to help us all create these really interesting ways of trying to connect providers to their data across EHR, claims, HIE systems, all of these different data sources that tend to live in their own silos and their own bubbles. It is this team, not me, that created this.

But the pirate captain only succeeds. He only survives literally to the end of the show because of his crew.

Technologies used

All right, so technologies, like I said, I did wanna make sure, I throw their logo in here a couple of times that we do work with a company called Health Catalyst that helps provide some of our backend services. In terms of technologies used, we use a lot of R, we use a lot of Python, we use a little bit of JavaScript, and don't tell anybody, we still have some Gleck.

But all jokes aside, we also do, we are customers with RStudio and we use RStudio Connect. And we also use, if anybody really wants to know all the dirty laundry in the backend, we use Microsoft MS SQL Server for our backend database driver. So those are sort of the suite of technologies that we use. Oh, I didn't put the logo up here, but we also have what we call the report server, which runs Docker instances. So those are sort of our suite of technologies.

When we started Acuitas, we were very purposeful about trying to not have a single technology or not have a single language that we would try to implement everything in. We wanted to recognize that data science is a rapidly growing and changing field. And that the reality is that we should be trying to use the best tool for the job. And while people are certainly welcome to argue about whether or not we have done that in all instances, these were the best choices for us at the time.

And we have been trying to make sure that we are empowering the people on our team. Remember I said, it's really about that team. So we were trying to make sure that we were empowering the people on that team to use the technologies that best fit that situation and their needs at that moment. So that's why we have tried to make sure that we don't do, I've worked in other places where everything has to be done in SPSS or everything has to be done in SAS or everything has to be done in R. And we have taken the opposite approach where we say, let's just try to figure out what the best tool for the job is and then use that tool.

Data sources and the Gordian knot of modern medicine

All right, so some fun facts about Acuitas. Acuitas, hence the logo, we live in this sometimes uncomfortable space between insurance companies, AKA payers and your doctor, the provider. I tend to use the terminology of payer and provider, but when I say payer, I mean medical insurance companies. And when I say provider, I mean your doctor or the practice sort of more generally. It is our job to help both succeed.

We are currently importing, just for some context in terms of what we are dealing with, we import EHR data from 14 different vendors. And we do so by a variety of means, including ODBC. If you are familiar how EHRs are implemented here in the US, the Consolidated Clinical Document or CCDA, and just good old fashioned CSV. We are actually supporting over 200 practices in the Capital District and upstate New York region. And we work with 11 different payer groups. And we do all that as a company that is going to turn five next June. So we are a very young company. We move very fast.

We break things from time to time, but what we are doing is trying to provide a highly fluid group of services to a very diverse group of providers to help them, like I said, succeed and thrive in this value-based payment regime. And so we live in the middle, which is sometimes uncomfortable because it's difficult living in the middle between two different groups that actually have a lot of the same common interest. They don't always see themselves as having all of the same common interest. So we live in the middle, helping everyone understand how actually providers and payers really do have a lot more overlap than they have in terms of differences of interest.

Some context around the provider tools that we're going to talk about. Let's think about, so I started this saying that we were going to connect providers to their data, and that is what we do. So let's think about what those data sources really are. You have EHRs, which are these marvelously complex relational data sources that have all of the patient history, the amount of data that is, and by the way, these screenshots, no, I pulled these down from the vendor's websites. So if there's PHI in this, not my fault.

These are not screenshots from our clients. But an EHR is this incredibly complex thing that is, it's basically a filing cabinet for everybody's healthcare data. And then you have the practice management system, which deals with things like billing and upcoming appointments, helping, you know, you call them up and say, hi, I'd like to see my doctor. And they say, okay, so we have an appointment available at next Tuesday at two o'clock, can you do that? That's what that practice management system is. In most practices, these two systems live independently of one another.

Yet at the same time, they are actually separate systems. And then other groups of data that exist. Here in the United States, we have what we call health information exchanges. A health information exchange I work with most often is called HICSNY. And a health information exchange sends out what we call an HL7. I know so much lingo, I hit healthcare sometimes.

So an HL7 message is just a fancy way of saying XML. And it is an XML message that has some information about an event or a patient that gets sent out over yield interwebs. And so that information goes out and usually gets dumped into the EHR and notifies the provider of some event or some thing. Again, all that's going into the EHR. And then of course, the other source of data that providers are having to deal with increasingly are claims.

So a patient, you know, the practice management system, the EHR know what's going on here. But there's this bigger picture of when you start trying to talk about a holistic picture of what someone is medically, there's this larger picture of what are other providers doing when there are, you know, DAA signed and all this legal stuff gets taken care of. How can we leverage the incredible power of claims data, the incredible power of these health information exchange systems? And all of the data providers have historically collected in their EHR and practice management system.

And the reality is that that big holistic picture is what I'm referring today to as population health. And there isn't really a stock tool. You can't go buy a system for this. And in fact, I'm not even sure at this point you can because the needs are so regional that are so dependent upon what that practice is doing at that time. Here in the United States, the Department of Health and Human Services comes out with a new medical model roughly every three minutes or so that providers may or may not decide to get involved with. So the complexity of healthcare just within the United States, let alone the rest of the world, but just within the United States is mind bogglingly complex.

Population health tools

So now, of course, the obvious question is, okay, so you say that you're supporting people with this. So what does that mean? So I'm gonna take you through what I'm gonna refer to as some population health tools. These are some tools that we have provided for our clients. Now, I've already said that this is obviously very tricky because there's all these different data sources. They don't necessarily wanna talk to one another. So effectively, what I've introduced you to is the Gordian Knot of modern medicine. So we're gonna be a little bit Alexander the Great here, and we are going to cut that Gordian Knot, and there's only one way that I know of to do this, and that's by getting everybody at the table and getting them involved.

So when I show you these tools, these are not things that were made in the back office somewhere, and some people, the data science team got together, and they're like, oh, this is a cool idea. That's not how we do things. We are not providing a product like Microsoft where we work on it for a couple of years, and then shove it out, and we put it in the store, and we ask people to buy it. We have contracts with providers. They need services from us.

What happens in terms of how we actually get to these tools is the providers or the payers come to us and say, hey, there's this need. We need to be able to communicate around this. We need to be able to help people navigate this specific space. Maybe we need to help with transitions of care. So when people leave the inpatient setting, how do we make sure that that works? How do we make sure that the primary care provider is following up with that patient?

And just if you think about that, that transition of care, you have a patient leaving the hospital, and they're gonna go home. And it would be ideal for their primary care provider to follow up and provide contact, you know, check in with them. Do we need to talk about your medications? How are you feeling? Do you need to come in and see me? In fact, let me go ahead and schedule that for you. That's what we're talking about around transition of care. And it's really hard because what's happened traditionally is EHRs get this message, and it gets dumped into the EHR, and it may or may not generate an alert for the provider. And there's more people at an actual practice than just the doctors doing work. They have a support team around them.

So I wanna introduce you to the first tool that's going to help us cut this Gordian knot is the Health Hospital Activity Monitor, or HAM. Now, you will note that the picture that I have on the screen at this point is of a lump of ham, and not the tool, which gets us into this really funny thing about healthcare is I can't show you a lot of what we do directly because it's literally chock full of PHI. And I don't really want to violate those federal laws, so I have to be a little bit careful here.

So what is the Hospital Activity Monitor? HAM, as we call it, and you'll see that a lot of our, there's a joke with everything. We have to have our fun. The HAM report is a daily email that goes out. It is actually provided to the sites as an Excel file. And in that Excel file are gonna be a whole bunch of tabs. And those tabs have things like, here's the list, doctor, you know, whoever. Here are the list of your patients who, within the last 24 hours, were admitted to the hospital. So here they are and what the admit reason is.

These are all patients that have consented to having their information exchanged over the HIE, the Health Information Exchange. They have consented to that. This doesn't just happen by magic. They have to consent. If they do consent and they allow their information to be sent out over HCME to the provider, we pick it up and we give the doctors a report, say, hey, these are your patients that have been admitted inpatient in the last 24 hours. We also have a list of, here are the patients who were discharged from the hospital in the last 24 hours. So they've gone home. Somebody should probably follow up with them.

And again, there's context. So you can see in terms of, you know, what type of stuff we're providing. Some of it's really boring. The MRN, the name of the date of birth, it just helps people know who we're talking about. But if you go in and you look at some of the event information, well, where are they going? Where were they admitted to or discharged from? So, you know, hospitals that we have up here in the Capital District would be places like Albany Med or St. Peter's. This is, you know, what I mean by an admit facility or discharge location. Why were they inpatient in the first place? What was that primary reason? What was the discharge date?

If there is one, that's obviously only on the discharges. And for context, for the provider, again, driven by the HIE, how many recent ER visits have they had? How many recent inpatient visits have they had? Because if someone who has an inpatient stay and you can look and go, wow, in the last year they've had 70 visits and now they're inpatient, that's a very different patient than someone who just went in, you know, overnight. You know, we have to try to gauge what is the severity of the patient's needs. So we try to provide a snapshot picture of what's going on.

The provider still has the EHR. If they have further questions, they can go diving through the incredibly rich dataset that is the EHR. This is a snapshot that allows the provider, a nurse, a care manager to make rapid decisions about which patients really need to be prioritized for follow-up upon that transition of care, which patients need to be followed up while they're actually in the hospital, what have you. And all of this thing is about really providing patient connectivity between the ambulatory primary care provider and the patient when they're going in and out of the hospital. So that is, well, a whole lot of ham.

Another tool that we have, which we call the Chronic Conditions Report or CCR. And this is another Excel file that is generated and sent out. And both of these, so the, actually back up, the Hospital Activity Monitor is actually a Python script and the CCR is an R script. And these run on what we refer to as our report server, which is our Docker powered system for emailing out large numbers of Excel files that we developed internally.

The, this is again, an Excel file, like I said, and this is something that we send out every other week to a site. And so if you are familiar with an EHR, one of the things that you would know is that EHRs are, I kind of compare, oh, you can't see this because it's in front of me, but I have a filing cabinet in front of me. They are a patient filing cabinet. All of the information gets put into the right little, you know, folder inside the EHR for that patient. And it's a marvelously rich data source, but EHRs are not good at providing the 30,000 foot view of what's going on.

So if you take off in a plane and you're flying over, you know, wherever, and you look down, you have a completely different view of the countryside than you do if you are driving down the road. And I would say the EHR is like driving down the road and using, you know, Google to get you from point A to point B. And this chronic conditions report, this is what you see when you get to the plane, because this is full panel data. EHRs have, obviously, full panel data. And when I say full panel data, what I mean is all of the patients at the site. So EHRs have that, but when you use an EHR, you are looking at just my data or just your data. You're not looking at that 30,000 foot view.

The CCR is that 30,000 foot view. So we break it down and we say, okay, so how many patients have diabetes at your practice? And of those who do, what was their last A1C value? Because providers need a way of saying, hey, you know, I'd like to be able to do this new intervention. I've got this new technology or I've got this new care manager who's joining my practice. And we wanna really be able to target people who have an A1C over nine. Well, this CCR, what we like to say is this democratizes that data because without having to come to us or to come to anyone else, the provider now has the ability to say, all right, who are all my patients who have diabetes with an A1C over nine?

Well, this CCR, what we like to say is this democratizes that data because without having to come to us or to come to anyone else, the provider now has the ability to say, all right, who are all my patients who have diabetes with an A1C over nine?

They have the ability using this Excel file to literally make that list. And then they can hand that off to their care manager and the office say, please, let's go provide some services for these patients. It makes it rapid. It makes it so that they have full transparency into what's going on. And you can see the entire list of things that we are providing in terms of the types of chronic conditions and labs that we target on this. And we're adding more slowly.

The next one here, and I've just got one or two more slides here before I wrap up, but this is what we call our pre-visit planning document. So Jane Doe is not a real patient. She is not a real person. So this is a dummy document, but it is emblematic of what our pre-visit planning tool is. Again, like I was saying, an EHR is super complicated and the EHR provides all the detail, all of their A1C's values, all of their history. So we developed this pre-visit planning tool to help providers get ready to see you.

So hopefully in the day or two, the week, what have you, before your appointment, when you go in to see your provider, they sit down and they do a chart review. They go through and they think about who you are medically. They prepare themselves. And because of our role of trying to help providers succeed in value-based payment contracts, some of the space here is occupied by information that will help that provider know what things they should be doing. So for example, down here, we have some lists of cervical cancer screenings and this, you know, in that case, there's something for them to do.

But we have a list of things that these are coming, these measures are eCQM measures, for those of you in the United States. These are measures that the doctor should be considering about how am I going to fill on this patient? This particular patient is apparently very complicated, but this is a little over the top in terms of an example, but it gives you an idea of what type of information is on it, how we're trying to help providers identify opportunities to close gaps in care. It goes down and has, you know, an ER and inpatient stay. So again, we're integrating data from the EHR, from HICSNY, from claims. All this is getting dumped into this one single document that your primary care provider can review and try to mentally get ready to provide you with the best possible care at that point of contact in the office.

They can sit down and they can see the orders and they can say, oh, well, did you follow up on that? What have you. Then if the provider has further questions, again, they still have that EHR. They can still go to that and they can open that up and go looking through and go, okay, so I see that your last A1C was really high. What's a 12? That's not good. But they can go into the EHR and say, okay, you had 112. Everything else was pretty good and you had 112. That's different than a patient that's got lots of 12s.

12 is a not good A1C. So they still may have to go to the EHR to really kind of put that full picture together, but we're providing a snapshot of information that really helps the provider get their head in the right space so that when they walk in to see you, they are ready, they know what's going on, and they have some context for where you are medically.

The last tool I've got I wanted to talk about just because this is an R in epidemiology thing. Kind of seems like we need a Shiny application shown off somewhere in this thing. So this is a Shiny app that we made, and it's also, I wanted to use this as an opportunity to highlight something that's not EHR-driven. A lot of our tools are, because we are connecting providers to their data, EHR-driven. Of course they are. This appointment trends application is not. In fact, there is almost no EHR data in this thing whatsoever. Also fun, because that means I can do screenshots.

But what this is really being driven by is by that practice management tool. You've got appointments coming up. You've got appointments showing up or not. If you would all recall, back in March of 2020, the state of New York shut itself down. So what this tool came about was over about a weekend after COVID-19 hit, and New York City and the New York State just a day or two later started shutting down. Providers started calling us and saying, I know that people are not going to show up for their appointments. I know patients aren't going to show up for their appointments. I know that my numbers are decreasing of appointments, but I don't have a limitability to wrap my head around what that means. I don't know how bad.

We were able to very rapidly put together a tool. It started off as a flex dashboard that we emailed the people, and later we were able to put it together as a shiny application that now lives actually in our network. And that purple line is 2020. And you can see the fall off the crater there is right there as we go into March of 2020 when COVID-19 causes New York State to shut down hard to deal with the epidemic. And the green line up there is what it should look like from 2019. So a little bit of a difference.

This tool also was able to be adapted to help providers understand, okay, I know my in-person numbers are crashing. That's what that screenshot is. But they were also implementing remote care. All of a sudden, kind of wild, you could go to your doctor on Zoom and have an entire medical visit where you didn't even have to be in the same room with your provider. And all of a sudden, we shoved medicine into the 21st century. And the practice sites were working really hard to implement these technologies, and they were honestly doing a really good job. What they didn't know was were they plugging the hole?

They said, I know my in-person numbers are down. Am I plugging that hole with these remote visits? And so this tool actually has the ability to let us go in and track. And of course, it varies by the site, and it varies by the type of care provided. But we were able to start helping providers understand, yes, your in-person visits are way, way down. This is to the extent that you're able to make that up using remote technologies, remote visits, et cetera, doing phone calls, what have you, to really try to make up that hole, make up that gap, plug that hole.

This was a tool that came about, I wanna say the initial version of this, we put together literally in one weekend. And we were able to get this out. And by the end of the year, it is now a standing application that some of our practice sites continue to use here in 2021 to understand what their numbers are looking like trending over time, because simply put, appointments mean revenue. So while one blip depends, how much revenue depends on what the appointment is, your appointments are going up, revenue will eventually follow.

because simply put, appointments mean revenue. So while one blip depends, how much revenue depends on what the appointment is, your appointments are going up, revenue will eventually follow.

So just one more application that we were able to do to help them see that 30,000 foot view of what their practice looked like.

All right, so that was my presentation. Thank you so much for everything. I put a link up there. I made the slides that I just went through publicly available there on my GitLab page. And there you go for everyone who needed it, your obligatory R code junk.

Q&A

Thank you so much, Andy. I really appreciate your energy as well.

While I go over to the Slido for some of the questions, do you mind copying and pasting the slides into the chat or just that link there? Yeah.

And just a reminder, if anybody joined a little bit later, we do have a Slido link where you can ask questions to or upvote other questions. But Andy, one of the most upvoted questions so far is, are there R packages that help with EHR data wrangling?

Good question. So that is something that I skimmed over when I went through the discussion around technologies. There it is. I skimmed over that. So what we actually do, I did say that the technology provider that we use to help us do what we do is Health Catalyst. What we actually wind up doing is Health Catalyst provides a lot of R backend services in terms of ETL. And they have a set of tools that they have developed, which we use to actually help us manage all of that complexity. And so what we actually do, we describe our data warehouse as a layered cake. And that first level of, well, we technically do ELT, but we extract load and then later we do the transformations. We use the Health Catalyst tools to actually do that initial export out of the EHRs into the data warehouse. So no, we are not using any R packages for that. There are really good R packages to help you with diagnosis groupings and things like that that are useful, but they're very well made B tools but we are not using those at this point.

The next one, Andy, is about large data. How do you deal with large data sets greater than a hundred gigabytes using R? I tend to use SAS to do data wrangling since R is limited by RAM size. Is there a way to solve this in R?

So I guess the first question that I would address with that is, so if you have very, very large data, a hundred gigabytes is pretty big. What are you trying to do with that? So the solution that I would suggest if you are doing some kind of a machine learning model would be different than if you are trying to do some sort of summarization. Because if what you are trying to do is say, so practice management data is something that tends to scale up into the OMG scale because just think about how many appointments a provider has in a day.

I'm talking to a provider like one doctor and there's often more than one doctor at a site and we're working with over 200 sites. So our practice management data is large, it's deep. I don't usually need to do a machine learning model off of the full cohort of that data. So what we actually do and what I would recommend if this is a relevant opportunity for you is to use a database server. Because yes, R is memory bound.