Skip to content

narges-rzv/FHIR_EPIC

Repository files navigation

This app is a vibe coded simple scrit to connect to EPIC Mychart and pull your data onto localhost (i.e your laptop) port 3000.


To run, first set up an environment (specified in healthAI_env.txt file)

$ conda create --name <env> --file healthAI_env.txt


You will also need to build an App under "EPIC on FHIR" (it's free everyone can do it) in EPIC to setup some FHIR endpoints (that by law every EPIC client has to have open). I have made an app with these endpoints - those highlighted in green for now in this google sheet The app has a callback of localhost:3000, and you need the client id of your app to be able to run your app.

Put the client id into a file as follows

echo "CLIENT_ID=\"the client id you got from the app\"" > client_id.py


Once the environment is set up (and activated!! conda activate [env name]), and you have the app and have the client_id.py file, to get your FHIR data (currently only NYU Langone data, I only specified the link for FHIR for that, I will add the others later), you run this in your terminal:

python epic_fhir_reader_final.py

It should start downloading your data in form of json files (and clinical notes will be txt) in a local directory called download. Once it is done you can just exit the program with ctl+c (sorry, will vibe code the exit better!). This make take a while but you will see the data also printed on terminal (in addition to being saved).


I also vibe coded a viewer app that will let you see these json files and texts, specially letting you see them in tabular format with only the relevant health items. These JSON files can be tricky to view.

That is under viewer_app.py. Just run it standalone i.e

$python viewer_app.py

The viewer app will connect to the download folder and can be accessed on localhost:5000 on the browser. Follow the viewer_app.py instructions once you run it.


I hope this is helpful for you. I had been looking for something like this for ages. Have fun and write to me if this is connected to what you do. More to come soon.

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages