JSON Templates
Every template can also be submitted as a JSON document instead of a spreadsheet or text file. This suits teams that generate submissions from code. The JSON templates are defined with JSON Schema (draft-04). If JSON Schema is new to you, start with Understanding JSON Schema.
- Schemas: in the
json-templatesfolder of the all-templates zip, or linked from each row of the Template Catalog. - Worked example: example_human_study_json_package.zip is a ready-to-submit package of several templates in JSON.
- Field names: each template's field page lists the JSON attribute and type for every column, for example
subjectId (string).
How the schema files fit together
A template's top-level schema describes the document. Its data array refers to a Datum schema for one record. Templates with result columns split each record further into metaData and resultData. subjectHumans is a good representative example:
flowchart LR
A[subjectHumans.json] -->|data items| B[subjectHumans.Datum.json]
B -->|metaData| C[subjectHumans.MetaData.json]
B -->|resultData items| D[subjectHumans.ResultData.json]
| Schema file | Defines | Required properties |
|---|---|---|
subjectHumans.json |
The document: which template and version, plus an array of records | fileName, name, schemaVersion, templateType, data |
subjectHumans.Datum.json |
One record: one metaData object plus one or more resultData objects |
metaData, resultData |
subjectHumans.MetaData.json |
Subject demographics. Dropdown fields are enum strings; free text has maxLength |
subjectId, armOrCohortId |
subjectHumans.ResultData.json |
Immune exposure, captured for HIPC and other consortium studies | exposureProcessReported |
Simpler templates have only the top-level and Datum files. Compound templates such as basic_study_design.json refer to one schema per section (for example basic_study_design.armOrCohort.json).
Example: two human subjects
{
"templateType": "combined-result",
"fileName": "subjectHumans.json",
"name": "subjecthumans",
"schemaVersion": "3.37",
"validationLevel": "1",
"data": [
{
"metaData": {
"subjectId": "Subject_2000_A",
"sex": "Male",
"minSubjectAge": "10",
"maxSubjectAge": "10",
"ageUnit": "Years",
"ageEvent": "Age at enrollment",
"subjectPhenotype": "Normal",
"subjectLocation": "US: Maryland",
"ethnicity": "Hispanic or Latino",
"race": "White",
"description": "Test Subject A",
"armOrCohortId": "TestStudyArm2000A"
},
"resultData": [
{
"exposureProcessReported": "administering substance in vivo",
"exposureMaterialReported": "Hepatitis B virus vaccine ; VO_0000644",
"diseaseReported": "acquired immunodeficiency syndrome ; DOID:635",
"diseaseStageReported": "Chronic"
}
]
},
{
"metaData": {
"subjectId": "Subject_2000_B",
"sex": "Female",
"minSubjectAge": "20",
"maxSubjectAge": "20",
"ageUnit": "Years",
"ageEvent": "Age at enrollment",
"subjectPhenotype": "Normal",
"subjectLocation": "US: Maryland",
"ethnicity": "Not Hispanic or Latino",
"race": "Black or African American",
"description": "Test Subject B",
"armOrCohortId": "TestStudyArm2000B"
},
"resultData": [
{
"exposureProcessReported": "administering substance in vivo",
"exposureMaterialReported": "Hepatitis B virus vaccine ; VO_0000644",
"diseaseReported": "acquired immunodeficiency syndrome ; DOID:635",
"diseaseStageReported": "Chronic"
}
]
}
]
}
Validate locally first
Any JSON Schema draft-04 validator can check your document against the downloaded schemas before you upload. schemaVersion must match the current template version (rule R-04).