---
title: "Aggregated AllergyIntolerance"
canonical: "https://wiki.patientsknowbest.com/space/api/3711238146/Aggregated%20AllergyIntolerance"
format: markdown
---
[http://fhir.patientsknowbest.com/structuredefinition/aggregated-allergyintolerance](http://fhir.patientsknowbest.com/structuredefinition/aggregated-allergyintolerance) 

[https://www.hl7.org/fhir/R4/allergyintolerance.html](https://www.hl7.org/fhir/R4/allergyintolerance.html) 

## Description

This profile is…

- a description of how non-FHIR allergy data will be mapped to FHIR in the [Aggregated FHIR endpoint](https://wiki.hub.patientsknowbest.com/wiki/spaces/api/pages/3364388935) by PKB

This profile is not…

- a spec for all AllergyIntolerance resources returned from the Aggregated FHIR endpoint; resources sent to a Customer FHIR endpoint are not guaranteed to conform to this profile
- a spec describing how AllergyIntolerance resources must be sent to a Customer FHIR endpoint; some of the elements used in this profile might only be meaningful for migrated data and cannot be provided to a Customer FHIR endpoint

## Relevant PKB entities

- [[[Allergy]]](https://pkbdev.atlassian.net/wiki/spaces/api/pages/3736141825/Entity+Allergy)

| **FHIR** | **PKB** | **Notes** |
| --- | --- | --- |
| Resource id | [[Allergy.Aggregated Data Point ID]] |  |
| Resource meta | - meta: Meta
  - lastUpdated = time of most recent update, automatically maintained by the FHIR server. It is normal for this to be slightly later than any value returned in the [http://fhir.patientsknowbest.com/structuredefinition/version-persisted](http://fhir.patientsknowbest.com/structuredefinition/version-persisted)  extension.
  - security[x]: Coding
    - system = <span style="color: #0747a6">"</span>[http://fhir.patientsknowbest.com/codesystem/privacy-label](http://fhir.patientsknowbest.com/codesystem/privacy-label)<span style="color: #0747a6">"</span>
    - code = [[Data Point.Privacy Label]]
  - security[x]: Coding
    - system =<span style="color: #0747a6"> “</span>[http://fhir.patientsknowbest.com/codesystem/source-organization](http://fhir.patientsknowbest.com/codesystem/source-organization)”
    - code = the resource ID of the Organization representing the [[Data Point.Source Organisation]]
  - security[x]: Coding
    - system = <span style="color: #0747a6">“</span>[http://fhir.patientsknowbest.com/codesystem/source-team](http://fhir.patientsknowbest.com/codesystem/source-team)”
    - code = the resource ID of the Organization representing the [[Data Point.Source Team]]
  - <span style="color: #ff991f"><conditional></span>
  - <span style="color: #ff991f">If Source Person is a Professional:</span>
  - security[x]: Coding
    - system = <span style="color: #0747a6">“</span>[http://fhir.patientsknowbest.com/codesystem/source-practitioner](http://fhir.patientsknowbest.com/codesystem/source-practitioner)”
    - code = the resource ID of the Practitioner
  - <span style="color: #ff991f">Else if Source Person is a Patient:</span>
  - security[x]: Coding
    - system = <span style="color: #0747a6">“</span>[http://fhir.patientsknowbest.com/codesystem/source-patient](http://fhir.patientsknowbest.com/codesystem/source-patient)”
    - code = the resource ID of the Patient
  - security[x]: Coding
    - system =<span style="color: #0747a6"> “</span>[http://fhir.patientsknowbest.com/codesystem/connecting-org](http://fhir.patientsknowbest.com/codesystem/connecting-org)”
    - code = the resource ID of the Organization representing the [[Data Point.Connecting Organisation]]<br>[[Data Point.Privacy Label]] code mappings (PKB → FHIR):<br>- GENERAL_HEALTH → GENERAL_HEALTH
- MENTAL_HEALTH → MENTAL_HEALTH
- SEXUAL_HEALTH → SEXUAL_HEALTH
- SOCIAL_CARE → SOCIAL_CARE |  |
|  | - extension[x]: Extension
  - url = “[http://fhir.patientsknowbest.com/structuredefinition/uploaded-data-id](http://fhir.patientsknowbest.com/structuredefinition/uploaded-data-id)”
  - valueString = [[Data Point.Uploaded Data ID]] | A single uploadeddata entry can result in multiple data points, so this ID does not necessarily uniquely identify a data point. |
|  | - extension[x]: Extension
  - url = “[http://fhir.patientsknowbest.com/structuredefinition/access-route](http://fhir.patientsknowbest.com/structuredefinition/access-route)”
  - valueCoding: Coding
    - system = “[http://fhir.patientsknowbest.com/codesystem/access-route](http://fhir.patientsknowbest.com/codesystem/access-route)”
    - code = [[Data Point.Access Route]]
    - display = display name for the corresponding access route |  |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">"</span>[http://fhir.patientsknowbest.com/structuredefinition/source-text](http://fhir.patientsknowbest.com/structuredefinition/source-text)<span style="color: #0747a6">"</span>
  - valueString = [[Data Point.Source Text]] |  |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">“</span>[http://fhir.patientsknowbest.com/structuredefinition/responsible-organization](http://fhir.patientsknowbest.com/structuredefinition/responsible-organization)<span style="color: #0747a6">”</span>
  - valueString = [[Data Point.Responsible Organisation Identifier]] |  |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">“</span>[http://fhir.patientsknowbest.com/structuredefinition/partner-identifier](http://fhir.patientsknowbest.com/structuredefinition/partner-identifier)<span style="color: #0747a6">”</span>
  - valueReference: Reference
    - identifier: Identifier
      - system = <span style="color: #0747a6">“urn:uuid:cd97da65-0aa4-43a6-b695-cfd0c6f3267d</span>”
      - value = [[Data Point.HL7 Partner]] |  |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">“</span>[http://fhir.patientsknowbest.com/structuredefinition/privacy-override-source-organization](http://fhir.patientsknowbest.com/structuredefinition/privacy-override-source-organization)<span style="color: #0747a6">”</span>
  - valueReference: Reference
    - reference = the relative URL of the Organization resource for the source organisation of the most recent privacy override | Note that this is a reference, unlike the meta.security which contains a code. |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">"</span>[http://fhir.patientsknowbest.com/structuredefinition/privacy-override-source-team](http://fhir.patientsknowbest.com/structuredefinition/privacy-override-source-team)<span style="color: #0747a6">”</span>
  - valueReference: Reference
    - reference = the relative URL of the Organization resource for the source team of the most recent privacy override | Note that this is a reference, unlike the meta.security which contains a code. |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">"</span>[http://fhir.patientsknowbest.com/structuredefinition/privacy-override-source-person](http://fhir.patientsknowbest.com/structuredefinition/privacy-override-source-person)<span style="color: #0747a6">”</span>
  - valueReference: Reference
    - reference = the relative URL of the Patient or Practitioner resource of the source person of the most recent privacy override | Note that this is a reference, unlike the meta.security which contains a code. |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">"</span>[http://fhir.patientsknowbest.com/structuredefinition/privacy-override-access-route](http://fhir.patientsknowbest.com/structuredefinition/privacy-override-access-route)<span style="color: #0747a6">”</span>
  - valueCoding: Coding
    - system = <span style="color: #0747a6">“</span>[http://fhir.patientsknowbest.com/codesystem/access-route](http://fhir.patientsknowbest.com/codesystem/access-route)<span style="color: #0747a6">”</span>
    - code = the access route which added the most recent privacy override
    - display = display name for the corresponding access route |  |
|  | - extension[x]: Extension
  - url = <span style="color: #0747a6">"</span>[http://fhir.patientsknowbest.com/structuredefinition/privacy-override-change-date](http://fhir.patientsknowbest.com/structuredefinition/privacy-override-change-date)<span style="color: #0747a6">“</span>
  - valueDateTime = the timestamp of the most recent privacy override |  |
|  | - extension[x]: Extension
  - url = “[http://fhir.patientsknowbest.com/structuredefinition/recorded-date](http://fhir.patientsknowbest.com/structuredefinition/recorded-date)”
  - valueDateTime = [[Data Point.Entered Timestamp]] |  |
|  | - extension[x]: Extension
  - url = “[http://fhir.patientsknowbest.com/structuredefinition/version-persisted](http://fhir.patientsknowbest.com/structuredefinition/version-persisted)”
  - valueDateTime = [[Data Point.Persisted Timestamp]] |  |
|  | - extension[x]: Extension
  - url = “[https://fhir.patientsknowbest.com/structuredefinition/upstream-last-updated](https://fhir.patientsknowbest.com/structuredefinition/upstream-last-updated)”
  - valueDateTime = as per extension definition |  |
| AllergyIntolerance.clinicalStatus | [[Allergy.Status]]<br>[[Allergy.Status]] code mappings (PKB → FHIR):<br>ACTIVE → ACTIVE<br>INACTIVE → INACTIVE<br>RESOLVED → RESOLVED |  |
| AllergyIntolerance.code | <span style="color: #ff991f"><conditional></span><br><span style="color: #ff991f">If [[Allergy.Allergen]] is populated:</span><br>[[Allergy.Allergen]]<br><span style="color: #ff991f">Else:</span><br>[[Allergy.Disorder]] |  |
| AllergyIntolerance.patient | - patient: Reference
  - reference = the relative URL of the Patient resource
  - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]] |  |
| AllergyIntolerance.onsetDateTime | [[Allergy.Onset Timestamp]] |  |
| AllergyIntolerance.lastOccurrence | [[Allergy.End Timestamp]] |  |
| AllergyIntolerance.reaction | - reaction[0]: BackboneElement
  - manifestation = [[Allergy.Reactions]]
  - severity: code
    - extension[x]: Extension
      - url = <span style="color: #0747a6">“</span><span style="color: #0747a6">[http://fhir.patientsknowbest.com/structuredefinition/allergy-reaction-severity“](#)</span>
      - valueCodeableConcept = [[Allergy.Severity]] |  |