{
  "resourceType": "StructureDefinition",
  "id": "cqf-relativeDateTime",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "fhir"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 1
    }
  ],
  "url": "http://hl7.org/fhir/StructureDefinition/cqf-relativeDateTime",
  "version": "4.0.0",
  "name": "relativeDateTime",
  "status": "draft",
  "date": "2015-05-30",
  "publisher": "Health Level Seven, Inc. - CDS WG",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/special/committees/dss"
        }
      ]
    }
  ],
  "description": "A date/time value that is determined based on a duration offset from a target event.",
  "fhirVersion": "4.0.0",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "Element"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "A date/time that is specified relative to another event",
        "definition": "A date/time value that is determined based on a duration offset from a target event.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:target",
        "path": "Extension.extension",
        "sliceName": "target",
        "short": "Relative to what event",
        "definition": "The event that the date/time value is relative to.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "id": "Extension.extension:target.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:target.url",
        "path": "Extension.extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "target"
      },
      {
        "id": "Extension.extension:target.valueReference",
        "path": "Extension.extension.valueReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Resource"
            ]
          }
        ]
      },
      {
        "id": "Extension.extension:targetPath",
        "path": "Extension.extension",
        "sliceName": "targetPath",
        "short": "Relative to which element on the event",
        "definition": "The path to the element that defines the effective period for the event that the date/time value is relative to.",
        "comment": "The specified path must be resolvable from the type of the target. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "id": "Extension.extension:targetPath.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:targetPath.url",
        "path": "Extension.extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "targetPath"
      },
      {
        "id": "Extension.extension:targetPath.valueString",
        "path": "Extension.extension.valueString",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:relationship",
        "path": "Extension.extension",
        "sliceName": "relationship",
        "short": "before-start | before | before-end | concurrent-with-start | concurrent | concurrent-with-end | after-start | after | after-end",
        "definition": "The relationship to the effective period of the target event that the date/time value is relative to.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "id": "Extension.extension:relationship.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:relationship.url",
        "path": "Extension.extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "relationship"
      },
      {
        "id": "Extension.extension:relationship.valueCode",
        "path": "Extension.extension.valueCode",
        "type": [
          {
            "code": "code"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ActionRelationshipType"
            }
          ],
          "strength": "required",
          "description": "A type that describes how two events are related in time.",
          "valueSet": "http://hl7.org/fhir/ValueSet/action-relationship-type|4.0.0"
        }
      },
      {
        "id": "Extension.extension:offset",
        "path": "Extension.extension",
        "sliceName": "offset",
        "short": "How long",
        "definition": "A duration or range of durations that specifies the offset between the date/time value and the target event. For example, 30-60 minutes before.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "id": "Extension.extension:offset.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:offset.url",
        "path": "Extension.extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "offset"
      },
      {
        "id": "Extension.extension:offset.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Duration"
          },
          {
            "code": "Range"
          }
        ]
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/cqf-relativeDateTime"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "min": 0,
        "max": "0"
      }
    ]
  }
}