idstringrequired
The resource ID
>= 1
Example:123
The Update AllergyIntolerance method allows you to modify an existing allergy or intolerance record for a patient. This is useful for updating allergy status, severity, reaction details, or verification status as new clinical information becomes available.
PUT /fhir/R4/AllergyIntolerance/{id}
Authorization: Bearer {access_token}
Accept: application/fhir+json
Content-Type: application/fhir+json
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | The unique identifier of the allergy record to update. |
| Parameter | Type | Required | Description |
|---|---|---|---|
clinicalStatus |
CodeableConcept | No | Indicates whether the allergy is active, inactive, or resolved. |
verificationStatus |
CodeableConcept | No | 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 | No | The substance that triggers the reaction. |
patient |
Reference | No | 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 AllergyIntoleranceUpdate {
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("PUT");
conn.setRequestProperty("Authorization", "Bearer your_access_token");
conn.setRequestProperty("Content-Type", "application/fhir+json");
conn.setDoOutput(true);
String jsonInputString = "{\\\"resourceType\\\": \\\"AllergyIntolerance\\\", \\\"id\\\": \\\"98765\\\", \\\"clinicalStatus\\\": {\\\"coding\\\": [{\\\"system\\\": \\\"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\\\", \\\"code\\\": \\\"inactive\\\"}]}, \\\"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": "inactive",
"display": "Inactive"
}]
},
"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"
}
The resource ID
>= 1
Example:123
A FHIR resource
Success
A FHIR resource
{
"resourceType": "AllergyIntolerance"
}curl --request PUT \
--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' \
--data '{
"resourceType": "AllergyIntolerance"
}'{}