# concept reference source and mrrt radiology templates

**URL:** <https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885>\
**Category:** Terminology\
**Tags:** referenceterm, radiology, concept\
**Created:** [September 5, 2016, 12:47pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885 "2016-09-05T12:47:53Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 5, 2016, 12:47pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/1 "2016-09-05T12:47:53Z")

</div>

Dear @akanter,

we have implemented Management of Radiology Report Templates (MRRT) [http://www.ihe.net/Technical\_Frameworks/#radiology](http://www.ihe.net/Technical_Frameworks/#radiology) in the [radiology module](https://github.com/openmrs/openmrs-module-radiology).

which are html files used as report templates. We have an implementation that extracts this metadata (as concept reference source/reference terms using the ConceptService) and stores `Set<ConceptReferenceTerm> terms` into the MRRT template object into the openmrs DB.

These files are tagged with `term` elements which reference entries in coding schemes like radlex or maybe snomed ct.

An example looks like so:

```
<coding_schemes>
 <coding_scheme name="RadLex" designator="2.16.840.1.113883.6.256" />
</coding_schemes>
<term>
 <code meaning="brain" value="RID6434" scheme="RadLex"/>
</term>

```

* * *

I still wonder about what the correct way is to enter radlex as `concept_reference_source` into the DB. And how to properly retrieve it.

1. the `concept_reference_source.name` is not unique so I guess we have to be ready for the event of two rows with “RADLEX” as their name. Why is the name not unique? What would be a use case?

2. the `concept_reference_source.hl7_code`

In MRRT they use the OID/UID as the designator. like shown here [https://www.hl7.org/fhir/terminologies-systems.html](https://www.hl7.org/fhir/terminologies-systems.html)

which I am able to insert in this column, and which would enable me to uniquely get the `concept_reference_source` matching the `coding_scheme`.

However, I see that in the CIEL dictionary SNOMED CT has for example `hl7_code=SCT`

which I can find at _Coding Scheme Designator_[http://dicom.nema.org/dicom/2013/output/chtml/part16/chapter\_8.html](http://dicom.nema.org/dicom/2013/output/chtml/part16/chapter_8.html)

Which for radlex would be `hl7_code=RADLEX` but this wouldnt help me in uniquely finding the `concept_reference_source`

I would be very grateful for your input! Thanks a lot!

(@judy I put you in “cc” here)

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 7, 2016, 7:16am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/2 "2016-09-07T07:16:41Z")

</div>

@akanter @judy would you be in favor of adding a column (constraint unique, but not-null to keep backwards compatibility) to `concept_reference_source` for its Coding Scheme UID ?

This would make it easy to reliably find a concept source based on its unique and registered OID.

I can see now that I need to define hl7\_code=“RADLEX” all upper case [http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter\_8](http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter_8)

but as MRRT is concerned it doesnt stick to this rule in its name attribute. So the designator OID is the best way to find the concept source as this one has strict rules about its formatting.

---

<div class="post-metadata">

**Author:** ![akanter](https://talk.openmrs.org/user_avatar/talk.openmrs.org/akanter/32/331_2.png) [@akanter](https://talk.openmrs.org/u/akanter)\
**Post date:** [September 7, 2016, 6:17pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/3 "2016-09-07T18:17:33Z")

</div>

Seems reasonable to me!

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 8, 2016, 1:08pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/4 "2016-09-08T13:08:58Z")

</div>

Dear @burke,

I would like to add an (optional) column `concept_reference_source.source_uid` + `ConceptService.getConceptSourceBySourceUid(String)`

as described in

> <https://issues.openmrs.org/browse/TRUNK-4936>

@akanter and @judy are both pro.

Would be great if you could have a look if this also makes sense to you.

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 20, 2016, 6:28am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/5 "2016-09-20T06:28:32Z")

</div>

dear @jthomas

I would like to discuss

> <https://issues.openmrs.org/browse/TRUNK-4936>

on a design forum

both of these dates work for me:

21 Sep - OPEN 26 Sep - OPEN

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [September 20, 2016, 2:52pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/6 "2016-09-20T14:52:55Z")

</div>

@teleivo, who should be at this design call? Particularly, do we need@akanter?

(I can do 21 sep, but not 26 sep, but I should not be a required participant for this.)

-Darius

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 20, 2016, 3:09pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/7 "2016-09-20T15:09:21Z")

</div>

@akanter would definitely be welcome but I laid out everything here and he agreed to my requested changes. Other than that no special requirements 🙂

---

<div class="post-metadata">

**Author:** ![jthomas](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jthomas/32/21_2.png) [@jthomas](https://talk.openmrs.org/u/jthomas)\
**Post date:** [September 20, 2016, 6:51pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/8 "2016-09-20T18:51:09Z")

</div>

@teleivo tomorrow sounds good. I’ll put it on the calendar.

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [September 21, 2016, 6:36pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/9 "2016-09-21T18:36:39Z")

</div>

We discussed on the Design Forum today, and the ticket is _almost_ ready for work. We have two specific questions that we hope @akanter and @burke can help with:

1. We propose to call the new column “external\_id” and not specifying exactly which external coding system one should use for any given Any objection to that name and approach? (Having “uuid” and “uid” would be confusing

2. We don’t know whether to require this to be unique or not. I was thinking it should be unique (so that getConceptSourceByExternalId(String) returns 0 or 1 values, but @teleivo has found an example on [http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter\_8](http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter_8) that shows two different codes using the same UID:

> SCT | 2.16.840.1.113883.6.96 | SNOMED-CT, using the CT code values SRT | 2.16.840.1.113883.6.96 | SNOMED-CT using the “SNOMED-RT style” code values

But this seems like a suspicious use case to me. Do you have any thoughts about whether we’d ever want to allow two rows in the concept\_source table to have the same external\_id?

(Of course we should allow multiple rows with a null external\_id.)

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 26, 2016, 7:13am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/10 "2016-09-26T07:13:56Z")

</div>

dear @burke and @akanter could I please get your input on the two points of @darius post so I can start working on the issue.

---

<div class="post-metadata">

**Author:** ![akanter](https://talk.openmrs.org/user_avatar/talk.openmrs.org/akanter/32/331_2.png) [@akanter](https://talk.openmrs.org/u/akanter)\
**Post date:** [September 26, 2016, 2:15pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/11 "2016-09-26T14:15:01Z")

</div>

I think the external ID makes sense as this is for the coding system and not the code. Whenever a code is used, you have to have a source (but that is not relevant for a list of sources). For the second issue, I asked my standards specialist about this re-use of the OID and haven’t heard back. Since SNOMED RT is a prior VERSION of SNOMED CT, perhaps that is the reason (and there is no overlap of codes between them since they refactored the codes). It does raise the question of whether there should be a source/code/version recording in the code recording or whether the version is irrelevant.

---

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [September 27, 2016, 4:00am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/12 "2016-09-27T04:00:15Z")

</div>

Is the proposed `external_id` essentially the same thing as FHIR’s [`unique_id`](https://www.hl7.org/fhir/namingsystem-definitions.html#NamingSystem.uniqueId)?

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 27, 2016, 7:07am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/13 "2016-09-27T07:07:10Z")

</div>

it is the Coding Scheme UID here: [http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter\_8](http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter_8) which can be seen as the HL7 OID [http://www.hl7.org/oid/index.cfm](http://www.hl7.org/oid/index.cfm)

and you can look them up at this registry [http://www.oid-info.com/](http://www.oid-info.com/) (which gives you a detailed description of this OID tree: which standards organization was it registered at/country/name & details of the organization its registered to)

---

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [September 29, 2016, 10:49am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/14 "2016-09-29T10:49:05Z")

</div>

> [@teleivo](#):
>
> it is the Coding Scheme UID here: [http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter\_8](http://dicom.nema.org/medical/dicom/current/output/html/part16.html#chapter_8) which can be seen as the HL7 OID [HL7 OID Registry](http://www.hl7.org/oid/index.cfm)
> 
> and you can look them up at this registry [http://www.oid-info.com/](http://www.oid-info.com/) (which gives you a detailed description of this OID tree: which standards organization was it registered at/country/name & details of the organization its registered to)

Ok. So, per the description of FHIR’s [uniqueId.type](https://www.hl7.org/fhir/namingsystem-definitions.html#NamingSystem.uniqueId.type), OID is a type of unique ID.

I would favor, when refactoring our model, we move _toward_ the FHIR model – i.e., use “unique\_id” instead of “external\_id” and, whether or not we decide to support more than one uniqueId per source in the db now, build the API methods assuming a source might have more than one unique ID.

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 29, 2016, 11:42am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/15 "2016-09-29T11:42:46Z")

</div>

> [@burke](#):
>
> I would favor, when refactoring our model, we move toward the FHIR model – i.e., use “unique\_id” instead of “external\_id”

seems like the FHIR model defines an own type for the `NamingSystem.uniqueId`

Am ok with calling it `unique_id`

> [@burke](#):
>
> and, whether or not we decide to support more than one uniqueId per source in the db now, build the API methods assuming a source might have more than one unique ID.

by that you mean adding

`List<ConceptSource> ConceptService.getConceptSourcesByUniqueId(String)`

to the API?

But if we do it this way, can we also add `NamingSystem.uniqueId.preferred` ? Otherwise in case of same source, multiple `unique_id`’s its again bit of a mystery which one should be used.

Seems bit similar to `PatientIdentifier`, maybe at a later stage we should extract `uniqueId` into its own domain object with `ConceptSource.uniqueIds`

---

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [September 29, 2016, 1:07pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/16 "2016-09-29T13:07:36Z")

</div>

Per FHIR’s design, a source may have more than one unique ID (e.g., OID, URI, etc). This does not mean that there should be more than one source for any given unique ID.

So, I would expect asking for the unique ID for a given source may return more than one type, but a search by unique ID would return a single source (since the ID, by definition, should be unique to one source) – i.e., `ConceptSource conceptService.getConceptSourceByUniqueId(String)`.

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 29, 2016, 1:14pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/17 "2016-09-29T13:14:55Z")

</div>

> [@burke](#):
>
> Per FHIR’s design, a source may have more than one unique ID (e.g., OID, URI, etc). This does not mean that there should be more than one source for any given unique ID.

fine by me (radlex only has one external id, as far as Ive seen).

But this means we would not allow the case I presented:

two sources with same `unique_id`

> SCT | 2.16.840.1.113883.6.96 | SNOMED-CT, using the CT code values SRT | 2.16.840.1.113883.6.96 | SNOMED-CT using the “SNOMED-RT style” code values

just want to make sure 🙂

if so, can

[https://issues.openmrs.org/browse/TRUNK-4936](https://issues.openmrs.org/browse/TRUNK-4936)

be worked on by me?

---

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [September 29, 2016, 1:54pm UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/18 "2016-09-29T13:54:34Z")

</div>

> [@teleivo](#):
>
> But this means we would not allow the case I presented:
> 
> two sources with same unique\_id
> 
> SCT | 2.16.840.1.113883.6.96 | SNOMED-CT, using the CT code values SRT | 2.16.840.1.113883.6.96 | SNOMED-CT using the “SNOMED-RT style” code values
> 
> just want to make sure 🙂

Correct. Having a _unique_ ID pointing to two things is an error.

> [@teleivo](#):
>
> if so, can
> 
> TRUNK-4936 - Add UID to ConceptSource
> 
> be worked on by me?

Of course!

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [September 30, 2016, 8:52am UTC](https://talk.openmrs.org/t/concept-reference-source-and-mrrt-radiology-templates/7885/19 "2016-09-30T08:52:23Z")

</div>

PR is ready ✅[https://github.com/openmrs/openmrs-core/pull/1846](https://github.com/openmrs/openmrs-core/pull/1846)
