/openmrs-android-fhir

Primary LanguageKotlinBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Setup

Accessing artifacts hosted on GitHub necessitates the use of a GitHub account for downloading purposes:

  • Duplicate the file local.properties.default and rename it to local.properties.
  • Then, open the "local.properties" file and insert your GitHub account/token details.

To run the OpenMRS Server & Keycloak

Note Following changes are required for Option 2:

  • Update the ANDROID_SDK_REDIRECT_URIS value to "org.openmrs.android.fhir:/oauth2redirect" on this line

Common setup issues fixes:

  1. Error 404 on clicking login button
    • Match the discovery_uri's port matches with your keycloak container's port here
  2. After successful login sync is failing directly & in logs it's throwing error 404:
    • Match the BASE_URL's port with your gateway container's port here
  3. The first sync is fetching too many resources:
    • Narrow down the scope of the download sync by modifying the urls here

OpenMRS Notes

to logout: http://localhost:8080/realms/main/protocol/openid-connect/logout There is an issue with current OpenMRS installation and SSO Logout process.

List of Users for OpenMRS: https://github.com/icrc/openmrs-distro-sso/blob/main/keycloak/users.csv

Keycloak and localhost vs 10.0.0.2

Keycloak can be accessed only from one URL but:

  • localhost will be used to log into OpenMRS Web application
  • 10.0.0.2 will be used from the android App

Thus the variable KC_HOSTNAME ( see docker-compose.yml, line 89) defining Keycloak hostname should be changed accordingly to the use case.

After a modification, Restart Keycloak with docker compose up -d that will restart only the service keycloak if you change that variable only or use docker compose restart keycloak.

Development

See https://github.com/google/android-fhir/tree/openmrs as a custom code is made for openmrs

Temporary Situation

A PR is currently under validation here: google/android-fhir#2525 If validated, SNAPSHOT will be available on officiel github project.

In the meantime, artifacts are https://github.com/icrc-fdeniger/android-fhir

Download

Android FHIR SDK with the FHIR Info Gateway