{
  "resourceType": "StructureDefinition",
  "id": "derivation-reference",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "fhir"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 0
    }
  ],
  "url": "http://hl7.org/fhir/StructureDefinition/derivation-reference",
  "version": "4.6.0",
  "name": "DerivationReference",
  "title": "Derivation Reference",
  "status": "draft",
  "date": "2020-01-18",
  "publisher": "HL7",
  "description": "References a location within a set of source text from which the discrete information described by this Resource/Element was extracted.",
  "fhirVersion": "4.6.0",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "Resource"
    },
    {
      "type": "element",
      "expression": "Element"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "References a location within a set of source text from which the discrete information described by this Resource/Element was extracted.",
        "definition": "References a location within a set of source text from which the discrete information described by this Resource/Element was extracted.",
        "constraint": [
          {
            "key": "der-1",
            "severity": "error",
            "human": "Cannot have length if offset is missing.",
            "expression": "extension.where(url='length').exists() implies extension.where(url='offset').exists()",
            "xpath": "todo-remove-this-line-when-build-process-allows-that",
            "source": "http://hl7.org/fhir/StructureDefinition/derivation-reference"
          }
        ]
      },
      {
        "id": "Extension.extension:reference",
        "path": "Extension.extension",
        "sliceName": "reference",
        "short": "Source reference.",
        "definition": "References a location within a set of source text from which the discrete information described by this Resource/Element was extracted.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:reference.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:reference.url",
        "path": "Extension.extension.url",
        "fixedUri": "reference"
      },
      {
        "id": "Extension.extension:reference.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Reference"
          }
        ]
      },
      {
        "id": "Extension.extension:path",
        "path": "Extension.extension",
        "sliceName": "path",
        "short": "Element containing text.",
        "definition": "Corresponds to the element within the resource containing the text.",
        "comment": "Follows the FHIRPath expression syntax used for OperationOutcome. If not present, then the resource must either be a Binary or a DocumentReference (with a single content element) and the content is the text represented by the instance or the attachment.  If the DocumentReference has more than one 'content', then this path element SHALL be present to distinguish which repetition the derivation occurred from.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:path.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:path.url",
        "path": "Extension.extension.url",
        "fixedUri": "path"
      },
      {
        "id": "Extension.extension:path.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:offset",
        "path": "Extension.extension",
        "sliceName": "offset",
        "short": "Starting position.",
        "definition": "Indicates the starting position (as a count of characters) within the text where the relevant derivation began.",
        "min": 0,
        "max": "1",
        "meaningWhenMissing": "If not specified, the location at which derivation started is unknown."
      },
      {
        "id": "Extension.extension:offset.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:offset.url",
        "path": "Extension.extension.url",
        "fixedUri": "offset"
      },
      {
        "id": "Extension.extension:offset.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ]
      },
      {
        "id": "Extension.extension:length",
        "path": "Extension.extension",
        "sliceName": "length",
        "short": "Number of characters.",
        "definition": "Indicates the number of characters following the start position/beginning of the document that was used as part of the derivation process.",
        "min": 0,
        "max": "1",
        "meaningWhenMissing": "If not specified, the location at which derivation ended is unknown."
      },
      {
        "id": "Extension.extension:length.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:length.url",
        "path": "Extension.extension.url",
        "fixedUri": "length"
      },
      {
        "id": "Extension.extension:length.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ]
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/derivation-reference"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "max": "0"
      }
    ]
  }
}