Account Creation & Consent

Workflow Guide

This guide describes the operations related to the account creation flow for new users. When a user without an existing b.well account authenticates, the system initiates account creation. The following workflow combines updateProfile and CreateConsent to submit required user demographics and register consent data.

Prerequisites

Summary of Steps

  1. Retrieve the user’s demographics via getProfile
  2. Use updateProfile to update the user’s demographics as needed
  3. Create a new consent record with createConsent

Step 1: Retrieve the User’s Profile Data (Demographics)

Use the getProfile endpoint to retrieve / confirm the user’s demographics.

Step 2: Update the User’s Profile Data (Demographics)

Use the updateProfile endpoint to update the user’s profile (FHIR Person record) with at least the minimum required demographics.

The following fields are required to create a user profile in b.well:

FieldTypeRequiredDescription
name.givenStringYesFirst Name
name.familyStringYesLast Name
birthDateStringYesDate of Birth (YYYY-MM-DD format

For a full list of required and recommended demographics, please refer to the User Profile Requirements page.

Step 3: Create a Consent record

Use the createConsent endpoint with the TOS Category to indicate that the user has accepted the Terms of Service.

Enum Values:

Example Request:

await sdk.user.createConsent(
  new CreateConsentRequest({
    status: 'active',
    provision: 'permit',
    category: 'TOS'
  })
);

For complete request and response schema, see UserManager documentation.