accessing-clinical-records.md 1.4 KB

Accessing clinical records using almirah

from almirah import Database
db = Database(name="calm-brain", host="https://www.calm-brain.ncbs.res.in/db-request/" , backend="request")
db
<Database url: 'request:calm-brain@https://www.calm-brain.ncbs.res.in/db-request/'>
db.connect("username", "password")
df = db.query(table="presenting_disorders")
df[["subject", "session", "addiction"]].head()
subject session addiction
0 D0019 101 0
1 D0019 111 0
2 D0020 101 0
3 D0020 111 <NA>
4 D0021 101 0
len(df)
2561
len(df[df["addiction"] == 1])
522