<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="pr-observation-social-history" />
  <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>
  <text>
    <status value="additional" />
    <div xmlns="http://www.w3.org/1999/xhtml">A social-history observation. Includes employment history, smoking status, alcohol consumption</div>
  </text>
  <url value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-observation-social-history" />
  <version value="1.03" />
  <name value="ObservationSocialHistory" />
  <title value="Profile: Observation (Social History)" />
  <status value="active" />
  <experimental value="false" />
  <date value="2022-06-02" />
  <publisher value="b.Well Connected Health" />
  <description value="A social-history observation. Includes employment history, smoking status, alcohol consumption" />
  <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="Observation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
    </element>
    <element id="Observation.id">
      <path value="Observation.id" />
    </element>
    <element id="Observation.meta">
      <path value="Observation.meta" />
      <label value="meta" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Meta" />
      </type>
    </element>
    <element id="Observation.meta.source">
      <path value="Observation.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="Observation.meta.security">
      <path value="Observation.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="Observation.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="Observation.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="Observation.extension.extension" />
      <label value="extension-any" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="de-extension-any.url">
      <path value="Observation.extension.url" />
      <label value="extension-any" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="de-extension-any.value[x]">
      <path value="Observation.extension.value[x]" />
      <label value="extension-any" />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="extension-employer-organization">
      <path value="Observation.extension" />
      <sliceName value="employer-organization" />
      <label value="employer-organization" />
      <short value="If the observation is describing an employment history, this is a reference to the employer organization" />
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="extension-employer-organization.id">
      <path value="Observation.extension.id" />
      <label value="employer-organization" />
      <short value="employer" />
      <min value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="extension-employer-organization.url">
      <path value="Observation.extension.url" />
      <label value="employer-organization" />
      <short value="fixed value: http://hl7.org/fhir/us/odh/StructureDefinition/odh-Employer-extension" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="http://hl7.org/fhir/us/odh/StructureDefinition/odh-Employer-extension" />
    </element>
    <element id="extension-employer-organization.valueReference">
      <path value="Observation.extension.valueReference" />
      <label value="employer-organization" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-partner-organization" />
      </type>
    </element>
    <element id="de-identifier">
      <path value="Observation.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="Observation.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="Observation.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="Observation.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="Observation.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="Observation.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-employee-id">
      <path value="Observation.identifier" />
      <sliceName value="identifier-employee-id" />
      <label value="employee-id" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
        <code value="employment" />
      </code>
      <short value="employer's's unique identifier for the individual" />
      <requirements value="system = source URI" />
      <type>
        <code value="Identifier" />
      </type>
      <patternIdentifier id="employee-id">
        <type>
          <coding id="employee-id-type">
            <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
            <code value="EI" />
          </coding>
        </type>
      </patternIdentifier>
    </element>
    <element id="de-member-number">
      <path value="Observation.identifier" />
      <sliceName value="identifier-member-number" />
      <label value="identifier-member-number" />
      <code>
        <system value="https://www.icanbwell.com/product-feature-code" />
      </code>
      <short value="insurance coverage's unique identifier for the individual" />
      <requirements value="system = source URI" />
      <type>
        <code value="Identifier" />
      </type>
      <patternIdentifier id="member-number">
        <type>
          <coding id="member-number-type">
            <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
            <code value="MB" />
          </coding>
        </type>
      </patternIdentifier>
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <short value="fixed: final" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <short value="fixed: social-history" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/observation-category" />
          <code value="social-history" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <short value="A code describing the specific observation" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <example>
        <label value="employment status" />
        <valueCodeableConcept>
          <coding>
            <system value="http://loinc.org" />
            <code value="74165-2" />
            <display value="History of employment status" />
          </coding>
        </valueCodeableConcept>
      </example>
      <mustSupport value="true" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <short value="Reference to Employee or Beneficiary record" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effectivePeriod">
      <path value="Observation.effective[x]" />
      <short value="employment period (hire date / terminiation date)" />
      <definition value="When the observation is describing a employment history, a Period type should be used to represent hire and termination dates. When the observation is a single assertion in time, a dateTime type should be used to represent the assertion date." />
      <type>
        <code value="Period" />
      </type>
      <type>
        <code value="dateTime" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.value">
      <path value="Observation.value" />
      <short value="coded employment status" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://www.hl7.org/fhir/us/bwell/bwell-vs-employment-status" />
      </binding>
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
    </element>
    <element id="Observation.interpretation">
      <path value="Observation.interpretation" />
      <max value="0" />
    </element>
    <element id="Observation.bodySite">
      <path value="Observation.bodySite" />
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
    </element>
    <element id="Observation.specimen">
      <path value="Observation.specimen" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
    </element>
    <element id="Observation.referenceRange">
      <path value="Observation.referenceRange" />
      <max value="0" />
    </element>
    <element id="Observation.hasMember">
      <path value="Observation.hasMember" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Observation.component.id">
      <path value="Observation.component.id" />
      <min value="1" />
    </element>
    <element id="Observation.component.code">
      <path value="Observation.component.code" />
      <min value="1" />
    </element>
    <element id="Observation.component.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>