-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix some children types might be overwritten during transforming to path rules #20
Conversation
moria97
commented
Mar 18, 2020
•
edited
Loading
edited
- Fix some children types might be overwrited during transforming to path rules as shown in test cases.
- Change FHIR path matching logic to a standard interface supported by Hl7.FhirPath.
src/Fhir.Anonymizer.Core/AnonymizationConfigurations/ResourceAnonymizerContext.cs
Show resolved
Hide resolved
@@ -29,6 +29,7 @@ public void GivenATypeRule_WhenParseRule_TransformedPathRuleShouldBeReturned() | |||
|
|||
Assert.Contains("Patient.address", context.PathSet); | |||
Assert.Contains("Patient.name", context.PathSet); | |||
Assert.Contains("Patient.name.period.start", context.PathSet); |
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 test case would not pass in master code as we treat all name nodes as the same structure and transform type rules based on Patient.name[0] but omits Patient.name[1].
@@ -74,9 +74,7 @@ public ElementNode AnonymizeResourceNode(ElementNode root) | |||
var resourceId = root.GetNodeId(); | |||
foreach (var rule in resourceContext.RuleList) | |||
{ | |||
var pathCompileExpression = new FhirPathCompiler().Compile($"{rule.Path}"); | |||
var matchedNodes = pathCompileExpression(root, EvaluationContext.CreateDefault()) | |||
.Cast<ElementNode>(); |
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.
Let me sync up with you on Teams to understand the details here.