@Handler(supports=Order.class) public class OrderValidator extends Object implements org.springframework.validation.Validator
Order
class.Constructor and Description |
---|
OrderValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class<?> c)
Determines if the command object being submitted is a valid type
|
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Checks the form object for any inconsistencies/errors
|
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
Should fail validation if order is null
Should fail validation if order and encounter have different patients
Should fail validation if voided is null
Should fail validation if concept is null
Should fail validation if patient is null
Should fail validation if encounter is null
Should fail validation if orderer is null
Should fail validation if urgency is null
Should fail validation if action is null
Should fail validation if dateActivated after dateStopped
Should fail validation if dateActivated after autoExpireDate
Should fail validation if dateActivated is before encounter's encounterDatetime
Should fail validation if scheduledDate is set and urgency is not set as ON_SCHEDULED_DATE
Should fail validation if scheduledDate is null when urgency is ON_SCHEDULED_DATE
Should fail validation if orderType.javaClass does not match order.class
Should pass validation if the class of the order is a subclass of orderType.javaClass
Should pass validation if all fields are correct
Should not allow a future dateActivated
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Copyright © 2024 OpenMRS Inc.. All rights reserved.