<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="room2Patient" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Base.Individuals" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="patient" />
  </extension>
  <url value="http://example.org/StructureDefinition/room2Patient" />
  <version value="1.0.0" />
  <name value="Room2PatientProfile" />
  <title value="My Favorite Room 2 Patient" />
  <status value="active" />
  <description value="Always follows recommendations." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="cda" />
    <uri value="http://hl7.org/v3/cda" />
    <name value="CDA (R2)" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="loinc" />
    <uri value="http://loinc.org" />
    <name value="LOINC code for the element" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Patient" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient" />
  <derivation value="constraint" />
  <differential>
    <element id="Patient">
      <path value="Patient" />
      <definition value="This is the element description." />
    </element>
    <element id="Patient.extension">
      <path value="Patient.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.extension:birthPlace">
      <path value="Patient.extension" />
      <sliceName value="birthPlace" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/patient-birthPlace" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.extension:occupation">
      <path value="Patient.extension" />
      <sliceName value="occupation" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://example.org/StructureDefinition/occupation" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.extension:occupation.extension:occupationType">
      <path value="Patient.extension.extension" />
      <sliceName value="occupationType" />
    </element>
    <element id="Patient.extension:occupation.extension:occupationType.valueCodeableConcept">
      <path value="Patient.extension.extension.valueCodeableConcept" />
      <min value="0" />
      <max value="1" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://example.org/ValueSet/MyValueSet" />
      </binding>
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <description value="Slice based on the identifier.system value" />
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:official">
      <path value="Patient.identifier" />
      <sliceName value="official" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:official.system">
      <path value="Patient.identifier.system" />
      <min value="1" />
      <patternUri value="http://national.registry.org/ids" />
    </element>
    <element id="Patient.identifier:official.value">
      <path value="Patient.identifier.value" />
      <min value="1" />
    </element>
    <element id="Patient.identifier:hospital">
      <path value="Patient.identifier" />
      <sliceName value="hospital" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:hospital.system">
      <path value="Patient.identifier.system" />
      <min value="1" />
      <patternUri value="http://optumcare.com/ids" />
    </element>
    <element id="Patient.identifier:hospital.value">
      <path value="Patient.identifier.value" />
      <min value="1" />
    </element>
    <element id="Patient.name">
      <path value="Patient.name" />
      <min value="1" />
      <type>
        <code value="HumanName" />
        <profile value="http://example.org/StructureDefinition/room2HumanName" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.gender">
      <path value="Patient.gender" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.birthDate">
      <path value="Patient.birthDate" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address">
      <path value="Patient.address" />
      <constraint>
        <key value="PatientAddressInvariant" />
        <severity value="error" />
        <human value="If the patient has a temporary address, the period this address is in use should be filled in" />
        <expression value="(use = 'temp') implies period.exists()" />
        <xpath value="f:use or f:period" />
        <source value="http://example.org/StructureDefinition/room2Patient" />
      </constraint>
    </element>
  </differential>
</StructureDefinition>