@Handler(supports=Concept.class, order=50) public class ConceptValidator extends BaseCustomizableValidator implements org.springframework.validation.Validator
Concept
objects. Constructor and Description |
---|
ConceptValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class<?> c)
Determines if the command object being submitted is a valid type
|
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Checks that a given concept object is valid.
|
validateAttributes
public boolean supports(Class<?> c)
supports
in interface org.springframework.validation.Validator
Validator.supports(java.lang.Class)
public void validate(Object obj, org.springframework.validation.Errors errors) throws APIException, DuplicateConceptNameException
validate
in interface org.springframework.validation.Validator
APIException
DuplicateConceptNameException
Should pass if the concept has at least one fully specified name added to it
Should fail if there is a duplicate unretired concept name in the locale
Should fail if there is a duplicate unretired preferred name in the same locale
Should fail if there is a duplicate unretired fully specified name in the same locale
Should fail if any names in the same locale for this concept are similar
Should pass if the concept with a duplicate name is retired
Should pass if the concept being validated is retired and has a duplicate name
Should fail if any name is an empty string
Should fail if the object parameter is null
Should pass if the concept is being updated with no name change
Should fail if any name is a null value
Should not allow multiple preferred names in a given locale
Should not allow multiple fully specified conceptNames in a given locale
Should not allow multiple short names in a given locale
Should not allow an index term to be a locale preferred name
Should fail if there is no name explicitly marked as fully specified
Should pass if the duplicate ConceptName is neither preferred nor fully Specified
Should pass if the concept has a synonym that is also a short name
Should fail if a term is mapped multiple times to the same concept
Should not fail if a term has two new mappings on it
Should fail if there is a duplicate unretired concept name in the same locale different than
the system locale
Should pass for a new concept with a map created with deprecated concept map methods
Should pass for an edited concept with a map created with deprecated concept map methods
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Should pass if fully specified name is the same as short name
Should pass if different concepts have the same short name
Should fail if the concept datatype is null
Should fail if the concept class is null
Should pass if the concept is retired and the only validation failures would be in ConceptName
or ConceptMap, as a retired Concept bypasses ConceptName and ConceptMap validation.
Copyright © 2024 OpenMRS Inc.. All rights reserved.