HAPI FHIR Server

read-type: Read a new AllergyIntolerance instance

Read AllergyIntolerance Record

The Read AllergyIntolerance method allows you to retrieve a specific allergy record by its unique ID. This is useful when verifying known allergies for a patient before prescribing medication or updating clinical records.

Endpoint

GET /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.

Example Request (Java)

import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;

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

        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String inputLine;
        StringBuffer response = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();

        System.out.println(response.toString());
    }
}

Example Response

{
  "resourceType": "Bundle",
  "type": "searchset",
  "entry": [
    {
      "resource": {
        "resourceType": "AllergyIntolerance",
        "id": "12345",
        "clinicalStatus": {
          "coding": [{
            "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
            "code": "active",
            "display": "Active"
          }]
        },
        "category": ["medication"],
        "code": {
          "coding": [{
            "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
            "code": "2670",
            "display": "Penicillin"
          }]
        },
        "patient": {
          "reference": "Patient/67890"
        },
        "recordedDate": "2024-02-18T12:00:00Z"
      }
    }
  ]
}

Additional Resources

get
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

get/AllergyIntolerance/{id}
 
curl --request GET \
  --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
{}