This document describes the RDF representation of FHIR Resources.

Revision History

The detailed list of changes and their diffs can be found in the Git repository.

Legend

Most of the RDF is generated by verbatim logic (e.g. An unidentified element becomes an anonymous individual -  blank node).

Where RDF is generated by special transformation it is marked in red

Where RDF is inferred by a reasoner it is marked in green.

Default Mapping

In general the mapping between types, elements in XML and Classes, individuals in RDF is generally the same. This section defines that default mapping and other section describe deviations from the default mapping.

Instance Mapping

In XML the element instances are nested using tags.

Element

An XML element corresponds to a RDF/OWL individual. In many cases unless the element has identity the mapping is to an anonymous individual. Where identity has been given to the element then it maps to a anamed individual.

XML Tag

The XML tag is mapped to an Object Property Assertion of the Object Property defined for the tag name.

XML Attribute

An XML attribute represents a simple type and in FHIR is always “value”. FHIR datatypes have attributes of XSD datatypes.

  fhir:CodingBase.display [ a fhir:string; fhir:value "Admin"] ;
Shows an anonymous individual in [] of datatype fhir:string with value data property “Admin”.

Nested Elements

An XML tag is unique within the namespace that it is declared in. FHIR does not use global declarations. The XML tag is mapped to an Object Property where the name is prefixed with the Class name in which it was declared. A tag “bar” declared in a complex type “Foo” would become an Object Property “Foo.bar”. This is aligned with the structural definition mechanism in FHIR.

Datatypes

In RDF the value attribute of a datatype is a Data Property named “value” with undefined range. Each FHIR data type has a restriction on the range of the Data Property (see section on Datatypes).

Message and Resource identity

XML Identity

XML Identity

The read RESTful interaction

  fhir:CodingBase.display [ a fhir:string; fhir:value "Admin"] ;
Causes a return of the mime type file which has an identity of [base]/[type]/[id].[mime-type]. These four parts form the dereferenceable URI and the identity of that file.

XML Resource identity

The XML Root tag binds the root element to a Complex Type. In FHIR the tag and the Complex Type have the same value however this is not always true in XML.

<AllergyIntolerance xmlns=http://hl7.org/fhir >
  <id value="1"/>
  <text>
  </text>
<!--   the date that this entry was recorded   -->
  <recordedDate value="2010-03-01"/>
<!--   the patient that actually has the risk of adverse reaction   -->
  <patient>
    <reference value="http://record/Patient/PeterPatient"/>
    <display value="Peter Patient"/>
  </patient>
<!--   substance, coded from SNOMED CT-->
  <substance>
    <coding>
      <system value="http://snomed.info/id/"/>
      <code value="90614001"/>
      <display value="beta-Lactam antibiotic"/>
    </coding>
  </substance>
  <status value="confirmed"/>
  <criticality value="high"/>
  <category value="medication"/>
</AllergyIntolerance>
          

The id value represents only a segment of the identifier. The type is taken from the root element and the base is not included in the Resource so it is not clear in FHIR that the Resource can be clearly disambiguated.

RDF/OWL identities

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix fhir: <http://hl7.org/fhir/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://record/AllergyIntolerance/1> rdf:type owl:Ontology ; owl:imports <http://hl7.org/fhir> .
<http://record/AllergyIntolerance/1> rdf:type <http://PatientSafetyProfile/AllergyIntolerance> , owl:NamedIndividual ;
   fhir:Resource.id [ rdf:type fhir:id ; fhir:value "1" ] ;
   fhir:AllergyIntolerance.status [ rdf:type fhir:code ;
      fhir:ConceptBase.coding [ fhir:CodingBase.code [ fhir:value "confirmed" ]  ]
   ] ;
   fhir:AllergyIntolerance.patient [ rdf:type fhir:Reference ;
      fhir:Reference.reference [ fhir:value "http://record/Patient/PeterPatient" ] ;
      fhir:Reference.display [ fhir:value "Peter Patient" ] ;
   ] ;
   fhir:AllergyIntolerance.substance [ rdf:type fhir:CodeableConcept , <http://snomed.info/id/90614001>;
      fhir:ConceptBase.coding [ rdf:type fhir:CodingBase ;
         fhir:CodingBase.code [ rdf:type fhir:codeBase ; fhir:value "90614001" ] ;
         fhir:CodingBase.system [ rdf:type fhir:uri ; fhir:value "http://snomed.info/sct" ] ;
         fhir:CodingBase.display [ rdf:type fhir:string ; fhir:value "beta-lactam (antibiotic)" ]
      ] ;
      fhir:ConceptBase.text [ rdf:type fhir:string ; fhir:value "beta-lactam (antibiotic)" ]
   ] .        

RDF File identity

