<StructureDefinition xmlns="http://hl7.org/fhir">
  <meta>
    <lastUpdated value="2019-02-08T10:04:31.601+00:00" />
  </meta>
  <url value="http://medico-emr.net/stu3/sd/AllergyIntolerance-AllergyIntolerance-1" />
  <name value="AllergyIntolerance-AllergyIntolerance-1" />
  <status value="active" />
  <date value="2019-02-08T10:04:31.4176448+00:00" />
  <fhirVersion value="3.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="AllergyIntolerance" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" />
  <derivation value="constraint" />
  <differential>
    <element id="AllergyIntolerance.id">
      <path value="AllergyIntolerance.id" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="id" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="Format:  Allergy-####" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.id:Allergy">
      <path value="AllergyIntolerance.id" />
      <sliceName value="Allergy" />
    </element>
    <element id="AllergyIntolerance.id:Allergy.id">
      <path value="AllergyIntolerance.id.id" />
      <definition value="Format: Allergy-#####" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.id:AllergyPerCase">
      <path value="AllergyIntolerance.id" />
      <sliceName value="AllergyPerCase" />
    </element>
    <element id="AllergyIntolerance.id:AllergyPerCase.id">
      <path value="AllergyIntolerance.id.id" />
      <definition value="Format:  AllergyPerCase-####" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.meta">
      <path value="AllergyIntolerance.meta" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.meta.id">
      <path value="AllergyIntolerance.meta.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.versionId">
      <path value="AllergyIntolerance.meta.versionId" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.lastUpdated">
      <path value="AllergyIntolerance.meta.lastUpdated" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.profile">
      <path value="AllergyIntolerance.meta.profile" />
      <min value="1" />
      <max value="1" />
      <fixedUri value="http://medico-emr.net/stu3/sd/AllergyIntolerance-AllergyIntolerance-1" />
    </element>
    <element id="AllergyIntolerance.meta.security">
      <path value="AllergyIntolerance.meta.security" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.tag">
      <path value="AllergyIntolerance.meta.tag" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.tag.id">
      <path value="AllergyIntolerance.meta.tag.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.tag.system">
      <path value="AllergyIntolerance.meta.tag.system" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.tag.version">
      <path value="AllergyIntolerance.meta.tag.version" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.tag.code">
      <path value="AllergyIntolerance.meta.tag.code" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.tag.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="AllergyIntolerance.meta.tag.display" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.meta.tag.userSelected">
      <path value="AllergyIntolerance.meta.tag.userSelected" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.implicitRules">
      <path value="AllergyIntolerance.implicitRules" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.language">
      <path value="AllergyIntolerance.language" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.text">
      <path value="AllergyIntolerance.text" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.contained">
      <path value="AllergyIntolerance.contained" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.extension">
      <path value="AllergyIntolerance.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="AllergyIntolerance.extension:MXT-AllergyIntolerance-ReferenceEncounter-1">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="MXT-AllergyIntolerance-ReferenceEncounter-1" />
      <definition value="An extension that can generically be used to link to an Encounter resource&#xD;&#xA;used e.g. in AllergyIntolerance - if it was originally recorded for just an encounter.&#xD;&#xA;Provided only if the allergy is mapped to an Encounter - and not to a patient." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://medico-emr.net/stu3/sd/MXT-AllergyIntolerance-ReferenceEncounter-1" />
      </type>
    </element>
    <element id="AllergyIntolerance.extension:MXT-AllergyIntolerance-ReferenceEncounter-1.valueReference:valueReference">
      <path value="AllergyIntolerance.extension.valueReference" />
      <sliceName value="valueReference" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.identifier">
      <path value="AllergyIntolerance.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.identifier:medicoResourceId">
      <path value="AllergyIntolerance.identifier" />
      <sliceName value="medicoResourceId" />
      <max value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://medico-emr.net/stu3/sd/Identifier-medicoResourceId-1" />
      </type>
    </element>
    <element id="AllergyIntolerance.identifier:medicoResourceId.system">
      <path value="AllergyIntolerance.identifier.system" />
      <definition value="Allergy is bound to patient" />
      <comment value="Dynamically resolved for validation&#xD;&#xA;--FixedValue=http://medico-emr.net/%KUNDE%/sid1/Allergy" />
    </element>
    <element id="AllergyIntolerance.identifier:medicoResourceId2">
      <path value="AllergyIntolerance.identifier" />
      <sliceName value="medicoResourceId2" />
      <max value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://medico-emr.net/stu3/sd/Identifier-medicoResourceId-1" />
      </type>
    </element>
    <element id="AllergyIntolerance.identifier:medicoResourceId2.system">
      <path value="AllergyIntolerance.identifier.system" />
      <definition value="Allergy is bound to Encounter of type case" />
      <comment value="Dynamically resolved for validation&#xD;&#xA;--FixedValue=http://medico-emr.net/%KUNDE%/sid1/AllergyPerCase" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus">
      <path value="AllergyIntolerance.clinicalStatus" />
      <definition value="always active - value has no meaning because there is no corresponding value in medico" />
      <min value="1" />
      <fixedCode value="active" />
    </element>
    <element id="AllergyIntolerance.verificationStatus">
      <path value="AllergyIntolerance.verificationStatus" />
      <fixedCode value="confirmed" />
    </element>
    <element id="AllergyIntolerance.type">
      <path value="AllergyIntolerance.type" />
      <min value="1" />
      <fixedCode value="allergy" />
    </element>
    <element id="AllergyIntolerance.category">
      <path value="AllergyIntolerance.category" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.criticality">
      <path value="AllergyIntolerance.criticality" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code">
      <path value="AllergyIntolerance.code" />
      <definition value="Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., &quot;Latex&quot;), an allergy or intolerance condition (e.g., &quot;Latex allergy&quot;), or a negated/excluded code for a specific substance or class (e.g., &quot;No latex allergy&quot;) or a general or categorical negated statement (e.g.,  &quot;No known allergy&quot;, &quot;No known drug allergies&quot;).&#xD;&#xA;medico: this is specific to a customer" />
      <min value="1" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceCode" />
        </extension>
        <strength value="example" />
        <valueSetReference>
          <reference value="http://medico-emr.net/%KUNDE%/vs/AllergyIntolerance-AllergyIntolerance-1" />
        </valueSetReference>
      </binding>
    </element>
    <element id="AllergyIntolerance.code.id">
      <path value="AllergyIntolerance.code.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code.coding">
      <path value="AllergyIntolerance.code.coding" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.id">
      <path value="AllergyIntolerance.code.coding.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code.coding.system">
      <path value="AllergyIntolerance.code.coding.system" />
      <definition value="Reference to customer-specific Code-System" />
      <comment value="Dynamically resolved for validation&#xD;&#xA;--FixedValue=http://medico-emr.net/%KUNDE%/cs/AllergyAttributes" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.version">
      <path value="AllergyIntolerance.code.coding.version" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code.coding.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <short value="the medico allergy code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="AllergyIntolerance.code.coding.display" />
      <definition value="Plain text for the selected code - as defined by the customer" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.userSelected">
      <path value="AllergyIntolerance.code.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="AllergyIntolerance.code.text" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.patient">
      <path value="AllergyIntolerance.patient" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <profile value="http://medico-emr.net/stu3/sd/Reference-SubjectPatient-1" />
        <targetProfile value="http://medico-emr.net/stu3/sd/Patient-Patient-1" />
      </type>
    </element>
    <element id="AllergyIntolerance.patient.reference">
      <path value="AllergyIntolerance.patient.reference" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.onset[x]:onsetDateTime">
      <path value="AllergyIntolerance.onsetDateTime" />
      <sliceName value="onsetDateTime" />
      <min value="1" />
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element id="AllergyIntolerance.onset[x]:onsetDateTime.id">
      <path value="AllergyIntolerance.onsetDateTime.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.assertedDate">
      <path value="AllergyIntolerance.assertedDate" />
      <definition value="Represents the date/time the record was created in medico" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.recorder">
      <path value="AllergyIntolerance.recorder" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.asserter">
      <path value="AllergyIntolerance.asserter" />
      <definition value="Reference to the user how last changed or created the allergy record." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://medico-emr.net/stu3/sd/Practitioner-User-1" />
      </type>
    </element>
    <element id="AllergyIntolerance.asserter.id">
      <path value="AllergyIntolerance.asserter.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.asserter.reference">
      <path value="AllergyIntolerance.asserter.reference" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.asserter.identifier">
      <path value="AllergyIntolerance.asserter.identifier" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.asserter.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="AllergyIntolerance.asserter.display" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.lastOccurrence">
      <path value="AllergyIntolerance.lastOccurrence" />
      <definition value="if set - marks &quot;the end&quot; of the allergy or intolerance to the substance" />
    </element>
    <element id="AllergyIntolerance.note">
      <path value="AllergyIntolerance.note" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.note.id">
      <path value="AllergyIntolerance.note.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.note.author[x]:authorReference">
      <path value="AllergyIntolerance.note.authorReference" />
      <sliceName value="authorReference" />
      <max value="0" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
    </element>
    <element id="AllergyIntolerance.note.time">
      <path value="AllergyIntolerance.note.time" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.reaction">
      <path value="AllergyIntolerance.reaction" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>