{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/independence-blue-cross/refs/heads/main/json-schema/independence-blue-cross-patient-schema.json",
  "title": "IBX Patient (US Core 3.1.1 subset)",
  "description": "Operational subset of the FHIR R4 Patient resource as published by Independence Blue Cross at https://eapics.ibx.com/patient/v1/fhir/Patient. Anchored to the US Core 3.1.1 Patient profile referenced in the published CapabilityStatement.",
  "type": "object",
  "required": ["resourceType", "id"],
  "properties": {
    "resourceType": {"type": "string", "const": "Patient"},
    "id": {"type": "string", "description": "Logical id of the Patient resource."},
    "identifier": {
      "type": "array",
      "description": "Member identifier(s) including IBX subscriber/member id.",
      "items": {
        "type": "object",
        "properties": {
          "system": {"type": "string", "format": "uri"},
          "value": {"type": "string"}
        }
      }
    },
    "active": {"type": "boolean"},
    "name": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "use": {"type": "string", "enum": ["usual", "official", "temp", "nickname", "anonymous", "old", "maiden"]},
          "family": {"type": "string"},
          "given": {"type": "array", "items": {"type": "string"}}
        }
      }
    },
    "telecom": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "system": {"type": "string", "enum": ["phone", "fax", "email", "pager", "url", "sms", "other"]},
          "value": {"type": "string"},
          "use": {"type": "string", "enum": ["home", "work", "temp", "old", "mobile"]}
        }
      }
    },
    "gender": {"type": "string", "enum": ["male", "female", "other", "unknown"]},
    "birthDate": {"type": "string", "format": "date"},
    "address": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "use": {"type": "string"},
          "line": {"type": "array", "items": {"type": "string"}},
          "city": {"type": "string"},
          "state": {"type": "string"},
          "postalCode": {"type": "string"},
          "country": {"type": "string"}
        }
      }
    },
    "communication": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "language": {
            "type": "object",
            "properties": {
              "coding": {"type": "array"}
            }
          },
          "preferred": {"type": "boolean"}
        }
      }
    }
  },
  "x-fhir-version": "4.0.1",
  "x-source-capability-statement": "https://eapics.ibx.com/patient/v1/fhir/metadata",
  "x-source-profile": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
}
