@Handler(supports=PatientProgram.class, order=50) public class PatientProgramValidator extends Object implements org.springframework.validation.Validator
PatientProgram
objectConstructor and Description |
---|
PatientProgramValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class<?> c) |
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Validates the given PatientProgram.
|
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)
validate
in interface org.springframework.validation.Validator
obj
- The patient program to validate.errors
- ErrorsShould fail validation if obj is null
Should fail if the patient field is blank
Should fail if there is more than one patientState with the same states and startDates
Should fail if there is more than one state with a null start date in the same workflow
Should pass if the start date of the first patient state in the work flow is null
Should fail if any patient state has an end date before its start date
Should fail if the program property is null
Should fail if any patient states overlap each other in the same work flow
Should fail if a patientState has an invalid work flow state
Should fail if a patient program has duplicate states in the same work flow
Should fail if a patient is in multiple states in the same work flow
Should fail if a enrolled date is in future at the date it set
Should fail if a completion date is in future at the date it set
Should fail if a patient program has an enroll date after its completion
Should pass if a patient is in multiple states in different work flows
Should pass for a valid program
Should pass for patient states that have the same start dates in the same work flow
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Copyright © 2024 OpenMRS Inc.. All rights reserved.