Difference between revisions of "Study JSON v2"

From ECRIN-MDR Wiki
Jump to navigation Jump to search
Line 7: Line 7:
 
     "$id": "http://ecrin.org/json_schemas/mdrstudy/v2.json",
 
     "$id": "http://ecrin.org/json_schemas/mdrstudy/v2.json",
 
     "title": "XDC Study definition",
 
     "title": "XDC Study definition",
     "description": "ECRIN Metadata Repository for clinical research objects, Study JSON definition, version 1 January 2019",
+
     "description": "ECRIN Metadata Repository for clinical research objects, Study JSON definition, version 2 February 2019",
  
 
     "type": "object",
 
     "type": "object",
     "required": ["Id", "ScientificTitle"],
+
     "required": ["id", "scientific_title"],
 
     "additionalProperties": false,
 
     "additionalProperties": false,
 
     "properties": {
 
     "properties": {
  
         "Id": {
+
         "id": {
 
             "type": "integer",
 
             "type": "integer",
 
             "description": "Internal accession number of the study within MDR database"
 
             "description": "Internal accession number of the study within MDR database"
 
         },
 
         },
  
         "ScientificTitle": {
+
         "scientific_title": {
             "type": "string",
+
             "type": "object",
"description": "The full scientific title, as used on the protocol document"
+
            "properties": {
 +
                "title": {
 +
                    "type": "string",
 +
                    "description": "The full scientific title, as used on the protocol document"
 +
                },
 +
                "lang_code": {
 +
                    "$ref": "#/definitions/lang_code"
 +
                }
 +
            }
 
         },
 
         },
  
         "StudyIdentifiers": {
+
         "study_identifiers": {
 
             "type": "array",
 
             "type": "array",
 
             "items": {
 
             "items": {
 
                 "type": "object",
 
                 "type": "object",
 
                 "description": "A composite object that indicates the value and type of the identifier, and optionally its date and organisation of origin",
 
                 "description": "A composite object that indicates the value and type of the identifier, and optionally its date and organisation of origin",
                 "required": ["Id", "IdentifierValue", "IdentifierTypeId"],
+
                 "required": ["id", "value", "type"],
 
                 "properties": {
 
                 "properties": {
                     "Id": {
+
                     "id": {
 
                         "type": "integer",
 
                         "type": "integer",
 
                         "description": "Study identifier record primary key, generated automatically in database"
 
                         "description": "Study identifier record primary key, generated automatically in database"
 
                     },
 
                     },
                     "IdentifierValue": {
+
                     "value": {
 
                         "type": "string",
 
                         "type": "string",
 
                         "description": "The identifier value, in a standardised format (for each identifier type)"
 
                         "description": "The identifier value, in a standardised format (for each identifier type)"
 
                     },
 
                     },
                     "IdentifierTypeId": {
+
                     "type": {
                         "type": "integer",
+
                         "type": "object",
                        "description": "An integer referencing the relevant record in the identifier_types enumeration / lookup table"
+
                        "properties": {
 +
                            "id": {
 +
                                "type": "integer",
 +
                                "description": "An integer referencing the relevant record in the identifier_types enumeration / lookup table"
 +
                            },
 +
                            "name": {
 +
                                "type": "string",
 +
                                "description": "One of the allowed types, from the identifier_types enumeration, e.g. 'Trial Registry ID', or 'Sponsor ID'"
 +
                            }
 +
                        }
 
                     },
 
                     },
                     "DateApplied": {
+
                     "date": {
 
                         "type": "string",
 
                         "type": "string",
 
                         "format": "date",
 
                         "format": "date",
 
                         "description": "The date the identifier was allocated, if known"
 
                         "description": "The date the identifier was allocated, if known"
 
                     },
 
                     },
                     "OrgId": {
+
                     "organisation": {
                         "type": "integer",
+
                         "$ref": "#/definitions/organisation"
                        "description": "An integer referencing an organisation record in the ECRIN context database"
 
 
                     }
 
                     }
 
                 }
 
                 }
Line 56: Line 72:
 
         },
 
         },
  
         "StudyTopics": {
+
         "study_topics": {
 
             "type": "array",
 
             "type": "array",
 
             "items": {
 
             "items": {
 
                 "type": "object",
 
                 "type": "object",
                 "description": "A composite object that indicates the topic name or keyword, and - if applicable - how it was classified in the source data",
+
                 "description": "A composite object that indicates the topic name or keyword, and - if applicable - how it was classified in the source data, the controlled terminology system used, and the code for the topic in that system",
                 "required": ["Id", "Topic"],
+
                 "required": ["id", "value"],
 
                 "properties": {
 
                 "properties": {
                     "Id": {
+
                     "id": {
 
                         "type": "integer",
 
                         "type": "integer",
 
                         "description": "Study topic record primary key, generated automatically in database"
 
                         "description": "Study topic record primary key, generated automatically in database"
 
                     },
 
                     },
                     "Topic": {
+
                     "value": {
 
                         "type": "string",
 
                         "type": "string",
 
                         "description": "The topic name, as provided in the source data"
 
                         "description": "The topic name, as provided in the source data"
 
                     },
 
                     },
                     "TopicTypeId": {
+
                     "topic_source_type": {
                         "type": "integer",
+
                         "type": "object",
                        "description": "An integer referencing the relevant record in the topic_source_types enumeration / lookup table"
+
                        "description": "How the topic was categorised in the source documentation, (or by using the controlled terminology, or using a category matching service)"
}
+
                        "properties": {
}
+
                            "id": {
 +
                                "type": "integer",
 +
                                "description": "An integer referencing the relevant record in the topic_source_types enumeration / lookup table"
 +
                            },
 +
                            "name": {
 +
                                "type": "string",
 +
                                "description": "One of the allowed types, from the topic_source_types enumeration, e.g. 'Condition', or 'Organism'"
 +
                            }
 +
                        }
 +
                    },
 +
                    "topic_ct": {
 +
                        "type": "object",
 +
                        "description": "If applicable, the controlled terminology system from which the topic name was taken",
 +
                        "properties": {
 +
                            "id": {
 +
                                "type": "integer",
 +
                                "description": "An integer referencing the relevant record in the topic_controlled_terminologies enumeration / lookup table"
 +
                            },
 +
                            "name": {
 +
                                "type": "string",
 +
                                "description": "One of the allowed types, from the topic_controlled_terminologies enumeration, e.g. 'MESH', or 'Cochrane PICO terminology'"
 +
                            }
 +
                        }
 +
                    },
 +
                    "topic_ct_code": {
 +
                        "type": "string",
 +
                        "description": "The code for the topic within the designated controlled terminology scheme"
 +
                    },
 +
                }
 
             }
 
             }
 
         },
 
         },
  
         "StudyOtherTitles": {
+
         "study_other_titles": {
 
             "type": "array",
 
             "type": "array",
 
             "items": {
 
             "items": {
 
                 "type": "object",
 
                 "type": "object",
 
                 "description": "A composite object that indicates the type and value of the 'other title'",
 
                 "description": "A composite object that indicates the type and value of the 'other title'",
                 "required": ["Id", "TitleTypeId", "TitleText"],
+
                 "required": ["id", "title_type", "title_text"],
 
                 "properties": {
 
                 "properties": {
                     "Id": {
+
                     "id": {
 
                         "type": "integer",
 
                         "type": "integer",
 
                         "description": "Other title record primary key, generated automatically in database"
 
                         "description": "Other title record primary key, generated automatically in database"
 
                     },
 
                     },
                     "TitleTypeId": {
+
                     "title_type": {
"type": "integer",
+
                        "type": "object",
                        "description": "An integer referencing the relevant record in the title_types enumeration / lookup table"
+
                        "properties": {
 +
                            "id": {
 +
                                "type": "integer",
 +
                                "description": "An integer referencing the relevant record in the title_types enumeration / lookup table"
 +
                            },
 +
                            "name": {
 +
                                "type": "string",
 +
                                "description": "One of the allowed types, from the title_types enumeration, e.g. 'Abbreviation or Acronym', or 'Translated Title'"
 +
                            }
 +
                        }
 
                     },
 
                     },
                     "TitleText": {
+
                     "title_text": {
 
                         "type": "string"
 
                         "type": "string"
 +
                    },
 +
                    "lang_code": {
 +
                        "$ref": "#/definitions/lang_code"
 
                     }
 
                     }
 
                 }
 
                 }
 
             }
 
             }
 
         },
 
         },
+
 
"StudyRelationships": {
+
        "study_type": {
 +
            "type": "object",
 +
            "properties": {
 +
                "id": {
 +
                    "type": "integer",
 +
                    "description": "An integer referencing the relevant record in the study_types enumeration / lookup table"
 +
                },
 +
                "name": {
 +
                    "type": "string",
 +
                    "description": "One of the allowed types, from the study_types enumeration, e.g. 'Interventional', or 'Observational'"
 +
                }
 +
            }
 +
        },
 +
 
 +
        "study_status": {
 +
            "type": "object",
 +
            "properties": {
 +
                "id": {
 +
                    "type": "integer",
 +
                    "description": "An integer referencing the relevant record in the study_statuses enumeration / lookup table"
 +
                },
 +
                "name": {
 +
                    "type": "string",
 +
                    "description": "One of the allowed types, from the study_statuses enumeration, e.g. 'Active, not recruiting', or 'Completed'"
 +
                }
 +
            }
 +
        },
 +
 
 +
        "linked_data_objects": {
 
             "type": "array",
 
             "type": "array",
 
             "items": {
 
             "items": {
 
                 "type": "object",
 
                 "type": "object",
                "description": "A composite object that indicates the type and value of the 'other title'",
 
                "required": ["Id", "StudyBId", "RelationshipId"],
 
 
                 "properties": {
 
                 "properties": {
                     "Id": {
+
                     "id": {
 
                         "type": "integer",
 
                         "type": "integer",
                         "description": "Study relationships record primary key, generated automatically in database"
+
                         "description": "The id, i.e. internal accession number, of the linked data object"
                    },
 
                    "StudyBId": {
 
"type": "integer",
 
                        "description": "An integer referencing the id, i.e. internal accession number, of the related study"
 
                    },
 
"RelationshipId": {
 
"type": "integer",
 
                        "description": "An integer referencing the relevant record in the study_relationship_types enumeration / lookup table"
 
                    },
 
                    "Comments": {
 
                        "type": "string"
 
"description": "Optional comments providing further details of the relationship"
 
 
                     }
 
                     }
 
                 }
 
                 }
 
             }
 
             }
 +
        }
 +
    },
 +
 +
    "definitions": {
 +
 +
        "lang_code": {
 +
            "type": "string",
 +
            "minLength" = 2,
 +
            "maxLength" = 2,
 +
            "description": "A two letter ISO 369-1 code indicating the language of the study",
 +
            "default": "en"
 
         },
 
         },
+
 
+
         "organisation": {
         "LinkedDataObjects": {
+
             "type": "object",
             "type": "array",
+
            "required": ["name"],
             "items": {
+
             "properties": {
                 "type": "object",
+
                 "id": {
                "properties": {
+
                    "type": "integer",
                    "DataObjectId": {
+
                    "description": "The id of the organisation within the ECRIN contextual database, if that id exists"
                        "type": "integer",
+
                }
                        "description": "The id, i.e. internal accession number, of the linked data object"
+
                "name": {
 +
                    "type": "array",
 +
                    "description": "Either the name of the organisation as supplied by the source data, or the names (may be multiple) of the organisation within the ECRIN contextual database",
 +
                    "minItems" = 1,
 +
                    "items": {
 +
                        "type": "string"
 
                     }
 
                     }
 
                 }
 
                 }
 
             }
 
             }
 
         }
 
         }
+
 
 
     }
 
     }
 
}
 
}

