{
  "resourceType": "StructureDefinition",
  "id": "el-observation-tonometryEvaluation",
  "url": "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-observation-tonometryEvaluation",
  "version": "1.0.0",
  "name": "ELTonometryEvaluation",
  "title": "EL Tonometry Evaluation Profile",
  "status": "draft",
  "description": "The profile for Tonometry Evaluation .",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "constraint": [
          {
            "key": "tactice-requires-code",
            "severity": "error",
            "human": "Tactile Tonometry requires a coded value.",
            "expression": "method = 'tactile'\n   implies\n      (note.exists() or (value as CodeableConcept).exists() or (component.value as CodeableConcept).exists()) and (value as Quantity).exists().not() and (component.value as Quantity).exists().not()",
            "source": "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-observation-tonometryEvaluation"
          },
          {
            "key": "goldmann-requires-quantity",
            "severity": "error",
            "human": "Goldmann Tonometry requires a quantity value.",
            "expression": "method = 'goldmann'\n   implies\n      (note.exists() or (value as Quantity).exists() or (component.value as Quantity).exists()) and (value as CodeableConcept).exists().not() and (component.value as CodeableConcept).exists().not()",
            "source": "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-observation-tonometryEvaluation"
          }
        ]
      },
      {
        "id": "Observation.meta.extension",
        "path": "Observation.meta.extension",
        "min": 1
      },
      {
        "id": "Observation.meta.extension:organization",
        "path": "Observation.meta.extension",
        "sliceName": "organization",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-meta-organization-extension"
            ]
          }
        ]
      },
      {
        "id": "Observation.meta.tag",
        "path": "Observation.meta.tag",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.essilorluxottica.com/fhir/ValueSet/el-metatag-vs"
        }
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "patternCode": "final"
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "exam",
              "system": "http://terminology.hl7.org/CodeSystem/observation-category"
            }
          ]
        }
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "tonometryEvaluation",
              "system": "http://fhir.essilorluxottica.com/fhir/CodeSystem/el-sectioncode-cs",
              "display": "Tonometry Evaluation"
            }
          ]
        }
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-patient"
            ]
          }
        ]
      },
      {
        "id": "Observation.encounter",
        "path": "Observation.encounter",
        "min": 1
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "type": [
          {
            "code": "Quantity"
          },
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "Observation.value[x]:valueCodeableConcept",
        "path": "Observation.value[x]",
        "sliceName": "valueCodeableConcept",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.essilorluxottica.com/fhir/ValueSet/el-observation-tonometryTactileObservation-vs"
        }
      },
      {
        "id": "Observation.value[x]:valueQuantity",
        "path": "Observation.value[x]",
        "sliceName": "valueQuantity",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.value[x]:valueQuantity.code",
        "path": "Observation.value[x].code",
        "patternCode": "mm[Hg]"
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.essilorluxottica.com/fhir/ValueSet/el-eyelocation-single-vs"
        }
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.essilorluxottica.com/fhir/ValueSet/el-observation-tonometryEvaluationMethod-vs"
        }
      }
    ]
  }
}