<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="EPLabObservation-2b3ad220-d87a-4f2a-bf15-74c71069d03e" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Clinical.Diagnostics" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="patient" />
  </extension>
  <url value="https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation" />
  <version value="0.1.0" />
  <name value="EPLabObservation" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="sct-concept" />
    <uri value="http://snomed.info/conceptdomain" />
    <name value="SNOMED CT Concept Domain Binding" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="sct-attr" />
    <uri value="http://snomed.org/attributebinding" />
    <name value="SNOMED CT Attribute Binding" />
  </mapping>
  <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" />
      <short value="An observation on the patient" />
      <definition value="Only the ones described here are authorized" />
    </element>
    <element id="Observation.id">
      <path value="Observation.id" />
      <definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.&#xD;&#xA;Is assigned by the server, do not provide a value." />
    </element>
    <element id="Observation.meta">
      <path value="Observation.meta" />
      <min value="1" />
    </element>
    <element id="Observation.meta.id">
      <path value="Observation.meta.id" />
      <max value="0" />
    </element>
    <element id="Observation.meta.versionId">
      <path value="Observation.meta.versionId" />
      <max value="0" />
    </element>
    <element id="Observation.meta.lastUpdated">
      <path value="Observation.meta.lastUpdated" />
      <max value="0" />
    </element>
    <element id="Observation.meta.source">
      <path value="Observation.meta.source" />
      <max value="0" />
    </element>
    <element id="Observation.meta.profile">
      <path value="Observation.meta.profile" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation" />
    </element>
    <element id="Observation.meta.security">
      <path value="Observation.meta.security" />
      <max value="0" />
    </element>
    <element id="Observation.meta.tag">
      <path value="Observation.meta.tag" />
      <max value="0" />
    </element>
    <element id="Observation.implicitRules">
      <path value="Observation.implicitRules" />
      <max value="0" />
    </element>
    <element id="Observation.language">
      <path value="Observation.language" />
      <max value="0" />
    </element>
    <element id="Observation.text">
      <path value="Observation.text" />
      <max value="0" />
    </element>
    <element id="Observation.contained">
      <path value="Observation.contained" />
      <max value="0" />
    </element>
    <element id="Observation.identifier">
      <path value="Observation.identifier" />
      <max value="0" />
    </element>
    <element id="Observation.basedOn">
      <path value="Observation.basedOn" />
      <max value="0" />
    </element>
    <element id="Observation.partOf">
      <path value="Observation.partOf" />
      <max value="0" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <fixedCode value="final" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <max value="0" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <short value="The code of the observation" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://www.esante.lu/fhir-spec/StructureDefinition/EPCodeableConcept" />
      </type>
    </element>
    <element id="Observation.code.coding">
      <path value="Observation.code.coding" />
      <min value="1" />
      <example>
        <label value="Date of last period" />
        <valueCoding>
          <system value="urn:oid:1.3.182.5.53" />
          <code value="159" />
        </valueCoding>
      </example>
      <example>
        <label value="Week of pregnancy" />
        <valueCoding>
          <system value="urn:oid:1.3.182.5.53" />
          <code value="162" />
        </valueCoding>
      </example>
      <example>
        <label value="Body weight" />
        <valueCoding>
          <system value="http://loinc.org" />
          <code value="29463-7" />
        </valueCoding>
      </example>
      <example>
        <label value="Body height" />
        <valueCoding>
          <system value="http://loinc.org" />
          <code value="8302-2" />
        </valueCoding>
      </example>
      <condition value="val-obsLabCode" />
      <constraint>
        <key value="val-obsLabCode" />
        <severity value="error" />
        <human value="Only the 4 possibilities shown in example are possible" />
        <expression value="((code = &quot;159&quot; or code = &quot;162&quot;) and system=&quot;urn:oid:1.3.182.5.53&quot;) or ((code = &quot;29463-7&quot; or code = &quot;8302-2&quot;) and system=&quot;http://loinc.org&quot;)" />
        <source value="https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation" />
      </constraint>
    </element>
    <element id="Observation.code.text">
      <path value="Observation.code.text" />
      <max value="0" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <short value="The patient" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.esante.lu/fhir-spec/StructureDefinition/EPPatient" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Observation.subject.id">
      <path value="Observation.subject.id" />
      <max value="0" />
    </element>
    <element id="Observation.subject.reference">
      <path value="Observation.subject.reference" />
      <short value="The patient referenced by its matricule" />
      <min value="1" />
      <example>
        <label value="Example" />
        <valueString value="Patient?identifier=urn:oid:1.3.182.4.4|1904112000166" />
      </example>
      <condition value="val-patByMatricule" />
      <constraint>
        <key value="val-patByMatricule" />
        <severity value="error" />
        <human value="The Patient SHALL be referenced by its matricule" />
        <expression value="startsWith('Patient?identifier=urn:oid:1.3.182.4.4|') and length()=52" />
        <source value="https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation" />
      </constraint>
    </element>
    <element id="Observation.subject.type">
      <path value="Observation.subject.type" />
      <max value="0" />
    </element>
    <element id="Observation.subject.identifier">
      <path value="Observation.subject.identifier" />
      <max value="0" />
    </element>
    <element id="Observation.subject.display">
      <path value="Observation.subject.display" />
      <max value="0" />
    </element>
    <element id="Observation.focus">
      <path value="Observation.focus" />
      <max value="0" />
    </element>
    <element id="Observation.encounter">
      <path value="Observation.encounter" />
      <max value="0" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <definition value="Normally, this is the same date as the prescription" />
      <min value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <example>
        <label value="Example" />
        <valueDateTime value="2021-11-24" />
      </example>
    </element>
    <element id="Observation.issued">
      <path value="Observation.issued" />
      <max value="0" />
    </element>
    <element id="Observation.performer">
      <path value="Observation.performer" />
      <short value="The health professional making this observation" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.esante.lu/fhir-spec/StructureDefinition/EPPractitioner" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Observation.performer.id">
      <path value="Observation.performer.id" />
      <max value="0" />
    </element>
    <element id="Observation.performer.reference">
      <path value="Observation.performer.reference" />
      <short value="A reference to the health professional" />
      <min value="1" />
      <example>
        <label value="Example" />
        <valueString value="Practitioner?identifier=urn:oid:1.3.182.4.1|2777777717" />
      </example>
      <condition value="val-1" />
      <constraint>
        <key value="val-1" />
        <severity value="error" />
        <human value="A Practitioner SHALL be referenced by its eHealthID" />
        <expression value="startsWith('Practitioner?identifier=urn:oid:1.3.182.4.1|2') and length()=54" />
        <source value="https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation" />
      </constraint>
    </element>
    <element id="Observation.performer.type">
      <path value="Observation.performer.type" />
      <max value="0" />
    </element>
    <element id="Observation.performer.identifier">
      <path value="Observation.performer.identifier" />
      <max value="0" />
    </element>
    <element id="Observation.performer.display">
      <path value="Observation.performer.display" />
      <max value="0" />
    </element>
    <element id="Observation.value[x]">
      <path value="Observation.value[x]" />
      <min value="1" />
      <type>
        <code value="Quantity" />
      </type>
      <type>
        <code value="string" />
      </type>
      <type>
        <code value="integer" />
      </type>
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <max value="0" />
    </element>
    <element id="Observation.interpretation">
      <path value="Observation.interpretation" />
      <max value="0" />
    </element>
    <element id="Observation.note">
      <path value="Observation.note" />
      <max value="0" />
    </element>
    <element id="Observation.bodySite">
      <path value="Observation.bodySite" />
      <max value="0" />
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <max value="0" />
    </element>
    <element id="Observation.specimen">
      <path value="Observation.specimen" />
      <max value="0" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
      <max value="0" />
    </element>
    <element id="Observation.referenceRange">
      <path value="Observation.referenceRange" />
      <max value="0" />
    </element>
    <element id="Observation.hasMember">
      <path value="Observation.hasMember" />
      <max value="0" />
    </element>
    <element id="Observation.derivedFrom">
      <path value="Observation.derivedFrom" />
      <max value="0" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>