The identity of the RDF file is its file name (e.g. http://record/AllergyIntolerance/1.ttl)

The first three segment (without the mime-type) are the name of the Ontology.

<http://record/AllergyIntolerance/1> rdf:type owl:Ontology ;
The file is an ontology. This is required since there appears to be a restriction on import statements importing the same ontology more than once. This is independent of prefixes of the elements.

RDF Individual identity

The name of the individual is derived from the URL identity of the resource. The class of the individual is declared using rdf:type:
<http://record/AllergyIntolerance/1> rdf:type <http://PatientSafetyProfile/AllergyIntolerance>, owl:NamedIndividual ;
In simple resources the identity of the message is mapped to the identity of the root element. However they may have different types.

In this case the name of the individual is the same as the name of the ontology. This appears to work.

In Bundles the identity of the message (bundle) is different from the identities of contained resources.

Note that the type of the resource is qualified by the profile which is obtained from Meta.profile (see Profile section later).

Ontology triples

The ontology identity is linked to the import predicate which links to the fhir ontology:
<http://record/AllergyIntolerance/1> rdf:type owl:Ontology ; owl:imports <http://hl7.org/fhir> .
The import statement is required for Turtle files so that the loading can distinguish between Object Properties and Annotation Properties.

Datatypes (section 1.18.0.1)

Difference in the treatment of datatypes code, string and uri as classes with primitive values as rdf:Datatypes. Datatypes are transformed into OWL Classes where the value is expressed as a an OWL DataProperty with restrictions (facets etc).

FHIR CodeableConcept and Coding Structure Definition

FHIR XML

Codeable Concept example

  <substance>
    <coding>
      <system value="http://snomed.info/sct"/>
      <code value="90614001"/>
      <display value=" beta-lactam (antibiotic)"/>
    </coding>
    <text value=" beta-lactam (antibiotic)"/>
  </substance>
          

RDF Data for Codeable Concept Instance

The RDF variant for fhir:Code, fhir:Coding and fhir:CodeableConcept are not straight translations of the FHIR representation. 3 new additional classes are introduced – codeBase, CodingBase and ConceptBase.

   fhir:AllergyIntolerance.substance [ a fhir:CodeableConcept ;
      fhir:ConceptBase.coding [ a fhir:CodingBase ;
         fhir:CodingBase.code [ fhir:value "90614001" ] ;
         fhir:CodingBase.system [ fhir:value "http://snomed.info/sct" ] ;
         fhir:CodingBase.display [ fhir:value "beta-lactam (antibiotic)" ]
      ] ;
      fhir:ConceptBase.text [ a fhir:string ; fhir:value "beta-lactam (antibiotic)" ]
   ] .
          
   <CodeableConceptShape> {
    a [fhir:CodeableConcept]?,
    fhir:ConceptBase.coding @<CodingShape>?,
    fhir:ConceptBase.text @<textShape>?
  }
  <codingShape> {
    a [fhir:CodingBase]?,
    fhir:CodingBase.code         @<extensibleLiteral>?,
    fhir:CodingBase.system       @<extensibleLiteral>?,
    fhir:CodingBase.display      @<extensibleLiteral>?,
    fhir:CodingBase.version      @<extensibleLiteral>?,
    fhir:CodingBase.userSelected @<extensibleLiteral>?
  }
  <textShape> {
    a [fhir:string]?,
    fhir:value LITERAL
  }
  <extensibleLiteral> {
    fhir:value LITERAL
  }

The fhir:CodeableConcept type assertion allows round trip back to the original XML type. The same approach will be taken for fhir:Coding and fhir:code.

This approach will be implemented by creating ConceptBase, CodingBase and codeBase individuals as blank nodes.

     

Terminology

Code system

A code system is a namespace which makes its codes unique. A Code system may contain Concepts. You can have many concept hierarchies in the same code system (e.g. SNOMED) or you can have one concept hierarchy in a code system (e.g. HL7 internal codes).

HL7 FHIR Internal Code System XML example

A definition of a code system, inlined into the value set instance (as a packaging convenience).

            <codeSystem>
             <extension url="http://hl7.org/fhir/StructureDefinition/valueset-oid">
               <valueUri value="urn:oid:2.16.840.1.113883.4.642.1.50"/>
             </extension>
             <system value="http://hl7.org/fhir/allergy-intolerance-status"/>
             <version value="1.0.0"/>
             <caseSensitive value="true"/>
             <concept>
               <code value="active"/>
               <display value="Active"/>
               <definition value="An active record of a reaction to the identified Substance."/>
               <concept>
                 <code value="confirmed"/>
                 <display value="Confirmed"/>
                 <definition value="A high level of certainty about the propensity for a reaction to the identified Substance,
                  which may include clinical evidence by testing or rechallenge."/>
               </concept>
             </concept>
           </codeSystem>
          

RDF CodeSystemURI declaration

A code system will have one named individual representing the code system. This is a member of class: fhir:CodeSystemURI. CodeSystemURI is a subclass of fhir:uri and allows named individuals to represent the URI. The properties are added to it as annotation properties. Thus the reference to a system in CodingBase.system can have a value e.g. <http://snomed.info/sct> and not have to declare a further anonymous individual.

HL7 Internal Code system URI example

              ###  http://hl7.org/fhir/cs/allergy-intolerance-status

              fhircs:allergy-intolerance-status rdf:type fhir:CodeSystemURI , owl:NamedIndividual ;
                 fhir:caseSensitive "true"^^xsd:boolean ;
                 fhir:valueset-oid "urn:oid:2.16.840.1.113883.4.642.1.50" ;
                 fhir:value "http://hl7.org/fhir/cs/allergy-intolerance-status" ;
                 fhir:prefix "http://hl7.org/fhir/allergy-intolerance-status#" ;
                 fhir:version "1.0.2" .
            

Note that since this acts as a namespace it has the case sensitivity indicator and a prefix (not in HL7 FHIR) to prepend the concepts to make them unique.

SNOMED RDF Code System URI example

              ###  http://snomed.info/sct

              <http://snomed.info/sct> rdf:type fhir:CodeSystemURI , owl:NamedIndividual ;
                 fhir:value "http://snomed.info/sct"^^xsd:anyURI .
                 fhir:caseSensitive "false"^^xsd:boolean ;
                 fhir:prefix "http://snomed.info/id/"^^xsd:string ;
                 fhir:valueset-oid "2.16.840.1.113883.6.96" ;
                 fhir:version "US1000124_20140301" .
            

Code systems are published at http://hl7-fhir.github.io/terminologies-systems.html and the URI identifier is used for FHIR/RDF rather than the OID.

Code System Version

Version of code system as part of the name is TBD.

Bridging Ontologies

Both external and HL7 internal terminologies use bridging ontologies to map between the Concepts and Codes.

If the terminology has an RDF representation then the bridging ontology binds from a common representation of Concept, Code and Value Set to that terminology.

In the case that there is not and RDF representation then the bridging ontology provides the complete representation and is constructed by transformation of the non-RDF representation.

Concept

RDF Concept Definition

A Concept in RDF/OWL is a named Class which has a restriction for CodingBase individuals associated with that concept. A specific Concept is a named subclass of the fhir:Concepts class or it is a subclass of another Concept. Where the restrictions are defined on the Concept they are the intersection of the restriction on ConceptBase.coding and CodingBase.code and CodingBase.system.

Concepts may have one or more CodingBase restrictions. The FHIR valueset resource structure definition only allows one but the RDF equivalent will relax that cardinality. A Concept which has multiple Codes associated with it, have a union of multiple CodingBase.code restrictions.

HL7 Bridging Ontology

HL7 FHIR XML Concept

The following fragment from Allergy Intolerance Status found at http://hl7 fhir.github.io/valueset allergy-intolerance-status.html

In FHIR, Code System contains ValueSet.codeSystem.concept elements.

ValueSet.codeSystem.concept have code, abstract, display, definition, designation and nested Valueset.Concepts.

                <codeSystem>
                 <extension url="http://hl7.org/fhir/StructureDefinition/valueset-oid">
                   <valueUri value="urn:oid:2.16.840.1.113883.4.642.1.50"/>
                 </extension>
                 <system value="http://hl7.org/fhir/allergy-intolerance-status"/>
                 <version value="1.0.0"/>
                 <caseSensitive value="true"/>
                 <concept>
                   <code value="active"/>
                   <display value="Active"/>
                   <definition value="An active record of a reaction to the identified Substance."/>
                   <concept>
                     <code value="confirmed"/>
                     <display value="Confirmed"/>
                     <definition value="A high level of certainty about the propensity for a reaction to the identified Substance,
                      which may include clinical evidence by testing or rechallenge."/>
                   </concept>
                 </concept>
               </codeSystem>
             </ValueSet>
            

The nesting of represents general to specific concepts although the structure does not indicate that semantic but rather a containment.

FHIR internal XML Concept mapping

The RDF Concept is a named Class which maps to the components of the ValueSet.codeSystem.concept element in FHIR Valueset Resource.

  • System maps to the restriction on CodingBase.system
  • Code maps to the restriction on CodingBase.code
  • Display maps to rdfs:label
  • Definition maps to fhir:concept_definition annotation
  • Nesting maps to subclass assertions (as a default)
  • An abstract Concept (ValueSetConcept.abstract = “true”) has no restriction on CodingBase.code just a position in the class hierarchy.
  • Designation will probably transform into annotation language (e.g. @en) or type.

HL7 Internal Concept RDF Example

###  http://hl7.org/fhir/allergy-intolerance-status#Concept

allergy-intolerance-status:Concept rdf:type owl:Class ;
   rdfs:label "Allergy Intolerance Status Concept" ;
   rdfs:subClassOf fhir:Concepts ;
   fhir:concept_definition "Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified Substance." .

###  http://hl7.org/fhir/allergy-intolerance-status#active

allergy-intolerance-status:active rdf:type owl:Class ;
   rdfs:label "Active" ;
   rdfs:subClassOf allergy-intolerance-status:Concept ;
   fhir:concept_definition "An active record of a reaction to the identified Substance" .

[ rdf:type owl:Restriction ;
  rdfs:subClassOf allergy-intolerance-status:active ; owl:onProperty fhir:ConceptBase.coding ;
  owl:someValuesFrom [ rdf:type owl:Class ;
                       owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                              owl:onProperty fhir:CodingBase.code ;
                                              owl:allValuesFrom [ rdf:type owl:Restriction ;
                                                                   owl:onProperty fhir:value ;
                                                                   owl:hasValue "active"
                                                                 ]
                                            ]
                                            [ rdf:type owl:Restriction ;
                                              owl:onProperty fhir:CodingBase.system ;
                                              owl:hasValue fhircs:allergy-intolerance-status
                                            ]
                                          )
                     ]
] .

###  http://hl7.org/fhir/allergy-intolerance-status#confirmed

allergy-intolerance-status:confirmed rdf:type owl:Class ;
   rdfs:label "Confirmed"@en ;
   rdfs:subClassOf allergy-intolerance-status:active ;
   fhir:concept_definition "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge." .

[ rdf:type owl:Restriction ;
  rdfs:subClassOf allergy-intolerance-status:confirmed ; owl:onProperty fhir:ConceptBase.coding ;
  owl:someValuesFrom [ rdf:type owl:Class ;
                       owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                              owl:onProperty fhir:CodingBase.code ;
                                              owl:allValuesFrom [ rdf:type owl:Restriction ;
                                                                  owl:onProperty fhir:value ;
                                                                  owl:hasValue "confirmed"
                                                                ]
                                            ]
                                            [ rdf:type owl:Restriction ;
                                              owl:onProperty fhir:CodingBase.system ;
                                              owl:hasValue fhircs:allergy-intolerance-status
                                            ]
                                          )
                     ]
] .
            

External Concept RDF Example

An external terminology is treated differently in that it is assumed that the ontology provided by the external organization cannot be changed. A bridging ontology is therefore provided which allows the expressions to be added to bind to the FHIR CodingBase instances.

The bridging ontology is constructed to add the expressions to categorize FHIR CodingBase individuals. This binding occurs at both code/system and concepts. Direct use of the declared SNOMED concept identifier is shown here but it is also possible to make an equivalent class if needed.

External SNOMED Ontology

The following example from the SNOMED OWL extraction shows the two top Concepts referenced in the valueset substance-code:

###  http://snomed.info/id/105590001

<http://snomed.info/id/105590001> rdf:type owl:Class ;
                                  rdfs:label "Substance (substance)" ;
                                  rdfs:subClassOf <http://snomed.info/id/138875005> .

###  http://snomed.info/id/373873005

<http://snomed.info/id/373873005> rdf:type owl:Class ;
                                  rdfs:label "Pharmaceutical / biologic product (product)" ;
                                  rdfs:subClassOf <http://snomed.info/id/138875005> .
              

Notice there is no description and the display value is in rdfs:label. Concept 138875005 is the top level SNOMED CT concept.

The extensions of the value set beyond substance-code are defined in SNOMED:

###  http://snomed.info/id/160244002

<http://snomed.info/id/160244002> rdf:type owl:Class ;
   rdfs:label "No Known Allergies" ;
   rdfs:subClassOf <http://snomed.info/id/138875005> .

###  http://snomed.info/id/409137002

<http://snomed.info/id/409137002> rdf:type owl:Class ;
   rdfs:label "No Known Drug Allergies" ;
   rdfs:subClassOf <http://snomed.info/id/138875005> .

###  http://snomed.info/id/428607008

<http://snomed.info/id/428607008> rdf:type owl:Class ;
   rdfs:label "No Known Environmental Allergy" ;
   rdfs:subClassOf <http://snomed.info/id/138875005> .

###  http://snomed.info/id/429625007

<http://snomed.info/id/429625007> rdf:type owl:Class ;
   rdfs:label "No Known Food Allergies" ;
   rdfs:subClassOf <http://snomed.info/id/138875005> .
              

These are shown as subclasses of the top concept which is incorrect.

Bridging Ontology

The FHIR SCTBridge ontology imports both fhir and snomed ontologies so it can see both:

                <http://hl7.org/fhirSCTBridge> rdf:type owl:Ontology ;
                               owl:imports <http://hl7.org/fhir> ,
                                           <http://snomed.info/id> .
              

The SNOMED ontology is named <http://snomed.info/id> which makes the concept URI construction natural.

The restrictions on the Concepts to CodingBase individuals are made through general class axioms in the same way as internal code systems:

  [ rdf:type owl:Restriction ;
  rdfs:subClassOf <http://snomed.info/id/90614001> ;
  owl:onProperty fhir:ConceptBase.coding ;
  owl:someValuesFrom [ rdf:type owl:Class ;
                       owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                              owl:onProperty fhir:CodingBase.code ;
                                              owl:allValuesFrom [ rdf:type owl:Restriction ;
                                                                   owl:onProperty fhir:value ;
                                                                   owl:hasValue "90614001"
                                                                 ]
                                            ]
                                            [ rdf:type owl:Restriction ;
                                              owl:onProperty fhir:CodingBase.system ;
                                              owl:hasValue <http://snomed.info/sct>
                                            ]
                                          )
                     ]
] .
              

This example shows that the Concept “Beta lactam antibiotic” is inferred when the ConceptBase.coding has a CodingBase where CodingBase.code has a code of 90614001 and CodingBase.system has value <http://snomed.info/sct>.

Relationship of Concept to Code SystemURI

The concept defines its CodeSystemURI through ConceptBase.system restriction.

The CodeSystemURI being an individual has no relationship to the Concepts in the Code system which are Classes.

ValueSets

A ValueSet in RDF is a specific Class which defines the CodingBase individuals which are members of it.

There are two ways of declaring the ValueSet in RDF –

See the later section for more detailed consideration of the flexibility of ValueSet definitions. These definitions will be mapped into the two ways above.

The following diagram shows the subclass relationships between the classes:

A valueset defines a subset of CodingBase individuals which meet the constraints of that ValueSet.

Two cases are explored A & B are the direct and indirect (via concepts ) restrictions:

Coding Binding to external terminology (section 1.17.3.3.5)

FHIR XML

<AllergyIntolerance xmlns=http://hl7.org/fhir >
  <id value="1"/>
  <text>
  </text>
<!--   the date that this entry was recorded   -->
  <recordedDate value="2010-03-01"/>
<!--   the patient that actually has the risk of adverse reaction   -->
  <patient>
    <reference value="http://record/Patient/PeterPatient"/>
    <display value="Peter Patient"/>
  </patient>
<!--   substance, coded from SNOMED CT-->
  <substance>
    <coding>
      <system value="http://snomed.info/id/"/>
      <code value="90614001"/>
      <display value="beta-Lactam antibiotic"/>
    </coding>
  </substance>
  <status value="confirmed"/>
  <criticality value="high"/>
  <category value="medication"/>
</AllergyIntolerance>
            

RDF Instance Example

This is the raw instance before processing and after in green for inference and red for specific processing

@prefix : <http://record/AllergyIntolerance/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sct: <http://snomed.info/id/> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix fhir: <http://hl7.org/fhir/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix profile: <http://PatientSafetyProfile/> .
@base <http://record/AllergyIntolerance/1> .

<http://record/AllergyIntolerance/> rdf:type owl:Ontology ;
  owl:imports <http://PatientSafetyProfile> .

###  http://record/AllergyIntolerance/1

<http://record/AllergyIntolerance/1> rdf:type profile:DomainResource, owl:NamedIndividual ;
   fhir:Resource.id [ rdf:type fhir:id ; fhir:value "1" ] ;
   fhir:AllergyIntolerance.status [ rdf:type fhir:code , <http://hl7.org/fhir/allergyIntoleranceStatus#confirmed>; 
      fhir:ConceptBase.coding [ fhir:CodingBase.code [ fhir:value "confirmed" ]  ] 
   ] ;
   fhir:AllergyIntolerance.patient [ rdf:type fhir:Reference ; 
      fhir:Reference.reference [ fhir:value "http://record/Patient/PeterPatient" ] ;
      fhir:Reference.display [ fhir:value "Peter Patient" ] ;
      fhir:Reference.link <http://record/Patient/PeterPatient> ;
   ] ;
   fhir:AllergyIntolerance.substance [ rdf:type fhir:CodeableConcept , <http://snomed.info/id/90614001>; 
      rdfs:label "beta-lactam (antibiotic)" ;
      fhir:ConceptBase.coding [ rdf:type fhir:CodingBase ;
         fhir:CodingBase.code [ rdf:type fhir:codeBase ; fhir:value "90614001" ] ;
         fhir:CodingBase.system [ rdf:type fhir:string ; fhir:value "http://snomed.info/sct" ] ;
         fhir:CodingBase.display [ rdf:type fhir:string ; fhir:value "beta-lactam (antibiotic)" ] 
      ] ;
      fhir:ConceptBase.text [ rdf:type fhir:string ; fhir:value "beta-lactam (antibiotic)" ]
   ] .
            

Note the use of a profile binding through the type “profile:AllergyIntolerance” which then restricts the types of CodingBase instances.

OWL Record binding Definition

Allergy Intolerance Class

The OWL schema fragment for the class and object properties is shown here:

###  http://hl7.org/fhir/AllergyIntolerance
fhir:AllergyIntolerance rdf:type owl:Class ;
                        
                        rdfs:subClassOf fhir:DomainResource ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.status ;
                                          owl:allValuesFrom fhirvs:allergy-intolerance-statusA
                                        ] ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.status ;
                                          owl:maxCardinality "1"^^xsd:nonNegativeInteger
                                        ] ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.patient ;
                                          owl:allValuesFrom fhir:Reference
                                        ] ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.patient ;
                                          owl:maxCardinality "1"^^xsd:nonNegativeInteger
                                        ] ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.substance ;
                                          owl:allValuesFrom fhir:CodeableConcept
                                        ] ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.substance ;
                                          owl:maxCardinality "1"^^xsd:nonNegativeInteger
                                        ] ,
………………………
.
            

It shows that:

  • AllergyIntolerance.status is restricted to the set defined by fhirvs:allergy intolerance statusA because the binding strength is “required”.
  • AllergyIntolerance.substance is not restricted to the set defined by fhirvs:allergyintolerance substance code but purely to the CodeableConcept since the binding strength is “example”.

FHIR XML value set definition

Allergy Intolerance Status Structural Definition

    <element>
      <path value="AllergyIntolerance.status"/>
      <short value="active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error"/>
      <definition value="Assertion about certainty associated with the propensity, or potential risk, of a reaction
       to the identified Substance."/>
      <comments value="Decision support would typically raise alerts for 'Unconfirmed', 'Confirmed', and 'Resolved'
       and ignore a 'Refuted' reaction. In particular, 'Refuted' may be useful for reconciliation of the Adverse Reaction
       List. Some implementations may choose to make this field mandatory."/>
      <alias value="State"/>
      <min value="0"/>
      <max value="1"/>
      <type>
        <code value="code"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <binding>
        <strength value="required"/>
        <description value="Assertion about certainty associated with a propensity, or potential risk, of a reaction
         to the identified Substance."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/allergy-intolerance-status"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="IAM-17"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="status"/>
      </mapping>
    </element>
            

AllergyIntolerance.substance Structural Definition

    <element>
      <path value="AllergyIntolerance.substance"/>
      <short value="Substance, (or class) considered to be responsible for risk"/>
      <definition value="Identification of a substance, or a class of substances, that is considered to be responsible
       for the adverse reaction risk."/>
      <comments value="It is strongly recommended that the substance be coded with a terminology, where possible.
       For example, some terminologies used include RxNorm, SNOMED CT, DM+D, NDFRT, ICD-9, IDC-10,
       UNI, ATC and CPT. Plain text should only be used if there is no appropriate terminology
       available. Additional details about a substance can be specified in the text."/>
      <alias value="Agent"/>
      <min value="1"/>
      <max value="1"/>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <strength value="example"/>
        <description value="Type of the substance and Negation codes for reporting no known allergies."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/allergyintolerance-substance-code"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="AL1-3 / IAM-3"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="what"/>
      </mapping>
    </element>
            

AllergyIntolerance.status Object Property definition

###  http://hl7.org/fhir/AllergyIntolerance.status

