Skip to content

Commit

Permalink
remove . at beginning of token file
Browse files Browse the repository at this point in the history
FHIR-2450
  • Loading branch information
Bloom committed Aug 7, 2024
1 parent 7bf89e9 commit f3e0f81
Showing 1 changed file with 41 additions and 22 deletions.
63 changes: 41 additions & 22 deletions jupyter/pilot/Notebook01_phs002921_URECA_subject_phenotype.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,21 @@
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"id": "d4b50729-08c1-43d2-91aa-edc93194f03a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"====== start time: 2024-08-02 17:36:44\n",
"https://dbgap-api.ncbi.nlm.nih.gov/fhir-jpa-pilot1/x1/ResearchSubject?study=phs002921\n",
"Total patients fetched: 1035\n",
"Accumulative patients with observations: 1\n",
"Accumulative patients with observations: 2\n",
"Data written to patient_observations.csv\n",
"====== end time: 2024-08-02 17:37:18\n",
"===========Elapsed time: 0 minutes and 34 seconds.\n"
]
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-07T19:32:03.428830Z",
"start_time": "2024-08-07T19:31:34.565851Z"
}
],
},
"source": [
"import os\n",
"import requests\n",
"import csv\n",
"from datetime import datetime\n",
"from time import sleep\n",
"from fhir_fetcher import fetch_all_data # Ensure this module is available and handles paging through all records\n",
"from fhir_fetcher import fetch_all_data # Ensure this module is available \n",
"# and handles paging through all records\n",
"\n",
"def fetch_patient_observations(session, fhir_base_url, patient_id):\n",
" qstr = f'Observation?subject=Patient/{patient_id}'\n",
Expand Down Expand Up @@ -64,7 +53,7 @@
" ###############################################################################################\n",
" # get the token from https://www.ncbi.nlm.nih.gov/gap/power-user-portal/. \n",
" # Scroll down and click on the \"Task Specific Token\" button to get the light-weight version of the dbGaP RAS Passport.\n",
" # Save the file into a text. In my example, it is saved to .task-specific-token_all.txt. \n",
" # Save the file into a text. In my example, it is saved to task-specific-token_all.txt. \n",
" ###############################################################################################\n",
" TST_PATH = '~/dev/fhir/task-specific-token-all.txt' \n",
" fhir_base_url = \"https://dbgap-api.ncbi.nlm.nih.gov/fhir-jpa-pilot1/x1\"\n",
Expand Down Expand Up @@ -129,15 +118,45 @@
"\n",
"if __name__ == \"__main__\":\n",
" main()\n"
]
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"====== start time: 2024-08-07 15:31:34\n",
"https://dbgap-api.ncbi.nlm.nih.gov/fhir-jpa-pilot1/x1/ResearchSubject?study=phs002921\n",
"Total patients fetched: 1035\n",
"Accumulative patients with observations: 1\n",
"Accumulative patients with observations: 2\n",
"Data written to patient_observations.csv\n",
"====== end time: 2024-08-07 15:32:03\n",
"===========Elapsed time: 0 minutes and 28 seconds.\n"
]
}
],
"execution_count": 3
},
{
"cell_type": "code",
"execution_count": null,
"id": "73d4fd89-d458-4f4d-8e0a-e8bb23027492",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-07T19:31:25.033138Z",
"start_time": "2024-08-07T19:31:25.029617Z"
}
},
"source": [],
"outputs": [],
"execution_count": 2
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"source": []
"execution_count": null,
"source": "",
"id": "e688d9da99c28d00"
}
],
"metadata": {
Expand Down

0 comments on commit f3e0f81

Please sign in to comment.