EmmaTellblom / Mensinator

MIT License
37 stars 10 forks source link

Setting to override and calculate period according to luteal phase (?) #22

Closed EmmaTellblom closed 3 months ago

EmmaTellblom commented 3 months ago

Create a new setting override_period_calculation / override period calculation (?) / ? (new setting group for calculation?) Dont forget increasing db_version Dont forget fixing onCreate/onUpgrade

Description

Our app currently supports the registration of ovulation dates and calculates the next menstrual period based on period start dates. However, this standard method often results in inaccurate predictions for the next period. To improve accuracy, we propose adding a new option that allows users to enable a more advanced period prediction method that calculates the next expected period start based on the ovulation that user has entered (luteal phase calculation).

Feature Request

We want to implement a feature that introduces a setting to switch between the standard period prediction method and luteal phase calculation.

Proposed Enhancement

Add a Setting for luteal phase calculation: Introduce a toggle or setting in the app that allows users to choose between the standard period prediction method and the other method that uses ovulation data. The setting should be located in the app’s settings menu or preferences.

Luteal Phase Period Prediction Algorithm: A new algorithm that uses historical data (passed 4 cycles?) that calculates an average luteal phase and then sets expected period start date from that.

Algorithm Details: Calculate the luteal phase length (the time between ovulation and the start of the next period). Adjust the prediction for the next period based on the average cycle length between ovulation dates and periods, rather than only using period start dates.

User Feedback and UI/UX Adjustments: Provide a clear explanation of the new advanced prediction method in the settings menu. Update the user interface to reflect the selected period prediction method and show how the ovulation data is used in the advanced prediction. Ensure that users receive updated information on how their ovulation dates affect the prediction of their next period.

Acceptance Criteria The app includes a setting that allows users to switch between the standard and advanced period prediction methods. The advanced prediction method accurately calculates the next period using ovulation dates and passed perioddates. Users can see how their ovulation data affects period predictions when the advanced method is enabled. Documentation and help sections are updated to explain the new prediction methods and how to use them.

EmmaTellblom commented 3 months ago

Function getLutealLength created in PeriodDatabaseHelper

EmmaTellblom commented 3 months ago

Started working on this....

EmmaTellblom commented 3 months ago

I have finished work on advanced (luteal phase) and basic (average cycle length) calculations.

TODO: Add new setting (advanced_calc = 0/1) -> ('advanced_calc ', 'Luteal Phase Calculation', '0', 3) -> 3 is other setting Add new setting group (?) Increase database-version GUI for setting Change calculation in CalendarScreen to use the new ones

EmmaTellblom commented 3 months ago

Done!