FHIR-JSON-RESOURCE
FHIR-JSON-RESOURCEobject
A FHIR resource
The Create AllergyIntolerance method allows you to add a new allergy or intolerance record for a patient. This is useful for logging new allergies during patient intake, updating a medical history, or ensuring known allergies are properly recorded in an EHR system.
POST /fhir/R4/AllergyIntolerance
Authorization: Bearer {access_token}
Accept: application/fhir+json
Content-Type: application/fhir+json
| Parameter | Type | Required | Description |
|---|---|---|---|
clinicalStatus |
CodeableConcept | Yes | Indicates whether the allergy is active, inactive, or resolved. |
verificationStatus |
CodeableConcept | Yes | Whether the allergy is confirmed or refuted. |
type |
string | No | Defines if the reaction is an allergy or intolerance. |
category |
array | No | Category of the allergen (e.g., medication, food, environment). |
code |
CodeableConcept | Yes | The substance that triggers the reaction. |
patient |
Reference | Yes | Reference to the patient associated with the allergy. |
reaction |
array | No | Details about symptoms and severity. |
recordedDate |
dateTime | No | The date the allergy was recorded. |
recorder |
Reference | No | Who documented the allergy. |
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
public class AllergyIntoleranceCreate {
public static void main(String[] args) throws Exception {
String apiUrl = "https://api.healthgorilla.com/fhir/R4/AllergyIntolerance";
URL url = new URL(apiUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer your_access_token");
conn.setRequestProperty("Content-Type", "application/fhir+json");
conn.setDoOutput(true);
String jsonInputString = "{\"resourceType\": \"AllergyIntolerance\", \"clinicalStatus\": {\"coding\": [{\"system\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\", \"code\": \"active\"}]}, \"code\": {\"coding\": [{\"system\": \"http://www.nlm.nih.gov/research/umls/rxnorm\", \"code\": \"2670\", \"display\": \"Penicillin\"}]}, \"patient\": {\"reference\": \"Patient/67890\"}}";
try (OutputStream os = conn.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input, 0, input.length);
}
int responseCode = conn.getResponseCode();
System.out.println("Response Code: " + responseCode);
}
}
{
"resourceType": "AllergyIntolerance",
"id": "98765",
"clinicalStatus": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code": "active",
"display": "Active"
}]
},
"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"
}
FHIR AllergyIntolerance Resource
Health Gorilla API Reference
A FHIR resource
Success
A FHIR resource
{
"resourceType": "AllergyIntolerance"
}curl --request POST \
--url http://localhost:8080/fhir/R4/AllergyIntolerance \
--header 'Accept: application/fhir+json, application/fhir+xml' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/fhir+json' \
--data '{
"resourceType": "AllergyIntolerance"
}'{}