API Allergies

See API Specification

Anyone using the API should also become very familiar with our schema documentation which contains important details about individual database table columns.
See Allergy Database Schema.

Allergies GET (single)

Version Added: 26.1.15

Gets a single allergy.

AllergyNum: Required in the URL.

Example Request:
GET /allergies/14

Example Response:
{
"AllergyNum": 14,
"AllergyDefNum": 23,
"PatNum": 85,
"defDescription": "Latex",
"defSnomedType": "None",
"Reaction": "Hives",
"StatusIsActive": "true",
"DateTStamp": "2026-04-30 08:24:33",
"DateAdverseReaction": "2024-10-02"
}

200 OK
404 NotFound (with explanation)

Allergies GET (multiple)

Version Added: 21.1

Gets a list of allergies.

Parameters:

PatNum: (Optional after 26.1.15) FK to patient.PatNum.

Example Request:
GET /allergies?PatNum=15

Example Response:
[
{
"AllergyNum": 1,
"AllergyDefNum": 4,
"PatNum": 15,
"defDescription": "Penicillin",
"defSnomedType": "None",
"Reaction": "Rash",
"StatusIsActive": "true",
"DateTStamp": "2025-06-11 10:43:15",
"DateAdverseReaction": "2020-03-18"
},
etc...
]

200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)

Allergies POST

Version Added: 21.3

Creates a new allergy, linking an allergydef to a patient.

Parameters:

AllergyDefNum: This or defDescription is required. FK to allergydef.AllergyDefNum.
PatNum: Required. FK to patient.PatNum.
defDescription: This or AllergyDefNum is required. FK to allergydef.Description.

Reaction: Optional. String describing the adverse reaction.
StatusIsActive: Optional. Either "true" or "false". Default "true".
DateAdverseReaction: Optional. String in "yyyy-MM-dd" format. Default "0001-01-01".

Example Requests:
POST /allergies

{
"PatNum": 12,
"AllergyDefNum": 243
}

or

{
"PatNum": 12,
"defDescription": "Penicillin",
"Reaction": "Hives",
"DateAdverseReaction": "2019-09-23"
}

Example Response:
{
"AllergyNum": 4,
"AllergyDefNum": 243,
"PatNum": 12,
"defDescription": "Penicillin",
"defSnomedType": "None",
"Reaction": "Hives",
"StatusIsActive": "true",
"DateTStamp": "2026-05-01 13:02:54",
"DateAdverseReaction": "2019-09-23"
}

201 Created
400 BadRequest (with explanation)
404 NotFound (with explanation)

Allergies PUT

Version Added: 22.1

Updates an allergy.

Parameters:

AllergyNum: Required in the URL.

Reaction: Optional. String describing the adverse reaction.
DateAdverseReaction: Optional. String in "yyyy-MM-dd" format.
StatusIsActive: Optional. Either "true" or "false".

Example Request:
PUT /allergies/12

{
"Reaction": "Rash",
"DateAdverseReaction": "2022-04-13",
"StatusIsActive": "true"
}

Example Response:
{
"AllergyNum": 12,
"AllergyDefNum": 298,
"PatNum": 41,
"defDescription": "Latex",
"defSnomedType": "None",
"Reaction": "Rash",
"StatusIsActive": "true",
"DateTStamp": "2026-04-27 06:32:21",
"DateAdverseReaction": "2022-04-13"
}

200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)

Allergies DELETE

Version Added: 22.1

Deletes an allergy.

AllergyNum: Required in the URL.

Example Requests:
DELETE /allergies/13

Example Response:
200 OK
404 NotFound (with explanation)