This guide is currently In-Progress. Over the next few months, content will be added to it. If you have any suggestions or would like to add pages which talk about the functionality of Bahmni, please feel free to add them. |
The Bahmni Connect metadata file present on the server decides whether the Bahmni Connect app on the devices needs to be upgraded or not.
The Bahmni Connect metadata file looks like this:
{ "latestAndroidAppUrl": "https://www.dropbox.com/s/url/for/android/apk", "latestChromeAppUrl": "https://www.dropbox.com/s/url/for/chrome/app", "compatibleVersions": [0.79, 0.80] } |
When the device is connected to the network, it reads the metadata file and determines whether it has an update. If there is an update, the 'Update' button will be shown in the header next to the 'Sync' button. The offlineMetadata.json is present at `/var/www/html/offlineMetadata.json'.
There are two kinds of updates:
For the Android app, the 'latestAndroidAppUrl' in the offlineMetadata.json contains the url of latest apk released. On clicking the Update button, the apk is downloaded from the specified url in offlineMetadata.json and installed automatically.
In order to get the version information can be found under Settings→ Application Manager→ Bahmni. The version information is bundled into the apk and thus, static in nature.
For the Chrome app, the 'latestChromeAppUrl' in the offlineMetadata.json contains the url from where the chrome extension tar file can be downloaded. On clicking the Update button, the link with the url is shown so that the extension can be downloaded and installed manually.
Connect version information can be seen post the extension is added to chrome i.e. it shows up alongside the extension name. Moreover, if the user navigates to the extension folder, the manifest.json file will have version defined, which is used for version information.
{ "name": "Bahmni", "description": "Bahmni is an easy to use, open source hospital system for healthcare providers in low-resource settings. Brought to you by Bahmni Coalition under fiscal sponsorship of OpenMRS.", "version": "0.88", "manifest_version": 2, "icons": { "128": "bahmni-128.png" }, "app": { "launch": { "local_path": "index.html" } }, "permissions": [ "tabs", "http://*/*", "https://*/*" ], "key" : "akgemjphbnkkphopcgfjplhfemmgfolc", "minimum_chrome_version": "28", "content_security_policy": "script-src 'self' https://dev.bahmnidev.org 'unsafe-eval'; object-src 'self'" } |
To install the extension manually, the tar file has to be unzipped and put in the location from where the extension is loaded.
The extension should not be deleted from the Chrome browser to update the app. Deleting the extension deletes the data as well. |