{
  "resourceType": "StructureDefinition",
  "id": "el-observation-stereoTest",
  "url": "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-observation-stereoTest",
  "version": "1.0.0",
  "name": "ELStereoTest",
  "title": "EL Stereo Test Profile",
  "status": "draft",
  "description": "The Stereo Test Profile.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "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": "stereotest",
              "system": "http://fhir.essilorluxottica.com/fhir/CodeSystem/el-sectioncode-cs",
              "display": "Stereo Test"
            }
          ]
        }
      },
      {
        "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.note",
        "path": "Observation.note",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "max": "0"
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.essilorluxottica.com/fhir/ValueSet/el-observation-stereoTestMethod-vs"
        }
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "code"
            }
          ],
          "rules": "open",
          "description": "Slice based on the component.code value"
        },
        "min": 1
      },
      {
        "id": "Observation.component:stereotestScore",
        "path": "Observation.component",
        "sliceName": "stereotestScore",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:stereotestScore.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "stereotestScore",
              "system": "http://fhir.essilorluxottica.com/fhir/CodeSystem/el-observation-componentcode-cs",
              "display": "Stereotest Score"
            }
          ]
        }
      },
      {
        "id": "Observation.component:stereotestScore.value[x]",
        "path": "Observation.component.value[x]",
        "type": [
          {
            "code": "Ratio"
          }
        ]
      },
      {
        "id": "Observation.component:stereotestStereoSeen",
        "path": "Observation.component",
        "sliceName": "stereotestStereoSeen",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:stereotestStereoSeen.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "stereotestStereoSeen",
              "system": "http://fhir.essilorluxottica.com/fhir/CodeSystem/el-observation-componentcode-cs",
              "display": "Stereo Seen"
            }
          ]
        }
      },
      {
        "id": "Observation.component:stereotestStereoSeen.value[x]",
        "path": "Observation.component.value[x]",
        "type": [
          {
            "code": "boolean"
          }
        ]
      },
      {
        "id": "Observation.component:stereotestSuppression",
        "path": "Observation.component",
        "sliceName": "stereotestSuppression",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:stereotestSuppression.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "stereotestSuppression",
              "system": "http://fhir.essilorluxottica.com/fhir/CodeSystem/el-observation-componentcode-cs",
              "display": "Stereo Suppression"
            }
          ]
        }
      },
      {
        "id": "Observation.component:stereotestSuppression.value[x]",
        "path": "Observation.component.value[x]",
        "type": [
          {
            "code": "boolean"
          }
        ]
      },
      {
        "id": "Observation.component:Stereopsis",
        "path": "Observation.component",
        "sliceName": "Stereopsis",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:Stereopsis.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "stereotestStereopsis",
              "system": "http://fhir.essilorluxottica.com/fhir/CodeSystem/el-observation-componentcode-cs",
              "display": "Stereopsis"
            }
          ]
        }
      },
      {
        "id": "Observation.component:Stereopsis.value[x]",
        "path": "Observation.component.value[x]",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.component:Stereopsis.value[x].unit",
        "path": "Observation.component.value[x].unit",
        "patternString": "''"
      }
    ]
  }
}