Vital Signs
Retrieving Vital Sign Groups
Overview
The getVitalSignGroups method in the b.well SDK is designed to fetch a list of VitalSignGroup resources, leveraging the VitalSignGroupsRequest object for specific search criteria.
Method Signature
suspend fun getVitalSignGroups(request: VitalSignGroupsRequest?): BWellResult<VitalSignGroup>request: Defines criteria for retrievingVitalSignGroupresources.BWellResult<VitalSignGroup>: Represents the list of Vital Sign Groups retrieved.
Data Class: VitalSignGroup
id: Unique identifier for the Vital Sign Group.name: Human readable name of the Vital Sign.source: Array of Strings representing the source of the data.sourceDisplay: Array of Strings representing the source of the data.category: A structured set of codes including a text representation.coding: Coding representing the kind of Vital Sign in this ResourceGroup.effectiveDateTime: The single point in time when the observation was made.interpretation: The interpretation of the observation results.value: The value of the observation. At most, one ObservationValue type will be returned per Observation.referenceRange: Reference ranges for interpreting the observation value.component: Component observations as part of this observation.references: Array of immunization id references in the ResourceGroup.
Example Usage
if (selectedList.category.toString() == resources.getString(R.string.vitals)) {
val vitalSignGroupsRequest = VitalSignGroupsRequest.Builder()
.page() // Specify the page number
.pageSize() // Specify the number of results per page
.build()
val vitalSignGroupsResult = BWellSdk.health.getVitalSignGroups(vitalSignGroupsRequest)
// Handle the retrieved Vital Sign Groups
}This code snippet demonstrates how to create a VitalSignGroupsRequest and use it to fetch vital sign 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 Vital Sign Groups effectively.
Retrieving Vital Signs Resources
Overview
The getVitalSigns method in the b.well SDK is used for retrieving observation records categorized as 'vital-signs' from the FHIR server. It allows for fetching detailed vital signs data essential for patient health monitoring.
Method Signature
suspend fun getVitalSigns(request: VitalSignsRequest?): BWellResult<Observation>request: An optionalVitalSignsRequestobject to customize the retrieval of observations.BWellResult<Observation>: Represents the list of laboratory observations retrieved.
Data Class: ObservationResource
id: Unique identifier for the Observation resource.meta: Metadata about the Observation resource.category: Classification of the type of observation.code: The code that categorizes the observation.value: Various types of values that an Observation can have, only one of these would typically be populated.referenceRange: Reference ranges for interpreting the observation value.interpretation: The interpretation of the observation results.component: Component observations as part of this observation.effectiveDateTime: The single point in time when the observation was made.effectivePeriod: The period of time over which the observation was made.hasMember: Related resource that belongs to the Observation group.note: Annotations or notes about the observation.encounter: The encounter associated with this observation.performer: Who is responsible for the observation.specimen: The specimen associated with this observation.display: Consumer friendly name for labs.dataAbsentReason: Why the result is missing. (0.63% population likelihood).status: The status of the result value.
Data Class: Component
code: The code that categorizes the observation.value: Various types of values that an Observation can have, only one of these would typically be populated.referenceRange: Reference ranges for interpreting the observation value. (0.11% population likelihood).interpretation: The interpretation of the observation results. (0.11% population likelihood).dataAbsentReason: Why the result is missing. (0.06% population likelihood)
Example Usage
The following example retrieves base vital sign observation resources based on groupCode while also setting the .lastUpdated parameter.
val vitalSignsRequest = VitalSignsRequest.Builder()
.groupCode(listOf(Coding(code = groupCode, system = groupSystem)))
.lastUpdated(lastUpdatedSearchDate)
.build()
GlobalScope.launch {
val vitalSigns = BWellSdk.health.getVitalSigns(vitalSignsRequest) as BWellResult.ResourceCollection
// Handle the retrieved vital signs observations
}Best Practices
- Utilize
VitalSignsRequestfor targeted searches. - Handle the response to process and utilize the fetched observations effectively.
Updated about 2 months ago
