This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

FHIR Allergy Sample

From HL7Wiki
Jump to navigation Jump to search

A FHIR Representation of the Patient with allergies to different substances CDA Sample (from CDA Template Example Task Force)

The CDA sample follows this structure:

<component>
  <section>
     <text /> <- I put this aside for the moment
     Erythromycin Allergy
     Bactrim Allergy
     Peanut Allergy
     Cat Dander Allergy
  </section>
</component>

TODO: -section.text? -bundling the resources

Erythromycin Allergy

<AllergyIntolerance xmlns="http://hl7.org/fhir">

 <contained>
   <Medication id="med1">
     <name value="Bactrim" />
     
       <coding>
         <system value="urn:2.16.840.1.113883.6.88"/>
         
         <display value="Erythromycin 0.02 MG/MG Topical Gel"/>
       </coding>
     
   </Medication>
 </contained>

 <contained>
   <AdverseReaction id="react1">

     <text>
       <div xmlns="http://www.w3.org/1999/xhtml">Urticaria</div>
     </text>

     <!--Can't do high/low-->
     <!--<effectiveTime>
     <low value="199512011205-0800"/>
     <high value="199512020835-0800"/>
     </effectiveTime>-->
     <reactionDate value="1995-12-01T12:05:00-08:00"/>

     <subject>
       <reference value="patient" />
     </subject>

     <didNotOccurFlag value ="false" />

     <recorder>
       <reference value="author1" />
     </recorder>

     <symptom>
       
         <coding>
           <system value="http://snomed.info/id"/>
           
           <display value="Urticaria"/>
         </coding>
         <text value="Urticaria"/>
       
       <!--In this case, the cda sample severity is code="6736007" displayName="moderate"-->
       <!--There doesn't seem to be a way to describe the severity of the allergy, just the reaction-->
       <severity value="moderate"/>
     </symptom>
   </AdverseReaction>
 </contained>
 
 <contained>
   <Practitioner id="author1">
     <identifier>
       <system value ="urn:oid:2.16.840.1.113883.4.6" />
       <value value="66778899" />
     </identifier>
   </Practitioner>
 </contained>

 <contained>
   <Patient id="patient">
     <!--not specified in the example-->
   </Patient>
 </contained>

 <!--CDA Note: not sure which (I took from the observation/id) entry/act/id... or entry/act/entryRelationship/observation/id.  entry/act describes the id for the allergy act... entry/act/entryrelationship/obsevation is the actual allergy -->
 <identifier>
   <value value="urn:uuid:4ffd3420-0f60-425c-aaca-6255c8d8c890" />
 </identifier>

 <!--Drug allergy-->
 <identifier>
   <label value ="Drug allergy" />
   <system value="http://snomed.info/id"/>
   <value value="416098002"/>
 </identifier>

 <!--CDA Note: reference text?-->
 <!--CDA Note: time the reaction occurred isn't recordable observation.entryrelationship.obsevation-->

 <!--Severe == high?-->
 <!--CDA Note: the CDA differentiates from the severity of the reaction and the severity of the allergy... but I don't see a FHIR equivalent.-->
 <criticality value="high" />

 <!--CDA Note: we're inferring a bit here (because of snomed drug allergy code)-->
 <sensitivityType value="allergy" />

 <!--Act.effectivetime-->
 <recordedDate value="1998-05-01T11:45:00-08:00"/>

 <!--CDA Note: entry/act/statuscode denotes that the allergy is "active" and needs to be monitored. it doesn't really map 1:1 to confirmed-->
 <status value="confirmed" />

 <subject>
   <reference value="#patient" />
 </subject>

 <!--CDA Note: the author of the act-->
 <recorder>
   <reference value="#author1" />
 </recorder>

 <substance>
   <reference value="#med1"/>
   <display value="Bactrim"/>
 </substance>

 <reaction>
   <reference value="#react1"/>
   <display value="Urticaria"/>
 </reaction>

 <sensitivityTest></sensitivityTest>

</AllergyIntolerance>

Bactrim Allergy

