Representing Concepts in FHIR

Tags: #<Tag:0x00007f56a30a8588>

In several place in FHIR, we need to implement what FHIR calls a Coding. By itself, this is pretty straight-forward. A code has an associated “system” and its code within that system.

For example, SNOMED CT code 161891005 (backache) would be represented like this:

{
    "system": "http://snomed.info/sct",
    "code": "161891005"
}

Similarly, the LOINC code 6299-2 (BUN) would be represented as:

{
    "system": "http://loinc.org".
    "code": "6299-2"
}

These two are easy because the system is defined as part of the FHIR spec.

Obviously actual implementations of OpenMRS depend on more terminology systems than just these. For coding systems that are common across the OpenMRS ecosystem (CIEL, PIH, AMPATH), we can probably just come up with some dummy URLs (though it would be nice to have “official” URLs, especially for CIEL, in the FHIR community registry @akanter).

The question I have is how we should represent implementation-specific concepts. There are a few approaches we can take:

  1. Simply send the code across without the system. While this is possible according to the FHIR spec, it is active discouraged.
  2. What was previously implemented in the old FHIR module, that is, specifying the dummy URL http://openmrs.org as the coding system for these concepts. While this technically works, it is semantically providing the wrong information. For example, the concepts defined in, say, UgandaEMR and eSaude, are not, strictly speaking, using the same terminological system.
  3. Come up with some kind of implementation-specific configurable URL to distinguish concepts.

I think we should pursue option 3, but I wanted some input on whether this is a good idea and if there is any existing information within OpenMRS we might be able to leverage to generate an appropriate URL. In particular, I’m wondering if anyone is doing anything similar with HL7 V2.

From the link that you gave, when i saw these:

I understood this as option 3

I’d think that the most appropriate place in the OpenMRS data model to pull this information from would be the ConceptSource for the code in question. There are currently 2 properties on ConceptSource which seem related to this: hl7Code and uniqueId. The “uniqueId” property was added in this ticket and is available for 2.1.0 onward. I’m not 100% sure either of these is intended to represent what you are describing, but they seem pretty similar to me. @burke and @akanter ?

So this is actually what I was talking about as “dummy URLs”. All of those are URLs for code systems that are part of the core data set. My question is what we do for the codes that the old version coded as “http://openmrs.org”, i.e., if you look at the last coded entry for the observation here.

The “uniqueId” property does seem to be trying to do something very similar. In particular those “designators” are HL7 OIDs for the various coding systems. And we could certainly leverage that information for both CIEL (2.16.840.1.113883.3.7201) and OpenMRS (2.16.840.1.113883.3.7194), where we could pass along

{
"system": "urn:oid:2.16.840.1.113883.3.7194",
...
}

Which at least has the virtue of theoretically being a resolvable id.