org.openmrs.patient
Interface IdentifierValidator
- All Known Implementing Classes:
- BaseHyphenatedIdentifierValidator, LuhnIdentifierValidator, VerhoeffIdentifierValidator
public interface IdentifierValidator
Interface for patient identifier validators. Patient identifier validators check whether a
patient identifier is valid. They also can be used to create a valid identifier from an
identifier that has not yet been given a check digit or other form of validation. Each validator
should also have a name, e.g. "Luhn Algorithm."
getName
java.lang.String getName()
- Returns:
- The name of this validator. E.g. "Luhn Algorithm"
isValid
boolean isValid(java.lang.String identifier)
throws UnallowedIdentifierException
- Parameters:
identifier
- The Identifier to check.
- Returns:
- Whether this identifier is valid according to the validator.
- Throws:
UnallowedIdentifierException
- if the identifier contains unallowed characters or is
otherwise not appropriate for this validator.
getValidIdentifier
java.lang.String getValidIdentifier(java.lang.String undecoratedIdentifier)
throws UnallowedIdentifierException
- Parameters:
undecoratedIdentifier
- The identifier prior to being given a check digit or other form
of validation.
- Returns:
- The identifier after the check digit or other form of validation has been applied.
- Throws:
UnallowedIdentifierException
- if the identifier contains unallowed characters or is
otherwise not appropriate for this validator.
getAllowedCharacters
java.lang.String getAllowedCharacters()
- Returns:
- A string containing all the characters allowed in this type of identifier validation.
Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change