|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openmrs.validator.PatientIdentifierValidator
@Handler(supports=PatientIdentifier.class, order=50) public class PatientIdentifierValidator
This class validates a PatientIdentifier object.
Constructor Summary | |
---|---|
PatientIdentifierValidator()
|
Method Summary | |
---|---|
static void |
checkIdentifierAgainstFormat(java.lang.String identifier,
java.lang.String format)
Validates that a given identifier string is valid for a given regular expression format |
static void |
checkIdentifierAgainstValidator(java.lang.String identifier,
IdentifierValidator validator)
Validates that a given identifier string is valid for a given IdentifierValidator |
boolean |
supports(java.lang.Class c)
|
void |
validate(java.lang.Object obj,
org.springframework.validation.Errors errors)
Validates a PatientIdentifier. |
static void |
validateIdentifier(PatientIdentifier pi)
Checks that the given PatientIdentifier is valid |
static void |
validateIdentifier(java.lang.String identifier,
PatientIdentifierType pit)
Validates that a given identifier string is valid for a given PatientIdentifierType
Checks for things like blank identifiers, invalid check digits, and invalid format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PatientIdentifierValidator()
Method Detail |
---|
public boolean supports(java.lang.Class c)
supports
in interface org.springframework.validation.Validator
Validator.supports(java.lang.Class)
public void validate(java.lang.Object obj, org.springframework.validation.Errors errors)
validate
in interface org.springframework.validation.Validator
Validator.validate(java.lang.Object,
org.springframework.validation.Errors)
public static void validateIdentifier(PatientIdentifier pi) throws PatientIdentifierException
PatientIdentifier
is valid
pi
- - the PatientIdentifier
to validate
PatientIdentifierException
- if the PatientIdentifier
is invalidvalidateIdentifier(String, PatientIdentifierType)
public static void validateIdentifier(java.lang.String identifier, PatientIdentifierType pit) throws PatientIdentifierException
PatientIdentifierType
Checks for things like blank identifiers, invalid check digits, and invalid format.
pit
- - the PatientIdentifierType
to validate againstidentifier
- - the identifier to check against the passed PatientIdentifierType
PatientIdentifierException
- if the identifier is invalidcheckIdentifierAgainstFormat(String, String)
,
checkIdentifierAgainstValidator(String, IdentifierValidator)
public static void checkIdentifierAgainstFormat(java.lang.String identifier, java.lang.String format) throws PatientIdentifierException
format
- - the regular expression format to validate againstidentifier
- - the identifier to check against the passed PatientIdentifierType
PatientIdentifierException
- if the identifier is does not match the formatpublic static void checkIdentifierAgainstValidator(java.lang.String identifier, IdentifierValidator validator) throws PatientIdentifierException
identifier
- the identifier to check against the passed PatientIdentifierType
validator
- the IdentifierValidator to use to check the identifier
PatientIdentifierException
- if the identifier is does not match the format
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |