Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

Commit 8dec5df

Browse files
[#173] Rename "minimum" and "maximum" to "min" and "max"
Also fixes the seeds when there are values in the "trial_deduplication_logs" table. opentrials/opentrials#173
1 parent 5c185de commit 8dec5df

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

api/swagger/swagger.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -532,14 +532,16 @@ definitions:
532532
age_range:
533533
type: object
534534
properties:
535-
minimum_age:
535+
min_age:
536536
type: string
537537
description: Minimum participant age (e.g. "12 Years", "1 Month",
538-
"15 Days"). If unknown, it's "Unknown". If no limit, it's undefined.
539-
maximum_age:
538+
"15 Days"). If unknown, it's `undefined`. If no limit, it's "any".
539+
If not applicable, it's "N/A".
540+
max_age:
540541
type: string
541542
description: Maximum participant age (e.g. "12 Years", "1 Month",
542-
"15 Days"). If unknown, it's "Unknown". If no limit, it's undefined.
543+
"15 Days"). If unknown, it's `undefined`. If no limit, it's "any".
544+
If not applicable, it's "N/A".
543545
has_published_results:
544546
type: boolean
545547
description: Trial has its results published (true/false)

seeds/trials.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ exports.seed = (knex) => {
282282
target_sample_size: 2000,
283283
gender: 'both',
284284
age_range: {
285-
minimum_age: '18 Years',
286-
maximum_age: '60 Years',
285+
min_age: '18 Years',
286+
max_age: '60 Years',
287287
},
288288
has_published_results: true,
289289
publications: [
@@ -356,7 +356,7 @@ exports.seed = (knex) => {
356356
study_phase: ['Not applicable'],
357357
target_sample_size: 250,
358358
age_range: {
359-
minimum_age: '18 Years',
359+
min_age: '18 Years',
360360
},
361361
locations: [
362362
{
@@ -544,6 +544,7 @@ exports.seed = (knex) => {
544544
.then(() => knex('persons').del())
545545
.then(() => knex('trials_organisations').del())
546546
.then(() => knex('organisations').del())
547+
.then(() => knex('trial_deduplication_logs').del())
547548
.then(() => knex('records').del())
548549
.then(() => knex('trials_publications').del())
549550
.then(() => knex('publications').del())

test/factory.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ const trialAttributes = {
152152
target_sample_size: 1000,
153153
gender: 'both',
154154
age_range: {
155-
minimum_age: '18 Years',
156-
maximum_age: '60 Years',
155+
min_age: '18 Years',
156+
max_age: '60 Years',
157157
},
158158
has_published_results: true,
159159
public_title: 'public_title',

tools/indexers/trials.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,10 @@ const trialMapping = {
444444
},
445445
age_range: {
446446
properties: {
447-
minimum_age: {
447+
min_age: {
448448
type: 'string',
449449
},
450-
maximum_age: {
450+
max_age: {
451451
type: 'string',
452452
},
453453
},

0 commit comments

Comments
 (0)