Skip to content
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

Merged
merged 3 commits into from
Mar 24, 2020

Conversation

moria97
Copy link
Contributor

@moria97 moria97 commented Mar 18, 2020

  1. Fix some children types might be overwrited during transforming to path rules as shown in test cases.
  2. Change FHIR path matching logic to a standard interface supported by Hl7.FhirPath.

@moria97 moria97 requested a review from BoyaWu10 March 18, 2020 06:38
@moria97 moria97 changed the title Fix some children types might be overwrited during transforming to path rules Fix some children types might be overwritten during transforming to path rules Mar 18, 2020
@@ -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);
Copy link
Contributor Author

@moria97 moria97 Mar 18, 2020

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>();

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.

@moria97 moria97 merged commit 784ab29 into master Mar 24, 2020
@moria97 moria97 deleted the personal/yufei/Fix-type-rule-bug branch March 24, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants