{
  "resourceType": "StructureDefinition",
  "id": "phenotype",
  "url": "http://ga4gh.org/fhir/phenopackets/StructureDefinition/Phenotype",
  "version": "1.0.0",
  "name": "Phenotype",
  "title": "Phenotype",
  "status": "draft",
  "description": "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": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.extension",
        "path": "Observation.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Observation.extension:phenotype-severity",
        "path": "Observation.extension",
        "sliceName": "phenotype-severity",
        "sliceIsConstraining": false,
        "label": "severity",
        "short": "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": "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": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ga4gh.org/fhir/phenopackets/StructureDefinition/phenotype-severity"
            ]
          }
        ]
      },
      {
        "id": "Observation.extension:phenotype-modifier",
        "path": "Observation.extension",
        "sliceName": "phenotype-modifier",
        "sliceIsConstraining": false,
        "label": "modifiers",
        "short": "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": "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": "Extension",
            "profile": [
              "http://ga4gh.org/fhir/phenopackets/StructureDefinition/phenotype-modifier"
            ]
          }
        ]
      },
      {
        "id": "Observation.extension:phenotype-modifier.value[x]:valueCoding",
        "path": "Observation.extension.value[x]",
        "sliceName": "valueCoding"
      },
      {
        "id": "Observation.extension:onset",
        "path": "Observation.extension",
        "sliceName": "onset",
        "sliceIsConstraining": false,
        "label": "onset",
        "short": "This element can be used to describe the age at which a phenotypic feature was first noticed or diagnosed.",
        "definition": "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": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ga4gh.org/fhir/phenopackets/StructureDefinition/phenotype-onset"
            ]
          }
        ]
      },
      {
        "id": "Observation.basedOn",
        "path": "Observation.basedOn",
        "max": "0"
      },
      {
        "id": "Observation.partOf",
        "path": "Observation.partOf",
        "max": "0"
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "fixedCode": "final"
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "max": "0"
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "label": "type",
        "short": "The element represents the primary ontology class which describes the phenotype. For example Craniosynostosis (HP:0001363).",
        "definition": "The element represents the primary ontology class which describes the phenotype. For example Craniosynostosis (HP:0001363).",
        "requirements": "A computable phenotype needs a code from an ontology.",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ObservationCode"
            }
          ],
          "strength": "preferred",
          "description": "The primary ontology class which describes the phenotype.",
          "valueSet": "http://ga4gh.org/fhir/phenopackets/ValueSet/phenotype-type"
        }
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          }
        ]
      },
      {
        "id": "Observation.focus",
        "path": "Observation.focus",
        "max": "0"
      },
      {
        "id": "Observation.encounter",
        "path": "Observation.encounter",
        "max": "0"
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "max": "0"
      },
      {
        "id": "Observation.issued",
        "path": "Observation.issued",
        "max": "0"
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "max": "0"
      },
      {
        "id": "Observation.value[x]:valueCodeableConcept",
        "path": "Observation.value[x]",
        "sliceName": "valueCodeableConcept",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSet": "http://ga4gh.org/fhir/phenopackets/ValueSet/presence"
        }
      },
      {
        "id": "Observation.dataAbsentReason",
        "path": "Observation.dataAbsentReason",
        "max": "0"
      },
      {
        "id": "Observation.interpretation",
        "path": "Observation.interpretation",
        "max": "0"
      },
      {
        "id": "Observation.note",
        "path": "Observation.note",
        "label": "description",
        "short": "This element represents a free-text description of the phenotype.",
        "definition": "This element represents a free-text description of the phenotype.",
        "comment": "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."
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "max": "0"
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "max": "0"
      },
      {
        "id": "Observation.specimen",
        "path": "Observation.specimen",
        "max": "0"
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "max": "0"
      },
      {
        "id": "Observation.referenceRange",
        "path": "Observation.referenceRange",
        "max": "0"
      },
      {
        "id": "Observation.hasMember",
        "path": "Observation.hasMember",
        "max": "0"
      },
      {
        "id": "Observation.derivedFrom",
        "path": "Observation.derivedFrom",
        "max": "0"
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "max": "0"
      }
    ]
  }
}