fhir:AllergyIntolerance.status rdf:type owl:ObjectProperty ;
   fhir:binding.valueSetReference "http://hl7.org/fhir/ValueSet/allergy-intolerance-status"^^xsd:anyURI ;
   fhir:isModifier "true"^^xsd:boolean ;
   fhir:isSummary "true"^^xsd:boolean ;
   rdfs:comment "Decision support would typically raise alerts for 'Unconfirmed', 'Confirmed', and 'Resolved' and ignore a 'Refuted' reaction. In particular, 'Refuted' may be useful for reconciliation  of the Adverse Reaction List. Some implementations may choose to make this field mandatory." ;
   fhir:short "active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error" ;
   fhir:binding.description "Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified Substance." ;
   fhir:concept_definition "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance." ;
   fhir:binding.strength "required" ;
   rdfs:domain fhir:AllergyIntolerance ;
   rdfs:range fhir:code ;
   rdfs:subPropertyOf fhir:objectProperty .
            

AllergyIntolerance.substance Object Property

###  http://hl7.org/fhir/AllergyIntolerance.substance

fhir:AllergyIntolerance.substance rdf:type owl:ObjectProperty ;
   fhir:isSummary "true"^^xsd:boolean ;
   fhir:binding.valueSetReference "http://hl7.org/fhir/ValueSet/allergyintolerance-substance-code" ;
   fhir:short "Substance, (or class) considered to be responsible for risk" ;
   fhir:concept_definition "Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk." ;
   fhir:binding.strength "example" ;
   rdfs:comment "It is strongly recommended that the substance be coded with a terminology, where possible.  For example, some terminologies used include RxNorm, SNOMED CT, DM+D, NDFRT, ICD-9, IDC-10, UNI, ATC and CPT. Plain text should only be used if there is no appropriate terminology available. Additional details about a substance can be specified in the text." ;
   fhir:binding.description "Type of the substance and Negation codes for reporting no known allergies." ;
   rdfs:domain fhir:AllergyIntolerance ;
   rdfs:range fhir:CodeableConcept ;
   rdfs:subPropertyOf fhir:objectProperty .
            

Approach to Conformance

Binding strength to a ValueSet determines the conformance of the CodingBase.

Almost all of the elements that have a coded data type are bound to a value set. The bindings are associated with various degrees of flexibility as to how closely the value set should be followed:

Required

To be conformant, instances of this element SHALL include a code from the specified value set

extensible

To be conformant, instances of this element must include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the valueset does not cover the concept (based on human review), alternate codings (from different code systems, including local ones) or (data type allowing) text) may be included instead.

Preferred

Instances are encouraged, to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant

Example

Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included

The classes that the CodingBase individual belong to, are inferred and the individual must belong to the ValueSet class declared in the schema if its binding strength is “required”.

In the example above, the individual ConceptBase has a CodingBase which is a member of fhirvs:allergy-intolerance-statusA so the ConceptBase individual is conformant to the schema.

This implies that a reasoner will work from the values in the CodingBase.system and CodingBase.code to infer the classes. The ValueSet Class must be equivalent or a superclass of the restriction for this to work.

Being a member of the Target ValueSet meets the “required” binding strength. Being a member of another ValueSet meets the “extensible” binding strength.

Note that the binding strength for AllergyIntolerance.substance is “example”. It is expected that a Profile would strengthen this to “required”.

In ORIM, the subclassing of restrictions approach (as a general Class axiom) is taken which avoids complications from propagation. This subclass approach for restrictions and the superclass approach for Concepts will be taken in FHIR/RDF.

The testing of the conformance is outside the scope of this paper but is expected to be performed with rules or query languages.

HL7 Internal Concept RDF Example

CodeSystem and Concept XML

<ValueSet xmlns="http://hl7.org/fhir">
  <id value="allergy-intolerance-status"/>
  <meta>
    <lastUpdated value="2015-10-27T02:58:28.599+00:00"/>
    <profile value="http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition"/>
  </meta>
  <text>

  </text>
  <extension url="http://hl7.org/fhir/StructureDefinition/valueset-oid">
    <valueUri value="urn:oid:2.16.840.1.113883.4.642.2.50"/>
  </extension>
  <url value="http://hl7.org/fhir/ValueSet/allergy-intolerance-status"/>
  <version value="1.0.2"/>
  <name value="AllergyIntoleranceStatus"/>
  <status value="draft"/>
  <experimental value="false"/>
  <publisher value="HL7 (FHIR Project)"/>
  <contact>
    <telecom>
      <system value="other"/>
      <value value="http://hl7.org/fhir"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="fhir@lists.hl7.org"/>
    </telecom>
  </contact>
  <date value="2015-10-27T02:58:28+00:00"/>
  <description value="Assertion about certainty associated with a propensity, or potential risk, of a reaction
   to the identified Substance."/>
  <codeSystem>
    <extension url="http://hl7.org/fhir/StructureDefinition/valueset-oid">
      <valueUri value="urn:oid:2.16.840.1.113883.4.642.1.50"/>
    </extension>
    <system value="http://hl7.org/fhir/allergy-intolerance-status"/>
    <version value="1.0.2"/>
    <caseSensitive value="true"/>
    <concept>
      <code value="active"/>
      <display value="Active"/>
      <definition value="An active record of a reaction to the identified Substance."/>
      <concept>
        <code value="unconfirmed"/>
        <display value="Unconfirmed"/>
        <definition value="A low level of certainty about the propensity for a reaction to the identified Substance."/>
      </concept>
      <concept>
        <code value="confirmed"/>
        <display value="Confirmed"/>
        <definition value="A high level of certainty about the propensity for a reaction to the identified Substance,
         which may include clinical evidence by testing or rechallenge."/>
      </concept>
    </concept>
    <concept>
      <code value="inactive"/>
      <display value="Inactive"/>
      <definition value="An inactive record of a reaction to the identified Substance."/>
      <concept>
        <code value="resolved"/>
        <display value="Resolved"/>
        <definition value="A reaction to the identified Substance has been clinically reassessed by testing or rechallenge
         and considered to be resolved."/>
      </concept>
      <concept>
        <code value="refuted"/>
        <display value="Refuted"/>
        <definition value="A propensity for a reaction to the identified Substance has been disproven with a high
         level of clinical certainty, which may include testing or rechallenge, and is refuted."/>
      </concept>
      <concept>
        <code value="entered-in-error"/>
        <display value="Entered In Error"/>
        <definition value="The statement was entered in error and is not valid."/>
      </concept>
    </concept>
  </codeSystem>
</ValueSet> 
            

RDF Direct Restriction

The first option for value set is where the valueset entry defines the direct restriction on code and system itself without referencing a named concept and when the ValueSet is aligned (all codes from) with the CodingSystem the declaration is simple.

Valueset allergy-intolerance-statusA is defined using general class axiom restriction on CodingBase.system

###  http://hl7.org/fhir/ValueSet/allergy-intolerance-statusA

fhirvs:allergy-intolerance-statusA rdf:type owl:Class ;
   rdfs:subClassOf fhir:Valuesets .

[ rdf:type owl:Restriction ;
  rdfs:subClassOf fhirvs:allergy-intolerance-statusA ;
  owl:onProperty fhir:CodingBase.system ;
  owl:hasValue fhircs:allergy-intolerance-status
] .
              

However, this mechanism does not validate that the coding is actually a member of the Code System which cannot be done without doing an indirect restriction (see B).

RDF Aligned ValueSet of CodingBase to Concept (B)

Since we can use the set expressions of OWL on classes (Concepts) there is a simplification to the expression of Valuesets subclasses as shown in allergy-intolerance-statusC.

The concepts are named classes as shown earlier. The Valuesets subclass can now refer to these named classes avoiding repetitive declaration of anonymous classes.

When the valueset is aligned with the code system the ValueSet is a superclass of all the CodingBase individuals which have a type Concept of the top concept (inferred).

###  http://hl7.org/fhir/ValueSet/allergy-intolerance-statusC

fhirvs:allergy-intolerance-statusC rdf:type owl:Class ;
   rdfs:label "Allergy Int Status C" ;
   rdfs:subClassOf fhir:Valuesets .

[ rdf:type owl:Restriction ;
  rdfs:subClassOf fhirvs:allergy-intolerance-statusC ;
  owl:onProperty fhir:CodingBase.concept ;
  owl:someValuesFrom allergy-intolerance-status:Concept
] .
              

This is entered as a general class axiom as in the other examples.

Note the Object Property CodingBase.concept which is the inverse of ConceptBase.coding:

###  http://hl7.org/fhir/CodingBase.concept

fhir:CodingBase.concept rdf:type owl:ObjectProperty ;
   owl:inverseOf fhir:ConceptBase.coding ;
   rdfs:subPropertyOf fhir:objectProperty .
              

The object property is then used in the restriction to say that the CodingBase individual belongs to the Concept as defined in the Concept restriction (in section 4.2.3).

External terminology ValueSets

All codes from

No examples are given where the Valueset is all codes from an external code system since this is generally too broad. If this is required the same process as internal terminologies can be used.

ValueSet Resource example in XML

The valueset “allergyintolerance-substance-code” includes the valueset “substance-code” but adds some additional codes:

