Allergy

An allergy occurs when a person reacts to substances in the environment that are harmless to most people.

The allergy model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the allergy.

  • Name
    object
    Type
    string
    Description

    Always 'allergy'.

  • Name
    patient
    Type
    string
    Description

    Patient this allergy is for.

  • Name
    name
    Type
    string
    Description

    Name of the allergy.

  • Name
    code_type
    Type
    Description

    Type of allergy.

    Possible values:
    allergy_class
    generic_drug
  • Name
    code
    Type
    string
    Description

    Code of allergy.

  • Name
    severity
    Type
    Description

    Severity of allergy.

    Possible values:
    mild
    moderate
    severe
  • Name
    reaction_type
    Type
    Description

    Reaction type of allergy.

    Possible values:
    allergy
    adverse_reaction
  • Name
    reaction
    Type
    string
    Description

    Reaction of allergy.

  • Name
    active
    Type
    boolean
    Description

    Whether the allergy is active or not.

  • Name
    onset_date
    Type
    string
    Description

    Onset date (in ISO 8601 format) of the allergy.

  • Name
    comment
    Type
    string
    Description

    Any comments associated with the allergy.

  • Name
    created_by
    Type
    string
    Description

    Creator of the allergy.

  • Name
    created_at
    Type
    date-time
    Description

    Timestamp (in ISO 8601 format) of when the allergy was created.

  • Name
    last_updated_at
    Type
    date-time
    Description

    Timestamp (in ISO 8601 format) of when the allergy was last updated.

Response

{
    "id": "algy_2UxtAULYUrX7GVsTKePy",
    "object": "allergy",
    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

    "name": "Ibuprofen",
    "code_type": "generic_drug",
    "code": "d00015",
    "severity": "mild",
    "reaction_type": "allergy",
    "reaction": "Rash",
    "active": true,
    "onset_date": "2024-07-07",
    "comment": "Allergy has become worse recently.",

    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": "2024-07-07T00:52:02.504Z",
    "last_updated_at": "2024-07-07T00:52:02.504Z"
}


POST/v2/allergies

Create an allergy

Creates a new allergy.

Required attributes

  • Name
    patient
    Type
    string
    Description

    Patient this allergy is for.

  • Name
    name
    Type
    string
    Description

    Name of the allergy.

  • Name
    code_type
    Type
    Description

    Type of allergy.

    Possible values:
    allergy_class
    generic_drug
  • Name
    code
    Type
    string
    Description

    Code of allergy.

  • Name
    severity
    Type
    Description

    Severity of allergy.

    Possible values:
    mild
    moderate
    severe
  • Name
    reaction_type
    Type
    Description

    Reaction type of allergy.

    Possible values:
    allergy
    adverse_reaction
  • Name
    reaction
    Type
    string
    Description

    Reaction of allergy.

  • Name
    active
    Type
    boolean
    Description

    Whether the allergy is active or not.

  • Name
    onset_date
    Type
    string
    Description

    Onset date (in ISO 8601 format) of the allergy.

Optional attributes

  • Name
    comment
    Type
    string
    Description

    Any comments associated with the allergy.

Request

POST
/v2/allergies
curl -X POST "https://{{base_subdomain}}.avonhealth.com/v2/allergies" \
  -H "Authorization: Bearer {{token}}" \
  -H "x-jwt: {{jwt}}" \
  -H "Content-Type: application/json" \
  --data '{
    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
    "name": "Example",
    "code_type": "allergy_class",
    "code": "Example",
    "severity": "mild",
    "reaction_type": "allergy",
    "reaction": "Example",
    "active": true
  }'

Response

    {
        "id": "algy_2UxtAULYUrX7GVsTKePy",
        "object": "allergy",
        "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

        "name": "Ibuprofen",
        "code_type": "generic_drug",
        "code": "d00015",
        "severity": "mild",
        "reaction_type": "allergy",
        "reaction": "Rash",
        "active": true,
        "onset_date": "2024-07-07",
        "comment": "Allergy has become worse recently.",

        "created_by": "user_xeDpGyt67wTor93qKtS7",
        "created_at": "2024-07-07T00:52:02.504Z",
        "last_updated_at": "2024-07-07T00:52:02.504Z"
    }


GET/v2/allergies/:id

Retrieve an allergy

Retrieves the specified allergy.

Request

