@Handler(supports=Obs.class, order=50) public class ObsValidator extends Object implements org.springframework.validation.Validator
Obs
Modifier and Type | Field and Description |
---|---|
static int |
VALUE_TEXT_MAX_LENGTH |
Constructor and Description |
---|
ObsValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class<?> c) |
void |
validate(Object obj,
org.springframework.validation.Errors errors) |
public static final int VALUE_TEXT_MAX_LENGTH
public boolean supports(Class<?> c)
supports
in interface org.springframework.validation.Validator
Should support Obs class
public void validate(Object obj, org.springframework.validation.Errors errors)
validate
in interface org.springframework.validation.Validator
Should fail validation if personId is null
Should fail validation if obsDatetime is null
Should fail validation if concept is null
Should fail validation if concept datatype is boolean and valueBoolean is null
Should fail validation if concept datatype is coded and valueCoded is null
Should fail validation if concept datatype is date and valueDatetime is null
Should fail validation if concept datatype is numeric and valueNumeric is null
Should fail validation if concept datatype is text and valueText is null
Should fail validation if obs ancestors contains obs
Should pass validation if all values present
Should fail validation if the parent obs has values
Should reject an invalid concept and drug combination
Should pass if answer concept and concept of value drug match
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Should not validate if obs is voided
Should not validate a voided child obs
Should fail for a null object
Copyright © 2024 OpenMRS Inc.. All rights reserved.