{
  "resourceType": "StructureDefinition",
  "id": "lt-observation",
  "url": "http://esveikata.lt/Profile/Observation",
  "version": "1.0.0",
  "name": "LtObservation",
  "status": "active",
  "date": "2023-02-09",
  "description": "Lithuanian national fhir profile for an Observation (Analitė).",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "constraint": [
          {
            "key": "lt-bundle-1",
            "severity": "error",
            "human": "Observation name must be defined.",
            "expression": "coding.display.hasValue() or text.hasValue()"
          }
        ]
      },
      {
        "id": "Observation.code.coding.system",
        "path": "Observation.code.coding.system",
        "min": 1
      },
      {
        "id": "Observation.code.coding.code",
        "path": "Observation.code.coding.code",
        "short": "Analitės kodas",
        "min": 1
      },
      {
        "id": "Observation.code.coding.display",
        "path": "Observation.code.coding.display",
        "short": "Analitės pavadinimas"
      },
      {
        "id": "Observation.code.text",
        "path": "Observation.code.text",
        "short": "Analitės pavadinimas"
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "short": "Analitės tyrimo rezultatas / matavimo vienetas",
        "min": 1,
        "constraint": [
          {
            "key": "lt-bundle-2",
            "severity": "error",
            "human": "Observation value Quantity must contain unit and value.",
            "expression": "($this is Quantity).not() or ($this.unit.hasValue() and $this.unit.hasValue())"
          },
          {
            "key": "lt-bundle-3",
            "severity": "error",
            "human": "Observation value CodeableConcept must contain a text representation of the concept.",
            "expression": "($this is CodeableConcept).not() or ($this.text.hasValue() or $this.coding.display.hasValue())"
          },
          {
            "key": "lt-bundle-4",
            "severity": "error",
            "human": "Observation value Range must contain unit and value for a low or high range value.",
            "expression": "($this is Range).not() or ($this.low.unit.hasValue() and $this.low.unit.hasValue()) or ($this.high.unit.hasValue() and $this.high.unit.hasValue())"
          },
          {
            "key": "lt-bundle-5",
            "severity": "error",
            "human": "Observation value Ratio must contain unit and value for numerator and denomitator values.",
            "expression": "($this is Ratio).not() or ($this.numerator.unit.hasValue() and $this.numerator.value.hasValue() and $this.denominator.unit.hasValue() and $this.denominator.value.hasValue())"
          },
          {
            "key": "lt-bundle-6",
            "severity": "error",
            "human": "Observation value SampledData must contain unit and value for origin field.",
            "expression": "($this is SampledData).not() or ($this.origin.unit.hasValue() and $this.origin.value.hasValue())"
          }
        ]
      },
      {
        "id": "Observation.note",
        "path": "Observation.note",
        "short": "Pastaba analitei"
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "short": "Analizės metodas",
        "min": 1
      },
      {
        "id": "Observation.method.coding.system",
        "path": "Observation.method.coding.system",
        "min": 1
      },
      {
        "id": "Observation.method.coding.code",
        "path": "Observation.method.coding.code",
        "min": 1
      },
      {
        "id": "Observation.referenceRange",
        "path": "Observation.referenceRange",
        "short": "Analitės referencinis dydis",
        "min": 1
      }
    ]
  }
}