{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amigo/main/json-schema/amigo-patient-summary-response-schema.json",
  "title": "PatientSummaryResponse",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amigo-fhir-api-openapi.yml#/components/schemas/PatientSummaryResponse",
  "properties": {
    "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
    },
    "entity_type": {
      "type": "string",
      "title": "Entity Type"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Name"
    },
    "state": {
      "additionalProperties": true,
      "type": "object",
      "title": "State",
      "description": "Full JSONB state blob. Prefer typed fields below.",
      "deprecated": true
    },
    "event_count": {
      "type": "integer",
      "title": "Event Count"
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Event At"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name",
      "description": "Patient name"
    },
    "phone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Phone",
      "description": "Primary phone number (E.164)"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Email",
      "description": "Primary email address"
    },
    "birth_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Birth Date",
      "description": "Date of birth (YYYY-MM-DD)"
    },
    "gender": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gender",
      "description": "Gender"
    },
    "mrn": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mrn",
      "description": "Medical record number"
    }
  },
  "type": "object",
  "required": [
    "entity_id",
    "entity_type",
    "display_name",
    "event_count",
    "last_event_at"
  ]
}