The aim of my question is to achieve this :
- User with authorization :

- User without authorization :

You can notice that some information of the PID segment are obfuscated.
I do have a solution but it involve a modification of EnsLib.HL7.Message. It's not a best practice.
Do you have idea or a simple solution that doesn't involve overloading every HL7 classes ?
Here is my solution :
https://github.com/grongierisc/hl7-msg-anonymizer
HL7-Msg-Anonymizer
This is a modification of EnsLib.HL7.Message to not display Patient demography information in visual trace.
.png)










.png)