HL7: Scrub Data: Have problems getting or sharing sample data, because it confidential information. One way to solve this problem is to scrub the data to remove confidential information. This example channel shows how to use the hl7.scrub module to remove confidential data in an HL7 message.
HL7 data scrubbing can be challenging. It’s a balance between guaranteeing that no confidential information gets through, yet preserving enough structure and data to make the resulting data useful.
This screenshot shows a before and after shot of an ADT^A03 message:
Notice how the routine preserves the length of each field and keeps numerical data numerical?
If you have any questions please contact us at email@example.com.
Using the Code [top]
- Import the HL7: Scrub Data channel from the Builtin: Iguana Protocols repository
- Experiment with the code to find out how it works
- Then add the modules to your Translator project
- Copy the require statements from the channel and add it at the top of your script
Note: Both included modules use require to return a single function
- Adapt the code to your own requirements
- Use the
hl7.scrub(Original)function to scrub out data
- Use the
RehydrateData()function to add back in selected data
Note: You can modify this function to suit your needs
- Interactive scripting help is included for this module
This is the github code for the main module:
How it works [top]
HL7 data scrubbing can be challenging, its a balance between guaranteeing that no confidential information gets through, yet preserving enough structure and data to make the resulting data useful.
To achieve this we use a two-step process scrubbing to remove all the data and rehydrating to selectively map some fields of (non-confidential) data back into the message. This is a simple process and also easy to adapt by modifying the rehydrate process. The channel shows an example of doing this re-mapping in some non sensitive data into the PID, NK1 and OBX segments.
First we use the
hl7.scrub() method to remove data, then we use
RehydrateData() to add data back in.
The three screenshots demonstrate what occurs.
The original message:
The message after scrubbing:
And this is the final result:
More information [top]
- Source code for the main module on github
- Source code for the scrub.lua module on github
- Source code for the hl7.findSegment module on github