<AllergyIntolerance xmlns="http://hl7.org/fhir">
 <contained>
   <Medication id="med1">
     <name value="Bactrim" />
     
       <coding>
         <!--RxNorm-->
         <system value="urn:2.16.840.1.113883.6.88"/>
         
         <display value="Bactrim"/>
       </coding>
     
   </Medication>
 </contained>

 <contained>
   <AdverseReaction id="react1">

     <text>
       <div xmlns="http://www.w3.org/1999/xhtml">Tongue swelling</div>
     </text>

     <!--cda entry/act/entryrelationship/observation/entryrelationship[severity]/observation/effectivetime -->
     <!--<effectiveTime><low value="19921001"/><high value="19921001"/></effectiveTime>-->
     <!--Chose the low time-->
     <reactionDate value="1992-10-01"/>

     <subject>
       <reference value="patient" />
     </subject>

     <didNotOccurFlag value ="false" />

     <!--Is this who discovered the allergy?-->
     <recorder>
       <reference value="author1" />
     </recorder>

     <symptom>
       
         <coding>
           <system value="http://snomed.info/id"/>
           
           <display value="Tongue swelling"/>
         </coding>
         <text value="Tongue swelling"/>
       
       <!--CDA tongue swelling observation.entryrelationship.observation.value [severity] In this case, the cda sample severity is code="371923003" displayName="Mild to moderate"-->
       <severity value="moderate"/>
     </symptom>
   </AdverseReaction>
 </contained>

 <contained>
   <Practitioner id="author1">
     <identifier>
       <!--NPI-->
       <system value ="urn:oid:2.16.840.1.113883.4.6" />
       <value value="66778899" />
     </identifier>
   </Practitioner>
 </contained>

 <contained>
   <Patient id="patient">
     <!--not specified in the example-->
   </Patient>
 </contained>

 <!--CDA Note: not sure which (I took from the observation/id) entry/act/id... or entry/act/entryRelationship/observation/id.  entry/act describes the id for the allergy act... entry/act/entryrelationship/obsevation is the actual allergy -->
 <identifier>
   <value value="urn:uuid:4ffd3420-0f60-425c-aaca-6255c8d8c890" />
 </identifier>

 <!--Drug allergy-->
 <identifier>
   <label value ="Drug allergy" />
   <system value="http://snomed.info/id"/>
   <value value="416098002"/>
 </identifier>

 <!--Is this what we should map to criticality?-->
 <!--CDA Note: the CDA differentiates from the severity of the reaction and the severity of the allergy... but I don't see a FHIR equivalent.-->
 <!--<value xsi:type="CD" code="371924009" displayName="Moderate to severe" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>-->
 <criticality value="mild" />

 <!--CDA Note: we're inferring a bit here (because of snomed drug allergy code)-->
 <sensitivityType value="allergy" />

 <!--Act.effectivetime-->
 <recordedDate value="2008-08-01T09:15:00-08:00"/>

 <!--CDA Note: entry/act/statuscode denotes that the allergy is active and needs to be monitored. it doesn't really map 1:1 to confirmed-->
 <status value="confirmed" />

 <subject>
   <reference value="#patient" />
 </subject>

 <!--CDA Note: the author of the act-->
 <recorder>
   <reference value="#author1" />
 </recorder>
 
 <substance>
   <reference value="#med1"/>
   <display value="Bactrim"/>
 </substance>

 <reaction>
   <reference value="#react1"/>
   <display value="Tongue swelling"/>
 </reaction>

 <sensitivityTest></sensitivityTest>

</AllergyIntolerance>

Peanut Allergy

