{
  "resourceType": "Bundle",
  "id": "example-digidot-external-critical-context",
  "type": "collection",
  "timestamp": "2026-07-31T08:00:00+00:00",
  "entry": [
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Patient/pas-ehds-context",
      "resource": {
        "resourceType": "Patient",
        "id": "pas-ehds-context",
        "meta": {
          "profile": [
            "http://hl7.no/fhir/StructureDefinition/no-basis-Patient"
          ],
          "source": "https://www.nhn.no/tjenester/persontjenesten"
        },
        "identifier": [
          {
            "system": "urn:oid:2.16.578.1.12.4.1.4.1",
            "value": "01019012345"
          }
        ],
        "name": [
          {
            "family": "Testpasient",
            "given": [
              "Digi"
            ]
          }
        ],
        "gender": "female",
        "birthDate": "1990-01-01"
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/PractitionerRole/prr-ehds-dentist",
      "resource": {
        "resourceType": "PractitionerRole",
        "id": "prr-ehds-dentist",
        "meta": {
          "profile": [
            "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole"
          ],
          "source": "https://www.nhn.no/tjenester/helsepersonellregisteret"
        },
        "practitioner": {
          "reference": "Practitioner/practitioner-ehds-dentist"
        },
        "organization": {
          "reference": "Organization/org-ehds-clinic"
        },
        "code": [
          {
            "coding": [
              {
                "system": "https://novari.no/fhir/digidot/CodeSystem/digidot-personnel-type",
                "code": "dentist",
                "display": "Dentist"
              }
            ]
          }
        ],
        "active": true
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Practitioner/practitioner-ehds-dentist",
      "resource": {
        "resourceType": "Practitioner",
        "id": "practitioner-ehds-dentist",
        "meta": {
          "profile": [
            "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner"
          ],
          "source": "https://www.nhn.no/tjenester/helsepersonellregisteret"
        },
        "identifier": [
          {
            "system": "urn:oid:2.16.578.1.12.4.1.4.4",
            "value": "123456789"
          }
        ],
        "name": [
          {
            "family": "Tannlege",
            "given": [
              "Test"
            ]
          }
        ]
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Organization/org-ehds-clinic",
      "resource": {
        "resourceType": "Organization",
        "id": "org-ehds-clinic",
        "meta": {
          "profile": [
            "http://hl7.no/fhir/StructureDefinition/no-basis-Organization"
          ]
        },
        "identifier": [
          {
            "system": "urn:oid:2.16.578.1.12.4.1.2",
            "value": "999999999"
          }
        ],
        "name": "DigiDOT test dental clinic"
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Location/loc-ehds-clinic-room",
      "resource": {
        "resourceType": "Location",
        "id": "loc-ehds-clinic-room",
        "meta": {
          "profile": [
            "http://hl7.no/fhir/StructureDefinition/no-basis-Location"
          ]
        },
        "status": "active",
        "name": "Treatment room 1",
        "managingOrganization": {
          "reference": "Organization/org-ehds-clinic"
        }
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/AllergyIntolerance/allergy-amoxicillin-critical",
      "resource": {
        "resourceType": "AllergyIntolerance",
        "id": "allergy-amoxicillin-critical",
        "meta": {
          "profile": [
            "http://hl7.no/fhir/StructureDefinition/no-basis-AllergyIntolerance"
          ],
          "source": "https://utviklerportal.nhn.no/informasjonstjenester/kjernejournal/kritisk-informasjon",
          "tag": [
            {
              "system": "https://novari.no/fhir/digidot/CodeSystem/cache-status",
              "code": "source-current",
              "display": "Source checked for this clinical context"
            }
          ]
        },
        "clinicalStatus": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
              "code": "active"
            }
          ]
        },
        "verificationStatus": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
              "code": "confirmed"
            }
          ]
        },
        "type": "allergy",
        "category": [
          "medication"
        ],
        "criticality": "high",
        "code": {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "387406002",
              "display": "Amoxicillin"
            }
          ],
          "text": "Penicillin/amoxicillin reaction"
        },
        "patient": {
          "reference": "Patient/pas-ehds-context"
        },
        "recordedDate": "2026-07-30T07:00:00+00:00",
        "recorder": {
          "reference": "PractitionerRole/prr-ehds-dentist"
        },
        "reaction": [
          {
            "manifestation": [
              {
                "coding": [
                  {
                    "system": "http://snomed.info/sct",
                    "code": "39579001",
                    "display": "Anaphylaxis"
                  }
                ],
                "text": "Anaphylaxis"
              }
            ],
            "severity": "severe"
          }
        ]
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Flag/flag-critical-allergy",
      "resource": {
        "resourceType": "Flag",
        "id": "flag-critical-allergy",
        "meta": {
          "source": "https://utviklerportal.nhn.no/informasjonstjenester/kjernejournal/kritisk-informasjon"
        },
        "status": "active",
        "category": [
          {
            "coding": [
              {
                "system": "http://terminology.hl7.org/CodeSystem/flag-category",
                "code": "safety",
                "display": "Safety"
              }
            ]
          }
        ],
        "code": {
          "text": "Critical allergy information exists"
        },
        "subject": {
          "reference": "Patient/pas-ehds-context"
        },
        "period": {
          "start": "2026-07-30"
        }
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Consent/consent-treatment-limitation",
      "resource": {
        "resourceType": "Consent",
        "id": "consent-treatment-limitation",
        "meta": {
          "source": "https://utviklerportal.nhn.no/informasjonstjenester/kjernejournal/kritisk-informasjon"
        },
        "status": "active",
        "scope": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/consentscope",
              "code": "adr",
              "display": "Advanced Care Directive"
            }
          ]
        },
        "category": [
          {
            "coding": [
              {
                "system": "http://loinc.org",
                "code": "42348-3",
                "display": "Advance directives"
              }
            ]
          }
        ],
        "patient": {
          "reference": "Patient/pas-ehds-context"
        },
        "dateTime": "2026-07-30T07:00:00+00:00",
        "performer": [
          {
            "reference": "Patient/pas-ehds-context"
          }
        ],
        "provision": {
          "type": "permit",
          "period": {
            "start": "2026-07-30"
          }
        }
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Device/device-pacemaker-context",
      "resource": {
        "resourceType": "Device",
        "id": "device-pacemaker-context",
        "status": "active",
        "type": {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "14106009",
              "display": "Cardiac pacemaker"
            }
          ]
        },
        "patient": {
          "reference": "Patient/pas-ehds-context"
        }
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/DeviceUseStatement/deviceuse-pacemaker-context",
      "resource": {
        "resourceType": "DeviceUseStatement",
        "id": "deviceuse-pacemaker-context",
        "meta": {
          "source": "https://utviklerportal.nhn.no/informasjonstjenester/kjernejournal/kritisk-informasjon"
        },
        "status": "active",
        "subject": {
          "reference": "Patient/pas-ehds-context"
        },
        "device": {
          "reference": "Device/device-pacemaker-context"
        },
        "recordedOn": "2026-07-30T07:00:00+00:00"
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/QuestionnaireResponse/qr-dental-anamnesis",
      "resource": {
        "resourceType": "QuestionnaireResponse",
        "id": "qr-dental-anamnesis",
        "status": "completed",
        "subject": {
          "reference": "Patient/pas-ehds-context"
        },
        "authored": "2026-07-31T07:35:00+00:00",
        "author": {
          "reference": "Patient/pas-ehds-context"
        },
        "item": [
          {
            "linkId": "dental-anxiety",
            "text": "Dental anxiety reported by patient",
            "answer": [
              {
                "valueString": "Needs extra explanation before local anesthesia."
              }
            ]
          }
        ]
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/ServiceRequest/sr-treatment-with-critical-context",
      "resource": {
        "resourceType": "ServiceRequest",
        "id": "sr-treatment-with-critical-context",
        "meta": {
          "profile": [
            "https://novari.no/fhir/digidot/StructureDefinition/digidot-ServiceRequest-no"
          ]
        },
        "status": "active",
        "intent": "plan",
        "code": {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "version": "http://snomed.info/sct/51000202101/version/20260715",
              "code": "129125009:{408730004=397943006,408731000=410512000,408732007=410604004,363589002=(234789004:{363704007=866006002})}"
            }
          ]
        },
        "subject": {
          "reference": "Patient/pas-ehds-context"
        },
        "authoredOn": "2026-07-31",
        "requester": {
          "reference": "PractitionerRole/prr-ehds-dentist"
        },
        "performer": [
          {
            "reference": "PractitionerRole/prr-ehds-dentist"
          }
        ],
        "locationReference": [
          {
            "reference": "Location/loc-ehds-clinic-room"
          }
        ],
        "supportingInfo": [
          {
            "reference": "AllergyIntolerance/allergy-amoxicillin-critical"
          },
          {
            "reference": "Flag/flag-critical-allergy"
          },
          {
            "reference": "Consent/consent-treatment-limitation"
          },
          {
            "reference": "DeviceUseStatement/deviceuse-pacemaker-context"
          },
          {
            "reference": "QuestionnaireResponse/qr-dental-anamnesis"
          }
        ],
        "bodySite": [
          {
            "extension": [
              {
                "url": "https://novari.no/fhir/digidot/StructureDefinition/digidot-ehds-body-structure",
                "extension": [
                  {
                    "url": "location",
                    "valueCodeableConcept": {
                      "coding": [
                        {
                          "system": "http://snomed.info/sct",
                          "version": "http://snomed.info/sct/51000202101/version/20260715",
                          "code": "866006002",
                          "display": "Structure of permanent mandibular left first molar tooth"
                        }
                      ]
                    }
                  }
                ]
              }
            ]
          }
        ],
        "category": [
          {
            "coding": [
              {
                "system": "https://novari.no/fhir/digidot/CodeSystem/digidot-service-request-category",
                "code": "dental-treatment",
                "display": "Dental treatment"
              }
            ],
            "text": "Dental treatment request"
          }
        ],
        "identifier": [
          {
            "system": "urn:novari:example:service-request",
            "value": "sr-treatment-with-critical-context"
          }
        ]
      }
    },
    {
      "fullUrl": "https://novari.no/fhir/digidot/example/Provenance/prov-critical-context-import",
      "resource": {
        "resourceType": "Provenance",
        "id": "prov-critical-context-import",
        "target": [
          {
            "reference": "AllergyIntolerance/allergy-amoxicillin-critical"
          },
          {
            "reference": "Flag/flag-critical-allergy"
          },
          {
            "reference": "Consent/consent-treatment-limitation"
          },
          {
            "reference": "DeviceUseStatement/deviceuse-pacemaker-context"
          }
        ],
        "recorded": "2026-07-31T07:40:00+00:00",
        "activity": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/v3-DataOperation",
              "code": "TRANS",
              "display": "Transform"
            }
          ]
        },
        "agent": [
          {
            "type": {
              "text": "Integration orchestrator"
            },
            "who": {
              "display": "DigiDOT Patient Context API"
            }
          }
        ],
        "entity": [
          {
            "role": "source",
            "what": {
              "display": "Kjernejournal critical information FHIR API"
            }
          }
        ]
      }
    }
  ],
  "meta": {
    "tag": [
      {
        "system": "https://novari.no/fhir/digidot/CodeSystem/example-status",
        "code": "historical",
        "display": "Historical illustration: includes supportingInfo targets excluded from ServiceRequest 0.6.8; not a current validation or import example."
      }
    ]
  }
}