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
- 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 demographics (FHIR Person record)
Required Demographics:
| Field | Type | Required | Description |
|---|---|---|---|
| name.given | String | Yes | First |
| name.family | String | Yes | Last Name |
| birthDate | String | Yes | Date of Birth |
| telecom[].system | String | Yes* | Contract type (email or phone) |
| telecom[].value | String | Yes* | Contact |
| telecom[].use | String | No | Contact usage type (home or mobile) |
| address.line | String | Yes | Street address |
| address.city | String | Yes | City |
| address.state | String | Yes | State Code |
| address.postalCode | String | Yes | Zip / Postal Code |
| gender | String | Yes | Sex 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:
| 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 about 2 months ago
