Skip to content

Commit 11486b7

Browse files
authored
chore(medic#6395): update pregnancy form
* Chore: update pregnancy form * Chore: update demo pregnancy form * Chore: update default pregnancy form * Chore: update demo pregnancy form test * Fix: refactor * Revert "Fix: refactor" This reverts commit c50c543.
1 parent 3e12635 commit 11486b7

File tree

8 files changed

+384
-374
lines changed

8 files changed

+384
-374
lines changed
5.06 KB
Binary file not shown.

config/default/forms/app/pregnancy.xml

Lines changed: 185 additions & 185 deletions
Large diffs are not rendered by default.

config/default/test/form-inputs.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,20 @@ module.exports = {
216216
additionalFactors: ['yes', 'underweight']
217217
};
218218
Object.assign(content, opts);
219+
220+
const pregnancyAnswers = [content.firstPregnancy];
221+
if (content.firstPregnancy === 'no') {
222+
pregnancyAnswers.push(content.miscarriages);
223+
}
224+
219225
return [
220226
['method_lmp'],
221227
['1999-08-01'],
222228
[],
223229
['1'],
224230
['yes', '1999-12-15'],
225231
['yes', '2000-01-15'],
226-
[content.firstPregnancy, content.miscarriages],
232+
pregnancyAnswers,
227233
[content.conditions, ...content.additionalFactors],
228234
['yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'],
229235
['no'],

config/default/test/forms/pregnancy.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ describe('Pregnancy form tests', () => {
128128
it('shows summary when this is the first pregnancy for the woman and there are all the risk factors', async() => {
129129
const result = await harness.fillForm('pregnancy', ...pregnancyRegistrationScenarios.riskDanger({
130130
firstPregnancy: 'yes',
131-
miscarriages: 'no',
132131
conditions: ['heart_condition', 'asthma', 'high_blood_pressure', 'diabetes'],
133132
additionalFactors: ['yes', 'underweight']
134133
}));

config/demo/forms/app/pregnancy.xlsx

5.06 KB
Binary file not shown.

config/demo/forms/app/pregnancy.xml

Lines changed: 185 additions & 185 deletions
Large diffs are not rendered by default.

config/demo/test/form-inputs.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,20 @@ module.exports = {
216216
additionalFactors: ['yes', 'underweight']
217217
};
218218
Object.assign(content, opts);
219+
220+
const pregnancyAnswers = [content.firstPregnancy];
221+
if (content.firstPregnancy === 'no') {
222+
pregnancyAnswers.push(content.miscarriages);
223+
}
224+
219225
return [
220226
['method_lmp'],
221227
['1999-08-01'],
222228
[],
223229
['1'],
224230
['yes', '1999-12-15'],
225231
['yes', '2000-01-15'],
226-
[content.firstPregnancy, content.miscarriages],
232+
pregnancyAnswers,
227233
[content.conditions, ...content.additionalFactors],
228234
['yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'],
229235
['no'],

config/demo/test/forms/pregnancy.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ describe('Pregnancy form tests', () => {
128128
it('shows summary when this is the first pregnancy for the woman and there are all the risk factors', async() => {
129129
const result = await harness.fillForm('pregnancy', ...pregnancyRegistrationScenarios.riskDanger({
130130
firstPregnancy: 'yes',
131-
miscarriages: 'no',
132131
conditions: ['heart_condition', 'asthma', 'high_blood_pressure', 'diabetes'],
133132
additionalFactors: ['yes', 'underweight']
134133
}));

0 commit comments

Comments
 (0)