<ValueSet xmlns="http://hl7.org/fhir">
  <id value="substance-code"/>
   
  <description value="This value set contains concept codes for specific substances"/>
  <copyright value="This value set includes content from SNOMED CT, which is copyright © 2002+ International
   Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement
   between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement"/>
  <compose>
    <include>
      <system value="http://snomed.info/sct"/>
      <filter>
        <property value="concept"/>
        <op value="is-a"/>
        <value value="105590001"/>
      </filter>
    </include>
    <include>
      <system value="http://snomed.info/sct"/>
      <filter>
        <property value="concept"/>
        <op value="is-a"/>
        <value value="373873005"/>
      </filter>
    </include>
  </compose>
</ValueSet>
            

<ValueSet xmlns="http://hl7.org/fhir">
  <id value="allergyintolerance-substance-code"/>
   
  <description value="This value set includes concept codes for specific substances and negation codes to specify
   the absence of specific types of allergies."/>
  <copyright value="This value set includes content from SNOMED CT, which is copyright © 2002+ International
   Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement
   between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement"/>
  <compose>
    <import value="http://hl7.org/fhir/ValueSet/substance-code"/>
    <include>
      <system value="http://snomed.info/sct"/>
      <concept>
        <code value="160244002"/>
        <display value="No Known Allergies"/>
      </concept>
      <concept>
        <code value="429625007"/>
        <display value="No Known Food Allergies"/>
      </concept>
      <concept>
        <code value="409137002"/>
        <display value="No Known Drug Allergies"/>
      </concept>
      <concept>
        <code value="428607008"/>
        <display value="No Known Environmental Allergy"/>
      </concept>
    </include>
  </compose>
</ValueSet>
            
            

Notice that allergyintolerance-substance-code extends substance-code with 4 concepts with their code restrictions and the system restriction at the beginning.

RDF CodingBase Direct Restriction (A)

The Valueset substance-codeB is declared in the FHIR ontology with no restrictions:

###  http://hl7.org/fhir/ValueSet/substance-codeA

fhirvs:substance-codeB rdf:type owl:Class ;
   rdfs:label "Substance Code" ;
   rdfs:subClassOf fhir:Valuesets.
              

In the Bridging Ontology, substance-codeA is declared against CodingBase.system and CodingBase.code restrictions.

[ rdf:type owl:Class ;
  rdfs:subClassOf <http://hl7.org/fhir/ValueSet/substance-codeA> ;
  owl:intersectionOf ( [ rdf:type owl:Restriction ; owl:onProperty fhir:CodingBase.code ;
        owl:allValuesFrom [ rdf:type owl:Class ;
           owl:unionOf ( 
              [ rdf:type owl:Restriction ; owl:onProperty fhir:value ; owl:hasValue "105590001" ]
              [ rdf:type owl:Restriction ; owl:onProperty fhir:value ; owl:hasValue "373873005" ]
           )
        ]
     ]
     [ rdf:type owl:Restriction ; owl:onProperty fhir:CodingBase.system ;
        owl:hasValue <http://snomed.info/sct>
     ]
  )
] .
              

This will only define the ValueSet as the top code and does not include all the subconcepts as codes. In order to do this an expansion must be made with a filter. See http://hl7-fhir.github.io/valueset-allergyintolerance-substance-code.html

The operation <filter><op> declares “is-a” to mean transitive subclassing. However this is not understood by RDF/OWL. What is understood is the subclassing of the SNOMED Concept ontology itself.

The only solution is to extract all the codes in the hierarchy and explicitly declare them in the Bridging Ontology. The treatment of allergyintolerance-substance-code is to add the concepts to the enumerated list.

RDF ValueSet binding to Concepts(B)

The valueset substance-codeB is declared in FHIR as before:

###  http://hl7.org/fhir/ValueSet/substance-codeB

fhirvs:substance-codeB rdf:type owl:Class ;
                       rdfs:label "Substance  Codes B" ;
                       rdfs:subClassOf fhir: Valuesets .
            

The allergyintolerance-substance-code valueset is also declared in FHIR

###  http://hl7.org/fhir/ValueSet/allergyintolerance-substance-code

<http://hl7.org/fhir//ValueSet/allergyintolerance-substance-code> rdf:type owl:Class ;
   rdfs:label " AllergyIntolerance Substance and Negation Codes" ;
   rdfs:subClassOf fhir:CodingBase_in_Valuesets .
            

The bridging ontology declares a general Class axiom which shows the mapping to the Concepts:

[ rdf:type owl:Restriction ;
  rdfs:subClassOf <http://hl7.org/fhir/ValueSet/substance-codeB> ;
  owl:onProperty fhir:CodingBase.concept ; owl:someValuesFrom [ rdf:type owl:Class ;
     owl:unionOf ( <http://snomed.info/id/105590001>
                   <http://snomed.info/id/373873005>
                 )
                     ]
] .
            
[ rdf:type owl:Class ;
  rdfs:subClassOf <http://hl7.org/fhir/ValueSet/allergyintolerance-substance-code> ;
  owl:unionOf ( <http://hl7.org/fhir/ValueSet/substance-codeD>
                [ rdf:type owl:Restriction ;
                  owl:onProperty fhir:CodingBase.concept ; owl:someValuesFrom [ rdf:type owl:Class ;
                     owl:unionOf ( <http://snomed.info/id/160244002>
                                   <http://snomed.info/id/409137002>
                                   <http://snomed.info/id/428607008>
                                   <http://snomed.info/id/429625007>
                                 )
                  ]
                ]
              )
] .
            

CodingBase.concept defines the restriction on concepts for the Codingbase.

The display values are redundant and since closure is achieved with these classes, their display as rdfs:label can be shown at any time in an OWL tool.

FHIR Allergy Intolerance OWL Schema

The schema is abridged to show the topics of interest:

###  http://hl7.org/fhir/AllergyIntolerance

fhir:AllergyIntolerance rdf:type owl:Class ;
                        
                        rdfs:subClassOf fhir:DomainResource ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.substance ;
                                          owl:maxCardinality "1"^^xsd:nonNegativeInteger
                                        ] ,
                                        [ rdf:type owl:Restriction ;
                                          owl:onProperty fhir:AllergyIntolerance.substance ;
                                          owl:allValuesFrom fhir:CodeableConcept
                                        ] ,
Etc..
.
            

The substance Object Property has no valueset type yet only the restriction that it is a CodeableConcept type. The valueset gets applied through the structural definition or profile binding.

Definitions of Code System, Concept

This section is needed to ground the definitions of Coding System, and Concept when defined in RDF/OWL.

Code System

The system ensures that codes can be unambiguously traced back to their original definition, and that logical comparisons, matching and inferences can be performed consistently by different systems.

In RDF/OWL a code system is a namespace in which the code is unique. Since a code forms a fragment of a URI, the code-system forms a prefix to that fragment making it unique. The code system identity and the prefix may not be the same but are related using a property of the code system.

URI

Source

OID

http://snomed.info/sct

SNOMED CT (IHTSDO )

2.16.840.1.113883.6.96

The prefix for snomed is http://snomed.info.id/

###  http://snomed.info/sct

<http://snomed.info/sct> rdf:type fhir:CodeSystemURI ,
                                  owl:NamedIndividual ;
                         
                         fhir:value "http://snomed.info/sct" .
            

A specific CodeSystem may be declared as a class which is a set of all the CodingBase individuals restricted by the CodingBase.system property.

###  http://snomed.info/sct

<http://snomed.info/sct> rdf:type owl:Class ;
                         
                         rdfs:subClassOf fhir:CodingBase_in_Systems .
            

Concept

A concept may be a single Class in RDF which may in turn be a union of multiple classes based on subclass relationships.

ValueSet

Example is substance-code used in AllergyIntolerance

Summary

Defining URL:

Name:

Substance Code

Definition:

This value set contains concept codes for specific substances

OID:

2.16.840.1.113883.4.642.2.57 (for OID based terminology systems)

Copyright:

This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement

Source Resource

XML / JSON

Content Logical Definition

This value set includes codes from the following code systems:

  • Include codes from http://snomed.info/sct where concept is-a 105590001
  • Include codes from http://snomed.info/sct where concept is-a 373873005

RDF Definition

Since these concepts in snomed are hierarchical, classes the valueset is by definition a union of concept classes.

A named Valueset as a class is a union of named concept classes (not a superclass). If an instance of CodingBase is typed to a Valueset then it probably means that the codeBase is unknown or to be selected.

The FHIR “include” gets stranslated to a union expression:

Examples

ValueSet schema in FHIR

A ValueSet individual will have define, compose and expansion object properties to applicable objects. The following RDF samples show a direct translation of the metamodel viewpoint.

###  http://hl7.org/fhir/ValueSet
fhir:ValueSet rdf:type owl:Class ;
              rdfs:subClassOf fhir:DomainResource ,
                              [ rdf:type owl:Restriction ;
                                owl:onProperty fhir:ValueSet.define ;
                                owl:allValuesFrom fhir:ValueSet.Define
                              ] ,
                              [ rdf:type owl:Restriction ;
                                owl:onProperty fhir:ValueSet.define ;
                                owl:maxCardinality "1"^^xsd:nonNegativeInteger
                              ] ,
                              [ rdf:type owl:Restriction ;
                                owl:onProperty fhir:ValueSet.compose ;
                                owl:allValuesFrom fhir:ValueSet.Compose
                              ] ,
                              [ rdf:type owl:Restriction ;
                                owl:onProperty fhir:ValueSet.expansion ;
                                owl:maxCardinality "1"^^xsd:nonNegativeInteger
                              ] ,
                              [ rdf:type owl:Restriction ;
                                owl:onProperty fhir:ValueSet.expansion ;
                                owl:allValuesFrom fhir:ValueSet.Expansion
                              ] ,
                              [ rdf:type owl:Restriction ;
                                owl:onProperty fhir:ValueSet.compose ;
                                owl:maxCardinality "1"^^xsd:nonNegativeInteger
                              ] .