Revision as of 12:17, 8 September 2019


{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://ecrin.org/json_schemas/mdrstudy/v2.json",
    "title": "XDC Study definition",
    "description": "ECRIN Metadata Repository for clinical research objects, Study JSON definition, version 2 February 2019",

    "type": "object",
    "required": ["id", "scientific_title"],
    "additionalProperties": false,
    "properties": {

        "id": {
            "type": "integer",
            "description": "Internal accession number of the study within MDR database"
        },

        "scientific_title": {
            "type": "object",
            "properties": {
                "title": {
                    "type": "string",
                    "description": "The full scientific title, as used on the protocol document"
                },
                "lang_code": {
                    "$ref": "#/definitions/lang_code"
                }
            }
        },

        "study_identifiers": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the value and type of the identifier, and optionally its date and organisation of origin",
                "required": ["id", "value", "type"],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Study identifier record primary key, generated automatically in database"
                    },
                    "value": {
                        "type": "string",
                        "description": "The identifier value, in a standardised format (for each identifier type)"
                    },
                    "type": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer",
                                "description": "An integer referencing the relevant record in the identifier_types enumeration / lookup table"
                            },
                            "name": {
                                "type": "string",
                                "description": "One of the allowed types, from the identifier_types enumeration, e.g. 'Trial Registry ID', or 'Sponsor ID'"
                            }
                        }
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "The date the identifier was allocated, if known"
                    },
                    "organisation": {
                        "$ref": "#/definitions/organisation"
                    }
                }
            }
        },

        "study_topics": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the topic name or keyword, and - if applicable - how it was classified in the source data, the controlled terminology system used, and the code for the topic in that system",
                "required": ["id", "value"],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Study topic record primary key, generated automatically in database"
                    },
                    "value": {
                        "type": "string",
                        "description": "The topic name, as provided in the source data"
                    },
                    "topic_source_type": {
                        "type": "object",
                        "description": "How the topic was categorised in the source documentation, (or by using the controlled terminology, or using a category matching service)"
                        "properties": {
                            "id": {
                                "type": "integer",
                                "description": "An integer referencing the relevant record in the topic_source_types enumeration / lookup table"
                            },
                            "name": {
                                "type": "string",
                                "description": "One of the allowed types, from the topic_source_types enumeration, e.g. 'Condition', or 'Organism'"
                            }
                        }
                    },
                    "topic_ct": {
                        "type": "object",
                        "description": "If applicable, the controlled terminology system from which the topic name was taken",
                        "properties": {
                            "id": {
                                "type": "integer",
                                "description": "An integer referencing the relevant record in the topic_controlled_terminologies enumeration / lookup table"
                            },
                            "name": {
                                "type": "string",
                                "description": "One of the allowed types, from the topic_controlled_terminologies enumeration, e.g. 'MESH', or 'Cochrane PICO terminology'"
                            }
                        }
                    },
                    "topic_ct_code": {
                        "type": "string",
                        "description": "The code for the topic within the designated controlled terminology scheme"
                    },
                }
            }
        },

        "study_other_titles": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "A composite object that indicates the type and value of the 'other title'",
                "required": ["id", "title_type", "title_text"],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Other title record primary key, generated automatically in database"
                    },
                    "title_type": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer",
                                "description": "An integer referencing the relevant record in the title_types enumeration / lookup table"
                            },
                            "name": {
                                "type": "string",
                                "description": "One of the allowed types, from the title_types enumeration, e.g. 'Abbreviation or Acronym', or 'Translated Title'"
                            }
                        }
                    },
                    "title_text": {
                        "type": "string"
                    },
                    "lang_code": {
                        "$ref": "#/definitions/lang_code"
                    }
                }
            }
        },

        "study_type": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "description": "An integer referencing the relevant record in the study_types enumeration / lookup table"
                },
                "name": {
                    "type": "string",
                    "description": "One of the allowed types, from the study_types enumeration, e.g. 'Interventional', or 'Observational'"
                }
            }
        },

        "study_status": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "description": "An integer referencing the relevant record in the study_statuses enumeration / lookup table"
                },
                "name": {
                    "type": "string",
                    "description": "One of the allowed types, from the study_statuses enumeration, e.g. 'Active, not recruiting', or 'Completed'"
                }
            }
        },

        "linked_data_objects": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "The id, i.e. internal accession number, of the linked data object"
                    }
                }
            }
        }
    },

    "definitions": {

        "lang_code": {
            "type": "string",
            "minLength" = 2,
            "maxLength" = 2,
            "description": "A two letter ISO 369-1 code indicating the language of the study",
            "default": "en"
        },

        "organisation": {
            "type": "object",
            "required": ["name"],
            "properties": {
                "id": {
                    "type": "integer",
                    "description": "The id of the organisation within the ECRIN contextual database, if that id exists"
                }
                "name": {
                    "type": "array",
                    "description": "Either the name of the organisation as supplied by the source data, or the names (may be multiple) of the organisation within the ECRIN contextual database",
                    "minItems" = 1,
                    "items": {
                        "type": "string"
                    }
                }
            }
        }

    }
}