<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="biobankcy-sd-consumptionofalcohol" />
  <url value="http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-consumptionofalcohol" />
  <name value="BIOBANKCYSDConsumptionOfAlcohol" />
  <title value="Profile: Consumption Of Alcohol (biobank.cy)" />
  <status value="draft" />
  <publisher value="biobank.cy" />
  <contact>
    <name value="Molecular Medicine Research Center (MMRC)" />
    <telecom>
      <system value="email" />
      <value value="biobank@ucy.ac.cy" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Represents the consumption of alcohol of a donor (research subject) or citizen (patient) of the biobank.cy. The consumption of alcohol can be self-reported by the patient or reported by a medical doctor or nurse." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-socialhistory" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <short value="biobank.cy profile for Consumption of Alcohol resources" />
      <condition value="biobank.cy-consumptionofalcohol-1" />
      <constraint>
        <key value="biobank.cy-consumptionofalcohol-1" />
        <severity value="error" />
        <human value="If value is &quot;Non - drinker&quot; or &quot;Lifetime non-drinker of alcohol&quot; then the amount shall not be recorded. The &quot;alcoholType&quot; cannot be recorded alone because the cardinality of component.code is 1..1." />
        <expression value="Observation.valueCodeableConcept.coding.where(code='105542008' or code='783261004').exists() implies Observation.component.code.coding.where(code='74013-4').exists().not()" />
      </constraint>
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <fixedCode value="final" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category:SHCat">
      <path value="Observation.category" />
      <sliceName value="SHCat" />
    </element>
    <element id="Observation.category:SHCat.coding">
      <path value="Observation.category.coding" />
      <min value="1" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="80439-3" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.coding">
      <path value="Observation.code.coding" />
      <comment value="Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.&#xD;&#xA;&#xD;&#xA;biobank.cy: display: &quot;Finding relating to alcohol drinking behavior&quot;" />
      <min value="1" />
    </element>
    <element id="Observation.subject.reference">
      <path value="Observation.subject.reference" />
      <min value="1" />
    </element>
    <element id="Observation.focus">
      <path value="Observation.focus" />
      <comment value="Typically, an observation is made about the subject - a patient, or group of patients, location, or device - and the distinction between the subject and what is directly measured for an observation is specified in the observation code itself ( e.g., &quot;Blood Glucose&quot;) and does not need to be represented separately using this element.  Use `specimen` if a reference to a specimen is required.  If a code is required instead of a resource use either  `bodysite` for bodysites or the standard extension [focusCode](extension-observation-focuscode.html).&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy." />
    </element>
    <element id="Observation.encounter.reference">
      <path value="Observation.encounter.reference" />
      <min value="1" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="At least a date should be present unless this observation is a historical report.  For recording imprecise or &quot;fuzzy&quot; times (For example, a blood glucose measurement taken &quot;after breakfast&quot;) use the [Timing](datatypes.html#timing) datatype which allow the measurement to be tied to regular life events.&#xD;&#xA;&#xD;&#xA;biobank.cy: effectivePeriod shall be used for biobank,cy data warehouse. However, IPS requires dateTime. When sending an IPS from the data warehouse of the biobank.cy registered donor/citizen, the effectivePeriod.start shall be used as effectiveDateTime. Accordingly, when receiving an IPS from a different organization, the effectivePeriod.start will be equal to the effectiveDateTime." />
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="Period" />
      </type>
    </element>
    <element id="Observation.effective[x]:effectivePeriod">
      <path value="Observation.effective[x]" />
      <sliceName value="effectivePeriod" />
      <type>
        <code value="Period" />
      </type>
    </element>
    <element id="Observation.effective[x]:effectiveDateTime">
      <path value="Observation.effective[x]" />
      <sliceName value="effectiveDateTime" />
      <comment value="At least a date should be present unless this observation is a historical report.  For recording imprecise or &quot;fuzzy&quot; times (For example, a blood glucose measurement taken &quot;after breakfast&quot;) use the [Timing](datatypes.html#timing) datatype which allow the measurement to be tied to regular life events.&#xD;&#xA;&#xD;&#xA;biobank.cy: effectivePeriod shall be used for biobank,cy data warehouse. However, IPS requires dateTime. When sending an IPS from the data warehouse of the biobank.cy registered donor/citizen, the effectivePeriod.start shall be used as effectiveDateTime. Accordingly, when receiving an IPS from a different organization, the effectivePeriod.start will be equal to the effectiveDateTime." />
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element id="Observation.performer.reference">
      <path value="Observation.performer.reference" />
      <min value="1" />
    </element>
    <element id="Observation.value[x]">
      <path value="Observation.value[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;biobank.cy: valueCodeableConcept shall be used to define the alcohol drinking behaviour of the patient. If the status defines that the patient is an alcohol drinker, then the component shall be used to define the alcohol type and the alcohol consumption quantity. valueQuantity shall be used for IPS creation where observation.valueQuantity = observation.component.valueQuantity" />
      <min value="1" />
      <type>
        <code value="Quantity" />
      </type>
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="Observation.value[x]:valueCodeableConcept">
      <path value="Observation.value[x]" />
      <sliceName value="valueCodeableConcept" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-alcoholstatus" />
      </binding>
    </element>
    <element id="Observation.value[x]:valueCodeableConcept.coding">
      <path value="Observation.value[x].coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.value[x]:valueCodeableConcept.coding.system">
      <path value="Observation.value[x].coding.system" />
      <min value="1" />
    </element>
    <element id="Observation.value[x]:valueCodeableConcept.coding.code">
      <path value="Observation.value[x].coding.code" />
      <min value="1" />
    </element>
    <element id="Observation.value[x]:valueCodeableConcept.coding.display">
      <path value="Observation.value[x].coding.display" />
      <min value="1" />
    </element>
    <element id="Observation.value[x]:valueQuantity">
      <path value="Observation.value[x]" />
      <sliceName value="valueQuantity" />
      <type>
        <code value="Quantity" />
      </type>
    </element>
    <element id="Observation.value[x]:valueQuantity.value">
      <path value="Observation.value[x].value" />
      <min value="1" />
    </element>
    <element id="Observation.value[x]:valueQuantity.code">
      <path value="Observation.value[x].code" />
      <min value="1" />
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.interpretation">
      <path value="Observation.interpretation" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.note">
      <path value="Observation.note" />
      <comment value="May include general statements about the observation, or statements about significant, unexpected or unreliable results values, or information about its source when relevant to its interpretation.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.bodySite">
      <path value="Observation.bodySite" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.specimen">
      <path value="Observation.specimen" />
      <comment value="Should only be used if not implicit in code found in `Observation.code`.  Observations are not made on specimens themselves; they are made on a subject, but in many cases by the means of a specimen. Note that although specimens are often involved, they are not always tracked and reported explicitly. Also note that observation resources may be used in contexts that track the specimen explicitly (e.g. Diagnostic Report).&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
      <comment value="Note that this is not meant to represent a device involved in the transmission of the result, e.g., a gateway.  Such devices may be documented using the Provenance resource where relevant.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.referenceRange">
      <path value="Observation.referenceRange" />
      <comment value="Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.hasMember">
      <path value="Observation.hasMember" />
      <comment value="When using this element, an observation will typically have either a value or a set of related resources, although both may be present in some cases.  For a discussion on the ways Observations can assembled in groups together, see [Notes](observation.html#obsgrouping) below.  Note that a system may calculate results from [QuestionnaireResponse](questionnaireresponse.html)  into a final score and represent the score as an Observation.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.derivedFrom">
      <path value="Observation.derivedFrom" />
      <comment value="All the reference choices that are listed in this element can represent clinical observations and other measurements that may be the source for a derived value.  The most common reference will be another Observation.  For a discussion on the ways Observations can assembled in groups together, see [Notes](observation.html#obsgrouping) below.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="code" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Observation.component.code">
      <path value="Observation.component.code" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component.dataAbsentReason">
      <path value="Observation.component.dataAbsentReason" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy." />
    </element>
    <element id="Observation.component.interpretation">
      <path value="Observation.component.interpretation" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy." />
    </element>
    <element id="Observation.component.referenceRange">
      <path value="Observation.component.referenceRange" />
      <comment value="Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.&#xD;&#xA;&#xD;&#xA;Not to be used for biobank.cy." />
    </element>
    <element id="Observation.component:alcoholIntake">
      <path value="Observation.component" />
      <sliceName value="alcoholIntake" />
      <comment value="biobank.cy:&#xD;&#xA;-  Currently, only one alcoholIntake can be recorded for each instance of this profile. In the case that the patient drinks more than one alcoholic beverages in the same effective period, then multiple instances must be created (one per each alcoholic beverage). This might change in the future so that many alcoholIntake components can be recorded for the same effective period.&#xD;&#xA;- When sending an IPS, the component:alcoholIntake.code and .Quantityvalue shall be written as Observation.code and Observation.valueQuantity correspondingly. If for an example there is no component (cardinality = 0) then it should be considered that there is not any available &quot;alcohol use&quot; observation for IPS." />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:alcoholIntake.extension:alcoholType">
      <path value="Observation.component.extension" />
      <sliceName value="alcoholType" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-alcoholtype" />
      </type>
      <mustSupport value="true" />
      <isModifier value="false" />
    </element>
    <element id="Observation.component:alcoholIntake.extension:alcoholType.url">
      <path value="Observation.component.extension.url" />
      <fixedUri value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-alcoholtype" />
    </element>
    <element id="Observation.component:alcoholIntake.extension:alcoholType.value[x]">
      <path value="Observation.component.extension.value[x]" />
      <min value="1" />
    </element>
    <element id="Observation.component:alcoholIntake.extension:alcoholType.value[x].coding">
      <path value="Observation.component.extension.value[x].coding" />
      <max value="1" />
    </element>
    <element id="Observation.component:alcoholIntake.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="74013-4" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:alcoholIntake.code.coding">
      <path value="Observation.component.code.coding" />
      <min value="1" />
    </element>
    <element id="Observation.component:alcoholIntake.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="Quantity" />
      </type>
      <patternQuantity>
        <system value="http://unitsofmeasure.org" />
      </patternQuantity>
    </element>
    <element id="Observation.component:alcoholIntake.value[x].value">
      <path value="Observation.component.value[x].value" />
      <min value="1" />
    </element>
    <element id="Observation.component:alcoholIntake.value[x].system">
      <path value="Observation.component.value[x].system" />
      <min value="1" />
    </element>
    <element id="Observation.component:alcoholIntake.value[x].code">
      <path value="Observation.component.value[x].code" />
      <comment value="The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system.&#xD;&#xA;&#xD;&#xA;biobank.cy: Use only codes that represent the &quot;per day&quot; unit (include the characters &quot;/d&quot;)" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>