Stream: implementers
Topic: Census API using Encounter Resource
Jeffrey Taylor (Oct 10 2018 at 20:36):
Our healthsystem generates a flat file every night for for each floor/ward. These files contain information about each room, and what patient is in each room. Each night, this file gets updated with the new up to date census data.
I'd like to expose this census data via a FHIR interface. What I have set up is a process to read this file every morning, construct some Encounter, Patient and Location resources in a FHIR Transaction, then POST that transaction to my FHIR Server. This information can now be queried like /Encounter?location=123
.
I'm not exactly sure how to update this information the next day though. I get the new information from the flat file. I can load it in the FHIR Server, but yesterday's data is in there too. I've thought about just deleting everything in the database as the first step in the transaction then loading the new data in, but that seems a little silly.
Is there a better way to model this data so a client can just ask for todays census data? Has anyone modeled anything like this?Census API using Encounter
Grahame Grieve (Oct 10 2018 at 20:37):
the question is hard to answer because you appear to asking about the upload process, but actually asked about a client. What role does the client play in the upload process?
natus (Oct 10 2018 at 20:44):
@Jeffrey Taylor in case the flat file do contain technical identifiers of each row, that's easy to implement a slow changing dimention algorithm to insert new data/ update modified information/de-activate deleted information. In case the flat file does not have such kind of id, then you might be able to create your own from composite columns from the data (eg: patient_id+date +fact) that is unique
Jeffrey Taylor (Oct 10 2018 at 20:44):
Apologies - the client just wants to query and get todays encounters for a given location. What I find difficult is how to load in a day's worth of encounter/patient data into a system (i'm using a transaction - i think that's the right tool here). Some patients are new, some encounters are new, but some encounters/patients are the same.
Jeffrey Taylor (Oct 10 2018 at 20:46):
@natus interesting idea for that algorithm. Yes, I do have identifiers (patient, encounter and location identifiers, actually) for each row. I was just shooting things into a FHIRServer using ifNoneExist
for a patient, but wasn't sure how to deal with an encounter that could last many days.
natus (Oct 10 2018 at 20:48):
SCD algorithm apply at the SQL level. I would directly load the data in the database without using FHIR. And only offer a read API for the client. That would be much easier and faster. BTW, you might not have access to it.
Last updated: Apr 12 2022 at 19:14 UTC