{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/elation-health/main/json-schema/elation-health-patient-family-history-schema.json",
  "title": "PatientFamilyHistory",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elation-health-family-histories-api-openapi.yml#/components/schemas/PatientFamilyHistory",
  "properties": {
    "created_date": {
      "description": "The date the family history was created.",
      "format": "date-time",
      "readOnly": true,
      "type": [
        "string",
        "null"
      ]
    },
    "deleted_date": {
      "description": "The date the family history was deleted.",
      "format": "date-time",
      "readOnly": true,
      "type": [
        "string",
        "null"
      ]
    },
    "icd9_code": {
      "description": "The icd9 code of the family history.",
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "readOnly": true,
      "type": "integer"
    },
    "patient": {
      "description": "The id of the patient.",
      "format": "int64",
      "type": "integer"
    },
    "rank": {
      "type": "integer"
    },
    "relationship": {
      "allOf": [
        {
          "$ref": "#/$defs/PatientFamilyHistoryRelationshipEnum"
        }
      ],
      "description": "The relationship of the family member of the family history."
    },
    "snomed_code": {
      "description": "The SNOMED code for the family history.",
      "type": [
        "string",
        "null"
      ]
    },
    "text": {
      "description": "The value (or text) of the family history.",
      "type": "string"
    }
  },
  "required": [
    "patient",
    "relationship"
  ],
  "type": "object",
  "$defs": {
    "PatientFamilyHistoryRelationshipEnum": {
      "enum": [
        "Aunt",
        "Brother",
        "Daughter",
        "Father",
        "Grandfather",
        "Grandmother",
        "Mother",
        "Other",
        "Sister",
        "Son",
        "Uncle"
      ],
      "type": "string"
    }
  }
}