- Patient Resource
- Coverage Resource
- CarePlan Resource
- Common Query Parameters
- Advanced Query Techniques
- Pagination
The Patient resource contains demographic and administrative information about individuals receiving healthcare services.
- Demographics (name, birthdate, gender)
- Contact information
- Language preferences
- Primary care provider
- Communication preferences
- Marital status
- Address history
# Search by name
GET [base]/Patient?name=Smith
# Search by birth date
GET [base]/Patient?birthdate=1970-01-01
# Search by identifier (e.g., SSN, MRN)
GET [base]/Patient?identifier=12345
# Combined demographic search
GET [base]/Patient?
given=John&
family=Smith&
gender=male&
birthdate=ge1960-01-01name: Full, given, or family namebirthdate: Exact date or rangegender: male, female, other, unknownaddress: City, state, postal codeactive: true/falselanguage: Preferred languageidentifier: Various ID types
The Coverage resource details insurance or payment information for healthcare services.
- Coverage status
- Subscriber information
- Benefit period
- Payor details
- Network information
- Cost-sharing details
- Coverage type
# Active coverage for patient
GET [base]/Coverage?
patient=12345&
status=active
# Coverage with specific payor
GET [base]/Coverage?
patient=12345&
payor=Organization/789
# Coverage within date range
GET [base]/Coverage?
patient=12345&
period=ge2023-01-01&
period=le2023-12-31status: active, cancelled, drafttype: Insurance type (medical, dental, etc.)period: Coverage datespayor: Insurance companysubscriber: Primary insurance holderbeneficiary: Covered individualclass: Coverage classification
The CarePlan resource documents the intended care strategy and goals for a patient.
- Care goals
- Planned activities
- Care team members
- Treatment protocols
- Progress notes
- Status updates
- Care instructions
# Active care plans
GET [base]/CarePlan?
patient=12345&
status=active
# Care plans by condition
GET [base]/CarePlan?
patient=12345&
condition=Condition/567
# Care plans by date
GET [base]/CarePlan?
patient=12345&
date=ge2023-01-01&
_sort=-datestatus: draft, active, completed, cancelledcategory: Type of care plancondition: Related health conditionsdate: Plan creation or update dateauthor: Care plan creatorcare-team: Involved healthcare providersgoal: Treatment goals
_count: Number of results per page_sort: Sort order of results_include: Include related resources_revinclude: Include referring resources_summary: Return only summary information
eq: Equalsne: Not equalsgt: Greater thanlt: Less thange: Greater than or equalsle: Less than or equals
:exact: Exact match:contains: Contains substring:text: Text search
# Patient with specific condition
GET [base]/Patient?
_has:Condition:patient:code=http://snomed.info/sct|73211009# Patient with coverage and care plan
GET [base]/Patient?
_id=12345&
_include=Patient:general-practitioner&
_revinclude=Coverage:patient&
_revinclude=CarePlan:patient# Search by name and birthdate combination
GET [base]/Patient?
given-family-birthdate=John$Smith$1970-01-01# Find all resources for a patient
GET [base]/Patient/12345/$everything# Search using custom extensions
GET [base]/Coverage?
patient=12345&
extension-custom-benefit-type=dental# Find care plans referencing specific practitioners
GET [base]/CarePlan?
patient=12345&
performer:Practitioner=Practitioner/789The API implements pagination using two key parameters:
_count: Specifies the number of results per page_page_token: Token for accessing subsequent pages
The API returns pagination information in the link array of the response:
{
"link": [
{
"relation": "search",
"url": "[base]/Patient/?_count=1"
},
{
"relation": "next",
"url": "[base]/Patient/?_count=1&_page_token=AUAcb7bUcVAqcd..."
},
{
"relation": "first",
"url": "[base]/Patient/?_count=1"
},
{
"relation": "self",
"url": "[base]/Patient/?_count=1"
}
]
}search: Base search URLnext: URL for the next page of results (includes page token)first: URL for the first pageself: Current page URL
GET [base]/Patient?_count=1GET [base]/Patient?_count=1&_page_token=AUAcb7bUcVAqcd...- Always specify
_countto control page size - Store the complete
_page_tokenfor subsequent requests - Handle cases where
nextlink might not be present (last page) - Don't modify other query parameters while paginating
- Page tokens are opaque and should not be modified
async function fetchAllPatients() {
let url = '[base]/Patient?_count=100';
let allResults = [];
while (url) {
const response = await fetch(url);
const data = await response.json();
// Add results to collection
allResults = allResults.concat(data.entry || []);
// Find next page URL
const nextLink = data.link.find(link => link.relation === 'next');
url = nextLink ? nextLink.url : null;
}
return allResults;
}# First page
GET [base]/Patient?_count=100
# Use next link from response for subsequent pages
GET [base]/Patient?_count=100&_page_token=[token]# First page of filtered results
GET [base]/Patient?_count=50&name=Smith
# Subsequent pages maintain filters
GET [base]/Patient?_count=50&name=Smith&_page_token=[token]