HAPI FHIR Server

delete-type: Delete a new AllergyIntolerance instance

Delete AllergyIntolerance Record

The Delete AllergyIntolerance method allows you to remove an existing allergy or intolerance record for a patient. This is useful when correcting erroneous entries or removing outdated allergy records from a patient’s medical history.

Endpoint

DELETE /fhir/R4/AllergyIntolerance/{id}

Required Headers

Authorization: Bearer {access_token}
Accept: application/fhir+json

Path Parameters

Parameter Type Required Description
id string Yes The unique identifier of the allergy record to delete.

Example Request (Java)

import java.net.HttpURLConnection;
import java.net.URL;

public class AllergyIntoleranceDelete {
    public static void main(String[] args) throws Exception {
        String apiUrl = "https://api.healthgorilla.com/fhir/R4/AllergyIntolerance/98765";
        URL url = new URL(apiUrl);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("DELETE");
        conn.setRequestProperty("Authorization", "Bearer your_access_token");
        conn.setRequestProperty("Accept", "application/fhir+json");

        int responseCode = conn.getResponseCode();
        System.out.println("Response Code: " + responseCode);
    }
}

Expected Response

HTTP/1.1 200 OK
Content-Type: application/fhir+json

{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "information",
      "code": "informational",
      "details": { "text": "AllergyIntolerance record successfully deleted." }
    }
  ]
}

Additional Resources

delete
http://localhost:8080/fhir/R4/AllergyIntolerance/{id}

Path Parameters

idstringrequired

The resource ID

>= 1

Example:123

Response

200

Success

FHIR-JSON-RESOURCE

FHIR-JSON-RESOURCEobject

A FHIR resource

delete/AllergyIntolerance/{id}
 
curl --request DELETE \
  --url http://localhost:8080/fhir/R4/AllergyIntolerance/123 \
  --header 'Accept: application/fhir+json, application/fhir+xml' \
  --header 'Authorization: Bearer ' \
  --header 'Content-Type: application/fhir+json'
200
{}