<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="pr-medication-statement" />
  <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-medication-statement" />
  <version value="1.00" />
  <name value="MedicationStatement" />
  <title value="Profile: Medication Statement" />
  <status value="active" />
  <experimental value="false" />
  <date value="2022-07-27" />
  <publisher value="b.Well Connected Health" />
  <description value="User-entered declarations of medication usage, whether it be an authorized prescription or other OTC substances" />
  <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="MedicationStatement" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationStatement">
      <path value="MedicationStatement" />
    </element>
    <element id="MedicationStatement.id">
      <path value="MedicationStatement.id" />
    </element>
    <element id="MedicationStatement.meta">
      <path value="MedicationStatement.meta" />
      <label value="meta" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Meta" />
      </type>
    </element>
    <element id="MedicationStatement.meta.source">
      <path value="MedicationStatement.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="MedicationStatement.meta.security">
      <path value="MedicationStatement.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-identifier">
      <path value="MedicationStatement.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="MedicationStatement.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="MedicationStatement.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="MedicationStatement.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="MedicationStatement.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="MedicationStatement.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-rx-number">
      <path value="MedicationStatement.identifier" />
      <sliceName value="identifier-rx-number" />
      <label value="identifier-rx-number" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
      </code>
      <short value="The prescription (rx) number" />
      <requirements value="system = source URI" />
      <type>
        <code value="Identifier" />
      </type>
      <example>
        <label value="RX Number" />
        <valueIdentifier id="rx-number">
          <type>
            <coding id="rx-number-type">
              <system value="https://fhir.icanbwell.com/4_0_0/CodeSystem/vs-identifier-type" />
              <code value="RX" />
            </coding>
          </type>
        </valueIdentifier>
      </example>
    </element>
    <element id="MedicationStatement.partOf">
      <path value="MedicationStatement.partOf" />
      <short value="Correlates to another resource, such as MedicationDispense" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-medication-dispense" />
      </type>
    </element>
    <element id="MedicationStatement.status">
      <path value="MedicationStatement.status" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
    </element>
    <element id="MedicationStatement.category">
      <path value="MedicationStatement.category" />
      <requirements value="If user-entry, patientspecified | http://terminology.hl7.org/CodeSystem/medication-statement-category" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="MedicationStatement.medication[x]">
      <path value="MedicationStatement.medication[x]" />
      <short value="The value representing the medication" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <type>
        <code value="Reference" />
      </type>
    </element>
    <element id="MedicationStatement.subject">
      <path value="MedicationStatement.subject" />
      <short value="The patient" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient" />
      </type>
    </element>
    <element id="MedicationStatement.effectivePeriod">
      <path value="MedicationStatement.effective[x]" />
      <short value="When the medication was taken" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Period" />
      </type>
    </element>
    <element id="MedicationStatement.dateAsserted">
      <path value="MedicationStatement.dateAsserted" />
      <short value="When the statement was made" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element id="MedicationStatement.informationSource">
      <path value="MedicationStatement.informationSource" />
      <short value="A reference to the source, when known" />
      <requirements value="Reference the patient when user-entry" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-organization" />
      </type>
    </element>
    <element id="MedicationStatement.dosage">
      <path value="MedicationStatement.dosage" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Dosage" />
      </type>
    </element>
    <element id="MedicationStatement.dosage.patientInstruction">
      <path value="MedicationStatement.dosage.patientInstruction" />
      <short value="Specific dosage instruction or verbal instruction given to the patient" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
  </differential>
</StructureDefinition>