{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/elation-health/main/json-schema/elation-health-visit-note-2-schema.json",
  "title": "VisitNote_2",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elation-health-visit-notes-api-openapi.yml#/components/schemas/VisitNote_2",
  "allOf": [
    {
      "$ref": "#/$defs/VisitNoteCreate"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64",
          "readOnly": true
        },
        "checklists": {
          "type": "object",
          "description": "PE and ROS checklist items"
        },
        "edits": {
          "type": "array",
          "readOnly": true,
          "items": {
            "type": "object"
          }
        },
        "signatures": {
          "type": "array",
          "readOnly": true,
          "items": {
            "type": "object"
          }
        },
        "signed_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "signed_by": {
          "type": [
            "integer",
            "null"
          ]
        },
        "amendment_request": {
          "type": [
            "object",
            "null"
          ]
        },
        "created_date": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "last_modified": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "clinical_summary_link": {
          "type": "string",
          "format": "uri",
          "readOnly": true
        },
        "visit_summary_link": {
          "type": "string",
          "format": "uri",
          "readOnly": true
        }
      }
    }
  ],
  "$defs": {
    "VisitNoteCreate": {
      "type": "object",
      "required": [
        "patient",
        "physician",
        "practice",
        "document_date",
        "chart_date",
        "template"
      ],
      "properties": {
        "patient": {
          "type": "integer",
          "format": "int64",
          "description": "Patient ID"
        },
        "physician": {
          "type": "integer",
          "format": "int64",
          "description": "Clinician ID"
        },
        "practice": {
          "type": "integer",
          "format": "int64",
          "description": "Practice ID"
        },
        "document_date": {
          "type": "string",
          "format": "date-time",
          "description": "Clinical service date"
        },
        "chart_date": {
          "type": "string",
          "format": "date-time",
          "description": "Date entry was recorded in chart"
        },
        "template": {
          "type": "string",
          "enum": [
            "Simple",
            "SOAP",
            "Complete H&P",
            "Pre-Op"
          ],
          "description": "Document structure format"
        },
        "type": {
          "type": "string",
          "maxLength": 50,
          "description": "Visit note classification"
        },
        "bullets": {
          "type": "array",
          "description": "Clinical bullet points organized by category",
          "items": {
            "type": "object",
            "properties": {
              "category": {
                "type": "string"
              },
              "text": {
                "type": "string",
                "maxLength": 500
              }
            }
          }
        },
        "confidential": {
          "type": "boolean",
          "description": "Privacy flag for sensitive content"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}