<AllergyIntolerance xmlns="http://hl7.org/fhir">
 
 <contained>
   <Substance id="sub1">
     <text>
       <status value="generated"/>
       <div xmlns="http://www.w3.org/1999/xhtml">Peanut</div>
     </text>
     <type>
       <coding>
         <!--UNII-->
         <system value="urn:oid:2.16.840.1.113883.4.9"/>
         
         <display value="PEANUT"/>
       </coding>
     </type>
   </Substance>
 </contained>

 <contained>
   <AdverseReaction id="react1">
     <text>
       <div xmlns="http://www.w3.org/1999/xhtml">Anaphylaxis Reaction</div>
     </text>
     
     <!--effective time of CDA allergy observation. Not exactly when you noticed the allergy.. but when you noticed the reaction-->
     <reactionDate value="1988"/>
     
     <subject>
       <reference value="patient" />
     </subject>

     <didNotOccurFlag value ="false" />

     <!--Is this who discovered the allergy?-->
     <recorder>
       <reference value="author1" />
     </recorder>
     
     <!--why not in identifier?-->
     <symptom>
       
         <coding>
           <system value="http://snomed.info/id"/>
           
           <display value="Anaphylaxis"/>
         </coding>
         <text value="Anaphylaxis reaction"/>
       
       <!--CDA alaphylaxis observation.entryrelationship.observation.value [severity]
        In this case, the cda sample severity is "Severe" (snomed 24484000)-->
       <severity value="severe"/>
     </symptom>
     
     <!-- do we need this if the allergy contains the allergen?
      <exposure>
        <exposureDate value="2012-09-17"/>
        <exposureType value="coincidental"/>
        <substance>
          <reference value="sub1"/>
        </substance>
      </exposure>-->
   </AdverseReaction>
 </contained>

 <contained>
   <Practitioner id="author1">
     <identifier>
       <system value ="urn:oid:2.16.840.1.113883.4.6" />
       <value value="66778899" />
     </identifier>
   </Practitioner>
 </contained>

 <contained>
   <Patient id="patient"> <!--not specified in the example-->
     
   </Patient>
 </contained>
 
 <!--CDA Note: not sure which (I took from the observation/id) entry/act/id... or entry/act/entryRelationship/observation/id. 
  entry/act describes the id for the allergy act... entry/act/entryrelationship/obsevation is the actual allergy -->
 <identifier>
   <value value="urn:uuid:e70b70c6-48d2-47af-8138-9470ed249bab" />
 </identifier>
 
 <!--Food allergy-->
 <identifier>
   <label value ="Food Allergy" />
   <system value="http://snomed.info/id"/>
   <value value="414285001"/>
 </identifier>

 <!--CDA Note: reference text?-->
 <!--CDA Note: time the reaction occurred isn't recordable observation.entryrelationship.obsevation-->

 <!--Severe == high?-->
 <!--CDA Note: the CDA differentiates from the severity of the reaction and the severity of the allergy... but I don't see a FHIR equivalent.-->
 <criticality value="high" />

 <!--CDA Note: we're inferring a bit here (because of snomed food allergy code)-->
 <sensitivityType value="allergy" />
  
 <!--Act.effectivetime-->
 <recordedDate value="1998-05-01T11:45:00-08:00"/>

 <!--CDA Note: entry/act/statuscode denotes that the allergy is active and needs to be monitored. it doesn't really map 1:1 to confirmed-->
 <status value="confirmed" />

 <subject>
   <reference value="#patient" />
 </subject>
  
 <!--CDA Note: the author of the act-->
 <recorder>
   <reference value="#author1" />
 </recorder>  
 
 <substance>
   <reference value="#sub1"/>
   <display value="Peanut"/>
 </substance>
 
 <reaction>
   <reference value="#react1"/>
   <display value="Anaphylaxis"/>
 </reaction>
 
 <sensitivityTest></sensitivityTest>
 
</AllergyIntolerance>

Cat Dander Allergy

