Class PatientProgramValidator

  extended by org.openmrs.validator.PatientProgramValidator
All Implemented Interfaces:

public class PatientProgramValidator
extends java.lang.Object
implements org.springframework.validation.Validator

This class validates a PatientProgram object


Constructor Summary
Method Summary
 boolean supports(java.lang.Class c)
 void validate(java.lang.Object obj, org.springframework.validation.Errors errors)
          Validates the given PatientProgram.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PatientProgramValidator()
Method Detail


public boolean supports(java.lang.Class c)
Specified by:
supports in interface org.springframework.validation.Validator
See Also:


public void validate(java.lang.Object obj,
                     org.springframework.validation.Errors errors)
Validates the given PatientProgram.

Specified by:
validate in interface org.springframework.validation.Validator
obj - The patient program to validate.
errors - Errors
See Also:
Validator.validate(java.lang.Object, org.springframework.validation.Errors)
Expected behavior:
fail validation if obj is null, fail if the patient field is blank, fail if there is more than one patientState with the same states and startDates, fail if there is more than one state with a null start date in the same workflow, pass if the start date of the first patient state in the work flow is null, fail if any patient state has an end date before its start date, fail if the program property is null, fail if any patient states overlap each other in the same work flow, fail if a patientState has an invalid work flow state, fail if a patient program has duplicate states in the same work flow, fail if a patient is in multiple states in the same work flow, pass if a patient is in multiple states in different work flows, pass for a valid program, pass for patient states that have the same start dates in the same work flow


Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change