{
  "resourceType": "StructureDefinition",
  "id": "test-digidot-Encounter-no",
  "url": "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-Encounter-no",
  "version": "0.1.0-test",
  "name": "TestDigidotEncounterNo",
  "title": "TEST DigiDot Encounter (NO)",
  "status": "draft",
  "date": "2026-05-19",
  "publisher": "Novari AS - DigiDOT",
  "purpose": "Use this profile as the anchor for actual dental contacts. It connects patient, actors, location, organization, appointment, plan or recall, episode and the health group/payment category snapshot.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Encounter",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Encounter",
        "path": "Encounter",
        "constraint": [
          {
            "key": "enc-participant-pprf-one",
            "severity": "warning",
            "human": "At least one participant should have type PPRF.",
            "expression": "participant.where(type.coding.where(system='http://terminology.hl7.org/CodeSystem/v3-ParticipationType' and code='PPRF').exists()).exists()"
          },
          {
            "key": "enc-participant-individual-one",
            "severity": "error",
            "human": "At least one participant should have individual (Practitioner or PractitionerRole).",
            "expression": "participant.where(individual.exists()).exists()"
          }
        ]
      },
      {
        "id": "Encounter.extension",
        "path": "Encounter.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.extension:helsegruppe",
        "path": "Encounter.extension",
        "sliceName": "helsegruppe",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-Helsegruppe-no"
            ]
          }
        ],
        "short": "Health group snapshot"
      },
      {
        "id": "Encounter.extension:helsegruppe.url",
        "path": "Encounter.extension.url",
        "fixedUri": "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-Helsegruppe-no"
      },
      {
        "id": "Encounter.identifier",
        "path": "Encounter.identifier",
        "min": 1
      },
      {
        "id": "Encounter.type",
        "path": "Encounter.type",
        "max": "1",
        "binding": {
          "strength": "preferred",
          "description": "Use DigiDOT contact type codes when a suitable concept exists. Keep this preferred while county and supplier contact type semantics are still being clarified.",
          "valueSet": "https://novari.no/fhir/digidot/ValueSet/test-digidot-contact-type"
        },
        "mustSupport": true
      },
      {
        "id": "Encounter.subject",
        "path": "Encounter.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          }
        ]
      },
      {
        "id": "Encounter.episodeOfCare",
        "path": "Encounter.episodeOfCare",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-EpisodeOfCare-no",
              "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"
            ]
          }
        ],
        "short": "Dental episode or course of care for this contact.",
        "definition": "Use Encounter.episodeOfCare to group the completed dental contact into the relevant DigiDOT EpisodeOfCare. This is the primary FHIR-native episode link for clinical resources that point to the encounter."
      },
      {
        "id": "Encounter.basedOn",
        "path": "Encounter.basedOn",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-ServiceRequest-no",
              "http://hl7.org/fhir/StructureDefinition/ServiceRequest"
            ]
          }
        ]
      },
      {
        "id": "Encounter.participant",
        "path": "Encounter.participant",
        "min": 1
      },
      {
        "id": "Encounter.participant.individual",
        "path": "Encounter.participant.individual",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole",
              "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Encounter.appointment",
        "path": "Encounter.appointment",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Appointment",
              "http://hl7.org/fhir/StructureDefinition/Appointment"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Encounter.reasonReference",
        "path": "Encounter.reasonReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-Condition-no",
              "http://hl7.org/fhir/StructureDefinition/Condition",
              "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-Procedure-no",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Procedure",
              "http://hl7.org/fhir/StructureDefinition/Procedure",
              "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-Observation-no",
              "http://hl7.org/fhir/StructureDefinition/Observation"
            ]
          }
        ]
      },
      {
        "id": "Encounter.location",
        "path": "Encounter.location",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.location.location",
        "path": "Encounter.location.location",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Location",
              "http://hl7.org/fhir/StructureDefinition/Location"
            ]
          }
        ]
      },
      {
        "id": "Encounter.serviceProvider",
        "path": "Encounter.serviceProvider",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Organization",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ]
      },
      {
        "id": "Encounter.partOf",
        "path": "Encounter.partOf",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://novari.no/fhir/digidot/StructureDefinition/test-digidot-Encounter-no",
              "http://hl7.org/fhir/StructureDefinition/Encounter"
            ]
          }
        ]
      },
      {
        "id": "Encounter.status",
        "path": "Encounter.status",
        "short": "Contact status"
      },
      {
        "id": "Encounter.period",
        "path": "Encounter.period",
        "mustSupport": true,
        "short": "Contact period"
      }
    ]
  },
  "description": "TEST comparison draft. Not for production use. DigiDOT profile for actual dental contacts. The profile connects clinical activity to patient, provider, location, optional appointment, optional planned service and the health group snapshot used for payment context."
}