google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
458 stars 238 forks source link

Ordering of patches with cycles during upload #2524

Open aditya-07 opened 3 weeks ago

aditya-07 commented 3 weeks ago

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #2500

Description

  1. Find subgraphs (weakly connected) of Resources with cycles in them .
  2. Pack the subgraphs in Bundles such that a single subgraph is not split between two Bundles (as it may cause server error).
  3. Order the remaining resources and add them to the Bundle (in remaining space of or new Bundles) .

Alternative(s) considered Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type Choose one: Bug fix

Screenshots (if applicable)

Checklist

MJ1998 commented 2 weeks ago

Is this ready for review ?

MJ1998 commented 1 day ago

It's the Tarjan's Algorithm: https://www.geeksforgeeks.org/tarjan-algorithm-find-strongly-connected-components/