###  http://hl7.org/fhir/ValueSet.Compose
fhir:ValueSet.Compose rdf:type owl:Class ;
                      rdfs:subClassOf fhir:BackboneElement .
                
###  http://hl7.org/fhir/ValueSet.Concept
fhir:ValueSet.Concept rdf:type owl:Class ;
                      rdfs:subClassOf fhir:BackboneElement ,
                                      [ rdf:type owl:Restriction ;
                                        owl:onProperty fhir:ValueSet.Concept.display ;
                                        owl:allValuesFrom fhir:string
                                      ] ,
                                      [ rdf:type owl:Restriction ;
                                        owl:onProperty fhir:ValueSet.Concept.code ;
                                        owl:cardinality "1"^^xsd:nonNegativeInteger
                                      ] ,
                                      [ rdf:type owl:Restriction ;
                                        owl:onProperty fhir:ValueSet.Concept.code ;
                                        owl:allValuesFrom fhir:code
                                      ] ,
                                      [ rdf:type owl:Restriction ;
                                        owl:onProperty fhir:ValueSet.Concept.definition ;
                                        owl:maxCardinality "1"^^xsd:nonNegativeInteger
                                      ] ,
                                      [ rdf:type owl:Restriction ;
                                        owl:onProperty fhir:ValueSet.Concept.display ;
                                        owl:maxCardinality "1"^^xsd:nonNegativeInteger
                                      ] ,
                                      [ rdf:type owl:Restriction ;
                                        owl:onProperty fhir:ValueSet.Concept.definition ;
                                        owl:allValuesFrom fhir:string
                                      ] .
                
###  http://hl7.org/fhir/ValueSet.Define
fhir:ValueSet.Define rdf:type owl:Class ;
                     rdfs:subClassOf fhir:BackboneElement ,
                                     [ rdf:type owl:Restriction ;
                                       owl:onProperty fhir:ValueSet.Define.system ;
                                       owl:allValuesFrom fhir:uri
                                     ] ,
                                     [ rdf:type owl:Restriction ;
                                       owl:onProperty fhir:ValueSet.Define.system ;
                                       owl:cardinality "1"^^xsd:nonNegativeInteger
                                     ] ,
                                     [ rdf:type owl:Restriction ;
                                       owl:onProperty fhir:ValueSet.Define.concept ;
                                       owl:allValuesFrom fhir:ValueSet.Concept
                                     ] .

###  http://hl7.org/fhir/ValueSet.Expansion
fhir:ValueSet.Expansion rdf:type owl:Class ;
                        rdfs:subClassOf fhir:BackboneElement .
                

FHIR internal System and Coding bindings (OWL Schema)

The system is inclusive of all the terms within it and all the instances of those terms.

@prefix allergy-intolerance-status: <http://hl7.org/fhir/allergy-intolerance-status#> .

###  http://hl7.org/fhir/allergy-intolerance-status

fhir:allergy-intolerance-status rdf:type owl:Class ;
  rdfs:subClassOf fhir:valueset-system ,
  [ rdf:type owl:Class ;
    owl:unionOf ( 
      allergy-intolerance-status:confirmed
      allergy-intolerance-status:entered-in-error
      allergy-intolerance-status:refuted
      allergy-intolerance-status:resolved
      allergy-intolerance-status:unconfirmed
    )
  ] ,
  [ rdf:type owl:Restriction ;
    owl:onProperty fhir:CodingBase.system ;
    owl:allValuesFrom [ rdf:type owl:Restriction ;
      owl:onProperty fhir:value ; owl:hasValue "http://hl7.org/fhir/allergy-intolerance-status"
    ]
  ] ;
  fhir:prefix "http://hl7.org/fhir/allergy-intolerance-status#" .

###  http://hl7.org/fhir/allergy-intolerance-status#confirmed

allergy-intolerance-status:confirmed rdf:type owl:Class ;
  rdfs:label "Confirmed" ;
  rdfs:subClassOf fhir:allergy-intolerance-status ,
  [ rdf:type owl:Restriction ;
    owl:onProperty fhir:CodingBase.code ;
    owl:allValuesFrom [ rdf:type owl:Restriction ;
      owl:onProperty fhir:value ; owl:hasValue "confirmed"
    ]
  ] ;
  rdfs:comment "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge." .

###  http://hl7.org/fhir/allergy-intolerance-status#entered-in-error

allergy-intolerance-status:entered-in-error rdf:type owl:Class ;
  rdfs:label "Entered In Error" ;
  rdfs:subClassOf fhir:allergy-intolerance-status ,
  [ rdf:type owl:Restriction ;
    owl:onProperty fhir:CodingBase.code ;
    owl:allValuesFrom [ rdf:type owl:Restriction ;
      owl:onProperty fhir:value ; owl:hasValue "entered-in-error"
    ]
  ] ;
  rdfs:comment "The statement was entered in error and is not valid" .
            

The system Class definition shows it is a subclass of the abstract valueset-system and restricts its members to the CodingBase.system.

There is also an annotation property fhir:prefix which defines the structure of the URI prefix when naming the members of the system. It causes the @prefix declaration.

Two members are shown “confirmed” and “entered-in-error”. They are subclasses of allergy-intolerance-status and have the restrictions of that class so they do not have to declare CodingBase.system restrictions.

System and codings external RDF representation

From the SNOMED RDF:

<http://snomed.info/id/138875005> rdf:type owl:Class ;
                                  rdfs:label "SNOMED CT Concept" .

<http://snomed.info/id/105590001> rdf:type owl:Class ;
                                  rdfs:label "Substance (substance)" ;
                                  rdfs:subClassOf <http://snomed.info/id/138875005> .

<http://snomed.info/id/373873005> rdf:type owl:Class ;
                                  rdfs:label "Pharmaceutical / biologic product (product)" ;
                                  rdfs:subClassOf <http://snomed.info/id/138875005> .

<http://snomed.info/id/346325008> rdf:type owl:Class ;
                                  rdfs:label "Antibacterial drugs (product)" ;
                                  rdfs:subClassOf <http://snomed.info/id/373873005> .

<http://snomed.info/id/90614001> rdf:type owl:Class ;
                                  rdfs:label "beta-Lactam antibiotic" ;
                                  rdfs:subClassOf <http://snomed.info/id/346325008> .
            

The system is defined further in the FHIR ontology

@prefix sct: <http://snomed.info/id/> .

###  http://snomed.info/sct

<http://snomed.info/sct> rdf:type owl:Class ;
  rdfs:subClassOf fhir:valueset-system ;
  fhir:prefix "http://snomed.info/id/" .
            

Valueset Definition

A ValueSet is somewhat similar to a value-set-system in that it applies constraints to the members but they can be from different systems.

The specific ValueSet is a Class which is a union of Concept classes from one or more coding-systems. It is expected that this representation can be computed from the FHIR representation.

Anonymous codings

Here is the definition of the specific ValueSet as a Class with restrictions on values not types:

<http://hl7.org/fhir/vs/allergy-intolerance-status> rdf:type owl:Class ;
  rdfs:label "Allergy Intolerance Status Value Set" ;
  rdfs:subClassOf fhir:valueset ,
  [ rdf:type owl:Class ;
    owl:intersectionOf ( 
      [ rdf:type owl:Restriction ;
        owl:onProperty fhir:CodingBase.code ;
        owl:someValuesFrom [ rdf:type owl:Class ;
          owl:unionOf ( 
            [ rdf:type owl:Restriction ; owl:onProperty fhir:value ; owl:hasValue "confirmed" ]
            [ rdf:type owl:Restriction ; owl:onProperty fhir:value ; owl:hasValue "entered-in-error" ]
            [ rdf:type owl:Restriction ; owl:onProperty fhir:value ; owl:hasValue "refuted" ]
            [ rdf:type owl:Restriction ; owl:onProperty fhir:value ; owl:hasValue "resolved" ]
            [ rdf:type owl:Restriction ; owl:onProperty fhir:value ; owl:hasValue "unconfirmed" ]
          )
        ]
      ]
      [ rdf:type owl:Restriction ;
        owl:onProperty fhir:CodingBase.system ;
        owl:allValuesFrom [ rdf:type owl:Restriction ; owl:onProperty fhir:value ;
          owl:hasValue "http://fhir/allergy-intolerance-status"
        ]
      ]
    )
  ] .
                

If the valueset needs to identify CodingBase restrictions from other systems then the restriction will have a slightly different structure. The example here shows the optimization for a single system (Define).

Named codings

If named codings are used then the expression can be greatly simplified since the restrictions are in the named class.

<http://hl7.org/fhir/vs/allergy-intolerance-status> rdf:type owl:Class ;
rdfs:label "Allergy Intolerance Status Value Set" ;
rdfs:subClassOf fhir:valueset ,
  [ rdf:type owl:Class ;
    owl:unionOf ( allergy-intolerance-status:confirmed
      allergy-intolerance-status:entered-in-error
      allergy-intolerance-status:refuted
      allergy-intolerance-status:resolved
      allergy-intolerance-status:unconfirmed
    )
  ] .
              

ValueSet schema in the metamodel

A metamodel is introduced when Classes in the Model are instances of MetaClasses which are subclasses of owl:class. In general the Element Definition (1.23.0) is a metamodel.

In the metamodel viewpoint, an instance of ValueSet will have object property assertions to

  • instances of ValueSet.Define if all the codes are taken from a single system
  • instances of ValueSet.Compose if the codes come from multiple systems and allow inclusion and exclusion
  • instances of ValueSet.Expansion if the valueset is converted into an enumerated list
A ValueSet individual will have define, compose and expansion object properties to applicable objects. However, these object property semantics are not understood by RDF or OWL. They are translated in the Model to subclass, intersection and union relationships between classes.

Restriction equivalents to Compose Elements

The Compose element has subelements – import, include, exclude.

Import

Import has a value of a ValueSet URI that is to be imported (see earlier Valueset example – 7.2.1)

                owl:unionOf ( <http://hl7.org/fhir/ValueSet/substance-codeD>
                [ rdf:type owl:Restriction ;
                Etc.]
              )
              

The import equivalent is the unionOf with the named Class representing the Valueset (here shown as <http://hl7.org/fhir/ValueSet/substance-codeD>.

CodeSystem – Concepts

The extensional definition of a Code system includes its concepts as subclasses of the top concept. This is translated into a CodeSystemURI individual with the annotation properties of the CodeSystem and the associated Concept Classes.

However, there is no direct ontology relationship between the CodeSystemURI and the top concept. Some thoughts about a pun relationship might be useful.

See - HL7 Internal Concept RDF Example.

Filter

The Filter element selects concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.

The Filter Operator value set has an inline code system http://hl7.org/fhir/filter-operator, which defines the following codes:

Code

Display

Definition

=

Equals

The specified property of the code equals the provided value.

is-a

Is A (by subsumption)

Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself.

is-not-a

Not (Is A) (by subsumption)

The specified property of the code does not have an is-a relationship with the provided value.

regex

Regular Expression

The specified property of the code matches the regex specified in the provided value.

in

In Set

The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).

not-in

Not in Set

The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).

Is-a – by subsumption

XML example

<include>
      <system value="http://snomed.info/sct"/>
      <filter>
        <property value="concept"/>
        <op value="is-a"/>
        <value value="105590001"/>
      </filter>
    </include>
    <include>
      <system value="http://snomed.info/sct"/>
      <filter>
        <property value="concept"/>
        <op value="is-a"/>
        <value value="373873005"/>
      </filter>
    </include>
                

The difficulty with this filter is that while it appears to apply to the concept class which can have is-a subsumption, the value is the CodingBase.code value which restricts it to the concept class without subsumption. CodingBase is a single class and the instances are not subsumable.

Compose Include is-a Concept

The approach is that the value must be translated into the Concept Class Name which would be <http://snomed.info/id/373873005> and would be used in the restriction.

                  <http://snomed.info/sct> fhir:prefix "http://snomed.info/id/"^^xsd:string .
                

An annotation property on the CodeSystem individual can be used to construct the concept name where a simple prefix is used with the codeBase value.

This may also be articulated by the ValueSet fragment class which has the system and filter annotation properties and could be translated into the final RDF form.

The include element in conjunction with filtering on is-a concept is transformed into a union of the named concept:

owl:someValuesFrom [ rdf:type owl:Class ;
                       owl:unionOf ( <http://snomed.info/id/105590001>
                                     <http://snomed.info/id/373873005>
                

Exclude

XML Example

         <exclude>
            <system value="http://snomed.info/sct"/>
            <filter>
              <property value="concept"/>
              <op value="is-a"/>
              <value value="410942007"/>
            </filter>
          </exclude>
                

Compose Exclude is-a Concept

[ rdf:type owl:Class ;
  rdfs:subClassOf <http://hl7.org/fhir/ValueSet/allergyintolerance-substance-code> ;
  owl:unionOf ( <http://hl7.org/fhir/ValueSet/substance-codeD>
                [ rdf:type owl:Restriction ;
                  owl:onProperty fhir:CodingBase.concept ;
                  owl:someValuesFrom [ rdf:type owl:Class ;
                                       owl:intersectionOf ( [ rdf:type owl:Class ;
                                                              owl:unionOf ( <http://snomed.info/id/160244002>
                                                                            <http://snomed.info/id/409137002>
                                                                            <http://snomed.info/id/428607008>
                                                                            <http://snomed.info/id/429625007>
                                                                          )
                                                            ]
                                                            [ rdf:type owl:Class ;
                                                              owl:complementOf <http://snomed.info/id/410942007>
                                                            ]
                                                          )
                                     ]
                ]
              )
] .
                

In this case the concept <http://snomed.info/id/410942007> is in the intersection as a complementOf so as to be excluded.

Equals and In

XML Example

       <description value="All RxNorm codes that have TTY = IN,PIN,MIN,BN, but TTY != OCD."/>
        <compose>
          <include>
            <system value="http://www.nlm.nih.gov/research/umls/rxnorm"/>
            <filter>
              <property value="TTY"/>
              <op value="in"/>
              <value value="IN,PIN,MIN,BN"/>
            </filter>
          </include>
          <exclude>
            <system value="http://www.nlm.nih.gov/research/umls/rxnorm"/>
            <filter>
              <property value="TTY"/>
              <op value="="/>
              <value value="OCD"/>
            </filter>
          </exclude>
        </compose>
                

These properties are specific to the code systems illustrated and would be expressed in the bridging ontology for that system.

Filter RDF Expression

Each filter is defined as a class. In the RDF example these will be named to assist testing and visibility.

A filter class will declare the set meeting the filter properties which are annotation properties. The set are CodingBase individuals and the filter is therefore a fragment of a ValueSet.

###  http://hl7.org/fhir/SomeBridge/fragmentA

<http://hl7.org/fhir/SomeBridge/fragmentA> rdf:type owl:Class ;
                                           rdfs:subClassOf fhir:Valuesets ;
                                           fhir:filter.property "TTY" ;
                                           fhir:filter.op "in" ;
                                           fhir:filter.system "http://www.nlm.nih.gov/research/umls/rxnorm" ;
                                           fhir:filter.value "IN,PIN,MIN,BN" .

###  http://hl7.org/fhir/SomeBridge/fragmentB

<http://hl7.org/fhir/SomeBridge/fragmentB> rdf:type owl:Class ;
                                           rdfs:subClassOf fhir:Valuesets ;
                                           fhir:filter.property "TTY" ;
                                           fhir:filter.op "=" ;
                                           fhir:filter.system "http://www.nlm.nih.gov/research/umls/rxnorm" ;
                                           fhir:filter.value "OCD" .
                

The definition may not be interpreted by OWL but can be through other mechanisms.

Further exploration needs to be done on SPARQL and SWRL expressions to define the fragment membership of CodingBase individuals there thereby the membership of the ValueSet.

The RDF ValueSet

The fragments are combined together based on include and exclude elements:

###  http://hl7.org/fhir/ValueSet/substance-rxnorm

<http://hl7.org/fhir/ValueSet/substance-rxnorm> rdf:type owl:Class ;
   rdfs:label "DAF Substance RxNorm Codes" ;
   rdfs:subClassOf fhir:Valuesets ;
   fhir:telecom.other "http://hl7.org/fhir" ;
   fhir:lastUpdated "2015-10-15T03:44:57.526+00:00" ;
   fhir:publisher "FHIR Project team" ;
   fhir:status "draft" ;
   fhir:concept_definition "All RxNorm codes that have TTY = IN,PIN,MIN,BN, but TTY != OCD." ;
   fhir:valueset-oid "urn:oid:2.16.840.1.113762.1.4.1010.7" .

[ rdf:type owl:Class ;
  rdfs:subClassOf <http://hl7.org/fhir/ValueSet/substance-rxnorm> ;
  owl:intersectionOf ( <http://hl7.org/fhir/SomeBridge/fragmentA>
                       [ rdf:type owl:Class ;
                         owl:complementOf <http://hl7.org/fhir/SomeBridge/fragmentB>
                       ]
                     )
] .
                

Resource References

FHIR XML

 < AllergyIntolerance xmlns="http://hl7.org/fhir" >
  < id value="1" />
  < text >
   
  </ text >
<!--   the date that this entry was recorded   -->
  < recordedDate value="2010-03-01" />
<!--   the patient that actually has the risk of adverse reaction   -->
  < patient >
    < reference value = "http://record/Patient/PeterPatient" />
    < display value = "Peter Patient" />
  </ patient >
</ AllergyIntolerance > 
        

RDF Data After processing (acquiring the resource and importing)

fhir:AllergyIntolerance.patient [ fhir:Reference.display [ fhir:value "Peter Patient" ] ;
                                fhir:Reference.reference [ fhir:value "http://record/Patient/PeterPatient" ] ;
                                fhir:Reference.link <http://record/Patient/PeterPatient>
                               ] ; 
        

Note that Reference object has been supplemented by the URI of the Reference.link.

AllergyIntolerance.patient.link can represent the property chain as shown earlier. A reverse property of the property chain can get the resources for a particular patient.

###  http://hl7.org/fhir/AllergyForPatient
fhir:AllergyForPatient rdf:type owl:ObjectProperty ;
                       owl:inverseOf fhir:AllergyIntolerance.patient.link .
###  http://hl7.org/fhir/AllergyIntolerance.patient.link
fhir:AllergyIntolerance.patient.link rdf:type owl:ObjectProperty ;
                       owl:propertyChainAxiom ( fhir:AllergyIntolerance.patient fhir:Reference.link ) .
        

The Reference.link is declared when the resource has been imported and closure has been achieved. This allows the consumer to determine whether the import has happened or not and can trigger that function. If the Reference.link is pre-established there will be no indication in the import and the Resource instance will be empty.

Containment

Containment is where a resource or container contains other resources.

It applies to Bundle, Contained and Parameters.

Bundle

One common operation performed with resources is to gather a collection of resources into a single instance with containing context. In FHIR this is referred to as "bundling" the resources together. These resource bundles are useful for a variety of different reasons, including:

Bundle XML instance

<Bundle xmlns="http://hl7.org/fhir">
  <id value="bundle-example"/><!--   this example bundle is a search set   -->
  <meta>
    <lastUpdated value="2014-08-18T01:43:30Z"/>
  </meta><!--   when the search was executed   -->
  <type value="searchset"/><!--   the base URL of the server is responding to the search   -->
  <base value="http://example.com/base"/><!--   the total number of matches. This is a stupid example - there's a grand total of 3 matches, and we're only going to return the first 1, with a next link, in order to demonstrate what a page link looks like   -->
  <total value="3"/>
  <link>
    <relation value="self"/>
    <url value="https://example.com/base/MedicationPrescription?patient=347&amp;_include=MedicationPrescription.medication"/>
  </link><!--   now, the link to the next set of results.
  Note that a big set of results will include prev, first, last links as well as next   -->
  <link>
    <relation value="next"/>
    <url value="https://example.com/base/MedicationPrescription?patient=347&amp;searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&amp;page=2"/>
  </link><!--   now, the actual entries   -->
  <entry>
    <resource>
      <MedicationPrescription><!--   the matching resource   -->
        <id value="3123"/>
        <text>
          Omitted
        </text>
        <patient>
          <reference value="Patient/347"/>
        </patient>
        <medication>
          <reference value="Medication/example"/>
        </medication>
      </MedicationPrescription>
    </resource>
    <search><!--   this resource included as a match to the search criteria. Servers are not required to populate this, but should, because there are a few cases where it might be ambiguous whether a resource is added because it's a match or an include  -->
      <mode value="match"/><!--   score. For matches where the criteria are not determinate,
        e.g. text search on narrative, the server can include a score to indicate
        how well the resource matches the conditions. Since this search is by patient
        identifier, there's nothing fuzzy about it, but for example purposes:   -->
      <score value="1"/>
    </search>
  </entry>
  <entry>
    <resource>
      <Medication>
        <id value="example"/>
        <text>
        </text>
      </Medication>
    </resource><!--   snip   -->
    <search><!--   added because the client asked to include the medications   -->
      <mode value="include"/>
    </search>
  </entry>
</Bundle>
          

Bundle XML content description

< Bundle xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <type value="[code]"/><!-- 1..1 document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection -->
 <total value="[unsignedInt]"/><!-- ?? 0..1 If search, the total number of matches -->
 <link>  <!-- 0..* Links related to this Bundle -->
  <relation value="[string]"/><!-- 1..1 http://www.iana.org/assignments/link-relations/link-relations.xhtml -->
  <url value="[uri]"/><!-- 1..1 Reference details for the link -->
 </link>
 <entry>  <!-- 0..* Entry in the bundle - will have a resource, or information -->
  <link><!-- 0..* Content as for Bundle.link Links related to this entry --></link>
  <fullUrl value="[uri]"/><!-- 0..1 Absolute URL for resource (server address, or UUID/OID) -->
  <resource><!-- 0..1 Resource A resource in the bundle --></resource>
  <search>  <!-- ?? 0..1 Search related information -->
   <mode value="[code]"/><!-- 0..1 match | include | outcome - why this is in the result set -->
   <score value="[decimal]"/><!-- 0..1 Search ranking (between 0 and 1) -->
  </search>
  <request>  <!-- ?? 0..1 Transaction Related Information -->
   <method value="[code]"/><!-- 1..1 GET | POST | PUT | DELETE -->
   <url value="[uri]"/><!-- 1..1 URL for HTTP equivalent of this entry -->
   <ifNoneMatch value="[string]"/><!-- 0..1 For managing cache currency -->
   <ifModifiedSince value="[instant]"/><!-- 0..1 For managing update contention -->
   <ifMatch value="[string]"/><!-- 0..1 For managing update contention -->
   <ifNoneExist value="[string]"/><!-- 0..1 For conditional creates -->
  </request>
  <response>  <!-- ?? 0..1 Transaction Related Information -->
   <status value="[string]"/><!-- 1..1 Status return code for entry -->
   <location value="[uri]"/><!-- 0..1 The location, if the operation returns a location -->
   <etag value="[string]"/><!-- 0..1 The etag for the resource (if relevant) -->
   <lastModified value="[instant]"/><!-- 0..1 Server's date time modified -->
  </response>
 </entry>
 <signature><!-- 0..1 Signature Digital Signature --></signature>
</Bundle>
          

Bundle RDF Content

<http://record/medpres1> rdf:type owl:Ontology ; owl:imports <http://hl7.org/fhir> .
###  http://record/medpres1/bundle1
<http://record/medpres1/bundle1> rdf:type fhir:Bundle , owl:NamedIndividual ;
   fhir:Bundle.entry [ rdf:type fhir:Bundle.Entry ;
      fhir:Bundle.Entry.resource < http://record/MedicationPrescription/1 >
   ] ;
   fhir:Bundle.type [ fhir:value "searchset"];
   fhir:Bundle.link [ rdf:type fhir:uri ; fhir:value "self"] ;
   fhir:Bundle.total [ rdf:type fhir:unsignedInt ; fhir:value 3 ];
   fhir:Resource.meta [ rdf:type fhir:Meta ; fhir:Meta.lastUpdated
      [ rdf:type fhir:instant ; fhir:value "2015-08-02T00:00:00"^^xsd:dateTime]
   ]  .
###  http://record/MedicationPrescription/1
<http://record/MedicationPrescription/1> rdf:type profile:MedicationPrescription , owl:NamedIndividual ;
   fhir:MedicationOrder.medicationReference [ rdf:type fhir:Reference ;
      fhir:Reference.link <http://record/Medication/1> ;
      fhir:Reference.reference [ fhir:value http://record/Medication/1 ] ;
      fhir:Reference.display [ fhir:value "Amoxicillin (product)" ]
   ] ;
   fhir:MedicationOrder.patient [ rdf:type fhir:Reference ;
      fhir:Reference.link <http://record/Patient/PeterPatient> ;
      fhir:Reference.display [ fhir:value "Peter Patient" ] ;
      fhir:Reference.reference [ fhir:value "http://record/Patient/PeterPatient"
   ]
] .
          

A Bundle may or may not have an Id (inherited from Resource) therefore it can be referenced as an Ontology e.g. record/Bundle/123. It may therefore be a named or anonymous individual.

Ordering

RDF individual ordering example

Simple integer DataProperty fhir:index can be applied to individuals of subclasses of fhir:Element

###  http://hl7.org/fhir/index
fhir:index rdf:type owl:DatatypeProperty ;
           rdfs:range fhir:index-primitive .
###  http://hl7.org/fhir/index-primitive
fhir:index-primitive rdf:type rdfs:Datatype ;
                     owl:equivalentClass [ rdf:type rdfs:Datatype ;
                                           owl:onDatatype xsd:integer ;
                                           owl:withRestrictions ( [ xsd:minInclusive 1 ] )
                     ] .
###  http://hl7.org/fhir/Element
fhir:Element rdf:type owl:Class ;
             rdfs:label "Element" ;
             rdfs:subClassOf [ rdf:type owl:Restriction ;
                               owl:onProperty fhir:Element.extension ;
                               owl:someValuesFrom fhir:Extension
                             ] ,
                             [ rdf:type owl:Restriction ;
                               owl:onProperty fhir:Element.id ;
                               owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
                               owl:onDataRange fhir:id-primitive
                             ] ,
                             [ rdf:type owl:Restriction ;
                               owl:onProperty fhir:index ;
                               owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
                               owl:onDataRange fhir:index-primitive
                             ] ;
             rdfs:comment "The base element used for all FHIR elements and resources - allows for them to be extended with extensions" .
 .
        

In general fhir:value and fhir:Element.id are converted to an attribute in XML. fhir:index dictates the sequence only.