GET
/v2/allergies/:id
curl "https://{{base_subdomain}}.avonhealth.com/v2/allergies/:id" \
  -H "Authorization: Bearer {{token}}" \
  -H "x-jwt: {{jwt}}"

Response

    {
        "id": "algy_2UxtAULYUrX7GVsTKePy",
        "object": "allergy",
        "patient": "user_Z1zXZKvqrpwxbznuW6lJ",

        "name": "Ibuprofen",
        "code_type": "generic_drug",
        "code": "d00015",
        "severity": "mild",
        "reaction_type": "allergy",
        "reaction": "Rash",
        "active": true,
        "onset_date": "2024-07-07",
        "comment": "Allergy has become worse recently.",

        "created_by": "user_xeDpGyt67wTor93qKtS7",
        "created_at": "2024-07-07T00:52:02.504Z",
        "last_updated_at": "2024-07-07T00:52:02.504Z"
    }


POST/v2/allergies/:id

Update an allergy

Updates the specified allergy object by setting the values of the parameters passed. Any other parameters not provided will not be modified.

Required attributes

    Optional attributes

    • Name
      severity
      Type
      Description

      Severity of allergy.

      Possible values:
      mild
      moderate
      severe
    • Name
      reaction_type
      Type
      Description

      Reaction type of allergy.

      Possible values:
      allergy
      adverse_reaction
    • Name
      reaction
      Type
      string
      Description

      Reaction of allergy.

    • Name
      active
      Type
      boolean
      Description

      Whether the allergy is active or not.

    • Name
      onset_date
      Type
      string
      Description

      Onset date (in ISO 8601 format) of the allergy.

    • Name
      comment
      Type
      string
      Description

      Any comments associated with the allergy.

    Request

    POST
    /v2/allergies/:id
    curl -X POST "https://{{base_subdomain}}.avonhealth.com/v2/allergies/:id" \
      -H "Authorization: Bearer {{token}}" \
      -H "x-jwt: {{jwt}}" \
      -H "Content-Type: application/json" \
      --data '{}'
    

    Response

        {
            "id": "algy_2UxtAULYUrX7GVsTKePy",
            "object": "allergy",
            "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
    
            "name": "Ibuprofen",
            "code_type": "generic_drug",
            "code": "d00015",
            "severity": "mild",
            "reaction_type": "allergy",
            "reaction": "Rash",
            "active": true,
            "onset_date": "2024-07-07",
            "comment": "Allergy has become worse recently.",
    
            "created_by": "user_xeDpGyt67wTor93qKtS7",
            "created_at": "2024-07-07T00:52:02.504Z",
            "last_updated_at": "2024-07-07T00:52:02.504Z"
        }
    

    GET/v2/allergies

    List all allergies

    Returns a list of all allergies.

    Optional query parameters

    • Name
      patient
      Type
      string
      Description

      Patient ID to filter by.

    Request

    GET
    /v2/allergies
    curl "https://{{base_subdomain}}.avonhealth.com/v2/allergies?patient=user_Z1zXZKvqrpwxbznuW6lJ" \
      -H "Authorization: Bearer {{token}}" \
      -H "x-jwt: {{jwt}}"
    

    Response

        {
          "object": "list",
          "data": [
            {
                "id": "algy_2UxtAULYUrX7GVsTKePy",
                "object": "allergy",
                "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
    
                "name": "Ibuprofen",
                "code_type": "generic_drug",
                "code": "d00015",
                "severity": "mild",
                "reaction_type": "allergy",
                "reaction": "Rash",
                "active": true,
                "onset_date": "2024-07-07",
                "comment": "Allergy has become worse recently.",
    
                "created_by": "user_xeDpGyt67wTor93qKtS7",
                "created_at": "2024-07-07T00:52:02.504Z",
                "last_updated_at": "2024-07-07T00:52:02.504Z"
            },
          ]
        }
    

    DELETE/v2/allergies/:id

    Delete an allergy

    Deletes the specified allergy.

    Required attributes

      Optional attributes

        Request

        DELETE
        /v2/allergies/:id
        curl -X DELETE "https://{{base_subdomain}}.avonhealth.com/v2/allergies/:id" \
          -H "Authorization: Bearer {{token}}" \
          -H "x-jwt: {{jwt}}"
        

        Response

            {
                "id": "algy_2UxtAULYUrX7GVsTKePy",
                "object": "allergy",
                "delete": true
            }