Welcome to the project! Follow the instructions below to set up the environment and get started.
Accessing artifacts hosted on GitHub requires a GitHub account for downloading purposes. Please follow these steps:
-
Duplicate and Rename Configuration File:
- Copy the file
local.properties.default
and rename it tolocal.properties
. - Open the
local.properties
file and insert your GitHub account/token details.
- Copy the file
-
Modify Additional Properties:
- Modify other properties (e.g., URLs, OAuth2) only if you are using a custom OpenMRS or Keycloak setup.
You can run the OpenMRS Server and Keycloak using one of the following options:
- Use the
docker-compose
file available in the root of this project. - Create a
.env
file from the provided template.env.default
.
- Follow the steps provided in the OpenMRS Distro SSO repository.
- Apply any necessary changes as per your setup.
- To log in using Keycloak, use one of the predefined users listed here.
This project supports the following authentication methods:
- Basic Auth
- OAuth2
Update the auth_method
property in your configuration to:
"basic"
for Basic Auth"openid"
for OAuth2
To enable FHIR synchronization, set the fhir_sync_urls
property with the required resource URLs in your local.properties
file.
Each resource type should be separated by a comma (,).
fhir_sync_urls=Location?_sort=_lastUpdated&_summary=data,Patient?_sort=_lastUpdated,Encounter?_sort=_lastUpdated,Observation?_sort=_lastUpdated
To Configure Patient Registration Questionnaire, set the registration_questionnaire_name
property to either of the following:
resourceId
of the registration questionnaire synced from the server.file name
of the registration questionnaire in the assets folder.
To ensure application diagnostics are sent to the correct developer email upon user request:
- Open the
local.properties
file. - Update the
support_email
property with the desired email address.
To log out of the OpenMRS web application:
http://localhost:8080/realms/main/protocol/openid-connect/logout
Note: There is an issue with the current OpenMRS installation and the SSO logout process.
A list of predefined users for OpenMRS can be found here:
Keycloak Users CSV
-
Error 404 on clicking login button:
- Ensure that the
discovery_uri
's port matches your Keycloak container's port in thelocal.properties
file.
- Ensure that the
-
Error 404 after successful login, and sync is failing:
- Verify that the
BASE_URL
's port matches your Gateway container's port in thelocal.properties
file.
- Verify that the
-
First sync is fetching too many resources:
- Narrow down the scope of the download sync by modifying the
fhir_sync_urls
property in thelocal.properties
file.
- Narrow down the scope of the download sync by modifying the
Keycloak can be accessed through different URLs depending on the use case:
- localhost is used to log into the OpenMRS web application.
- 10.0.0.2 is used by the Android app.
To configure this:
- Update the
KC_HOSTNAME
variable indocker-compose.yml
(line 89). - After modifying, restart using:
docker compose up -d
Alternatively to restart only the Keycloak service, you can use:docker compose restart keycloak
Refer to the custom code created for OpenMRS:
Google Android FHIR OpenMRS Code
- This project is based on Google FHIR App Examples.
- For more details, see:
OpenMRS Android FHIR Project
To initiate the build workflow:
- From Git: Just create and push a tag
vX.Y.Z
- From Web UI: Create a release and the related tag
vX.Y.Z
and Delete immediately the Realse
the Build
action should be triggered and it will create a new release containing the apk configured to use dev3.openmrs.org as the OpenMRS Backend.