Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
cb953881
Commit
cb953881
authored
6 years ago
by
emelko
Browse files
Options
Downloads
Patches
Plain Diff
Adding secondarySymptom
* so calculating preOvuPhase with cervix is possible
parent
ef51dab4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/sympto/index.js
+2
-1
2 additions, 1 deletion
lib/sympto/index.js
lib/sympto/minus-8-day-rule.js
+2
-2
2 additions, 2 deletions
lib/sympto/minus-8-day-rule.js
lib/sympto/pre-ovulatory.js
+5
-4
5 additions, 4 deletions
lib/sympto/pre-ovulatory.js
with
9 additions
and
7 deletions
lib/sympto/index.js
+
2
−
1
View file @
cb953881
...
...
@@ -23,7 +23,8 @@ export default function getSymptoThermalStatus(cycleInfo) {
if
(
statusForLast
.
temperatureShift
)
{
const
preOvuPhase
=
getPreOvulatoryPhase
(
cycle
,
[
previousCycle
,
...
earlierCycles
]
[
previousCycle
,
...
earlierCycles
],
secondarySymptom
)
if
(
preOvuPhase
)
{
status
.
phases
.
preOvulatory
=
preOvuPhase
...
...
This diff is collapsed.
Click to expand it.
lib/sympto/minus-8-day-rule.js
+
2
−
2
View file @
cb953881
import
{
LocalDate
}
from
'
js-joda
'
import
getNfpStatus
from
'
./index
'
export
default
function
(
previousCycles
)
{
export
default
function
(
previousCycles
,
secondarySymptom
)
{
const
fhms
=
previousCycles
.
map
(
cycle
=>
{
const
status
=
getNfpStatus
({
cycle
})
const
status
=
getNfpStatus
({
cycle
,
secondarySymptom
})
if
(
status
.
temperatureShift
)
{
const
day
=
status
.
temperatureShift
.
firstHighMeasurementDay
const
firstCycleDayDate
=
LocalDate
.
parse
(
cycle
[
0
].
date
)
...
...
This diff is collapsed.
Click to expand it.
lib/sympto/pre-ovulatory.js
+
5
−
4
View file @
cb953881
import
{
LocalDate
}
from
"
js-joda
"
import
apply8DayRule
from
'
./minus-8-day-rule
'
export
default
function
(
cycle
,
previousCycles
)
{
export
default
function
(
cycle
,
previousCycles
,
secondarySymptom
)
{
let
preOvuPhaseLength
=
5
const
minus8DayRuleResult
=
apply8DayRule
(
previousCycles
)
const
minus8DayRuleResult
=
apply8DayRule
(
previousCycles
,
secondarySymptom
)
if
(
minus8DayRuleResult
)
preOvuPhaseLength
=
minus8DayRuleResult
const
startDate
=
LocalDate
.
parse
(
cycle
[
0
].
date
)
...
...
@@ -12,7 +12,7 @@ export default function(cycle, previousCycles) {
const
maybePreOvuDays
=
cycle
.
slice
(
0
,
preOvuPhaseLength
).
filter
(
d
=>
{
return
d
.
date
<=
preOvuEndDate
})
const
preOvulatoryDays
=
getDaysUntilFertileSecondarySymptom
(
maybePreOvuDays
)
const
preOvulatoryDays
=
getDaysUntilFertileSecondarySymptom
(
maybePreOvuDays
,
secondarySymptom
)
// if fertile mucus or cervix occurs on the 1st cycle day, there is no pre-ovu phase
if
(
!
preOvulatoryDays
.
length
)
return
null
...
...
@@ -39,7 +39,8 @@ function getDaysUntilFertileSecondarySymptom(days, secondarySymptom = 'mucus') {
if
(
secondarySymptom
===
'
mucus
'
)
{
return
day
.
mucus
&&
day
.
mucus
.
value
>
1
}
else
if
(
secondarySymptom
===
'
cervix
'
)
{
return
day
.
cervix
&&
!
day
.
cervix
.
isClosedAndHard
return
day
.
cervix
&&
day
.
cervix
.
opening
>
0
||
day
.
cervix
&&
day
.
cervix
.
firmness
>
0
}
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment