﻿{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/DataElement",
  "$ref": "#/definitions/DataElement",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "DataElement": {
      "allOf": [
        {
          "$ref": "DomainResource.schema.json/definitions/DomainResource"
        },
        {
          "description": "The formal description of a single piece of information that can be gathered and reported.",
          "properties": {
            "resourceType": {
              "description": "This is a DataElement resource",
              "type": "string",
              "enum": [
                "DataElement"
              ]
            },
            "url": {
              "description": "An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published.",
              "type": "string"
            },
            "url_": {
              "description": "Extensions for url",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "identifier": {
              "description": "Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json/definitions/Identifier"
              }
            },
            "version": {
              "description": "The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.",
              "type": "string"
            },
            "version_": {
              "description": "Extensions for version",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "status": {
              "description": "The status of the data element.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "status_": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "experimental": {
              "description": "A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.",
              "type": "true | false"
            },
            "experimental_": {
              "description": "Extensions for experimental",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "publisher": {
              "description": "The name of the individual or organization that published the data element.",
              "type": "string"
            },
            "publisher_": {
              "description": "Extensions for publisher",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "date": {
              "description": "The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element  changes.",
              "type": "string",
              "pattern": "-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
            },
            "date_": {
              "description": "Extensions for date",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "name": {
              "description": "The term used by humans to refer to the data element.  Should ideally be unique within the context in which the data element is expected to be used.",
              "type": "string"
            },
            "name_": {
              "description": "Extensions for name",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "contact": {
              "description": "Contacts to assist a user in finding and communicating with the publisher.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/DataElement.Contact"
              }
            },
            "useContext": {
              "description": "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
              }
            },
            "copyright": {
              "description": "A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.",
              "type": "string"
            },
            "copyright_": {
              "description": "Extensions for copyright",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "stringency": {
              "description": "Identifies how precise the data element is in its definition.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "stringency_": {
              "description": "Extensions for stringency",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "mapping": {
              "description": "Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/DataElement.Mapping"
              }
            },
            "element": {
              "description": "Defines the structure, type, allowed values and other constraining characteristics of the data element.",
              "type": "array",
              "items": {
                "$ref": "ElementDefinition.schema.json/definitions/ElementDefinition"
              }
            }
          },
          "required": [
            "resourceType",
            "element"
          ]
        }
      ]
    },
    "DataElement.Contact": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "The formal description of a single piece of information that can be gathered and reported.",
          "properties": {
            "name": {
              "description": "The name of an individual to contact regarding the data element.",
              "type": "string"
            },
            "name_": {
              "description": "Extensions for name",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "telecom": {
              "description": "Contact details for individual (if a name was provided) or the publisher.",
              "type": "array",
              "items": {
                "$ref": "ContactPoint.schema.json/definitions/ContactPoint"
              }
            }
          }
        }
      ]
    },
    "DataElement.Mapping": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "The formal description of a single piece of information that can be gathered and reported.",
          "properties": {
            "identity": {
              "description": "An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.",
              "type": "string",
              "pattern": "[A-Za-z0-9\\-\\.]{1,64}"
            },
            "identity_": {
              "description": "Extensions for identity",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "uri": {
              "description": "An absolute URI that identifies the specification that this mapping is expressed to.",
              "type": "string"
            },
            "uri_": {
              "description": "Extensions for uri",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "name": {
              "description": "A name for the specification that is being mapped to.",
              "type": "string"
            },
            "name_": {
              "description": "Extensions for name",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "comment": {
              "description": "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.",
              "type": "string"
            },
            "comment_": {
              "description": "Extensions for comment",
              "$ref": "Element.schema.json/definitions/Element"
            }
          }
        }
      ]
    }
  }
}