{
  "resourceType": "StructureDefinition",
  "id": "test-digidot-Observation-no",
  "url": "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Observation-no",
  "version": "0.1.0-test",
  "name": "TestDigidotObservationNo",
  "title": "TEST DigiDot Observation (NO)",
  "status": "draft",
  "date": "2026-05-19",
  "publisher": "Novari AS - DigiDOT",
  "purpose": "Use this profile for dental measurements, indicators, methods and observed values. It is deliberately more flexible than Procedure because some dental observations may use local or calculated codes during terminology maturation.",
  "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"
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "min": 1,
        "max": "1",
        "short": "Observation status.",
        "definition": "Use final for stable clinical findings and calculated indicators. Other FHIR Observation statuses are allowed for migrated, preliminary, corrected or entered-in-error data when the lifecycle is relevant."
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "min": 0,
        "max": "*",
        "binding": {
          "strength": "preferred",
          "valueSet": "http://terminology.hl7.org/ValueSet/observation-category"
        }
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "short": "Observable entity",
        "definition": "The SNOMED CT concept describing what is being observed (observable entity).",
        "min": 1,
        "constraint": [
          {
            "key": "obs-sct-min1",
            "severity": "warning",
            "human": "At least one SNOMED CT code (pre- or postcoordinated) should be present.",
            "expression": "coding.where(system = 'http://snomed.info/sct').exists()"
          }
        ],
        "binding": {
          "strength": "extensible",
          "description": "Use SNOMED CT observable entity when it covers the intended observation. Other codings may be used for calculated indicators or local observations when no suitable SNOMED CT observable concept exists.",
          "valueSet": "http://snomed.info/sct?fhir_vs=isa/363787002"
        }
      },
      {
        "id": "Observation.code.coding",
        "path": "Observation.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "max": "2"
      },
      {
        "id": "Observation.code.coding:SCTpre",
        "path": "Observation.code.coding",
        "sliceName": "SCTpre",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-SCTpre-no"
            ]
          }
        ],
        "binding": {
          "strength": "extensible",
          "description": "Use a SNOMED CT observable entity when it covers the intended observation. Local or calculated indicator codes may be used when no suitable SNOMED CT observable exists; these should be handled explicitly in the implementation guide and reporting rules.",
          "valueSet": "http://snomed.info/sct?fhir_vs=isa/363787002"
        }
      },
      {
        "id": "Observation.code.coding:SCTpost",
        "path": "Observation.code.coding",
        "sliceName": "SCTpost",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-SCTpost-no"
            ]
          }
        ]
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          }
        ]
      },
      {
        "id": "Observation.encounter",
        "path": "Observation.encounter",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Encounter-no",
              "http://hl7.org/fhir/StructureDefinition/Encounter"
            ]
          }
        ]
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Organization",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson",
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "short": "Result value",
        "definition": "The result of the observation.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Quantity"
          },
          {
            "code": "CodeableConcept"
          },
          {
            "code": "string"
          },
          {
            "code": "integer"
          },
          {
            "code": "boolean"
          }
        ]
      },
      {
        "id": "Observation.interpretation",
        "path": "Observation.interpretation",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Observation.note",
        "path": "Observation.note",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "min": 0,
        "max": "1",
        "constraint": [
          {
            "key": "tooth-required-if-surface",
            "severity": "error",
            "human": "If tooth surfaces are provided, a tooth must also be provided.",
            "expression": "coding.where(memberOf('http://novari.no/fhir/digidot/ValueSet/tooth-surfaces')).empty() or coding.where(memberOf('http://novari.no/fhir/digidot/ValueSet/teeth')).exists()"
          }
        ]
      },
      {
        "id": "Observation.bodySite.coding",
        "path": "Observation.bodySite.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 0,
        "max": "*"
      },
      {
        "id": "Observation.bodySite.coding:tooth",
        "path": "Observation.bodySite.coding",
        "sliceName": "tooth",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-tooth-no"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://novari.no/fhir/digidot/ValueSet/teeth"
        }
      },
      {
        "id": "Observation.bodySite.coding:surface",
        "path": "Observation.bodySite.coding",
        "sliceName": "surface",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-tooth-surface-no"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://novari.no/fhir/digidot/ValueSet/tooth-surfaces"
        }
      },
      {
        "id": "Observation.bodySite.coding.system",
        "path": "Observation.bodySite.coding.system",
        "min": 1,
        "fixedUri": "http://snomed.info/sct"
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "min": 0,
        "max": "1",
        "binding": {
          "strength": "preferred",
          "description": "Use DigiDOT observation method codes when a suitable method exists; otherwise use SNOMED CT or another agreed code system.",
          "valueSet": "http://novari.no/fhir/digidot/ValueSet/test-digidot-observation-method"
        }
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Observation.component.code",
        "path": "Observation.component.code",
        "min": 1
      },
      {
        "id": "Observation.component.value[x]",
        "path": "Observation.component.value[x]",
        "min": 0,
        "type": [
          {
            "code": "Quantity"
          },
          {
            "code": "CodeableConcept"
          },
          {
            "code": "string"
          },
          {
            "code": "integer"
          },
          {
            "code": "boolean"
          }
        ]
      }
    ]
  },
  "description": "TEST comparison draft. Not for production use."
}