{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "BsonObjectId": {
            "type": [
                "null",
                "string"
            ],
            "maxLength": 12,
            "minLength": 12
        },
        "Gender": {
            "type": "string",
            "maxLength": 1,
            "minLength": 1,
            "title": "Gender definition.",
            "description": "An explanation about the purpose of this instance described by this schema.",
            "enum": [
                null,
                "M",
                "F",
                "U"
            ]
        },
        "ISO8601DateTime": {
            "type": "string",
            "maxLength": 24,
            "minLength": 4,
            "pattern": "^((([0-9]{4})-([0-9][0-9])-([0-9][0-9]))T([0-9][0-9]:[0-9][0-9]:[0-9][0-9](.[0-9][0-9][0-9]?)?)Z)$",
            "title": "Timestamp String",
            "description": "Date-Time as String (optional fractioanl seconds) ex: 2014-07-18T13:08:53.307Z"
        },
        "MoodCode": {
            "type": "string",
            "minLength": 1,
            "title": "Mood_code schema.",
            "description": "An explanation about the purpose of this instance described by this schema.",
            "enum": [
                null,
                "EVN"
            ]
        },
        "Oid": {
            "type": [
                "string",
                "null"
            ],
            "minLength": 1,
            "title": "Oid schema.",
            "description": "An explanation about the purpose of this instance described by this schema."
        },
        "ResultValue": {
            "type": "object",
            "additionalProperties": true,
            "title": "Result Value schema.",
            "description": "An explanation about the purpose of this instance described by this schema."
        },
        "SecondsSinceEpoch": {
            "type": [
                "integer",
                "null"
            ],
            "multipleOf": 1,
            "title": "Milliseconds since Epoch",
            "description": "Number of milliseconds since Jan 1, 1970"
        },
        "MedicationProduct": {
            "type": "object",
            "additionalProperties": true
        }
    },
    "properties": {
        "BsonObjectId": {
            "$ref": "#/definitions/BsonObjectId"
        },
        "Gender": {
            "$ref": "#/definitions/Gender"
        },
        "ISO8601DateTime": {
            "$ref": "#/definitions/ISO8601DateTime"
        },
        "MoodCode": {
            "$ref": "#/definitions/MoodCode"
        },
        "Oid": {
            "$ref": "#/definitions/Oid"
        },
        "ResultValue": {
            "$ref": "#/definitions/ResultValue"
        },
        "SecondsSinceEpoch": {
            "$ref": "#/definitions/SecondsSinceEpoch"
        },
        "MedicationProduct": {
            "$ref": "#/definitions/MedicationProduct"
        }
    },
    "required": [
        "BsonObjectId",
        "Gender",
        "ISO8601DateTime",
        "MoodCode",
        "Oid",
        "ResultValue",
        "SecondsSinceEpoch",
        "MedicationProduct"
    ]
}