Additional Health Record Retrieval Options
Application APIs
This workflow describes the process to query individual FHIR resources and supplemental Medication or Lab educational content. Instead of using the $everything operation to retrieve all health records at once, you can query individual FHIR resource types through GraphQL for more granular data retrieval.
Prerequisites
- End-User Authentication - User must be authenticated
- Account Creation and Consent - User account and consent must be completed
- Established Data Connections - At least one connection must be established through Search for & Establish Connections or Locate & Establish Connections with Network Record Locator Service
Environment URL:
- Client-Sandbox:
https://api.client-sandbox.icanbwell.com/v1/graphql
Retrieve Specific FHIR Resources via GraphQL
When to use this approach:
- You only need specific resource types (e.g., only allergies or medications)
- You want to reduce payload size and improve query performance
- You're building targeted features (e.g., medication list view, conditions timeline)
- You need to paginate or filter specific resource categories
Example FHIR Resource Queries
The following GraphQL queries can be used for retrieving specific health data categories:
General Clinical Data:
allergyIntolerances- Allergies and intolerancescarePlans- Care plans and treatment planscareTeams- Care team members and rolesconditions- Diagnoses and health conditions- encounters` - Healthcare visits and appointments
immunizations- Vaccination recordsprocedures- Medical procedures and interventionsdocumentReferences- Clinical documents and notes
Labs & Vital Signs:
observations- Laboratory results, vital signs, and clinical observations
Medications:
medicationAdministration- Medication administration recordsmedicationDispenses- Pharmacy dispensing recordsmedicationRequests- Medication prescriptions and ordersmedicationStatements- Patient-reported or clinician-documented medications
Example: Query Allergy Intolerances
All FHIR resource queries follow the same pattern. This example retrieves a user's allergy and intolerance records:
GraphQL Query:
query getAllergyIntolerances {
allergyIntolerances {
entry {
resource {
resourceType
id
meta {
lastUpdated
}
clinicalStatus {
coding {
system
code
display
}
}
verificationStatus {
coding {
system
code
display
}
}
category
criticality
code {
coding {
system
code
display
}
}
patient {
reference
}
onsetDateTime
onsetPeriod {
start
end
}
recordedDate
reaction {
substance {
coding {
system
code
display
}
}
manifestation {
coding {
system
code
display
}
text
}
severity
exposureRoute {
coding {
system
code
display
}
}
}
}
}
}
}Replace allergyIntolerances with any other FHIR resource query name from the list above to retrieve different health data categories. Each query returns resources in the same FHIR bundle structure with an entry array containing individual resources.
For complete query parameters, filtering options, and response schemas for each resource type, see b.well's *GraphQL Playground*.
Query Additional Medication and Lab Information (Optional)
Use the MedicationStatement and Observation IDs to retrieve additional detailed information through the getMedicationKnowledge and getLabKnowledge GraphQL queries.
Note: If the necessary code data is not available within the
MedicationStatementorObservationresource, nothing will be returned in thecontentfield of the response.
Example Query (getMedicationKnowledge):
query getMedicationKnowledge($request: MedicationKnowledgeRequest) {
getMedicationKnowledge(request: $request) {
resources {
title
content
}
}
}Example Variables:
{
"request": {
"page": 0,
"pageSize": 10,
"medicationStatementId": "a69db751-8ec5-5882-b4a7-dd0b90e3d037"
}
}Example Response:
{
"data": {
"getMedicationKnowledge": {
"resources": [
{
"title": "Active ingredient (in each tablet)",
"content": "<div><div><p>Cetirizine hydrochloride USP 10 mg</p></div></div>"
},
{
"title": "Purpose",
"content": "<div><div><p>Antihistamine</p></div></div>"
},
{
"title": "Uses",
"content": "<div><div><p>temporarily relieves these symptoms due to hay fever or other upper respiratory allergies:</p> <ul><li>runny nose</li> <li>sneezing</li> <li>itchy, watery eyes</li> <li>itching of the nose or throat</li></ul></div></div>"
}
]
}
}
}Use the same pattern for getLabKnowledge with labId instead of medicationStatementId.
Updated 8 days ago
