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

FHIRPathSpecTest update and related changes #2749

Merged
merged 2 commits into from
Sep 15, 2021
Merged

Conversation

lmsurpre
Copy link
Member

@lmsurpre lmsurpre commented Sep 8, 2021

  1. Update to the latest from
    https://github.com/FHIR/fhir-test-cases/blob/master/r4/fhirpath/tests-fhir-r4.xml
  2. Comment out the test cases we consider to be invalid (and add
    comments to explain why)
  3. Minor fixes to the FHIRPathSpecTest harness
  4. Minor fixes to our FHIRPath engine
    • add guard in FHIRPathAbstractTemporalValue.isComparableTo
    • FHIRPathEvaluator.exists fix for applying predicate against all
      context nodes (not just the first one)
    • Update allTrue() to throw when called with non-boolean inputs
    • rename private validateEqualityOperands helper

Update results:

Total tests run: 723, Passes: 544, Failures: 0, Skips: 179

Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com

@lmsurpre lmsurpre force-pushed the update-fhirpath-tests branch 2 times, most recently from 8a71315 to d5b073f Compare September 10, 2021 21:28
@lmsurpre lmsurpre marked this pull request as ready for review September 10, 2021 21:29
@lmsurpre lmsurpre changed the title Update the FHIRPath tests FHIRPathSpecTest update and related changes Sep 10, 2021
1. Update to the latest from
https://github.com/FHIR/fhir-test-cases/blob/master/r4/fhirpath/tests-fhir-r4.xml
2. Comment out the test cases we consider to be invalid (and add
comments to explain why)
3. Minor fixes to the FHIRPathSpecTest harness
4. Minor fixes to our FHIRPath engine
  * add guard in FHIRPathAbstractTemporalValue.isComparableTo
  * FHIRPathEvaluator.exists fix for applying predicate against all
context nodes (not just the first one)
  * Update allTrue() to throw when called with non-boolean inputs
  * rename private validateEqualityOperands helper

Update results:
```
Total tests run: 723, Passes: 544, Failures: 0, Skips: 179
```

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
if (!validateEqualityOperands(left, right)) {
// for quantity operands: Attempting to operate on quantities with invalid units will result in empty ({ }).
// for temporal operands: If one input has a value for the precision and the other does not, the comparison stops and the result is empty ({ })
if (!isEqualityOperationValid(left, right)) {
Copy link
Collaborator

@JohnTimm JohnTimm Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are really checking the operands here. I think perhaps:

if (!equalityOperandsValid(left, right))

or

if (!equalityOperandsAreValid(left, right))

reads a little better.

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
@JohnTimm JohnTimm self-requested a review September 13, 2021 13:52
Copy link
Collaborator

@JohnTimm JohnTimm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lmsurpre lmsurpre merged commit ffcd281 into main Sep 15, 2021
@lmsurpre lmsurpre deleted the update-fhirpath-tests branch September 15, 2021 19:50
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.

None yet

2 participants