You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The release artifacts are made avalable via the Maven Central repository, so you will need to have the following in your list of dependency repositories:
39
+
The release artifacts are made avalable via the Maven Central repository and some dependencies are in Jitpack, so you will need to have the following in your list of dependency repositories (probably settings.gradle):
40
40
41
41
`mavenCentral()`
42
42
43
-
Additionally, some dependency artifacts are served by Jitpack, so you will also need to add the following maven repository:
44
-
45
43
`maven { url "https://jitpack.io" }`
46
44
47
45
### Manifest Placeholders
48
46
49
-
The interapplication data sharing functionality of CommonHealth leverages native Android communication components. The CommonHealth Client SDK defines the following activities, services, and receivers in its `manifest.xml` file, which will be merged into the application's manifest during the build process:
47
+
Our authorization process is inspired by OAuth and requires that the `RedirectUriReceiverActivity` receive a redirect from CommonHealth. Applications must define the `interappAuthRedirectScheme`, `interappAuthRedirectHost`, and `interappAuthRedirectPath` manifest placeholders in the app's `build.gradle` file, and the compiled URL must match the `authorizationCallbackUri` in the `CommonHealthStoreConfiguration` object (see below). For example, defining the following manifest placeholders in `app/build.gradle`:
Our authorization process is inspired by OAuth and requires that the `RedirectUriReceiverActivity` receive a redirect from CommonHealth. Applications must define the `interappAuthRedirectScheme`, `interappAuthRedirectHost`, and `interappAuthRedirectPath` manifest placeholders in the app's `build.gradle` file, and the compiled URL must match the `authorizationCallbackUri` in the `CommonHealthStoreConfiguration` object (see below). For example, defining the following manifest placeholders in your `build.gradle` file:
50
+
android {
51
+
defaultConfig {
52
+
...
53
+
manifestPlaceholders.interappAuthRedirectScheme = "YOUR FULL APP PACKAGE" // ex: org.thecommonsproject.android.commonhealth.sampleapp
commonHealthAuthorizationUri = "org.thecommonsproject.android.phr.developer://interapp/auth", // remove ".developer" for production
96
+
authorizationCallbackUri = "YOUR FULL PACKAGE NAME://interapp/redirect",
125
97
notificationPreferences = notificationPreferences
126
98
)
127
99
```
@@ -130,11 +102,11 @@ Note that the the `interappAuthRedirectScheme`, `interappAuthRedirectHost`, and
130
102
131
103
In order to store the keys required to secure the connection(s) with the CommonHealth application, the client application must also provide a secure implementation of the `NamespacedKeyValueStore` interface. This object persists the stored values across application launches.
132
104
133
-
The `common` module provides a `NamespacedKeyValueStore` implementation that utilizes the Android Room architecture component. If you're not using Android Room for persistence, you can provide an implementation using the persistence method of your choosing.
105
+
The `common` module provides a `NamespacedKeyValueStore` implementation that utilizes the Android Room architecture component. If you're not using Android Room for persistence, you can provide an implementation using the persistence method of your choosing.
134
106
135
107
To help with security, the `common` module provides `SecureNamespacedKeyValueStore` to automatically encrypt and decrypt values. This class leverages the Google Tink encryption library and a key stored in the Android Keystore.
136
108
137
-
The `SampleApplication` class contains the following code to create a `SecureNamespacedKeyValueStore`:
109
+
The `SampleApplication` class contains the following code (including helper methods like createDatabase) to create a `SecureNamespacedKeyValueStore`:
138
110
139
111
```
140
112
val cryptoProvider = DefaultCryptoProvider(DefaultAndroidKeystoreClientWrapper())
@@ -164,14 +136,30 @@ You'll likely notice that many of the interface methods require a `connectionAli
164
136
165
137
### Check that CommonHealth is available
166
138
139
+
Declare <queries> in `Android Manifest.xml` the package that will be launched.
The `CommonHealthStore` class provides the `getCommonHealthAvailability` method that can help determine how (or how not) to interact with CommonHealth:
168
156
169
157
```
170
158
val chStore = CommonHealthStore.getSharedInstance()
171
159
val chAvailability = chStore.getCommonHealthAvailability(context)
172
160
when(chAvailability) {
173
-
CommonHealthAvailability.NOT_INSTALLED -> { } // show install UX
174
-
CommonHealthAvailability.ACCOUNT_NOT_CONFIGURED_FOR_SHARING -> { } // this can indicate that a user has disabled sharing entirely or that their device is unsuitable for sharing (ex. device is rooted)
161
+
CommonHealthAvailability.NotInstalled -> { } // show install UX
162
+
CommonHealthAvailability.NotConfiguredForSharing -> { } // this can indicate that a user has disabled sharing entirely or that their device is unsuitable for sharing (ex. device is rooted)
175
163
CommonHealthAvailability.AVAILABLE -> { } // Suitable for authorization or querying if consent has been given
176
164
}
177
165
```
@@ -278,7 +266,7 @@ val authorizationRequest = AuthorizationRequest(
278
266
"Sample app would like to read your labs, vitals, and conditions."
279
267
)
280
268
281
-
val intent = AuthorizationManagementActivity.createStartForResultIntent(
269
+
val authIntent = AuthorizationManagementActivity.createStartForResultIntent(
282
270
context,
283
271
authorizationRequest
284
272
)
@@ -389,72 +377,3 @@ CommonHealth performs SMART® Health Card validation prior to ingesting the card
389
377
## Registering with CommonHealth
390
378
391
379
Registering with CommonHealth is not required to begin testing integrations with CommonHealth Developer Edition. However, if you have a client application that you would like to use in staging or production environments, you'll need to register the application with CommonHealth. This is similar to registering an OAuth client, where you would specify information such as required scope, authorization redirect URI, etc. Please reach out to developers [at] commonhealth.org for more information.
392
-
393
-
## Upgrading from v1.6.2 to v1.6.4
394
-
`v1.6.4` updated our SMART IT Sandbox version:
395
-
396
-
- Upgraded to SMART IT Sandbox R4 from DSTU2
397
-
- Make sure to use the R4 Patient Browser (listed above) rather than the previously linked DSTU2 browser for finding valid patients
398
-
399
-
## Upgrading from v1.3.15 to v1.6.2
400
-
`v1.6.2` introduced insurance data:
401
-
402
-
- Support for Insurance data through the CMS Blue Button 2.0 Sandbox. This will require you to register with CMS an app with a redirect url to CommonHealth, and then for you to provide the client id/secret locally into CommonHealth so that you can download the data. Please see section "Using CMS Blue Button Sandbox" above.
403
-
- Minor change to readSampleQuery(..) parameters
404
-
405
-
## Upgrading from v1.1.2 to v1.3.15
406
-
`v1.3.15` introduced a small number of changes:
407
-
408
-
- Support for requesting access to Verifiable Credentials (SMART® Health Cards) is now in beta
409
-
- Updates to support higher Android OS levels (specifically changes to accommodate new restrictions on apps calling into packageManager)
410
-
411
-
## Upgrading from v0.4.8 to v1.1.2
412
-
`v1.1.2` introduced a small number of changes:
413
-
414
-
- The constructor for `SecureNamespacedKeyValueStore` now requires a `CryptoProvider` object.
415
-
- The artifacts names have changed:
416
-
-`org.thecommonsproject.commonhealth:common` is now `org.thecommonsproject:commonhealth-common`
417
-
-`org.thecommonsproject.commonhealth:commonhealthclient` is now `org.thecommonsproject:commonhealth-client`
418
-
- The artifacts are now hosted in Maven Central.
419
-
420
-
## Upgrading from v0.4.4 to v0.4.8
421
-
`v0.4.8` introduced a number of large changes and enhancements to the API:
422
-
423
-
- CommonHealthStoreConfiguration now has a required NotificationPreferences property
424
-
- AuthorizationResponses are now communicated as a notification to a subscriber contained in the CommonHealthStoreConfiguration
425
-
- A new `getRecordUpdates` method was added to the CommonHealthStore to help determine changes to the data
426
-
- A `NEW_DATA_AVAILABLE` notificationType is added to support receiving updates asynchronously from CommonHealth
427
-
- The `isCommonHealthAvailable` method was removed in favor of the new `getCommonHealthAvailability`
428
-
429
-
## Upgrading from v0.4.0 to v0.4.4
430
-
`v0.4.4` introduced a small number of changes to the API:
431
-
432
-
- Scope requests can now be limited to a specific set of codes within a data type.
433
-
- The `inactive` value was added to the `CommonHealthAuthorizationStatus` enum.
434
-
- The optional `fetchedAfter` parameter was added to the `readSampleQuery` interface method. This parameter can be used to limit responses to resources added or updated after a certain date.
435
-
436
-
Additionally, the following maven repo is now required:
437
-
438
-
maven { url "https://jitpack.io" }
439
-
440
-
## Upgrading from v0.3.0 to v0.4.0
441
-
No functional changes to the API were introduced in `v0.4.0`.
442
-
443
-
## Upgrading from v0.2.0 to v0.3.0
444
-
`v0.3.0` introduced a number of changes:
445
-
446
-
- Introduced the `CommonHealthAuthorizationActivityResponse` class to assist with decoding responses from `AuthorizationManagementActivity`.
447
-
- Connections now timeout after 90 days. After that, the client application will need to request authorization again OR the user can also renew the connection via client application detail view in the CommonHealth application. If the connection has timed out, the `checkAuthorizationStatus` method will return `CommonHealthAuthorizationStatus.connectionExpired`.
448
-
- The `readSampleQuery` performs additional validation on `before` and `after` parameters.
449
-
- Public `CommonHealthStore` methods have been annotated to indicate that they throw.
450
-
451
-
## Upgrading from v0.1.0 to v0.2.0
452
-
453
-
`v0.2.0` introduced a number of changes, some of them breaking.
454
-
455
-
- Introduced `AuthorizationManagementActivity.USER_CANCELED` activity status code that is returned to the initiating activity in the case that the user cancels authorization.
456
-
- Removed requirement that applications perform initialization on the `Tink` and `AndroidThreeTen` libraries. This also results in removing application build dependencies on these libraries.
457
-
-`CommonHealthStoreConfiguration.Builder` class has been removed. Applications should create instances of this class directly.
458
-
- Removed the `CommonHealthStoreProvider` interface and dependency on the custom Application implementation to adopt the interface. Implementers should instead initialize the `CommonHealthStore` singleton via the `CommonHealthStore.initialize` static method. The `CommonHealthStore.getSharedInstance` static method is provided for accessing the `CommonHealthStore` singleton.
459
-
- Removed the requirement for applications to include SDK specific `service`, `broadcastreciever`, and `activity` components in the application manifest. These have been moved to the SDK manifest file and will be merged in during the build process. We've added a requirement that applications define the `interappAuthRedirectScheme`, `interappAuthRedirectHost`, and `interappAuthRedirectPath` manifest placeholders in the app's `build.gradle` file.
460
-
- Replaced the `CommonHealthStore``executeDataQuery` method with `readSampleQuery`.
0 commit comments