@Handler(supports=Concept.class, order=50) public class ConceptValidator extends BaseCustomizableValidator implements org.springframework.validation.Validator
|Constructor and Description|
|Modifier and Type||Method and Description|
Determines if the command object being submitted is a valid type
Checks that a given concept object is valid.
public boolean supports(Class<?> c)
public void validate(Object obj, org.springframework.validation.Errors errors) throws 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
Copyright © 2021 OpenMRS Inc.. All rights reserved.