The FHIR equivalent to the CDA Entry for cat allergy is:

 <AllergyIntolerance xmlns="http://hl7.org/fhir">

  <!--Cat dander substance (entry.act.entryRelationship.observation.participant.participantRole[classCode="MANU"].playingEntity[classCode="MMAT"].code
    Note too, that entry.act.entryRelationship.observation.effectiveTime.low indicates allergy onset, and I can't seem to find a place to map that... Adverse Reaction seems to have a time that indicates when the reaction occurred.-->
  <contained>
    <Substance id="sub1">
     <text>
       <status value="generated"/>
       <div xmlns="http://www.w3.org/1999/xhtml">Cat Dander</div>
     </text>
     <type>
       <coding>
         <!--UNII-->
         <system value="urn:oid:2.16.840.1.113883.4.9"/>
         
         <display value="Felis catus dander"/>
       </coding>
     </type>
   </Substance>
  
  <!--Note that there does not seem an appropriate place to put entry.act.entryRelationship.observation.entryRelationship[typeCode="SUBJ"] (describing the severity of the allergy) SEE note at criticality node below-->

 </contained>

 <!--Eye Swelling Reaction (entry.act.entryRelationship.observation.entryRelationship[typeCode="MFST"].observation)-->
 <contained>
   <AdverseReaction id="react1">
     <text>
       <div xmlns="http://www.w3.org/1999/xhtml">Eye swelling reaction</div>
     </text>
  
     <!--A reaction to cat dander was observed for 3 days in January 2009. We don't seem to have an equivalent way of representing it.-->
     <!--<effectiveTime>
        <low value="20090116"/>
        <high value="2009019"/>
      </effectiveTime>-->
     <reactionDate value="2009-01-16"/> <!--Since there's no way to do effectiveTime.low/high that I can see, I took the low'\-->
  
     <!--Making a safe assumption-->
     <subject>
       <reference value="patient" />
     </subject>
  
     <!--Node CDA negation indicators, so...-->
     <didNotOccurFlag value ="false" />
  
     <!--Since there's no other author specified, we'll go up the tree until we find one... and that's at entry.act.author-->
     <recorder>
       <reference value="author1" />
     </recorder>
  
     <!--why not in identifier?-->
     <symptom>
       
         <coding>
           <system value="http://snomed.info/id"/>
           
           <display value="Eye swelling"/>
         </coding>
         <text value="Eye swelling"/>
       
       
       <!--entryrelationship[typeCode="SUBJ"].observation.value == 255604002 [mild severity]-->
       <severity value="mild"/>
     </symptom>
   </AdverseReaction>
 </contained>

 <!--Author-->
 <!--This is the CDA entry.act.author:-->
  
  <!--This author participant indicates the provider who recorded the allergy -->
 <!--<author>
     Same as when the allergy was first recorded in the patient's chart 
     <time value="199805011145-0800"/>'' '''<-Since this is the same as the act effective time, we can ignore it
    <assignedAuthor>
        <id extension="66778899" root="2.16.840.1.113883.4.6"/>
        This ID points back to a provider described in the header
    </assignedAuthor>
  </author>-->
  
 <contained>
   <Practitioner id="author1">
     <identifier>
       <system value ="urn:oid:2.16.840.1.113883.4.6" />
       <value value="66778899" />
     </identifier>
   </Practitioner>
 </contained>
  
 <!--Patient (referenced in another resource elsewhere)-->
 <contained>
   <Patient id="patient">
     <!--assumed to be in the header in the CDA example-->
   </Patient>
 </contained>

 <!--CDA entry. should both act.id and entry.act.entryRelationship.observation.id be mapped?-->
 <!--I took act.id-->
 entry/act describes the id for the allergy act... entry/act/entryrelationship/obsevation is the actual allergy--></nowiki>
 <identifier>
   <value value="urn:uuid:dd8f01c9-fb0d-4744-aeda-75e7f208dca7" />
 </identifier>

 <!--Allergy to substance (entry.act.entryRelationship.observation.value)-->
 <identifier>
   <label value ="Allergy to substance" />
   <system value="http://snomed.info/id"/>
   <value value="419199007"/>
 </identifier>

 <!--Is this the correct inference?-->
 <!--the CDA differentiates from the severity of the reaction and the severity of the allergy... but I don't see a FHIR equivalent.-->
 <criticality value="" />

 <!--we're inferring a bit here (because of snomed allergy code)-->
 <sensitivityType value="allergy" />

 <!--entry.act.effectivetime.low-->
 <recordedDate value="1998-05-01T11:45:00-08:00"/>

 <!--CDA Note: entry.act.statuscode="active" denotes that the allergy is active and needs to be monitored. It doesn't seem to really map 1:1 to confirmed-->
 <status value="confirmed" />

 <subject>
   <reference value="#patient" />
 </subject>

 <!--CDA Note: the author of the act-->
 <recorder>
   <reference value="#author1" />
 </recorder>

 <substance>
   <reference value="#sub1"/>
   <display value="Cat Dander"/>
 </substance>

 <reaction>
   <reference value="#react1"/>
   <display value="Eye swelling"/>
 </reaction>

 <sensitivityTest></sensitivityTest>

</AllergyIntolerance>