b.well Kotlin SDK v1.19.0
about 1 month ago
b.well Kotlin SDK version 1.19.0 includes new features, breaking changes, and several enhancements.
New Additions
New SearchOrganization model
SearchOrganization model- New
com.bwell.common.models.domain.search.SearchOrganizationdata class with three properties:name: String?endpoint: List<Endpoint>?lists the technical endpoints that provide access to services operated for the organizationlogoUrl: String?holds the URL of the organization's logo
SearchOrganizationis now the element type ofHealthResource.organization, replacingcom.bwell.common.models.domain.common.Organization
Health Sync: connect and disconnect are now HealthSyncManager members
connect and disconnect are now HealthSyncManager membersHealthSyncManagerdeclares both operations directly, so they are reached throughBWellSdk.healthSynclike every other Health Sync primitive:connect(sourceId: String? = null): BWellResult<Unit>provisions backend credentials for the source's connection viasetupMobileSync, maps them into a vendor-neutralHealthSyncSession, and starts the on-device sessiondisconnect(sourceId: String? = null): BWellResult<Unit>ends the on-device session and deletes the backend connection
sourceIdmay be omitted when exactly one source is registered- On
disconnect, both steps run even if the first fails. TheendSessionoutcome takes priority when both fail - Credentials never reach the caller. A missing
orgIdis a hard failure,HealthSyncError.InvalidCredentials, not a silent default - NOTE: the
BWellSdk.connect()andBWellSdk.disconnect()extension functions have been removed. Please update call sites fromsdk.connect(sourceId)tosdk.healthSync.connect(sourceId), and fromsdk.disconnect(sourceId)tosdk.healthSync.disconnect(sourceId). Signatures, return types, and error semantics are unchanged. Only the receiver changed
Updates
Search: HealthResource model updates
HealthResource model updates- New
logoUrl: String?field added, the URL of the health resource's logo. Resources without a logo returnnull organizationchanged fromList<Organization>?toList<SearchOrganization>?nameandendpointare unchanged. Same property names, same types, and same values- The health resource search response has only ever supplied
nameandendpoint, so the remainingOrganizationfields were alwaysnullon a search result.SearchOrganizationreflects what the response actually returns - NOTE:
logoUrlis the fourth constructor parameter and has no default value, shiftingcomponent4()throughcomponent12()tocomponent5()throughcomponent13(). Positional construction and destructuring will break. Please accessHealthResourcefields by name - NOTE:
id,identifier,resourceType,telecom,address,active, andtypeare not present onSearchOrganization, so code reading those fields off a search result's organization will no longer compile. Please fetch the fullOrganizationseparately if you need them - NOTE:
locationremains deprecated in favor ofproviderLocation, unchanged from 1.18.0
Health Sync: BWellHealthSync.configure() now supports device and connections
BWellHealthSync.configure() now supports device and connectionsconfigure()accepts optionaldeviceandconnectionsparameters, defaulting to the realBWellSdksingleton, so tests can inject fakes without a fully initialized SDK
Notes
searchProviders()is unaffected. It still runs against the deprecatedprovidersquery, whose organization type has nologoUrlon the schema.Provideris unchanged in this release- If you are upgrading from 1.17.0 or earlier, the Health Sync module introduced in 1.18.0 is new to you. Register the on-device source once at startup with
BWellHealthSync.configure(source)afterBWellSdk.initialize(config). See the v1.18.0 change log - The 3-parameter
location(latitude, longitude, zipCode)request builder remains deprecated in favor oflocation(latitude, longitude)andlocation(zipCode), unchanged since 1.13.0
