validate
A helper method used internally by the SDK to perform minimal validation on the object before sending it to the server.
This method performs the the following checks, in order:
firstName is not empty
lastName is not empty
phone is not empty
phone is valid per PhoneValidator.isValid. The phone number string is stripped of any special characters before validation, using PhoneValidator.removeSpecialCharacters.
email is not empty
email is valid per EmailValidator.isValid.
address.postalCode is valid per ZipCodeValidator.isValid
ehrIdentifier is not empty
ehrIdentifierType is not empty
homeEhr is not empty
Return
A MissingInformationError with an error string identifying one of the above issues, or null if the object passes validation.