﻿{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/Person",
  "$ref": "#/definitions/Person",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "Person": {
      "allOf": [
        {
          "$ref": "DomainResource.schema.json/definitions/DomainResource"
        },
        {
          "description": "Demographics and administrative information about a person independent of a specific health-related context.",
          "properties": {
            "resourceType": {
              "description": "This is a Person resource",
              "type": "string",
              "enum": [
                "Person"
              ]
            },
            "identifier": {
              "description": "Identifier for a person within a particular scope.",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json/definitions/Identifier"
              }
            },
            "name": {
              "description": "A name associated with the person.",
              "type": "array",
              "items": {
                "$ref": "HumanName.schema.json/definitions/HumanName"
              }
            },
            "telecom": {
              "description": "A contact detail for the person, e.g. a telephone number or an email address.",
              "type": "array",
              "items": {
                "$ref": "ContactPoint.schema.json/definitions/ContactPoint"
              }
            },
            "gender": {
              "description": "Administrative Gender.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "gender_": {
              "description": "Extensions for gender",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "birthDate": {
              "description": "The birth date for the person.",
              "type": "string",
              "pattern": "-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?"
            },
            "birthDate_": {
              "description": "Extensions for birthDate",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "address": {
              "description": "One or more addresses for the person.",
              "type": "array",
              "items": {
                "$ref": "Address.schema.json/definitions/Address"
              }
            },
            "photo": {
              "description": "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.",
              "$ref": "Attachment.schema.json/definitions/Attachment"
            },
            "managingOrganization": {
              "description": "The organization that is the custodian of the person record.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "active": {
              "description": "Whether this person\u0027s record is in active use.",
              "type": "true | false"
            },
            "active_": {
              "description": "Extensions for active",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "link": {
              "description": "Link to a resource that concerns the same actual person.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/Person.Link"
              }
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "Person.Link": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "Demographics and administrative information about a person independent of a specific health-related context.",
          "properties": {
            "target": {
              "description": "The resource to which this actual person is associated.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "assurance": {
              "description": "Level of assurance that this link is actually associated with the target resource.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "assurance_": {
              "description": "Extensions for assurance",
              "$ref": "Element.schema.json/definitions/Element"
            }
          },
          "required": [
            "target"
          ]
        }
      ]
    }
  }
}