Account Creation and 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 demographics (FHIR Person record)

Required Demographics:

FieldTypeRequiredDescription
name.givenStringYesFirst
name.familyStringYesLast Name
birthDateStringYesDate of Birth
telecom[].systemStringYes*Contract type (email or phone)
telecom[].valueStringYes*Contact
telecom[].useStringNoContact usage type (home or mobile)
address.lineStringYesStreet address
address.cityStringYesCity
address.stateStringYesState Code
address.postalCodeStringYesZip / Postal Code
genderStringYesSex at birth

Note: At least one telecom entry (phone or email) is required.

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.