Care Plans
Retrieving Care Plan Groups
Overview
The getCarePlanGroups method in the b.well SDK is designed to fetch a list of CarePlanGroup resources. It uses the CarePlanGroupsRequest object for specifying search criteria tailored to care plans.
Method Signature
suspend fun getCarePlanGroups(request: CarePlanGroupsRequest?): BWellResult<CarePlanGroup>request: An object that defines the search criteria forCarePlanGroupresources.BWellResult<CarePlanGroup>: Represents the list of Care Plan Groups retrieved.
Example Usage
if (selectedList.category.toString() == resources.getString(R.string.care_plans)) {
val carePlanGroupsRequest = CarePlanGroupsRequest.Builder()
.page() // Specify the page number
.pageSize() // Specify the number of results per page
.build()
val carePlanGroupsResult = BWellSdk.health.getCarePlanGroups(carePlanGroupsRequest)
// Handle the retrieved Care Plan Groups
}This code demonstrates building a CarePlanGroupsRequest and fetching care plan groups based on the specified criteria.
Best Practices
- Appropriately set
pageandpageSizein the request to manage the volume of results. - Handle the response to process the list of Care Plan Groups.
Retrieving Care Plan Resources
Overview
The getCarePlans method in the b.well SDK is designed for retrieving Care Plan resources.
Method Signature
suspend fun getCarePlans(request: CarePlanRequest?): BWellResult<CarePlan>request: An optionalCarePlanRequestobject for customizing the retrieval. If not provided, all available Care Plans are fetched.BWellResult<CarePlan>: Represents the list of Care Plans retrieved.
Data Class: CarePlan
meta: Meta information about the CarePlan, like version, tags, etc (nullable Meta type)id: The unique identifier for this CarePlan resource (required String)title: The human-readable title of the CarePlan (nullable String)category: Categories or types of care plans (nullable List of CodeableConcept)status: The current status of the CarePlan (nullable CarePlanStatusCode, e.g., ACTIVE, COMPLETED)intent: Indicates the intent of the CarePlan (nullable CarePlanIntentCode, e.g., PROPOSAL, PLAN)subject: The patient or group for whom the CarePlan is maintained (nullable Subject)period: The time period the CarePlan covers (nullable Period)created: Date record was first recorded (nullable Date)activity: Action to occur as part of plan (nullable List of Activity)note: Comments about the plan (nullable List of Annotation)text: A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human (nullable Narrative)
Example Usage
The following example retrieves base care plan resources based on groupCode while also setting the .lastUpdated parameter.
val carePlanRequest = CarePlanRequest.Builder()
.groupCode(listOf(Coding(code = groupCode, system = groupSystem)))
.lastUpdated(lastUpdatedSearchDate)
.build()
GlobalScope.launch {
val carePlans = BWellSdk.health.getCarePlans(carePlanRequest) as BWellResult.ResourceCollection
// Handle the retrieved Care Plans
}Best Practices
- Set appropriate filters and pagination in the
CarePlanRequest. - Handle the response to process and utilize the fetched Care Plans effectively.
Updated about 2 months ago
