From e6383ef856ca868adefab0f43d1801d63752690f Mon Sep 17 00:00:00 2001 From: Mallory Freeberg Date: Tue, 5 Dec 2017 14:41:40 +0000 Subject: [PATCH 1/4] Added regex to allow range numbers. Added plural age_unit enums. --- json_schema/donor.json | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/json_schema/donor.json b/json_schema/donor.json index e76d3992d..6c5aae066 100644 --- a/json_schema/donor.json +++ b/json_schema/donor.json @@ -5,9 +5,8 @@ "properties": { "age": { "description": "Age in age_units. For embryos, measured since fertilization. For all others, measured since birth.", - "maximum": 150, - "minimum": 0, - "type": "number" + "pattern": "^\d+\.?\d*-?\d*\.?\d*$", + "type": "string" }, "age_unit": { "description": "The unit in which age is expressed. Must be one of day, week, month, or year.", @@ -15,7 +14,11 @@ "hour", "day", "week", - "year" + "year", + "hours", + "days", + "weeks", + "years" ] }, "alcohol_history": { @@ -55,10 +58,9 @@ "type": "string" }, "height": { - "description": "Height of donor in meters.", - "maximum": 10, - "minimum": 0, - "type": "number" + "description": "Height of donor, in meters. Can be a range separated by a hyphen.", + "pattern": "^\d+\.?\d*-?\d*\.?\d*$", + "type": "string" }, "is_living": { "description": "Should be yes if donor is living at time of sample donation. Otherwise, should be no.", @@ -109,10 +111,9 @@ } }, "weight": { - "description": "Weight of donor in kilograms.", - "maximum": 1000, - "minimum": 0, - "type": "number" + "description": "Weight of donor, in kilograms. Can be a range separated by a hyphen.", + "pattern": "^\d+\.?\d*-?\d*\.?\d*$", + "type": "string" } }, "required": [ From 645c852d9aa907dee3a53a94fb329a4b4e2ab57d Mon Sep 17 00:00:00 2001 From: Mallory Freeberg Date: Tue, 5 Dec 2017 14:44:53 +0000 Subject: [PATCH 2/4] Fixed regex digits. --- json_schema/donor.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/json_schema/donor.json b/json_schema/donor.json index 6c5aae066..7b32f12c7 100644 --- a/json_schema/donor.json +++ b/json_schema/donor.json @@ -5,7 +5,7 @@ "properties": { "age": { "description": "Age in age_units. For embryos, measured since fertilization. For all others, measured since birth.", - "pattern": "^\d+\.?\d*-?\d*\.?\d*$", + "pattern": "^[0-9]+\.?[0-9]*-?[0-9]*\.?[0-9]*$", "type": "string" }, "age_unit": { @@ -59,7 +59,7 @@ }, "height": { "description": "Height of donor, in meters. Can be a range separated by a hyphen.", - "pattern": "^\d+\.?\d*-?\d*\.?\d*$", + "pattern": "^[0-9]+\.?[0-9]*-?[0-9]*\.?[0-9]*$", "type": "string" }, "is_living": { @@ -112,7 +112,7 @@ }, "weight": { "description": "Weight of donor, in kilograms. Can be a range separated by a hyphen.", - "pattern": "^\d+\.?\d*-?\d*\.?\d*$", + "pattern": "^[0-9]+\.?[0-9]*-?[0-9]*\.?[0-9]*$", "type": "string" } }, From 2ebd85a7bff3e3e85aecd651431a05dbcf0bf1d3 Mon Sep 17 00:00:00 2001 From: Mallory Freeberg Date: Tue, 5 Dec 2017 14:48:46 +0000 Subject: [PATCH 3/4] Fixed regex, double escape period. --- json_schema/donor.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/json_schema/donor.json b/json_schema/donor.json index 7b32f12c7..2829e0f42 100644 --- a/json_schema/donor.json +++ b/json_schema/donor.json @@ -5,7 +5,7 @@ "properties": { "age": { "description": "Age in age_units. For embryos, measured since fertilization. For all others, measured since birth.", - "pattern": "^[0-9]+\.?[0-9]*-?[0-9]*\.?[0-9]*$", + "pattern": "^[0-9]+\\.?[0-9]*-?[0-9]*\\.?[0-9]*$", "type": "string" }, "age_unit": { @@ -59,7 +59,7 @@ }, "height": { "description": "Height of donor, in meters. Can be a range separated by a hyphen.", - "pattern": "^[0-9]+\.?[0-9]*-?[0-9]*\.?[0-9]*$", + "pattern": "^[0-9]+\\.?[0-9]*-?[0-9]*\\.?[0-9]*$", "type": "string" }, "is_living": { @@ -112,7 +112,7 @@ }, "weight": { "description": "Weight of donor, in kilograms. Can be a range separated by a hyphen.", - "pattern": "^[0-9]+\.?[0-9]*-?[0-9]*\.?[0-9]*$", + "pattern": "^[0-9]+\\.?[0-9]*-?[0-9]*\\.?[0-9]*$", "type": "string" } }, From 0fd79944c35e963f3e0b5240062e256ec6e87492 Mon Sep 17 00:00:00 2001 From: Mallory Freeberg Date: Tue, 5 Dec 2017 15:12:17 +0000 Subject: [PATCH 4/4] Removed time_of_death as required for death.json --- json_schema/death.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/json_schema/death.json b/json_schema/death.json index f316c5748..3b2e3ae82 100644 --- a/json_schema/death.json +++ b/json_schema/death.json @@ -31,8 +31,7 @@ } }, "required": [ - "cause_of_death", - "time_of_death" + "cause_of_death" ], "title": "death", "type": "object"