Update a critical information record for a patient

A HelseId token is required to authorize the user.

When updating a record a new record with a new version number wil be created and the old record will be preserved.

Curl example: Update an AllergyIntolerance for a patient

curl --location --request PUT 'https://test1.critical-information.hit.nhn.no/api/critical-information/v1/AllergyIntolerance/ecdc45cf-0e25-4c90-b3f0-cbc1f0d83fc2' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiI......<HelseId token>' \
--header 'Content-Type: application/fhir+json; charset=UTF-8' \
--header 'Accept: application/fhir+json' \
--header 'hit-user-role: %7B%0A++++%22system%22%3A+%22urn%3Aoid%3A2.16.578.1.12.4.1.1.9060%22%2C%0A++++%22code%22%3A+%22LE%22%0A%7D' \
--header 'hit-access-basis: SAMTYKKE' \
--header 'hit-source-system: My EPJ system name' \
--header 'hit-patient-pid: 10086055555' \
--data '{
  "resourceType": "AllergyIntolerance",
  "id": "ecdc45cf-0e25-4c90-b3f0-cbc1f0d83fc2",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2023-11-21T11:16:30.552+00:00",
    "profile": [
      "http://nhn.no/kj/fhir/StructureDefinition/KjAllergyIntolerance"
    ]
  },
  "contained": [
    {
      "resourceType": "PractitionerRole",
      "id": "updaterRef",
      "practitioner": {
        "identifier": {
          "system": "urn:oid:2.16.578.1.12.4.1.4.4",
          "value": "222200063"
        },
        "display": "Fos Perez, Jack"
      },
      "organization": {
        "identifier": {
          "system": "urn:oid:2.16.578.1.12.4.1.2.101",
          "value": "100100223"
        },
        "display": "Andeby Legevakt"
      },
      "code": [
        {
          "coding": [
            {
              "system": "http://nhn.no/kj/fhir/CodeSystem/CategoriesOfHealthProfessionals",
              "code": "LE"
            }
          ]
        }
      ]
    },
    {
      "resourceType": "PractitionerRole",
      "id": "recorderRef",
      "practitioner": {
        "identifier": {
          "system": "urn:oid:2.16.578.1.12.4.1.4.4",
          "value": "222200068"
        },
        "display": "Ben Psa Reddik"
      },
      "organization": {
        "identifier": {
          "system": "urn:oid:2.16.578.1.12.4.1.2.101",
          "value": "100100223"
        },
        "display": "Andeby Legevakt"
      },
      "code": [
        {
          "coding": [
            {
              "system": "http://nhn.no/kj/fhir/CodeSystem/CategoriesOfHealthProfessionals",
              "code": "LE"
            }
          ]
        }
      ]
    }
  ],
  "extension": [
    {
      "url": "http://nhn.no/kj/fhir/StructureDefinition/KjSourceOfInformation",
      "valueCoding": {
        "system": "http://nhn.no/kj/fhir/CodeSystem/SourceOfInformation",
        "code": "1",
        "display": "Resultat av tester / analyser"
      }
    },
    {
      "url": "http://nhn.no/kj/fhir/StructureDefinition/KjUpdater",
      "valueReference": {
        "reference": "#updaterRef"
      }
    }
  ],
  "clinicalStatus": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
        "code": "active",
        "display": "Active"
      }
    ]
  },
  "verificationStatus": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
        "code": "confirmed",
        "display": "Confirmed"
      }
    ]
  },
  "category": [
    "environment"
  ],
  "criticality": "high",
  "code": {
    "coding": [
      {
        "system": "http://nhn.no/kj/fhir/CodeSystem/OtherAllergen",
        "code": "15"
      }
    ],
    "text": "En knallsterk nudelpakke"
  },
  "patient": {
    "reference": "Patient/10086055555"
  },
  "onsetAge": {
    "value": 59,
    "system": "http://unitsofmeasure.org",
    "code": "a"
  },
  "recordedDate": "1964-03-19T02:00:00+02:00",
  "recorder": {
    "reference": "#recorderRef"
  },
  "note": [
    {
      "text": "update comment"
    }
  ],
  "reaction": [
    {
      "manifestation": [
        {
          "coding": [
            {
              "system": "http://nhn.no/kj/fhir/CodeSystem/TypeOfReaction",
              "code": "4",
              "display": "Larynxødem"
            }
          ]
        }
      ]
    }
  ]
}'