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.default booleanIf 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.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.
-
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 thePatient.name.familyandPatient.name.givenelements. If a resource contains multiple repetitions of thePatient.nameelement 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
-