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
- Retrieve the user’s demographics via getProfile
- Use updateProfile to update the user’s demographics as needed
- 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:
| Field | Type | Required | Description |
|---|---|---|---|
name.given | String | Yes | First Name |
name.family | String | Yes | Last Name |
birthDate | String | Yes | Date 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:
| Field | Value |
|---|---|
| Category | CategoryCode Enum Values |
| Status | ConsentStatus Enum Values |
| Provision | ConsentProvisionType 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.
Updated 6 days ago
