Skip to content

Document

Dereferenced schema · Source · Referenced version

A source document. Publisher, company, drug names, dates, and status are extensions; urls are plain strings.

Fields

Field Type Required Description
id string matching ^doc:(fda|ema|hse|hc|hpra):.+$ yes
type always Document yes
documentType one of Regulatory approval yes
name string yes
title string or null yes
aliases array of string yes
description string yes
urls array of string format uri yes
doi string or null yes
pmid string or null yes
extensions array of extensions (see Extensions) yes

Extensions

Each extension is an object with a name, a value, and an optional description (see Extension).

Name Value Required
agent Agent without extensions yes
company string yes
drug_name_brand string or null yes
drug_name_generic string or null yes
first_publication_date iso_date_or_null yes
publication_date iso_date_or_null yes
regulatory_identifier string or null yes
status one of Active, Deprecated yes

Definitions

iso_date_or_null

An ISO 8601 date (YYYY-MM-DD) or null.

Type: null or string format date

Additional rules

These rules also apply to every record:

  • When id matches ^doc:fda:: extensions must contain regulatory_identifier extension with value string matching ^(BLA|NDA)[0-9]{6}$.

JSON Schema

Full JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://moalmanac.org/schemas/dereferenced/documents.schema.json",
  "title": "Document",
  "description": "A source document. Publisher, company, drug names, dates, and status are extensions; urls are plain strings.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^doc:(fda|ema|hse|hc|hpra):.+$"
    },
    "type": {
      "const": "Document"
    },
    "documentType": {
      "enum": [
        "Regulatory approval"
      ]
    },
    "name": {
      "type": "string"
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "aliases": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "description": {
      "type": "string"
    },
    "urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "doi": {
      "type": [
        "string",
        "null"
      ]
    },
    "pmid": {
      "type": [
        "string",
        "null"
      ]
    },
    "extensions": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "agent"
              },
              "value": {
                "$ref": "agents.schema.json",
                "not": {
                  "required": [
                    "extensions"
                  ]
                }
              }
            }
          },
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "company"
              },
              "value": {
                "type": "string"
              }
            }
          },
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "drug_name_brand"
              },
              "value": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "drug_name_generic"
              },
              "value": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "first_publication_date"
              },
              "value": {
                "$ref": "#/$defs/iso_date_or_null"
              }
            }
          },
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "publication_date"
              },
              "value": {
                "$ref": "#/$defs/iso_date_or_null"
              }
            }
          },
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "regulatory_identifier"
              },
              "value": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "status"
              },
              "value": {
                "enum": [
                  "Active",
                  "Deprecated"
                ]
              }
            }
          }
        ]
      },
      "allOf": [
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "agent"
              },
              "value": {
                "$ref": "agents.schema.json",
                "not": {
                  "required": [
                    "extensions"
                  ]
                }
              }
            }
          }
        },
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "company"
              },
              "value": {
                "type": "string"
              }
            }
          }
        },
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "drug_name_brand"
              },
              "value": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        },
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "drug_name_generic"
              },
              "value": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        },
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "first_publication_date"
              },
              "value": {
                "$ref": "#/$defs/iso_date_or_null"
              }
            }
          }
        },
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "publication_date"
              },
              "value": {
                "$ref": "#/$defs/iso_date_or_null"
              }
            }
          }
        },
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "regulatory_identifier"
              },
              "value": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        },
        {
          "contains": {
            "$ref": "extension.schema.json",
            "properties": {
              "name": {
                "const": "status"
              },
              "value": {
                "enum": [
                  "Active",
                  "Deprecated"
                ]
              }
            }
          }
        }
      ]
    }
  },
  "required": [
    "id",
    "type",
    "documentType",
    "name",
    "title",
    "aliases",
    "description",
    "urls",
    "doi",
    "pmid",
    "extensions"
  ],
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "pattern": "^doc:fda:"
          }
        }
      },
      "then": {
        "properties": {
          "extensions": {
            "contains": {
              "$ref": "extension.schema.json",
              "properties": {
                "name": {
                  "const": "regulatory_identifier"
                },
                "value": {
                  "type": "string",
                  "pattern": "^(BLA|NDA)[0-9]{6}$"
                }
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "iso_date_or_null": {
      "description": "An ISO 8601 date (YYYY-MM-DD) or null.",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "format": "date"
        }
      ]
    }
  }
}