UgandaEMR Mobile is an Android application built to support offline FHIR-based data collection, patient management, and encounter recording in healthcare facilities across Uganda. The app uses the Android FHIR SDK to enable standards-based interoperability and integrates with the UgandaEMR backend via OpenMRS FHIR.
- ✅ FHIR-based Patient registration, visits, and encounters
 - ✅ Form rendering using FHIR SDC questionnaires
 - ✅ Offline-first with encrypted local FHIR storage
 - ✅ Secure user authentication and session management
 - ✅ Data synchronization with OpenMRS-compatible FHIR server
 - ✅ Modular, testable codebase with modern Android architecture
 
The app follows Clean Architecture and integrates the Android FHIR SDK:
UI (Jetpack Compose)
   ↓
ViewModel (StateFlow)
   ↓
UseCase (Business logic)
   ↓
FHIRRepository (Data layer)
   ↓
Android FHIR Engine (local store) + Remote FHIR API (OpenMRS)
- 🧱 Jetpack Compose (UI)
 - 🏧 MVVM + Use Cases + Hilt
 - 📦 Android FHIR Engine (SDK)
 - 🌐 OpenMRS FHIR API (DSTU3/R4)
 - 📂 Encrypted SharedPreferences + DataStore
 - 📲 WorkManager (sync)
 - 🔐 Secure local FHIR storage
 
| Module | Description | 
|---|---|
app | 
Main navigation & entry point | 
core-fhir | 
FHIR engine config, DAO wrappers | 
core-ui | 
Shared UI components, theme, typography | 
core-network | 
FHIR REST client config | 
core-domain | 
Use cases, models, validators | 
feature-auth | 
Login & token management | 
feature-patient | 
Patient list, search, registration (FHIR-based) | 
feature-form | 
SDC Questionnaire rendering + response mapping | 
feature-sync | 
Background sync, sync status | 
- Android Studio Hedgehog or later
 - JDK 11
 - Kotlin 1.9+
 - Gradle 8+
 - FHIR-compatible OpenMRS server
 
git clone https://github.com/your-org/ugandaemr-mobile.git
cd ugandaemr-mobile
./gradlew syncOpen in Android Studio and run the app module on an emulator or device.
Run unit tests:
./gradlew testDebugUnitTestRun UI tests:
./gradlew connectedDebugAndroidTest- FHIR data is stored in the encrypted local FHIR database
 - All credentials are securely handled via 
EncryptedSharedPreferences - HTTPS enforced using 
network_security_config.xml 
- Uses WorkManager for scheduled sync jobs
 versionCode= Git commit countversionName= latest Git tag (e.g.v1.0.3)
Example tagging:
git tag v1.3.0
git push origin v1.3.0- ✅ SDC-compliant forms rendered via 
QuestionnaireFragment - ✅ QuestionnaireResponse mapped to FHIR resources before submission
 - ✅ Uses 
DefaultResourceMapperandQuestionnaireViewModelFactory - ✅ Custom mappings supported via extensions or transformers
 - ✅ Offline-first using 
FhirEngine.getInstance(context) 
We welcome contributions! Please read CONTRIBUTING.md for setup and coding guidelines.
This project is licensed under the MIT License.
METS Program - Uganda