Concept Validation
- 1.1 Concept Validation Rules - What makes a concept valid?
- 1.2 Concept Reference Term Validation Rules (1.9 and above)
- 1.3 Concept Map Type Validation Rules (1.9 and above)
- 1.4 Validation module
- 1.5 Other validations rules to enforce in the future
- 1.6 Useful validation rules for specific concept dictionaries
- 2 See also
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
The code and concept reference source are required i.e they shouldn't be blank/null
The code should be unique among all other codes in its Concept Reference source
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.
Can't add a concept reference term to the same reference term multiple times
If a name has been specified for a reference term, it should be unique among all other names in its Concept Reference Source
When adding a mapping to another reference term, the concept map type and the other term getting mapped to are required
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.
Can't map a reference term to itself
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
The name is required i.e it shouldn't be blank/null
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
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.
See also
Aligning concept validation rules with Open Concept Lab (OCL) was discussed on Talk in 2021-2022
Concept Validation Queries for SQL to perform validations within the database