@Handler(supports=Visit.class, order=50) public class VisitValidator extends BaseCustomizableValidator implements org.springframework.validation.Validator
Visit class.| Constructor and Description | 
|---|
| VisitValidator() | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | supports(Class<?> clazz) | 
| void | validate(Object target,
        org.springframework.validation.Errors errors) | 
validateAttributespublic boolean supports(Class<?> clazz)
supports in interface org.springframework.validation.ValidatorValidator.supports(java.lang.Class)public void validate(Object target, org.springframework.validation.Errors errors)
validate in interface org.springframework.validation.ValidatorShould accept a visit that has the right number of attribute occurrences
 Should reject a visit if it has fewer than min occurs of an attribute
 Should reject a visit if it has more than max occurs of an attribute
 Should fail if patient is not set
 Should fail if visit type is not set
 Should fail if startDatetime is not set
 Should fail if the endDatetime is before the startDatetime
 Should fail if the startDatetime is after any encounter
 Should fail if the stopDatetime is before any encounter
 Should fail if an attribute is bad
 Should reject a visit if startDateTime is equal to startDateTime of another visit of the same patient
 Should reject a visit if startDateTime falls into another visit of the same patient
 Should reject a visit if stopDateTime falls into another visit of the same patient
 Should reject a visit if it contains another visit of the same patient
 Should accept a visit if startDateTime is equal to startDateTime of another voided visit of the same patient
 Should accept a visit if startDateTime falls into another voided visit of the same patient
 Should accept a visit if stopDateTime falls into another voided visit of the same patient
 Should accept a visit if it contains another voided visit of the same patient
 Should pass validation if field lengths are correct
 Should fail validation if field lengths are not correctCopyright © 2024 OpenMRS Inc.. All rights reserved.