Skip to content

Concepts

Concepts

Bases: Endpoint

Queries concepts/ endpoints

Functions

get(**kwargs)

Queries concepts/, with optional query parameters

Other Parameters:

Name Type Description
search string

Keyword search

collections list

IDs of collections

tags list

IDs of tags

datasources list

IDs of datasources

Returns:

Name Type Description
Response list

List of concepts matching query parameters

Examples:

>>> from pyconceptlibraryclient import Client
>>> client = Client(public=False)
>>> # Get all concepts
>>> client.concepts.get()
>>> # Search concepts
>>> client.concepts.get(search='asthma', collections=19)

get_codelist(id, version_id=None)

Queries concepts/{id}/export/codes/ or concepts/{id}/version/{version_id}/export/codes if version_id is supplied

Parameters:

Name Type Description Default
id str

ID of entity to query, in format C[\d+]

required
version_id int

version ID of entity

None

Returns:

Name Type Description
Response list

Codelist of queried concept

Examples:

>>> from pyconceptlibraryclient import Client
>>> client = Client(public=False)
>>> # Get codelist of phenotype, PH1
>>> client.concepts.get_codelist('PH1')
>>> # Get codelist of version 2 of phenotype, PH1
>>> client.concepts.get_codelist('PH1', version_id=2)

get_detail(id, version_id=None)

Queries concepts/{id}/detail/ or concepts/{id}/version/{version_id}/detail if version_id is supplied

Parameters:

Name Type Description Default
id str

ID of entity to query, in format C[\d+]

required
version_id int

version ID of entity

None

Returns:

Name Type Description
Response list

Details of queried concept

Examples:

>>> from pyconceptlibraryclient import Client
>>> client = Client(public=False)
>>> # Get detail of phenotype, PH1
>>> client.concepts.get_detail('PH1')
>>> # Get detail of version 2 of phenotype, PH1
>>> client.concepts.get_detail('PH1', version_id=2)

get_versions(id)

Queries concepts/{id}/get-versions/

Parameters:

Name Type Description Default
id str

ID of entity to query, in format C[\d+]

required

Returns:

Name Type Description
Response list

Version list of queried concept

Examples:

>>> from pyconceptlibraryclient import Client
>>> client = Client(public=False)
>>> client.concepts.get_versions('PH1')