<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="shr-core-RecurrenceRange-extension" />
  <text>
    <status value="generated" />
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>
        <b>SHR RecurrenceRange Extension</b>
      </p>
      <p>The start and end of the overall recurrence pattern in terms of dates/times or in terms of number of repeats. Could also be an event, such as when all doses are taken.</p>
    </div>
  </text>
  <url value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-RecurrenceRange-extension" />
  <identifier>
    <system value="http://standardhealthrecord.org" />
    <value value="shr.core.RecurrenceRange" />
  </identifier>
  <version value="0.0.1" />
  <name value="SHR RecurrenceRange Extension" />
  <title value="SHR RecurrenceRange Extension" />
  <status value="draft" />
  <date value="2017-12-20" />
  <publisher value="The MITRE Corporation: Standard Health Record Collaborative" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://standardhealthrecord.org" />
    </telecom>
  </contact>
  <description value="The start and end of the overall recurrence pattern in terms of dates/times or in terms of number of repeats. Could also be an event, such as when all doses are taken." />
  <fhirVersion value="3.0.1" />
  <kind value="complex-type" />
  <abstract value="false" />
  <contextType value="resource" />
  <context value="*" />
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension:recurrencerange">
      <path value="Extension" />
      <short value="SHR RecurrenceRange Extension" />
      <definition value="The start and end of the overall recurrence pattern in terms of dates/times or in terms of number of repeats. Could also be an event, such as when all doses are taken." />
      <min value="0" />
      <max value="*" />
      <constraint>
        <key value="choice-1" />
        <severity value="error" />
        <human value="shr-core-RecurrenceRange-extension SHALL have either extension('timeperiod') or extension('numberofrepeats')" />
        <expression value="( extension('timeperiod').url | extension('numberofrepeats').url ).distinct().count() == 1" />
      </constraint>
    </element>
    <element id="Extension:recurrencerange.extension:timeperiod">
      <path value="Extension.extension" />
      <sliceName value="timeperiod" />
      <definition value="A period of time defined by a start and end time, date, or year. If the start element is missing, the start of the period is not known. If the end element is missing, it means that the period is ongoing, or the start may be in the past, and the end date in the future, which means that period is expected/planned to end at the specified time. The end value includes any matching date/time. For example, the period 2011-05-23 to 2011-05-27 includes all the times from the start of the 23rd May through to the end of the 27th of May." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-TimePeriod-extension" />
      </type>
    </element>
    <element id="Extension:recurrencerange.extension:numberofrepeats">
      <path value="Extension.extension" />
      <sliceName value="numberofrepeats" />
      <definition value="How many times the action should be repeated." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-NumberOfRepeats-extension" />
      </type>
    </element>
    <element id="Extension:recurrencerange.url">
      <path value="Extension.url" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-RecurrenceRange-extension" />
    </element>
    <element id="Extension:recurrencerange.value[x]">
      <path value="Extension.value[x]" />
      <min value="0" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>