@Handler(supports=Patient.class, order=25) public class PatientValidator extends PersonValidator
Constructor and Description |
---|
PatientValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class<?> c)
Returns whether or not this validator supports validating a given class.
|
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Validates the given Patient.
|
public boolean supports(Class<?> c)
supports
in interface org.springframework.validation.Validator
supports
in class PersonValidator
c
- The class to check for support.Validator.supports(java.lang.Class)
public void validate(Object obj, org.springframework.validation.Errors errors)
validate
in interface org.springframework.validation.Validator
validate
in class PersonValidator
obj
- The patient to validate.errors
- ErrorsShould fail validation if gender is blank
Should fail validation if birthdate makes patient older than 140 years old
Should fail validation if birthdate is a future date
Should fail validation if a preferred patient identifier is not chosen
Should fail validation if voidReason is blank when patient is voided
Should fail validation if causeOfDeath is blank when patient is dead
Should fail validation if a preferred patient identifier is not chosen for voided patients
Should not fail when patient has only one identifier and its not preferred
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Copyright © 2024 OpenMRS Inc.. All rights reserved.