Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
OpenMRS does not want to be a vocabulary standard. There is a lot of up-keep involved with managing universal codes used around the world. Instead, every openmrs installation is free to add new concepts, change concepts, etc in their local installation. That installation's concepts will get concept_ids assigned by the database and are probably unique to that installation.
A concept can have any number of mappings to any number of other vocabularies. Other vocabularies are called "concept sources" in OpenMRS (ie. LOINC, SNOMED, ICD-9, ICD10, RxNORM, etc), but the concept source can also be a custom (ie. org.openmrs.module.mdrtb, PIH, AMPATH, MVP, etc.). Every concept can define a string for its mapping in any "concept source" defined in the database.
Some concepts are included with the installation demo data. It is not necessary to use this set of concepts. These concepts do not come with any mappings defined to any terminology.
To Create a new term:
To edit an existing term:
To retire a term:
To restore a term:
To delete a term:
The way concept mapping was done in versions prior to 1.9 was fairly low-key and didn't allow for looser mapping to other terminologies. The implementation almost assumed a 1 to 1. (Or a "this is that"). In the real world the mapping is less exact. We needed to support extra attributes on the concept map to address this. We also needed to specify the relationship between two mapped terms. We had no way to do that in openmrs prior to 1.9. Below is how you can add new concept mappings (If the term you wish to use for the mapping already exists, skip steps 1 and 2).
To remove a concept mapping, just click the remove button on the right of the mapping you wish to remove.
Note: Super users and those with the 'Create Reference Terms While Editing Concepts' privilege can create new reference terms on the fly from the concept form.
See above for how to create new reference terms in case the term you wish to use for the mapping is none existent.
To remove a mapping, click the remove button on the right of the mapping you wish to remove.
OpenMRS ships with a set of predefined concept map types that will meet an implementation's needs but in the event where you can't seem to find the appropriate one, you can define new relationship/map types that can be used when mapping concepts to other terminologies or when mapping reference terms to each other, Some of the map types come when they are hidden/disabled, you need to make them active before using them. You can view the complete listing of all the concept map types by going to the admin page and click the 'Manage Concept Map Types' link under the concepts section, this feature is disabled by default so if you can't find the link, you will need to enable concept map type management by setting the value of the global property 'concept_map_type_management.enable' to true. Below is how you can define new concept map types.
You can active/deactivate a concept map type for use by selecting it from the concept map type listing page to be able to edit it. From the concept map type edit form, check the 'Is Hidden' checkbox and then save.
As of version 1.5, openmrs can receive hl7 ORUR01 messages with mapping codes instead of just internal concept_ids. The hl7_code for the concept_source simply has to be in the hl7 part and the code can be the mapping:
398439443293^WEIGHT (KG)^SNOMED
(Assumes the weight concept has a mapping of "398439443293" to the Snomed "concept source" and that source has the hl7 code of "SNOMED")
Table Definitions:
To add a concept mapping to a concept using the API:
ConceptSource snomedSource = Context.getConceptService().getConceptSourceByName("SnoMed Source");
ConceptMap mapping = new ConceptMap();
mapping.setSource(snomedSource);
mapping.setSourceCode("398439443293");
Concept weightConcept = Context.getConceptService().getConcept(5089);
weightConcept.addMapping(mapping);
Context.getConceptService().saveConcept(weightConcept);
To get a concept by its mapping using the API:
ConceptService service = Context.getConceptService();
Concept c = service.getConceptByMapping("398439443293", "SnoMed Source");
The OpenMRS Concept Collaborative (OCC) uses the mapping tables to facilitate OpenMRS installations to share data by mapping to each other's concepts. In this case, you would have a concept source named "PIH's Concepts" and then add mappings there.