-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor changes #5
base: master
Are you sure you want to change the base?
Minor changes #5
Conversation
src/Anon.ts
Outdated
@@ -34,6 +34,7 @@ export default function anonymize(dict) { | |||
for(const key of Object.keys(dict)) { | |||
// Use default action or action specified in policy | |||
var rule = policy["default"]; | |||
//what happens if key is not in policy? ??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rule
is initially set to the default policy (the preceding line).
If there's a policy for that specific key, we use that instead.
src/Anon.ts
Outdated
// TODO: Test that there's no personal data stored outside the "Value" for a | ||
// given tag. This should be the case, and we're making the assumption that the | ||
// user is not maliciously trying to hide data. | ||
export default function anonymize(dict) { | ||
var newDict = {}; | ||
for(const key of Object.keys(dict)) { | ||
// Use default action or action specified in policy | ||
//CONSIDER MOVING NEXT LINE OUTSIDE THE LOOP! (CMHM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to reset rule
to the default policy for each loop iteration - otherwise, the policy rule for the previous field would be used if none were defined.
// OBVIOUSLY I NEED TO CHECK that CT and MRI are not hashed or encoded or entered as Numbers or , or or,or | ||
// // "00080016": {"action":"keep", "description":"SOP Class UID"}, | ||
// The following are additional fields to check: | ||
// "00080060": { "description":"Modality"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is listed in the default set of policies at https://github.com/radiopaedia/dicomanon/blob/master/src/DefaultPolicy.ts#L9
adding a colon, noting something that could be pulled out of a loop (i moved it because it's computationally expensive!), and describing my plan