Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
repp_backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Julieta Dubra Raimunde
repp_backend
Commits
a9216ee6
Commit
a9216ee6
authored
3 years ago
by
Agustin Ruiz Diaz Cambon
Browse files
Options
Downloads
Patches
Plain Diff
Maternity women aged 30 to 59 fixed
Now population maternity calculation is only available for women aged 18 to 29
parent
8d5c22ee
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Schemas/getRepBody.ts
+0
-20
0 additions, 20 deletions
src/Schemas/getRepBody.ts
src/Services/ERCalculator.ts
+3
-5
3 additions, 5 deletions
src/Services/ERCalculator.ts
with
3 additions
and
25 deletions
src/Schemas/getRepBody.ts
+
0
−
20
View file @
a9216ee6
...
...
@@ -130,27 +130,7 @@ const getRepBody = {
type
:
'
number
'
as const
,
minimum
:
0
,
},
countryBirthRate
:
{
type
:
'
number
'
as const
,
minimum
:
0
,
},
countryWomenInAgeGroup
:
{
type
:
'
number
'
as const
,
exclusiveMinimum
:
0
,
},
countryPopulation
:
{
type
:
'
number
'
as const
,
exclusiveMinimum
:
0
,
},
},
oneOf
:
[
{
required
:
[
'
pregnantWomen
'
,
'
lactatingWomen
'
],
},
{
required
:
[
'
countryBirthRate
'
,
'
countryWomenInAgeGroup
'
,
'
countryPopulation
'
],
},
],
},
},
},
...
...
This diff is collapsed.
Click to expand it.
src/Services/ERCalculator.ts
+
3
−
5
View file @
a9216ee6
...
...
@@ -196,13 +196,11 @@ const calculate30To59Years = (group: AgeGroup, params: number[], data: ExtraData
// If the group's sex is Female, then you have to take into account
// the extra energy required by women that are pregnant or lactating
if
(
group
.
sex
===
Sex
.
Female
)
{
if
(
typeof
(
data
.
maternity30To59
)
===
'
undefined
'
)
{
throw
new
Error
(
'
Missing maternity data for women aged 30 to 59
'
);
}
else
if
(
isIndividualMaternity
(
data
.
maternity30To59
))
{
if
(
group
.
sex
===
Sex
.
Female
&&
data
.
maternity30To59
!==
undefined
)
{
if
(
isIndividualMaternity
(
data
.
maternity30To59
))
{
requirement
=
calculateERWomenIndividual
(
group
,
params
,
data
.
maternity30To59
,
requirement
);
}
else
{
requirement
=
calculateERWomenPopulation
(
params
,
data
.
maternity30To59
,
requirement
);
throw
new
Error
(
'
Invalid maternity data for 30 to 59 years old women group
'
);
}
}
...
...
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