﻿{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/StructureDefinition",
  "$ref": "#/definitions/StructureDefinition",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "StructureDefinition": {
      "allOf": [
        {
          "$ref": "DomainResource.schema.json/definitions/DomainResource"
        },
        {
          "description": "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types.",
          "properties": {
            "resourceType": {
              "description": "This is a StructureDefinition resource",
              "type": "string",
              "enum": [
                "StructureDefinition"
              ]
            },
            "url": {
              "description": "An absolute URL that is used to identify this structure definition 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 structure definition 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 StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance  (should be globally unique OID, UUID, or URI), (if it\u0027s not possible to use the literal URI).",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json/definitions/Identifier"
              }
            },
            "version": {
              "description": "The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.",
              "type": "string"
            },
            "version_": {
              "description": "Extensions for version",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "name": {
              "description": "A free text natural language name identifying the StructureDefinition.",
              "type": "string"
            },
            "name_": {
              "description": "Extensions for name",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "display": {
              "description": "Defined so that applications can use this name when displaying the value of the extension to the user.",
              "type": "string"
            },
            "display_": {
              "description": "Extensions for display",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "status": {
              "description": "The status of the StructureDefinition.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "status_": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "experimental": {
              "description": "This StructureDefinition was 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 structure definition.",
              "type": "string"
            },
            "publisher_": {
              "description": "Extensions for publisher",
              "$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/StructureDefinition.Contact"
              }
            },
            "date": {
              "description": "The date this version of the structure definition 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 structure definition 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"
            },
            "description": {
              "description": "A free text natural language description of the StructureDefinition and its use.",
              "type": "string"
            },
            "description_": {
              "description": "Extensions for description",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "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 structure definitions.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
              }
            },
            "requirements": {
              "description": "Explains why this structure definition is needed and why it\u0027s been constrained as it has.",
              "type": "string"
            },
            "requirements_": {
              "description": "Extensions for requirements",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "copyright": {
              "description": "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.",
              "type": "string"
            },
            "copyright_": {
              "description": "Extensions for copyright",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "code": {
              "description": "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.",
              "type": "array",
              "items": {
                "$ref": "Coding.schema.json/definitions/Coding"
              }
            },
            "fhirVersion": {
              "description": "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.6.0 for this version.",
              "type": "string",
              "pattern": "[A-Za-z0-9\\-\\.]{1,64}"
            },
            "fhirVersion_": {
              "description": "Extensions for fhirVersion",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "mapping": {
              "description": "An external specification that the content is mapped to.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/StructureDefinition.Mapping"
              }
            },
            "kind": {
              "description": "Defines the kind of structure that this definition is describing.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "kind_": {
              "description": "Extensions for kind",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "abstract": {
              "description": "Whether structure this definition describes is abstract or not  - that is, whether an actual exchanged item can ever be of this type.",
              "type": "true | false"
            },
            "abstract_": {
              "description": "Extensions for abstract",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "contextType": {
              "description": "If this is an extension, Identifies the context within FHIR resources where the extension can be used.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "contextType_": {
              "description": "Extensions for contextType",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "context": {
              "description": "Identifies the types of resource or data type elements to which the extension can be applied.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "context_": {
              "description": "Extensions for context",
              "items": {
                "$ref": "Element.schema.json/definitions/Element"
              }
            },
            "type": {
              "description": "The type this structure is describes. If the derivation kind is \u0027specialization\u0027 then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "type_": {
              "description": "Extensions for type",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "baseDefinition": {
              "description": "An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.",
              "type": "string"
            },
            "baseDefinition_": {
              "description": "Extensions for baseDefinition",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "derivation": {
              "description": "How the type relates to the baseDefinition.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "derivation_": {
              "description": "Extensions for derivation",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "snapshot": {
              "description": "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.",
              "$ref": "#/definitions/StructureDefinition.Snapshot"
            },
            "differential": {
              "description": "A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.",
              "$ref": "#/definitions/StructureDefinition.Differential"
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "StructureDefinition.Contact": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types.",
          "properties": {
            "name": {
              "description": "The name of an individual to contact regarding the structure definition.",
              "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"
              }
            }
          }
        }
      ]
    },
    "StructureDefinition.Mapping": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types.",
          "properties": {
            "identity": {
              "description": "An Internal id that is used to identify this mapping set when specific mappings are made.",
              "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"
            },
            "comments": {
              "description": "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.",
              "type": "string"
            },
            "comments_": {
              "description": "Extensions for comments",
              "$ref": "Element.schema.json/definitions/Element"
            }
          }
        }
      ]
    },
    "StructureDefinition.Snapshot": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types.",
          "properties": {
            "element": {
              "description": "Captures constraints on each element within the resource.",
              "type": "array",
              "items": {
                "$ref": "ElementDefinition.schema.json/definitions/ElementDefinition"
              }
            }
          },
          "required": [
            "element"
          ]
        }
      ]
    },
    "StructureDefinition.Differential": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types.",
          "properties": {
            "element": {
              "description": "Captures constraints on each element within the resource.",
              "type": "array",
              "items": {
                "$ref": "ElementDefinition.schema.json/definitions/ElementDefinition"
              }
            }
          },
          "required": [
            "element"
          ]
        }
      ]
    }
  }
}