Finding All Data Scopes a Patient Consented To
To determine what healthcare data a patient has consented to release for a particular project, you may want to abstract away the specific consent types. This becomes especially useful as more data consent types are added to the HealthEx system.
Instead of checking individual consent types, you can simply ask: "Across all of the patient's consents, what data have they agreed to release to this project?"
This is accomplished using the getPatientConsentDataScopes API.
To check consented data scopes, you need:
- A patient identifier (reference ID, external ID, email, or phone number).
- The ID of a project managed by your organization.
Identifying a Patient
You can identify the patient the same way you would for Basic Consent Checking.
Identifying Your Project ID
- Log in to HealthEx and navigate to Home.
- Select your project from the projects list to view its details.
- Copy the project ID from the browser URL:
https://app.healthex.io/#/projects/{project-id}/patient-management
Example Values
For this example, we will use the following values:
- Patient ID:
19cff418-7d80 - Project ID:
694d61c2-3f1b-4dc8
Making the API Call
This API requires a valid JWT token. See the Authentication guide for setup instructions.
To check what data scopes this patient has consented to for this project, make the following API call:
GET https://api.healthex.io/v1/patients/19cff418-7d80/consented-data-scopes/study/694d61c2-3f1b-4dc8
Accept: application/json
Authorization: Bearer <your JWT token>
Response Payload
The response body will return all of the patient's consented data scopes, across all consents for this project, in the consentDataScopes array:
{
"consentDataScopes": [
{
"resourceScope": "CONTACT_INFO",
"sensitivityScope": "NORMAL"
},
{
"resourceScope": "DIAGNOSES",
"sensitivityScope": "NORMAL"
},
{
"resourceScope": "DIAGNOSES",
"sensitivityScope": "SUBSTANCE_USE_OR_DRUG_ABUSE"
}
],
"consentRecordIds": ["19", "20"]
}
For complete payload details, see the getPatientConsentDataScopes API reference.
See Also
- Want to find the data consent scopes, but only for a specific consent type? See Basic Consent Checking
- Need to check consents for multiple patients in a project in one call? See Finding All Consented Patients For a Project