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)
The name is required i.e it shouldn't be blank/null
The name should be unique among all other names
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:
Other validations rules to enforce in the future
A fully specified name can neither be a short name nor an index/search term
Can't add a concept mapping with a retired concept map type or reference term
Can't add a concept mapping to a voided concept reference source
The concept reference source of a reference term should be non-voided
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.