@Handler(supports=DrugOrder.class, order=50) public class DrugOrderValidator extends OrderValidator implements org.springframework.validation.Validator
DrugOrder
class.Constructor and Description |
---|
DrugOrderValidator() |
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
supports
in class OrderValidator
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 OrderValidator
Should fail validation if asNeeded is null
Should fail validation if dosingType is null
Should fail validation if drug concept is different from order concept
Should fail validation if dose is null for SimpleDosingInstructions dosingType
Should fail validation if doseUnits is null for SimpleDosingInstructions dosingType
Should fail validation if route is null for SimpleDosingInstructions dosingType
Should fail validation if frequency is null for SimpleDosingInstructions dosingType
Should fail validation if dosingInstructions is null for FreeTextDosingInstructions
dosingType
Should fail validation if numberOfRefills is null for outpatient careSetting
Should fail validation if quantity is null for outpatient careSetting
Should fail validation if doseUnits is null when dose is present
Should fail validation if doseUnits is not a dose unit concept
Should fail validation if quantityUnits is null when quantity is present
Should fail validation if quantityUnits it not a quantity unit concept
Should fail validation if durationUnits is null when duration is present
Should fail validation if durationUnits is not a duration unit concept
Should pass validation if all fields are correct
Should not require all fields for a discontinuation order
Should fail if route is not a valid concept
Should fail if concept is null and drug is not specified
Should fail if concept is null and cannot infer it from drug
Should pass if concept is null and drug is set
Should not validate a custom dosing type against any other dosing type validation
Should apply validation for a custom dosing type
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Copyright © 2024 OpenMRS Inc.. All rights reserved.