Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_consent #260

Merged
merged 2 commits into from
Oct 16, 2020
Merged

Add get_consent #260

merged 2 commits into from
Oct 16, 2020

Conversation

boulund
Copy link
Member

@boulund boulund commented Oct 16, 2020

Add support for Consent endpoint

@boulund
Copy link
Member Author

boulund commented Oct 16, 2020

I just tested this and the failure modes, and everything seems to work well.

Should be ready to merge to develop @chichackles. I will use when I build the biobank export step later so we only export samples with a valid consent (i.e. OPTIN).

It's straightforward to use:

import clarity_ext_scripts.covid.partner_api_client.PartnerAPIV7Client as client
consent = client.get_consent("000000")  # some valid patient number

This returns the Consent resource from the json response. The actual consent can be accessed by:

>>> consent["policyRule"]["coding"]["code"]
u'OPTIN'

@boulund boulund marked this pull request as ready for review October 16, 2020 11:31
@chichackles chichackles merged commit a6e84dd into dev Oct 16, 2020
@chichackles
Copy link
Contributor

chichackles commented Oct 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants