This document is intended to supply the reader with a basic understanding of the structure of how data written in HL7's RIM can be expressed in RDF. It is not a substitute for HL7's documentation, but instead the author's notion of a quick way to familiarize oneself with the concepts and terms used in the RIM and how the graph structure of RDF is a natural way to represent this data.
Copyright © 2013 W3C ® (MIT, ERCIM, Keio, Beihang) Usage policies apply.
The RIM has ~40 basic classes, but the most important ones are color coded for easy recognition (inspired by Peter Coad):
At the right is a typical RIM diagram using the color-coding described above.
Suppose we want to write down a fairly detailed clinical observation:
Grade 4 anaphylactic reaction to penicillin as evidenced by the combination of wheals (hives), acute respiratory distress (ARD) and systemic hypotension (LBP) following a penicillin injection.
As a set of observations and relationships, it might look like the image on the right.
That image may be somewhat informative if viewed directly by a physician, but it lacks all the structure and use of common coding systems necessary for machine interpretation.
We can add codes to the observation (recall that they are Acts). Codes perform several functions:
This is a step towards machine-readability and interoperability, but so far, we are still counting on the information model have sufficient relationship terms to convey every detail relating two observations.
Adding codes to the ActRelationships permits us to use a coding system to provide the detailed relationships we want to convey. This reduces significantly the expressivity requirements on the information model, though in practice, the codes in this example still come from HL7, the same folks who define the information model.
Here's what it looks like all together. Kind of a mess as a diagram, but pretty easy to sort through in a typical instance document. The rimITS provides a straightforward XML representation of RIM:
<content xsi:type="Observation" classCode="OBS" moodCode="EVN"> ... <value code="241938005" displayName="penicillin-induced anaphylaxis (disorder)" .../>
<inboundRelationship typeCode="SUBJ"> <source ...> <code code="SEV" displayName="Severity Observation" .../>
<value code="423132009" displayName="Grade 4/5"/>
</source> </inboundRelationship>
<outboundRelationship typeCode="EVID">... <target ...> <code code="ASSERTION" .../>
<value code="247472004" displayName="weal (disorder)"/>
</target> </outboundRelationship>
... <!-- etc. for 373895009 (acute respiratory distress) and 45007003 (low blood pressure) -->
</content>
<rim-graph xmlns="urn:hl7-org:v3-rim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="0229">
<content xsi:type="Observation" classCode="OBS" moodCode="EVN"> <code code="ASSERTION" displayName="Assertion" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/> <value xsi:type="CD" code="241938005" displayName="penicillin-induced anaphylaxis (disorder)" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>
<inboundRelationship typeCode="SUBJ"> <source xsi:type="Observation" classCode="OBS" moodCode="EVN"> <code code="SEV" displayName="Severity Observation" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
<value xsi:type="CD" code="423132009" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>
</source> </inboundRelationship>
<outboundRelationship typeCode="EVID"> <target xsi:type="Observation" classCode="OBS" moodCode="EVN"> <code code="ASSERTION" displayName="Assertion" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
<value xsi:type="CD" code="247472004" displayName="weal (disorder)" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>
</target> </outboundRelationship>
<outboundRelationship typeCode="EVID"> <target xsi:type="Observation" classCode="OBS" moodCode="EVN"> <code code="ASSERTION" displayName="Assertion" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
<value xsi:type="CD" code="373895009" displayName="acute respiratory distress" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>
</target> </outboundRelationship>
<outboundRelationship typeCode="EVID"> <target xsi:type="Observation" classCode="OBS" moodCode="EVN"> <code code="ASSERTION" displayName="Assertion" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
<value xsi:type="CD" code="45007003" displayName="low blood pressure (disorder)" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>
</target> </outboundRelationship>
</content>
</rim-graph>
The rimITS example we just saw is optimized for readability by RIM afficionados. There are many more popular representations of the RIM which use XML tags and structures which are less related to the core RIM structure. An important one is C-CDA, mandated by the Affordable Care Act to provide patient portability between clinics and systems.
There is still some consistency between RMIMs; the structure attributes like mood
and typeCode
remain the same and, if you know the mapping back to RIM, it's fairly intuitive to read data expressed in some RMIM as RIM objects.
At the right is a small excerpt of the RMIM for C-CDA capturing the reference ranges for measured values.
Below is what that looks like in XML:
<observation classCode="OBS" moodCode="EVN"> <code code="718-7" displayName="Hgb Bld-mCnc" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" /> <value xsi:type="PQ" value="15.0" unit="g/dL" /> <referenceRange> <observationRange> <text>13.5 - 18</text> </observationRange> </referenceRange> </observation>
Note that classCode
, moodCode
, code
, displayName
, codeSystem
and codeSystemName
are the same structure attributes that we saw in the rimITS example.
Some XML elements represent a cyclic structure.
At the right, the entryRelationship
element connects one Observation to another.
This captures the Acts and ActRelationships we saw in the rimITS example.
The diagnosis and severity from the rimITS example can be expressed in C-CDA as:
<Observation classCode="OBS" moodCode="EVN"> <code code="ASSERTION" displayName="Assertion" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/> <value xsi:type="CD" code="241938005" displayName="penicillin-induced anaphylaxis (disorder)" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>
<entityRelationship typeCode="SUBJ" xsi:type="Observation" classCode="OBS" moodCode="EVN"> <code code="SEV" displayName="Severity Observation" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
<value xsi:type="CD" code="423132009" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT"/>
</@@@source> </@@@inboundRelationship>
From what we've seen of the RIM, its general graph structure can model anything (a famous example being plays by Shakespear), provided you can define ActRelationships to capture the relationships. The core of the expressivity is that the ActRelationship define potentially cyclic graph. Such a graph model can be trivially expressed in RDF.
@@
Come geek with us in the W3C Semantic Web in Health Care and Life Sciences IG