Record Level Access control limits the user's access to specific records and this limit holds for all layouts in your database file.
There are two possible fixes that I can think of:
a) Separate the data in this table into two related tables. The data that must be kept private should be kept in the current table and be protected with your current security set up. But the data that can be presented in an "anonymized" fashion would be kept in the related table (linked one to one by PatientID). SInce this is now a different table, you can set different access permissions for this data.
b) You may be able to modify the "lock" expression to check the contents of a global variable as part of the expression. You can then "unlock" access to the table by setting the global variable to a different value. The OnLayoutEnter trigger could perform a script to modify the value in this variable to "unlock" access to the data and an OnLayoutExit trigger performed script can return the variable to it's original value to lock it back up again.
The first option is a lot more work to set up, but also offers a much more secure control over access to the data.
Thanks for your suggestions
I used your 2 related tables approach and the solution works perfectly