mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The administration set was windowed only to the report period (up to 730 days). A chronic medication dosed several times a day across that window, multiplied across several medications, can still materialise thousands of MedicationAdministration resources into a single Bundle — bounded by the window but unbounded by dose frequency. Cap the set at the most-recent 1000 acted intakes overall. The omitted rows are the oldest in the window, so recent adherence is preserved intact. When the cap trims rows the aggregator records the original and included counts and the FHIR document narrative discloses the truncation, so the export is honest about the omitted history rather than silently dropping it. Cover the cap in the report aggregator and the narrative note in the bundle builder. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit c6ce7df2bf6efb5e2c9d948d8f189d95d1289758)