<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="phenotype" />
  <url value="http://ga4gh.org/fhir/phenopackets/StructureDefinition/Phenotype" />
  <version value="1.0.0" />
  <name value="Phenotype" />
  <title value="Phenotype" />
  <status value="draft" />
  <description value="This element is intended to be used to describe a phenotype that characterizes the subject of the Phenopacket. For medical use cases the subject will generally be a patient or a proband of a study, and the phenotypes will be abnormalities described by an ontology such as the Human Phenotype Ontology. The word phenotype is used with many different meanings including disease entity, but in this context we mean an individual phenotypic feature, observed as either present or absent (negated), with possible onset, modifiers and frequency." />
  <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.extension">
      <path value="Observation.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Observation.extension:phenotype-severity">
      <path value="Observation.extension" />
      <sliceName value="phenotype-severity" />
      <sliceIsConstraining value="false" />
      <label value="severity" />
      <short value="This element is an ontology class that describes the severity of the condition e.g. subclasses of Severity (HP:0012824) or SNOMED:272141005-Severities." />
      <definition value="This element is an ontology class that describes the severity of the condition e.g. subclasses of Severity (HP:0012824) or SNOMED:272141005-Severities." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ga4gh.org/fhir/phenopackets/StructureDefinition/phenotype-severity" />
      </type>
    </element>
    <element id="Observation.extension:phenotype-modifier">
      <path value="Observation.extension" />
      <sliceName value="phenotype-modifier" />
      <sliceIsConstraining value="false" />
      <label value="modifiers" />
      <short value="This element is a list of ontology class elements that can be empty or contain one or more ontology terms that are intended to provide more expressive or precise descriptions of a phenotypic feature, including attributes such as positionality and external factors that tend to trigger or ameliorate the feature." />
      <definition value="This element is a list of ontology class elements that can be empty or contain one or more ontology terms that are intended to provide more expressive or precise descriptions of a phenotypic feature, including attributes such as positionality and external factors that tend to trigger or ameliorate the feature. Terms can be taken from the hierarchy of Clinical modifier in the HPO (noting that severity should be coded in the severity element)." />
      <type>
        <code value="Extension" />
        <profile value="http://ga4gh.org/fhir/phenopackets/StructureDefinition/phenotype-modifier" />
      </type>
    </element>
    <element id="Observation.extension:phenotype-modifier.value[x]:valueCoding">
      <path value="Observation.extension.value[x]" />
      <sliceName value="valueCoding" />
    </element>
    <element id="Observation.extension:onset">
      <path value="Observation.extension" />
      <sliceName value="onset" />
      <sliceIsConstraining value="false" />
      <label value="onset" />
      <short value="This element can be used to describe the age at which a phenotypic feature was first noticed or diagnosed." />
      <definition value="This element can be used to describe the age at which a phenotypic feature was first noticed or diagnosed. For many medical use cases, either the Age subelement or an ontology class (e.g., from the HPO Onset (HP:0003674) terms) will be used." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ga4gh.org/fhir/phenopackets/StructureDefinition/phenotype-onset" />
      </type>
    </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" />
      <label value="type" />
      <short value="The element represents the primary ontology class which describes the phenotype. For example Craniosynostosis (HP:0001363)." />
      <definition value="The element represents the primary ontology class which describes the phenotype. For example Craniosynostosis (HP:0001363)." />
      <requirements value="A computable phenotype needs a code from an ontology." />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ObservationCode" />
        </extension>
        <strength value="preferred" />
        <description value="The primary ontology class which describes the phenotype." />
        <valueSet value="http://ga4gh.org/fhir/phenopackets/ValueSet/phenotype-type" />
      </binding>
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </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]" />
      <max value="0" />
    </element>
    <element id="Observation.issued">
      <path value="Observation.issued" />
      <max value="0" />
    </element>
    <element id="Observation.performer">
      <path value="Observation.performer" />
      <max value="0" />
    </element>
    <element id="Observation.value[x]:valueCodeableConcept">
      <path value="Observation.value[x]" />
      <sliceName value="valueCodeableConcept" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://ga4gh.org/fhir/phenopackets/ValueSet/presence" />
      </binding>
    </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" />
      <label value="description" />
      <short value="This element represents a free-text description of the phenotype." />
      <definition value="This element represents a free-text description of the phenotype." />
      <comment value="It should not be used as the primary means of describing the phenotype, but can be used to supplement the record if ontology terms are not sufficiently able to capture all the nuances. In general, the type and onset etc… fields should be used for this purpose, and this field is a last resort." />
    </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>