Beginning with the 24.2.1 release of QIE, there are two built-in function to help deidentify and then reidentify data in a message. The two functions are:
qie.deIdentifyMessage(message, ‘variable’, ‘public certificate’, ‘node path’) ;
and
qie.reIdentifyMessage(message, ‘private key’, ‘node path’) ;
Let’s discuss the steps to deidentify the data first.
The four parameters that are passed in are as follows:
message: The message object that needs to be deidentified. Any message type can be used.
variable: This is a ‘System Variable’ that is of type ‘Table’ and will have a minimum of 4 columns.
- Description : Only used to help the user know what the node path or row is used for.
- NodePath : Node path to the value that needs to be changed or deidentified
- Action: The action can be one of the following
- blank : Will blank out the field
- newuuid : Will generate a new 32 byte UUID value with dashes that will be used
- newuid : Will generate a new Dicom UID
- transformuid : Will transform the existing UID by generating a SHA1 digest of the existing UID and converting it to a BigInteger. Using this method will generate the same UID output for the same UID input.
- hash or hash-sha256 : Will generate a SHA-256 hash from the value
- hash-sha1 : Will generate a SHA-1 hash from the value
- hash-md5 : Will generate a MD5 hash from the value
- custom : Will place the static text or evaluate a template and use that for the value.
- Required : If set to ‘true’ and the node path is not found, then an exception is thrown. If set to ‘false’ and node path is not found, then the node is skipped.
public certificate: The public certificate is used to encrypt all the values that have been replaced. The encrypted values can only be decrypted using the private key of the public certificate.
node path: (Optional) The location where the encrypted data will be stored. The field data that has been deidentified will be stored in this field and is used to reidentify the message. This parameter may be left null, however when it is null the message will be deidentified but cannot be reidentified as the original values will not be stored.
To reidentify the message you will pass in the following:
message: The message object that was previously deidentified. If the ‘node path’ option was not used on the call to deidentify the message object, then it is not possible to reidentify the message.
private key: This is the private key associated with the public certificate that was used to deidentify the data. This key is used to decrypt the data found in the ‘node path’ parameter, and then placed back into the values that were deidentified.
node path: The location where the encrypted data was stored when the message was deidentified.
To help with the ‘variable’ parameter, options were added to the ‘System Variable’ page for the ‘Table’ type variable. When creating a new variable, switch the ‘Type’ to ‘Table’, and then select the ‘Table’ menu item in the ‘Value’ editor.
You are presented with 4 options:
- Import Default DICOM ID Fields
- Import Default HL7v2.3 ID Fields
- Import Default HL7v2.5 ID Fields
- Import Default HL7v2.6 ID Fields
This will generate a table that contains the common ID fields for the different message types.
Example:
// deidentify the data
qie.deIdentifyMessage(message, 'DeidentifyDicom', 'My Certificate', '/0041,1100');
// ReIdentify message
qie.reIdentifyMessage(message, 'My Private Key', '/0041,1100');