Skip to content

Integrate Fhir Engine - #63

Merged
LZRS merged 31 commits into
ohs-foundation:mainfrom
LZRS:feature/fhir-engine-repository
Jul 15, 2026
Merged

Integrate Fhir Engine #63
LZRS merged 31 commits into
ohs-foundation:mainfrom
LZRS:feature/fhir-engine-repository

Conversation

@LZRS

@LZRS LZRS commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #58

It's a good idea to open an issue first for discussion.

  • All CI build checks pass e.g. Tests
  • Appropriate changes to documentation are included in the PR

LZRS added 14 commits July 13, 2026 04:44
FhirJson moves to the util package so other repositories can share the
same encoding/decoding configuration.
The version string used a space instead of a hyphen before the
pre-release qualifier (2.0.0 alpha01 vs 2.0.0-alpha01), which broke
dependency resolution.
…everywhere

FhirEngineRepository is already wired into all four platform entry
points, so the in-memory implementation and its now-orphaned
RepositorySnapshotStore persistence layer (interface + 4 platform
actuals) are dead code. AppDependencies.fhirRepository becomes a
lateinit var since it's assigned at platform startup before any
consumer reads it.

Also drops a stale AndroidAppContextHolder reference in MainActivity
left over from the removed snapshot store, and adds
InMemorySampleFhirRepository as a lightweight test double so
PatientListScreenTest/PatientProfileScreenTest keep working without
the deleted in-memory repository's eager sample-data seeding.
@LZRS
LZRS marked this pull request as ready for review July 13, 2026 13:08
LZRS added 14 commits July 13, 2026 23:15
Keeps MainActivity focused on UI setup and centralizes app-wide init in the Application lifecycle instead of the first Activity's onCreate.
Drop the seedResourcesLoader constructor parameter so production repositories no longer auto-seed a real device database with demo data on first launch. Also removes the equivalent seeding from the InMemorySampleFhirRepository test double and the now-unused SampleResourcesBundle.json; the two UI tests that relied on seeded patient p1 data now seed a minimal fixture (SamplePatientFixture) directly via upsert().
Clarifies that implementers must bump revision after each successful upsert so observers know to re-query.
Converts GroupRepository from a singleton object reading the global
AppDependencies.fhirRepository into a class taking FhirRepository as a
constructor parameter. Hoists buildGroupProfileUiState to a top-level
internal function.

Also updates GroupListViewModel and GroupProfileViewModel to take
GroupRepository via constructor injection, since Gradle's jvmTest
compiles the whole source set before running any test and these were
the only callers of GroupRepository's now-instance methods. Wiring
these into Koin, and fixing the screens that construct these
ViewModels, is deferred to later tasks in the migration.
Move org.koin.* imports to their correct alphabetical position after
all dev.ohs.* imports, in line with the project's alphabetical import
sorting convention.
- Replace PlayerApplication (androidMain) to call initKoin with FhirEngine module
- Replace MainViewController (iosMain) to call initKoin with FhirEngine module
- Replace main.kt (jvmMain) to call initKoin with FhirEngine module
- Replace main.kt (webMain) to call initKoin with FhirEngine module
- Delete AppDependencies.kt and remove all references
- Update test files to use Koin's test utilities instead of AppDependencies
The plan's replacement code for these files omitted the header comment; restoring it to match every other file in the repo and satisfy the ratcheted spotlessCheck license rule.
@LZRS
LZRS requested a review from ellykits July 14, 2026 02:14
ellykits
ellykits previously approved these changes Jul 15, 2026
Both fail in CI even though the underlying test tasks are disabled
(enabled = false) in build.gradle.kts. Tracking issue filed to
root-cause and restore JS/Wasm compile coverage in CI.
@LZRS
LZRS force-pushed the feature/fhir-engine-repository branch from 2952a55 to b1262d7 Compare July 15, 2026 12:27
@LZRS
LZRS merged commit 2f5a152 into ohs-foundation:main Jul 15, 2026
5 checks passed
Itskiprotich added a commit to Itskiprotich/icl-auth-mobile that referenced this pull request Jul 28, 2026


- Replace EngineBackedFhirRepository delegate pattern with a self-contained
  FhirEngineRepository that owns all FhirEngine interactions directly
- Add fhirEngineRepositoryModule in AppModule to bind FhirRepository →
  FhirEngineRepository; platform modules now only supply FhirEngine
- Update InitKoin to load fhirEngineRepositoryModule with platformModule last
  (allowOverride=true) so web can still override with InMemoryFhirRepository
- Simplify Android, iOS and JVM entry points — remove SeededFhirRepository
  wrapping and FhirRepository bindings from platform modules
- Remove group feature (GroupRepository, GroupList/Profile screens and VMs,
  Binary-Group* resources) and platform-specific FhirEngineRepository stubs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LZRS
LZRS deleted the feature/fhir-engine-repository branch July 29, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate FHIR Engine

2 participants