Skip to content

Commit

Permalink
Split up data_index.json schema file
Browse files Browse the repository at this point in the history
Closes #452.
  • Loading branch information
alexdewar committed Aug 28, 2024
1 parent e3a1017 commit 6db82b2
Show file tree
Hide file tree
Showing 6 changed files with 309 additions and 280 deletions.
284 changes: 4 additions & 280 deletions schemas/v1/data_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,292 +6,16 @@
"type": "object",
"properties": {
"country": {
"allOf": [
{
"$ref": "file_info.json"
},
{
"type": "object",
"properties": {
"file_name": {
"type": "string"
}
},
"required": [
"file_name"
]
}
]
"$ref": "data_index/country.json"
},
"demographic": {
"allOf": [
{
"$ref": "file_info.json"
},
{
"type": "object",
"properties": {
"age_limits": {
"$ref": "age_range.json"
},
"time_limits": {
"type": "array",
"prefixItems": [
{
"type": "integer",
"minimum": 1900
},
{
"type": "integer",
"minimum": 1900
}
],
"minItems": 2,
"items": false
},
"projections": {
"type": "integer"
},
"population": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"path": {
"type": "string"
},
"file_name": {
"type": "string"
}
},
"required": [
"description",
"path",
"file_name"
]
},
"mortality": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"path": {
"type": "string"
},
"file_name": {
"type": "string"
}
},
"required": [
"description",
"path",
"file_name"
]
}
},
"required": [
"age_limits",
"time_limits",
"projections",
"population",
"mortality"
]
}
]
"$ref": "data_index/demographic.json"
},
"diseases": {
"allOf": [
{
"$ref": "file_info.json"
},
{
"type": "object",
"properties": {
"age_limits": {
"$ref": "age_range.json"
},
"time_year": {
"type": "integer",
"minimum": 1900
},
"disease": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"file_name": {
"type": "string"
},
"relative_risk": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"to_disease": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"file_name": {
"type": "string"
},
"default_value": {
"type": "number"
}
},
"required": [
"path",
"file_name",
"default_value"
]
},
"to_risk_factor": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"file_name": {
"type": "string"
}
},
"required": [
"path",
"file_name"
]
}
},
"required": [
"path",
"to_disease",
"to_risk_factor"
]
},
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"files": {
"type": "object",
"properties": {
"distribution": {
"type": "string"
},
"survival_rate": {
"type": "string"
},
"death_weight": {
"type": "string"
}
},
"required": [
"distribution",
"survival_rate",
"death_weight"
]
}
},
"required": [
"path",
"files"
]
}
},
"required": [
"path",
"file_name",
"relative_risk",
"parameters"
]
},
"registry": {
"type": "array",
"items": {
"type": "object",
"properties": {
"group": {
"enum": [
"other",
"cancer"
]
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"group",
"id",
"name"
]
}
}
},
"required": [
"age_limits",
"time_year",
"disease",
"registry"
]
}
]
"$ref": "data_index/diseases.json"
},
"analysis": {
"allOf": [
{
"$ref": "file_info.json"
},
{
"type": "object",
"properties": {
"age_limits": {
"$ref": "age_range.json"
},
"time_year": {
"type": "integer",
"minimum": 1900
},
"disability_file_name": {
"type": "string"
},
"lms_file_name": {
"type": "string"
},
"cost_of_disease": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"file_name": {
"type": "string"
}
},
"required": [
"path",
"file_name"
]
}
},
"required": [
"age_limits",
"time_year",
"disability_file_name",
"lms_file_name",
"cost_of_disease"
]
}
]
"$ref": "data_index/analysis.json"
}
},
"required": [
Expand Down
50 changes: 50 additions & 0 deletions schemas/v1/data_index/analysis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/imperialCHEPI/healthgps/main/schemas/v1/data_index/analysis.json",
"type": "object",
"allOf": [
{
"$ref": "../file_info.json"
},
{
"type": "object",
"properties": {
"age_limits": {
"$ref": "../age_range.json"
},
"time_year": {
"type": "integer",
"minimum": 1900
},
"disability_file_name": {
"type": "string"
},
"lms_file_name": {
"type": "string"
},
"cost_of_disease": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"file_name": {
"type": "string"
}
},
"required": [
"path",
"file_name"
]
}
},
"required": [
"age_limits",
"time_year",
"disability_file_name",
"lms_file_name",
"cost_of_disease"
]
}
]
}
21 changes: 21 additions & 0 deletions schemas/v1/data_index/country.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/imperialCHEPI/healthgps/main/schemas/v1/data_index/country.json",
"type": "object",
"allOf": [
{
"$ref": "../file_info.json"
},
{
"type": "object",
"properties": {
"file_name": {
"type": "string"
}
},
"required": [
"file_name"
]
}
]
}
Loading

0 comments on commit 6db82b2

Please sign in to comment.