How google/android-fhir works
Main architectural components
• FHIR Engine and Database: This includes the “engine” module, which provides the core data synchronization, local storage, and FHIR REST operations (including database schema and migration logic). Also include key libraries that handle FHIR resource queries, search, and indexing.
• Knowledge and Terminology: The “knowledge” module and associated schemas, DAO classes, and npm package handling components form the backend for FHIR knowledge management and terminology support.
• Data Capture and UI Components: The “datacapture” and related modules (e.g., “catalog”, “demo”, “codelabs”) provide user interface components, fragments, adapters, and view models that allow questionnaire rendering and user data collection.
• Workflow and Business Rules: The “workflow” and “workflow_demo” modules encapsulate the logic for executing clinical workflows and integrating business rules (e.g., CQL processing) into the mobile application.
• External Contributions and Extensions: The “contrib” folders (e.g. barcode, locationwidget) show how the SDK can be extended with extra UI elements or specialized functionality.
• Build / Infrastructure and CI: Parts like the Gradle build scripts, GitHub workflows (under “.github”), and container configurations (under “.devcontainer”) should be represented to indicate how the project is built, tested, and integrated as part of continuous delivery.
• Documentation and Community: The “docs” folder and related markdown resources signal that documentation and community guidelines are also an important part of the ecosystem.
Component relationships and data flows
• That the Knowledge module and Workflow modules are layered on top of the Engine – they rely on FHIR data but also add clinical logic, terminology resolution, and process automation.
Architectural patterns and design principles
• Modularization: Emphasize the Gradle multi-module structure—each subproject is responsible for a set of related functionalities and is loosely coupled.
• Separation of concerns: Distinguish between the domain-specific core (FHIR Engine, Knowledge, and Workflow), the presentation layer (datacapture, demo, catalog), and extension points (contrib).
• Offline-first design: Mark the data syncing components and local database as central to enabling offline capability.
• Extensibility: Note how additional features (from the “contrib” folder) use common interfaces to plug into the main engine and UI frameworks.