In [1]:
Copied!
%%capture [--no-stdout]
!pip install fhir-aggregator-client --no-cache-dir --quiet
%%capture [--no-stdout]
!pip install fhir-aggregator-client --no-cache-dir --quiet
In [2]:
Copied!
%%capture [--no-stdout]
import numpy as np
import pandas as pd
from itables import init_notebook_mode, show
init_notebook_mode(connected=True)
import itables.options as opt
opt.classes="display nowrap compact"
opt.buttons=["copyHtml5", "csvHtml5", "excelHtml5"]
opt.maxBytes=0
%env FHIR_BASE= https://google-fhir.fhir-aggregator.org
!fq vocabulary vocabulary.tsv --fhir-base-url $FHIR_BASE
df = pd.read_csv('vocabulary.tsv', sep='\t').fillna('')
%%capture [--no-stdout]
import numpy as np
import pandas as pd
from itables import init_notebook_mode, show
init_notebook_mode(connected=True)
import itables.options as opt
opt.classes="display nowrap compact"
opt.buttons=["copyHtml5", "csvHtml5", "excelHtml5"]
opt.maxBytes=0
%env FHIR_BASE= https://google-fhir.fhir-aggregator.org
!fq vocabulary vocabulary.tsv --fhir-base-url $FHIR_BASE
df = pd.read_csv('vocabulary.tsv', sep='\t').fillna('')
Vocabulary filtering examples¶
It's easy enough to get a straightforward table response - just utilize Pandas to filter appropriately to your interest. Some examples below:
Exploring a study¶
Finding the vocabulary specific study is easy - filter according to the desired identifier in the research_study_identifiers column.
In [3]:
Copied!
scratch_df = df[df['research_study_identifiers'].str.contains('1KG')]
scratch_df
scratch_df = df[df['research_study_identifiers'].str.contains('1KG')]
scratch_df
Out[3]:
| Loading ITables v2.5.2 from the internet... (need help?) |
Exploring available conditions¶
Or query the vocab table for the available condition codes of the various patients in each research study.
In [4]:
Copied!
scratch_df = df[df['path'].str.contains('Condition.code')]
scratch_df
scratch_df = df[df['path'].str.contains('Condition.code')]
scratch_df
Out[4]:
| Loading ITables v2.5.2 from the internet... (need help?) |