Package ca.cdr.api.fhir.tokenization
Interface ITokenizationProvider
public interface ITokenizationProvider
This interface implements the conversion of non-tokenized strings into
tokens, and vice versa.
- Since:
- 2025.05
-
Method Summary
Modifier and TypeMethodDescriptiondetokenize
(RequestDetails theRequestDetails, DetokenizationRequests theRequests) Performs de-tokenization for a collection of requests.tokenize
(RequestDetails theRequestDetails, TokenizationRequests theRequests) Performs tokenization for a collection of requests.
-
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 tokenizationtheRequests
- 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
DetokenizationResults detokenize(RequestDetails theRequestDetails, DetokenizationRequests theRequests) Performs de-tokenization for a collection of requests. This method will be provided a collection of tokens originally obtained by invokingtokenize(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 aUnsupportedOperationException
.- Parameters:
theRequestDetails
- The request associated with the tokenizationtheRequests
- 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.
-