question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistency in the application of multiple recipe rules on the same field

See original GitHub issue

After the parser update, there is an inconsistency in the manner in which multiple recipe rules applied to the same field.

Prior to the update, multiple rules were additive.
Example 1:

JITTER StudyDate 1
JITTER StudyDate 2

Results in 3 days being added to StudyDate.

Example 2:

ADD PatientIdentityRemoved Yes
REMOVE PatientIdentityRemoved 

Results in no change to the header.

Example 3:

REMOVE StudyDate 
ADD StudyDate 20200806

Resulted in StudyDate having a value of 20200806.

After the parser update, any actions following a REMOVE rule are ignored. As a result, while Examples 1 and 2 still operate the same, Example 3 fails to add the new StudyDate to the header.

I believe that this is occurring because the REMOVE action (specifically parser.py - delete_field()) removes the specified field from the FileDataSet in the parser.dicom property but is not removing the item from the fields property. In subsequent ADD rules, we fall into the add_field function and since the deleted field is still in parser.fields the add is treated as a replacement (line 377) which updates the element, but the tag with the new value is never re-added to the parser.dicom FileDataSet.

I have a few unit tests written for the examples that I’ve outlined above - but haven’t implemented a solution yet (the new tests can be seen in this commit). I wanted to get your perspective first. My first thought was to ensure that the REMOVE action removed the element from the fields property in addition to what it currently does.

While all of the above may seem like nonsense - “Why wouldn’t you just compress each of these scenarios down to three single rules?” - the REMOVE/ADD scenario does have real-world applicability for situations like:

REMOVE endswith:ID
ADD PatientID 12345

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vsochcommented, Aug 7, 2020

Fixed with #141

1reaction
wetzeljcommented, Aug 7, 2020

I like typical. 😃 It’s switched to deepcopy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Files in Folders Schema Inconsistencies - Dataiku Community
For example just now when trying to refresh the data set I go. The current schema of output dataset(s) doesn't match what the...
Read more >
Unavoidable inconsistency of coffee brewing and tasting
My goal this year was simple – I wanted to make a fool-proof recipe, easily repeatable at home by people with no previous...
Read more >
Best Practice Recipes for Publishing RDF Vocabularies - W3C
Abstract. This document describes best practice recipes for publishing vocabularies or ontologies on the Web (in RDF Schema or OWL ). The features...
Read more >
Why are restaurant meals inconsistent? You can eat the same ...
Short Answer: It's more than likely almost always prepared by a different cook. To get the same cook you'd have to go the...
Read more >
Reproducibility and Replicability in Research
Imagine giving one recipe to 10 different chefs and getting 10 completely different results. This inconsistency could be due to any number ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found