Allergy Intolerances
Retrieving Allergy Intolerance Groups
Overview
The getAllergyIntoleranceGroups method in the b.well SDK is used to fetch a list of AllergyIntoleranceGroup resources. It utilizes the AllergyIntoleranceGroupsRequest object to define search criteria.
Method Signature
suspend fun getAllergyIntoleranceGroups(request: AllergyIntoleranceGroupsRequest?): BWellResult<AllergyIntoleranceGroup>request: Specifies search criteria for retrievingAllergyIntoleranceGroupresources.BWellResult<AllergyIntoleranceGroup>: Represents the list of Allergy Intolerance Groups retrieved.
Return Type
BwellResult<AllergyIntoleranceGroup> containing list of AllergyIntoleranceGroup. The type of AllergyIntoleranceGroup is described below.
data class AllergyIntoleranceGroup (
val id: String?,
val name: String?,
val coding: Coding?,
val references: List<String>?,
val criticality: AllergyIntoleranceCriticalityCode?,
val source: List<String>?,
val sourceDisplay: List<String>?,
val recordedDate: Date?,
)
data class AllergyIntoleranceCriticalityCode(
val code: Code?,
val display: String?,
)
enum class AllergyIntoleranceCriticalityCode {
LOW,
HIGH,
UNABLE-TO-ASSESS
}id: id of the underlying Groupname : Human-readable name of the allergy intolerancecoding: Coding representing the kind of allergy intolerances in this ResourceGroupreferences: Array of AllergyIntolerance id references in the ResourceGroupcriticality: The most recent recorded Allergy criticality codesource: Array of Strings representing the source of the datasourceDisplay: Array of Strings representing the (Presentable) source of the data.recordedDate: Date first version of the resource instance was recorded
Parameters
The method takes an optional AllergyIntoleranceGroupsRequest object, allowing users to specify pagination details like page number and page size.
page: Is an integer that can be used to specify which page of results to return. The first value should be 0pageSize: Is an integer that can be used to specify the number of results to return in a page.
Example Usage
val request = AllergyIntoleranceGroupsRequest.Builder()
.page(0)
.pageSize(10)
.build()
val result = BWellSdk.health.getAllergyIntoleranceGroups(request)
This code snippet demonstrates how to create an AllergyIntoleranceGroupsRequest and use it to fetch allergy intolerance groups.
Best Practices
- Ensure the
pageandpageSizeparameters are set appropriately to manage the volume of results. - Handle the result by checking the status and processing the list of allergy intolerance groups.
Retrieving Allergy Intolerance Resources
Overview
The getAllergyIntolerances method in the b.well SDK fetches a list of AllergyIntolerance resources from the FHIR server, utilizing the AllergyIntoleranceRequest object to define specific search criteria.
Method Signature
suspend fun getAllergyIntolerances(request: AllergyIntoleranceRequest?): BWellResult<AllergyIntolerance>request: Specifies criteria for retrieving Allergy Intolerance resources.BWellResult<AllergyIntolerance>: Represents the list of Allergy Intolerances retrieved.
Return Type
BwellResult<AllergyIntolerance> containing list of AllergyIntolerance. The type of AllergyIntolerance is described below.
data class AllergyIntolerance {
val id: String,
val meta: Meta?,
val category: List<AllergyIntoleranceCategoryCode>?,
val code: CodeableConcept?,
val criticality: AllergyIntoleranceCriticalityCode?,
val onsetDateTime: Date?,
val onsetPeriod: Period?,
val lastOccurrence: Date?,
val reaction: List<Reaction>?,
val recordedDate: Date?,
val note: List<Annotation>?,
val verificationStatus: CodeableConcept?,
val clinicalStatus: CodeableConcept?
}
enum class AllergyIntoleranceCategoryCode {
FOOD,
MEDICATION,
BIOLOGIC
}id: The id of the AllergyIntolerancemeta: Metadata about the resource (e.g., tags, security)category: Category of the event (e.g., FOOD, MEDICATION)code: Code that identifies the substancecriticality: Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substanceonsetDateTime: Date and time of the onsetonsetPeriod: Period over which the AllergyIntolerance was observedlastOccurrence: Date and time of the last occurrencereaction: Details about each adverse reaction eventrecordedDate: Date first version of the resource instance was recordednote: Notes about the allergy intolerance that aren't captured in other fieldsverificationStatus: Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substanceclinicalStatus: The clinical status of the allergy or intolerance. (active , inactive , resolved)
Parameters
The method takes an optional AllergyIntoleranceRequest object, allowing users to specify filtering and pagination.
ids: List of allergy intolerance idsgroupCode: The SearchToken which contains the code/system for the provided AllergyIntolerancelastUpdated: Filters based on the lastUpdated date of the resourcepage: Is an integer that can be used to specify which page of results to return. The first value should be 0pageSize: Is an integer that can be used to specify the number of results to return in a page.
Example Usage
The following example retrieves base allergy intolerance resources based on groupCode while also setting the .lastUpdated parameter.
val request = AllergyIntoleranceRequest.Builder()
.groupCode(
listOf(
Coding(
code = "code-value",
system = "system-value"
)
)
)
.lastUpdated(
SearchDate.Builder()
.greaterThan(SimpleDateFormat("yyyy-MM-dd").parse("2020-01-12"))
.build()
)
.ids(listOf("id-1", "id-2"))
.page(0)
.pageSize(10)
.build()
val result = BWellSdk.health.getDocumentReferences(request)
Best Practices
- Set
ids,groupCode,page, andpageSizeappropriately to target the desired resources. - Handle the response, checking the status and processing the list of retrieved resources.
- Display Priority for Allergy Names: When displaying allergy name, prioritize
CodeableConcept.textoverCodeableConcept.coding.display.
Updated about 2 months ago
