Create a Data Connection
b.well Health SDK for Android
Establishing New Connections
Overview
The createConnection method in the b.well SDK is designed for initiating the process of establishing new connections with various healthcare-related entities. This process is crucial for integrating and interacting with providers, clinics, hospitals, health systems, or labs.
This method is used when establishing a connection when the data source category is BASIC. Connections support different integration types: when the integration type is DIRECT, user credentials are not required.
Method Signature
suspend fun createConnection(request: ConnectionCreateRequest): BWellResult<Connection>request: AConnectionCreateRequestobject containing the necessary information for establishing a new connection.Connection: Information about the newly created connection.
Connection Creation Process
-
Request Preparation:
- The
ConnectionCreateRequestmust encapsulate essential details like the connection ID and, depending on the integration type, credentials. When integrationType is DIRECT, credentials are not required. For all other integration types, both username and password must be provided.
- The
-
Initiating Connection:
- The method initiates the connection process, which may involve authentication steps specific to the type of healthcare entity being connected.
Integration Types
The integrationType field on ConnectionCreateRequest determines whether credentials are required.
| Value | Description | Credentials Required |
|---|---|---|
| DIRECT | Direct connection (no user credentials) | No |
| PROA | Patient Right of Access | Yes |
| DIRECT_IAS | Direct Identity Access Service | Yes |
| INDIRECT_IAS | Indirect Identity Access Service | Yes |
| IAL2 | Identity Assurance Level 2 | Yes |
When integrationType is not specified, both username and password are required (backward-compatible behavior).
Connection Object in b.well SDK
Connection Object in b.well SDKThe Connection class in the b.well SDK represents a data connection. It contains key information and statuses about the connection.
Properties
id(String): Unique identifier for the connection.name(String): Display name of the connection.category(ConnectionCategory): Category classification of the connection.type(ConnectionType): Type of the connection.status(ConnectionStatus, optional): Current status of the connection.syncStatus(SyncStatus, optional): Current synchronization status.statusUpdated(Date, optional): Last date when the status was updated.lastSynced(Date, optional): Date of the last synchronization.created(Date): Date when the connection was created.isDirect(Boolean): Indicates if it's a direct connection.integrationType(IntegrationType, optional): The integration type of the connection (e.g., DIRECT, PROA, IAL2).
Example Usage
//Direct Connection Request
val request = ConnectionCreateRequest.Builder() .connectionId("entity-123")
.integrationType(IntegrationType.DIRECT) .build() val result = sdk.connection.createConnection(request)
Best Practices
- Accurate Information: Ensure all details in the
ConnectionCreateRequestare accurate and complete. - Understanding OperationOutcome: Familiarize yourself with interpreting the
OperationOutcometo understand the success or failure of the connection process.
Updated 6 days ago
