<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="pr-schedule" />
  <meta>
    <source value="https://www.icanbwell.com/fhir_profile_definitions" />
    <security>
      <system value="https://www.icanbwell.com/owner" />
      <code value="bwell" />
    </security>
    <security>
      <system value="https://www.icanbwell.com/access" />
      <code value="bwell" />
    </security>
  </meta>
  <url value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-schedule" />
  <version value="1.02" />
  <name value="Schedule" />
  <title value="Profile: Schedule" />
  <status value="active" />
  <experimental value="false" />
  <date value="2022-06-02" />
  <publisher value="b.Well Connected Health" />
  <description value="Schedule resource for provider search &amp; online booking" />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="US" />
      <display value="United States of America" />
    </coding>
    <text value="United States of America" />
  </jurisdiction>
  <fhirVersion value="4.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Schedule" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Schedule" />
  <derivation value="constraint" />
  <differential>
    <element id="Schedule">
      <path value="Schedule" />
    </element>
    <element id="Schedule.id">
      <path value="Schedule.id" />
    </element>
    <element id="Schedule.meta">
      <path value="Schedule.meta" />
      <label value="meta" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Meta" />
      </type>
    </element>
    <element id="Schedule.meta.source">
      <path value="Schedule.meta.source" />
      <sliceName value="meta-source" />
      <label value="meta" />
      <short value="uri of the data source" />
      <definition value="Typically the data owner's URL followed by a source/file description" />
      <requirements value="mandatory for all resources in bWell's FHIR Server" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <example>
        <label value="example of meta.source" />
        <valueUri value="https://www.icanbwell.com/provider-directory" />
      </example>
    </element>
    <element id="Schedule.meta.security">
      <path value="Schedule.meta.security" />
      <sliceName value="meta-security" />
      <label value="meta" />
      <short value="security tags representing the data's owner, vendor, and accessibility" />
      <definition value="data owner: &#xA; &#xA; data vendor: &#xA; &#xA; data access:" />
      <requirements value="/owner &amp; /access are mandatory for all resources in bWell's FHIR Server" />
      <min value="1" />
      <max value="*" />
      <type>
        <code value="Coding" />
      </type>
      <example>
        <label value="example of data owner security tag" />
        <valueCoding>
          <system value="https://www.icanbwell.com/owner" />
          <code value="bwell" />
        </valueCoding>
      </example>
      <example>
        <label value="example of data access security tag" />
        <valueCoding>
          <system value="https://www.icanbwell.com/access" />
          <code value="bwell" />
        </valueCoding>
      </example>
      <example>
        <label value="example of data vendor security tag" />
        <valueCoding>
          <system value="https://www.icanbwell.com/vendor" />
          <code value="bwell" />
        </valueCoding>
      </example>
    </element>
    <element id="de-extension-any">
      <path value="Schedule.extension" />
      <label value="extension-any" />
      <slicing>
        <description value="slice by types" />
        <rules value="open" />
      </slicing>
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="de-extension-any.id">
      <path value="Schedule.extension.id" />
      <label value="extension-any" />
      <short value="defined case-by-case, but is frequently the extension url" />
      <min value="1" />
    </element>
    <element id="de-extension-any.extension">
      <path value="Schedule.extension.extension" />
      <label value="extension-any" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="de-extension-any.url">
      <path value="Schedule.extension.url" />
      <label value="extension-any" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="de-extension-any.value[x]">
      <path value="Schedule.extension.value[x]" />
      <label value="extension-any" />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="extension-provider-search">
      <path value="Schedule.extension" />
      <sliceName value="provider-search" />
      <label value="provider-search" />
      <short value="extension container for provider search characteristics per system" />
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="extension-provider-search.id">
      <path value="Schedule.extension.id" />
      <label value="provider-search" />
      <short value="providersearch" />
      <min value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="extension-provider-search.extension-search-system">
      <path value="Schedule.extension.extension" />
      <sliceName value="search-system" />
      <label value="provider-search-search-system" />
      <short value="extension(s) to indicate the provider search system" />
      <requirements value="Indicate the provider search system URI, in case the provider instance belongs to feeds more than one search system" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="extension-provider-search.extension-search-system.id">
      <path value="Schedule.extension.extension.id" />
      <label value="provider-search-search-system" />
      <short value="forsystem" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="extension-provider-search.extension-search-system.url">
      <path value="Schedule.extension.extension.url" />
      <label value="provider-search-search-system" />
      <short value="fixed value: forSystem" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="forSystem" />
    </element>
    <element id="extension-provider-search.extension-search-system.valueUri">
      <path value="Schedule.extension.extension.valueUri" />
      <label value="provider-search-search-system" />
      <short value="uri / url of the search system" />
      <requirements value="Although the context of this already implies it's for the Helix Provider Search Service, this field was included in the definition to specify which front end version of PSS. This would accommodate clients in the event they have more than one portal with us." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
    </element>
    <element id="extension-provider-search.extension-searchable">
      <path value="Schedule.extension.extension" />
      <sliceName value="searchable" />
      <label value="provider-search-searchable" />
      <short value="extension(s) for a coded characteristic" />
      <definition value="a list of characteristics to describe the behavior and/or visibility of the record. Examples: online bookable; provider searchable" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="extension-provider-search.extension-searchable.id">
      <path value="Schedule.extension.extension.id" />
      <label value="provider-search-searchable" />
      <short value="searchable" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="extension-provider-search.extension-searchable.url">
      <path value="Schedule.extension.extension.url" />
      <label value="provider-search-searchable" />
      <short value="fixed value: searchCharacteristic" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="searchCharacteristic" />
    </element>
    <element id="extension-provider-search.extension-searchable.valueCodeableConcept">
      <path value="Schedule.extension.extension.valueCodeableConcept" />
      <label value="provider-search-searchable" />
      <short value="searchable | hide-from-search" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="extension-provider-search.extension-bookable">
      <path value="Schedule.extension.extension" />
      <sliceName value="bookable" />
      <label value="provider-search-bookable" />
      <short value="extension(s) for coded bookablity characteristics" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="extension-provider-search.extension-bookable.id">
      <path value="Schedule.extension.extension.id" />
      <label value="provider-search-bookable" />
      <short value="bookable" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="extension-provider-search.extension-bookable.url">
      <path value="Schedule.extension.extension.url" />
      <label value="provider-search-bookable" />
      <short value="fixed value: bookable" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="bookable" />
    </element>
    <element id="extension-provider-search.extension-bookable.valueCodeableConcept">
      <path value="Schedule.extension.extension.valueCodeableConcept" />
      <label value="provider-search-bookable" />
      <short value="bookable-phone | bookable-online" />
      <requirements value="through the Coding object, multiple codes can be assigned" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <example>
        <label value="provider is online bookable and has 'call to book' option" />
        <valueCodeableConcept>
          <coding id="bookable-phone">
            <system value="https://raw.githubusercontent.com/imranq2/SparkAutoMapper.FHIR/main/ValueSet/search_characteristic" />
            <code value="bookable-phone" />
          </coding>
          <coding id="bookable-online">
            <system value="https://raw.githubusercontent.com/imranq2/SparkAutoMapper.FHIR/main/ValueSet/search_characteristic" />
            <code value="bookable-online" />
          </coding>
        </valueCodeableConcept>
      </example>
      <example>
        <label value="epic open scheduling" />
        <valueCodeableConcept>
          <coding id="bookable-phone">
            <system value="https://raw.githubusercontent.com/imranq2/SparkAutoMapper.FHIR/main/ValueSet/search_characteristic" />
            <code value="bookable-phone" />
          </coding>
          <coding id="bookable-online">
            <system value="https://raw.githubusercontent.com/imranq2/SparkAutoMapper.FHIR/main/ValueSet/search_characteristic" />
            <code value="bookable-online" />
          </coding>
          <coding id="epic-scheduling">
            <system value="https://healthcaresystem.org/epic/scheduling_type" />
            <code value="open" />
          </coding>
        </valueCodeableConcept>
      </example>
    </element>
    <element id="extension-provider-search.url">
      <path value="Schedule.extension.url" />
      <label value="provider-search" />
      <short value="fixed value: https://raw.githubusercontent.com/imranq2/SparkAutoMapper.FHIR/main/StructureDefinition/provider_search" />
      <min value="1" />
      <max value="1" />
      <fixedUri value="https://raw.githubusercontent.com/imranq2/SparkAutoMapper.FHIR/main/StructureDefinition/provider_search" />
    </element>
    <element id="extension-provider-search.value[x]">
      <path value="Schedule.extension.value[x]" />
      <max value="0" />
    </element>
    <element id="de-identifier">
      <path value="Schedule.identifier" />
      <label value="identifier" />
      <slicing>
        <description value="slice by types" />
        <rules value="open" />
      </slicing>
      <short value="a value to identify the resource by" />
      <type>
        <code value="Identifier" />
      </type>
    </element>
    <element id="identifier.id">
      <path value="Schedule.identifier.id" />
      <label value="identifier" />
      <short value="set case-by-case" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="identifier.use">
      <path value="Schedule.identifier.use" />
      <label value="identifier" />
      <short value="usual | official | temp | secondary | old (If known)" />
      <definition value="The purpose of this identifier." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
    </element>
    <element id="identifier.type">
      <path value="Schedule.identifier.type" />
      <label value="identifier" />
      <short value="Description of identifier" />
      <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." />
      <requirements value="Needs binding valueset" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="identifier.system">
      <path value="Schedule.identifier.system" />
      <label value="identifier" />
      <short value="The system which created the identifier" />
      <definition value="Values may be an oid, uri, url, or canonical" />
      <comment value="for mapped data, this is frequently a canonical url" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <example>
        <label value="a client's unknown system" />
        <valueUri value="https://www.health.org/person-identifier" />
      </example>
    </element>
    <element id="identifier.value">
      <path value="Schedule.identifier.value" />
      <label value="identifier" />
      <short value="The unique value" />
      <definition value="The raw identifier value that represents a resource" />
      <requirements value="This should be the raw value, as it exists in the source data (ie without prefix)" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="de-npi">
      <path value="Schedule.identifier" />
      <sliceName value="npi" />
      <label value="npi" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <short value="NPI of a practitioner or organization" />
      <definition value="national provider identifier as defined by nppes" />
      <type>
        <code value="Identifier" />
      </type>
      <patternIdentifier id="npi">
        <use value="official" />
        <type>
          <coding id="type-npi">
            <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
            <code value="NPI" />
          </coding>
        </type>
        <system value="http://hl7.org/fhir/sid/us-npi" />
      </patternIdentifier>
    </element>
    <element id="de-identifier-facility-id">
      <path value="Schedule.identifier" />
      <sliceName value="facility-id" />
      <label value="facility-id" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <short value="external source id for the location" />
      <definition value="raw value used by the data source to identify the record" />
      <requirements value="system = source URI" />
      <alias value="location identifier" />
      <alias value="practice identifier" />
      <min value="1" />
      <type>
        <code value="Identifier" />
      </type>
      <patternIdentifier id="facility-id">
        <type>
          <coding id="facility-id">
            <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
            <code value="FI" />
          </coding>
        </type>
      </patternIdentifier>
    </element>
    <element id="de-provider-id">
      <path value="Schedule.identifier" />
      <sliceName value="provider-id" />
      <label value="provider-id" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <short value="external source id for the practitioner" />
      <definition value="raw value used by the data source to identify the practitioner" />
      <requirements value="system = source URI" />
      <alias value="practitioner identifier" />
      <alias value="ehr identifier" />
      <alias value="prn" />
      <min value="0" />
      <type>
        <code value="Identifier" />
      </type>
      <patternIdentifier id="provider-id">
        <type>
          <coding id="provider-id">
            <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
            <code value="PRN" />
          </coding>
        </type>
      </patternIdentifier>
    </element>
    <element id="Schedule.active">
      <path value="Schedule.active" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="integrated-scheduling" />
      </code>
      <short value="active flag" />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Schedule.serviceType">
      <path value="Schedule.serviceType" />
      <label value="visit-type" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="integrated-scheduling" />
      </code>
      <short value="the type of visit (appointment)" />
      <definition value="includes scheduling appointment types, triage groups and protocols" />
      <requirements value="Needs Review for integrated scheduling requirements" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Schedule.actor">
      <path value="Schedule.actor" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="integrated-scheduling" />
      </code>
      <slicing>
        <description value="slice by type" />
        <rules value="open" />
      </slicing>
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-healthcare-service" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-practitioner-role" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Schedule.actor-facility">
      <path value="Schedule.actor" />
      <sliceName value="actor-facility" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="integrated-scheduling" />
      </code>
      <short value="The healthcare facility the schedule pertains to" />
      <definition value="Use in instances where the schedule applies to the facility as a whole (and not any specific practitioner)" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-healthcare-service" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Schedule.actor-practitioner">
      <path value="Schedule.actor" />
      <sliceName value="actor-practitioner" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="provider-search" />
      </code>
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="integrated-scheduling" />
      </code>
      <short value="The practitioner the schedule pertains to" />
      <definition value="Use in instances where the schedule applies to a specific practitioner (at a specific healthcare location)" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-practitioner-role" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>