{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/elation-health/main/json-schema/elation-health-non-visit-note-schema.json",
  "title": "NonVisitNote",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elation-health-non-visit-notes-api-openapi.yml#/components/schemas/NonVisitNote",
  "properties": {
    "bullets": {
      "description": "The bullets of the non visit note.",
      "items": {
        "$ref": "#/$defs/NonVisitNoteBullet"
      },
      "type": "array"
    },
    "chart_date": {
      "format": "date-time",
      "type": "string"
    },
    "created_date": {
      "format": "date-time",
      "readOnly": true,
      "type": [
        "string",
        "null"
      ]
    },
    "deleted_date": {
      "format": "date-time",
      "readOnly": true,
      "type": [
        "string",
        "null"
      ]
    },
    "document_date": {
      "format": "date-time",
      "type": "string"
    },
    "id": {
      "readOnly": true,
      "type": "integer"
    },
    "note_documents": {
      "description": "The documents referenced by the non visit note.",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/NonVisitNoteDocument"
          },
          {
            "type": "null"
          }
        ]
      },
      "type": "array"
    },
    "note_items": {
      "description": "The items in the clinical record on the left hand side of the chart referenced by the non visit note.",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/NonVisitNotePatientItem"
          },
          {
            "type": "null"
          }
        ]
      },
      "type": "array"
    },
    "patient": {
      "format": "int64",
      "type": "integer"
    },
    "signed_by": {
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "signed_date": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "description": "The ids of the document tags you want to attach.",
      "items": {
        "format": "int64",
        "type": "integer"
      },
      "type": "array"
    },
    "type": {
      "description": "The type of the non visit note.",
      "type": "string"
    }
  },
  "required": [
    "chart_date",
    "document_date",
    "patient",
    "type"
  ],
  "type": "object",
  "$defs": {
    "Document": {
      "properties": {
        "authoring_practice": {
          "format": "int64",
          "type": "integer"
        },
        "chart_date": {
          "description": "The creation date of the patient chart.",
          "format": "date-time",
          "type": "string"
        },
        "created_date": {
          "description": "The creation date of the document.",
          "format": "date-time",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "deleted_date": {
          "description": "The deleted date of the document.",
          "format": "date-time",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "document_date": {
          "description": "The date of the document. In most cases it's the same as the creation date. For some documents, like visit notes, it's the date of the visit note.",
          "format": "date-time",
          "type": "string"
        },
        "document_type": {
          "readOnly": true,
          "type": [
            "integer",
            "null"
          ]
        },
        "id": {
          "format": "int64",
          "type": "integer"
        },
        "last_modified": {
          "format": "date-time",
          "type": "string"
        },
        "patient": {
          "format": "int64",
          "type": "integer"
        },
        "sign_date": {
          "description": "The date of when the document was signed (if signed).",
          "format": "date-time",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "signed_by": {
          "description": "The id of whoever signed the document (if signed).",
          "readOnly": true,
          "type": "integer"
        }
      },
      "required": [
        "authoring_practice",
        "chart_date",
        "document_date",
        "id",
        "patient"
      ],
      "type": "object"
    },
    "NonVisitNoteBullet": {
      "properties": {
        "author": {
          "description": "The author of the bullet.",
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "text": {
          "description": "The text of the bullet.",
          "type": "string"
        },
        "updated_date": {
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "version": {
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    },
    "NonVisitNoteDocument": {
      "properties": {
        "document": {
          "$ref": "#/$defs/Document"
        },
        "id": {
          "readOnly": true,
          "type": "integer"
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "document"
      ],
      "type": "object"
    },
    "NonVisitNotePatientItem": {
      "properties": {
        "id": {
          "readOnly": true,
          "type": "integer"
        },
        "item": {
          "$ref": "#/$defs/PatientItem"
        }
      },
      "required": [
        "item"
      ],
      "type": "object"
    },
    "PatientItem": {
      "properties": {
        "created_date": {
          "format": "date-time",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "deleted_date": {
          "format": "date-time",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "readOnly": true,
          "type": "integer"
        },
        "is_confidential": {
          "type": "boolean"
        },
        "patient": {
          "format": "int64",
          "type": "integer"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "is_confidential",
        "patient",
        "type"
      ],
      "type": "object"
    }
  }
}