Describe the bug
It seems that fhirpath doesn't work correctly for equality != operation. I use it JUTE mappings.
Severity
Steps to reproduce the behavior:
POST /Mapping/$debug
mapping:
body:
$let:
answerLinkId: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId!='next-informative-message-question').where(answer).linkId").0
patient: $ fhirpath("QuestionnaireResponse.subject")
$body:
type: transaction
entry:
- request:
url: /ChatSuggestionHistory
method: POST
resource:
patient: $ patient
suggestion: $ answerLinkId
derivedFrom:
id: $ fhirpath("QuestionnaireResponse.id")
resourceType: QuestionnaireResponse
resourceType: ChatSuggestionHistory
id: informative-message-extract
resourceType: Mapping
scope:
item:
- answer:
- value:
string: informative-message-workout
linkId: next-informative-message-question
- text: >-
The air quality isn't great right now.
linkId: informative-message-air-pollution
- text: >-
Yeah to you! It looks like you are doing a great job working out.
answer:
- value:
Coding:
code: acknowledge
system: https://api.juli.co/code-systems/informative-message
display: Got it
linkId: informative-message-workout
status: completed
subject:
id: 66b00713-81a1-45f0-96c9-7896b17aade6
resourceType: Patient
questionnaire: informative-message
resourceType: QuestionnaireResponse
The result I get is below. Take a look at suggestion field, it should contain the result of this expression $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId!='next-informative-message-question').where(answer).linkId").0.
And it does, but the result is wrong because I use != operation in where clause, but it seems that it treats it as =.
Describe the bug It seems that fhirpath doesn't work correctly for equality
!=
operation. I use it JUTE mappings.Severity
Steps to reproduce the behavior:
The result I get is below. Take a look at
suggestion
field, it should contain the result of this expression$ fhirpath("QuestionnaireResponse.repeat(item).where(linkId!='next-informative-message-question').where(answer).linkId").0
.And it does, but the result is wrong because I use
!=
operation inwhere
clause, but it seems that it treats it as=
.Expected behavior I should get
informative-message-workout
insuggestion
field because it matches the fhirpath request.Versions:
Additional context I tested this fhirpath expression using fhirparth.js (https://hl7.github.io/fhirpath.js/) and fhirpath-py and it works correctly.