Interface ITokenizationProvider


public interface ITokenizationProvider
This interface implements the conversion of non-tokenized strings into tokens, and vice versa.
Since:
2025.05
  • Method Details

    • tokenize

      Performs tokenization for a collection of requests. This method is invoked when Smile CDR needs to convert one or more strings into their corresponding tokens. The algorithm used to tokenize is flexible, and could rely on an external database or a cryptographic algorithm (or both). It must however be deterministic, meaning that repeated calls to tokenize the same input string must produce the same result.
      Parameters:
      theRequestDetails - The request associated with the tokenization
      theRequests - The requests, which include the specific rule as well as the object being tokenized
      Returns:
      Returns a collection of tokenized results. A result must be provided for every request in the request object.
    • detokenize

      Performs de-tokenization for a collection of requests. This method will be provided a collection of tokens originally obtained by invoking tokenize(RequestDetails, TokenizationRequests), and should supply the same input string. This method will not be called if none of the configured tokenization rules allow for de-tokenization, in which case this method may simply throw a UnsupportedOperationException.
      Parameters:
      theRequestDetails - The request associated with the tokenization
      theRequests - The requests, which include the specific rule as well as the token being detokenized
      Returns:
      Returns a collection of detokenized results. A result must be provided for every request in the request object.
    • isIncludeDuplicateRequests

      default boolean isIncludeDuplicateRequests()
      If this method returns false (which is the default implementation unless this method is overridden), duplicate requests will be merged into a single request, with the result applied to all duplicates. For example, suppose rules are in place to tokenize the Patient.name.family and Patient.name.given elements. If a resource contains multiple repetitions of the Patient.name element with the same family name but different given names, then the tokenization provider will be invoked with three requests: one for the common family name, and once for each given name. If this method returns true, then the tokenization provider will be invoked with 4 requests: one for each family name, and one for each given name.
      Since:
      2026.05.R01