Codings in Health Data Request Objects

Utilizing Coding for Effective Health Data Queries

Introduction

In the BWell SDK, Coding plays a crucial role in representing standardized healthcare codes and identifiers from various terminologies. It ensures structured and consistent health data representation. Coding is essential in request objects, like AllergyIntolerancesRequest for example, for detailed and relevant search criteria.

Understanding Coding

  • Definition: Coding in healthcare informatics uses standardized codes and identifiers for representing medical conditions, treatments, procedures, and more. It's based on systems like ICD-10, LOINC, and SNOMED CT.
  • Components:
    • code: Symbol or string representing a healthcare concept.
    • system: URI identifying the coding system.
    • display: Optional, readable description of the code.

Using GroupCode in SDK Requests

  1. From Group Call Codings:
    • Obtain Coding from a group call (e.g., getAllergyIntoleranceGroups().first().coding).
    • Use it to construct groupCode for a request (e.g., AllergyIntoleranceRequest.Builder().groupCode(listOf(groupCoding)).build()), which internally converts to SearchToken.

Example

// obtaining a coding from a group call
val groupCoding = getAllergyIntoleranceGroups().first().coding

// building the AllergyIntoleranceRequest with this coding
val request = AllergyIntoleranceRequest.Builder()
    .groupCode(listOf(groupCoding)) // converts to SearchToken internally
    .build()
  1. From a Custom Coding List:
  • Create a custom list of codings (e.g., listOf(Coding("system1", "code1"), Coding("system2", "code2"))).
  • Use this list to build groupCode (e.g., AllergyIntoleranceRequest.Builder().groupCode(codings).build()).

Example

// creating a custom list of codings
val codings = listOf(
    Coding("system1", "code1"),
    Coding("system2", "code2")
)

// building the AllergyIntoleranceRequest with custom codings
val request = AllergyIntoleranceRequest.Builder()
    .groupCode(codings) //converts to SearchToken internally
    .build()

Note: GroupCode is optional in request objects. If unset, requests proceed without specific group-based criteria.

Summary

GroupCode in requests like AllergyIntolerancesRequest adds flexibility, allowing the use of codings from group calls or custom lists. Although implemented as a SearchToken, this complexity is hidden from users, making the interface straightforward. This feature enables customized, powerful search query options in the SDK.