Delete a critical information record for a patient

A HelseId token is required to authorize the user.

NB!
Delete shall only be used when a registration is “entered in error”, e.g. wrong patient. Records will not be physically deleted, but will have “clinical status” set to “entered-in-error”. If the information is no longer valid use the API update method to change the critical information record accordingly.

Note that it's only allowed to delete the latest version.

On delete the API does a soft delete by marking the critical info record as no longer active without actually deleting it from the database. If reading a deleted record the API will filter away most of the data for privacy reasons. If reading an old version of a deleted record it will also be filtered.

Curl example: Delete the latest AllergyIntolerance for a patient

curl --location --request DELETE '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'

Curl example: Delete the latest AllergyIntolerance for a patient with version

curl --location --request DELETE 'https://test1.critical-information.hit.nhn.no/api/critical-information/v1/AllergyIntolerance/ecdc45cf-0e25-4c90-b3f0-cbc1f0d83fc2/_history/2' \
--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'