Johns Hopkins Medicine uses the EPIC EMR at all locations except All Children's Hospital (ACH). The Epic EMR backs up nightly into a Clarity relational database comprising of over 20k tables. Those tables are brought into the PMAP data commons and projected to prospective research databases. As such, the data will have a 24 hour latency.
Most of the tutorials in this section are based on a de-identified dataset projected from Epic on patients with asthma based upon an IRB from Dr. Christopher Chute. The dataset encompasses 60k patients with over 110M data elements encompassing encounters, medications, labs, procedures, symptoms, and vital measurements. The data only includes categorical fields (hence no narrative notes). To compile relevant Jupyter notebook tutorials you will need to be granted access to the PMAP database with this data.
You will need to attest here that you will:
To access the PMAP Database you will need to use your JHEDID and password which you can hide by using the getpass library. PMAP maintains a list of approved users for each data projection based upon IRB protocols.
import getpass
from SciServer import Authentication
myUserName = Authentication.getKeystoneUserWithToken(Authentication.getToken()).userName
passwd = getpass.getpass('Password for ' + myUserName + ': ')
user = "win\\" + myUserName
Password for pnagy2: ········
The data sits on a database server that is designed to query large data sets quickly. This script connects to the PMAP database server and allows access to the CAMP_PMCoe_Projection which is the de-identified asthma dataset.
import sqlalchemy
import urllib.parse
#SQL Driver
driver="FreeTDS"
tds_ver="8.0"
# Database
host_ip="ESMPMDBPR4.WIN.AD.JHU.EDU" # Update this accordingly
db_port="1433"
db="CAMP_PMCoe_Projection" # Update this accordingly
# Create Connection String
conn_str=("DRIVER={};Server={};PORT={};DATABASE={};UID={};PWD={};TDS_VERSION={}"
.format(driver, host_ip, db_port, db, user, passwd, tds_ver)
)
# Create Engine
engine = sqlalchemy.create_engine('mssql+pyodbc:///?odbc_connect=' +
urllib.parse.quote(conn_str)
)