Mask MRN when used as the ID of a Patient resource#98
Merged
Conversation
mgramigna
suggested changes
Mar 29, 2021
mgramigna
left a comment
Contributor
There was a problem hiding this comment.
Overall the masking changes work/look great! I just have a few small comments and suggestions that I made inline
Co-authored-by: Matthew Gramigna <matthewgramigna@gmail.com>
Co-authored-by: Matthew Gramigna <matthewgramigna@gmail.com>
julianxcarter
approved these changes
Mar 29, 2021
julianxcarter
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me and works well. Nice job!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since the MRN is used as an ID on the patient resource, it appears as a reference in other resources. Now when masking the MRN, all of those references will also be masked by replacing the MRN with a hash of the MRN after extraction is completed.
New behavior
If the MRN is specified as a field to be masked, in addition to masking the MRN in the Patient resource, there is an additional masking step after extraction is finished. All references to the MRN as an ID will be replaced by a hashed version of the MRN. Right now, the only places I found the MRN being used as an ID are in the
idandfullUrlfields of the Patient resource and 'subject' and 'individual' objects in other resources.Code changes
patientUtils.jsnow has amaskMRNfunction that takes a bundle as input, modifies the bundle to replace the MRN with a hashed version as the ID of the Patient resource, and then replaces every reference in other resources with the same hashapp.jswill check the config to see if the MRN needs to be masked and will perform the masking after extraction is completedpatientUtils.test.jsnow contains tests for themaskMRNfunctionTesting guidance
"mask": ["mrn"]in theconstructorArgsof the patient extractor