Codings in Health Data Request Objects

Utilizing Coding for Effective Health Data Queries

Introduction

In the b.well 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.

GroupCode in requests like AllergyIntolerancesRequest adds flexibility, allowing the use of codings from group calls or custom lists. This feature enables customized, powerful search query options in the SDK.

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()[0].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()[0].coding

// building the AllergyIntoleranceRequest with this coding
setGroupCode: createRequestInfoReducer<{ selector: string, groupCode: SearchTokenValue }>((requestInfo, action) => {
  requestInfo.groupCode = {
    value: {
      code: action.payload.groupCode.code,
      value: action.payload.groupCode.value,
    }
  }
})
  1. From a Custom Coding List:
  • Create a custom list of codings as SearchTokenValue objects (e.g., [{ system: "system1", code: "code1" }, { system: "system2", code: "code2" }])
  • Use this to build groupCode as a SearchToken (e.g., { values: [...] }).

Example

// creating a custom list of codings as SearchTokenValue objects
const codings: SearchTokenValue[] = [
    { system: "system1", code: "code1" },
    { system: "system2", code: "code2" }
];

// creating the request with groupCode as SearchToken
const request: HealthDataRequestInput = {
    groupCode: {
        values: codings
    }
};

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