Concept Validation

Background

A concept is the basic element of flexibility in OpenMRS. Concepts are the individual data points collected from a population of patients. Concepts include both questions and answers. Therefore, it is very important to have them conform to specific validation rules in order to have a cleaner data set.

Concept Validation Rules - What makes a concept valid?

These apply as per the latest OpenMRS version, there are couple of minor variations between 1.7, 1.8, 1.9, there are major variations in 1.6 and earlier versions.

For all (modern) OpenMRS versions

  • Duplicate names for the same locale are not permitted.

  • The datatype of the concept should be defined.

  • The concept class of the concept should be defined

  • A name can't be blank/null

  • A description can't be null.  A description is not required for a concept, but a null description (ie.  blank or NULL concept_description.description) is not permitted.

  • Code/source code is required for every concept mapping (Applies to  1.8 and below)

  • Can't map the same concept to the same Reference Term multiple times

For OpenMRS 1.7 and above

  • At least one non-voided, non empty/blank fully specified name is required (This DOESN'T mean one is required for each locale)

  • The name marked as preferred for a given locale should be unique among all other non voided names in its locale across all non-retired concepts

  • All names that belong to the same concept and locale should be unique except for the short name (Applies to  1.7 and above though the short name exception is as of 1.8)

  • A name marked as fully specified for a given locale should be unique among all other non voided names in its locale across all non-retired concepts

  • A preferred name can neither be a short name, an index/search term nor a voided name

  • Only one non-voided short name is allowed per locale

  • Only one non-voided preferred name is allowed per locale

  • A voided name can't be marked as fully specified

  • Only one non-voided fully specified name is allowed per locale

for OpenMRS 1.9 and above

  • Concept map type and reference term are required for every concept mapping

for OpenMRS 1.10 and above when released

  • At least one non-retired description is required (This DOESN'T mean one is required for each locale), any blank descriptions are removed automatically

Concept Reference Term Validation Rules (1.9 and above)

See Mapping Concepts to Other terminologies for more about Concept Reference Terms and Map Types

  1. The code and concept reference source are required i.e they shouldn't be blank/null

  2. The code should be unique among all other codes in its Concept Reference source

  3. The reference source should belong to an existing concept i.e Can't add a term to a source that is getting created on the fly along with it.

  4. Can't add a concept reference term to the same reference term multiple times

  5. If a name has been specified for a reference term, it should be unique among all other names in its Concept Reference Source

  6. When adding a  mapping to another reference term, the concept map type and the other term getting mapped to are required

  7. When adding a  mapping to another reference term, the term getting mapped to should be existing i.e Can't map to a term that is getting created on the fly.

  8. Can't map a reference term to itself

  9. Can't map a reference term to the same reference term multiple times

Concept Map Type Validation Rules (1.9 and above)

See Mapping Concepts to Other terminologies for more about Concept Reference Terms and Map Types

  1. The name is required i.e it shouldn't be blank/null

  2. The name should be unique among all other names

Validation module

The Validation Module is a great way to review the concepts and show any errors against the validation rules.  Choose any of these types for reviewing the concept dictionary:

  • org.openmrs.Concept

  • org.openmrs.ConceptDescription

  • org.openmrs.ConceptName

Other validations rules to enforce in the future

  1. A fully specified name can neither be a short name nor an index/search term

  2. Can't add a concept mapping with a retired concept map type or reference term

  3. Can't add a concept mapping to a voided concept reference source

  4. The concept reference source of a  reference term should be non-voided

  5. Can't add a concept reference term map with a retired concept map type or reference term

Useful validation rules for specific concept dictionaries

There is no validation that checks that certain mappings are only used on 1 concept in a concept dictionary. A concept source mapping for a concept dictionary (ie. PIH:12) should only be associated with 1 concept.  ICD10 mappings can be associated to multiple concepts.   

See also