# UCS Location Synchronization Project
A Java-based application designed to synchronize health facility location data between the OpenMRS and Health Facility Registry (HFR) systems. It also supports importing hamlet-level location data from CSV files to ensure comprehensive location data management for healthcare systems.
## Overview
The UCS Location Synchronization Project performs several key functions:
- **Administrative Hierarchy Processing:** Retrieves and processes hierarchical data from HFR to maintain proper parent-child relationships between locations.
- **CSV Import:** Imports hamlet location data from CSV files for fine-grained location management.
- **Robust Error Handling:** Implements retry mechanisms and detailed logging to address network issues or data inconsistencies.
## Features
- **OpenMRS Integration:** Fetches location data from an OpenMRS instance.
- **HFR Data Synchronization:** Retrieves health facility and administrative hierarchy data from HFR with configurable retry attempts.
- **CSV Import:** Imports hamlet location data from CSV files.
- **Caching & Data Lookup:** Maintains caches for rapid lookups by location UUID and code.
- **Modular Architecture:** Organized into clearly separated packages such as `domain`, `service`, and `util`.
- **Configurable Settings:** Uses `application.conf` for environment-specific configuration.
## Technologies
- **Java**
- **Gradle**
- **Typesafe Config**
- **OkHttp & Apache HttpClient**
- **JSON (org.json)**
- **JUnit & Mockito**
## Project Structure
- **`Main.java`**: The entry point of the application.
- **`domain`**: Contains data model classes (e.g., `Location`, `User`, `LocationCSVRow`).
- **`service`**: Contains service classes (e.g., `HfrService`, `OpenmrsLocationService`) for data synchronization.
- **`util`**: Contains utility classes for HTTP requests, CSV parsing, configuration management, etc.
- **`src/main/resources`**: Contains configuration and CSV data files.
## Prerequisites …