Create a critical information record for a patient

A HelseId token is required to authorize the user.

Curl example: Create AllergyIntolerance for a patient

curl --location --request POST 'https://test1.critical-information.hit.nhn.no/api/critical-information/v1/AllergyIntolerance' \
--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",
  "meta": {
    "profile": [
      "http://nhn.no/kj/fhir/StructureDefinition/KjAllergyIntolerance"
    ]
  },
  "contained": [
    {
      "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.4.101",
          "value": "100100223"
        },
        "display": "Andeby Legevakt"
      },
      "code": [
        {
          "coding": [
            {
              "system": "http://nhn.no/kj/fhir/CodeSystem/CategoriesOfHealthProfessionals",
              "code": "LE",
              "display": "Lege"
            }
          ]
        }
      ]
    }
  ],
  "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"
      }
    }
  ],
  "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": 16,
    "system": "http://unitsofmeasure.org",
    "code": "a"
  },
  "recordedDate": "2021-04-20T14:01:52+02:00",
  "recorder": {
    "reference": "#recorderRef"
  },
  "note": [
    {
      "text": "en kommentar"
    }
  ],
  "reaction": [
    {
      "manifestation": [
        {
          "coding": [
            {
              "system": "http://nhn.no/kj/fhir/CodeSystem/TypeOfReaction",
              "code": "4",
              "display": "Larynxødem"
            }
          ]
        }
      ]
    }
  ]
}'