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

FHIRPath precedence operators of in and or not honored #1425

Closed
oliveregger opened this issue Sep 5, 2023 · 3 comments
Closed

FHIRPath precedence operators of in and or not honored #1425

oliveregger opened this issue Sep 5, 2023 · 3 comments
Labels
bug Something isn't working fhirpath wontfix This will not be worked on

Comments

@oliveregger
Copy link
Contributor

The following FHIRPath expression gives an error in IG Publisher:

original:
status in ('registered'|'cancelled') or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()

HAPI-0389: Failed to call access method: org.hl7.fhir.exceptions.PathEngineException: Unable to evaluate as a boolean: registered,cancelled (@char 11)

according to operator precedence in should be before or and ('registered'|'cancelled') should not be evaulated to boolean.

making it explicit (status in ('registered'|'cancelled')) or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()

it returns no errors.

see also hl7-eu/laboratory#51, qa

javascript.js. Java (IBM) and the .NET (Firely) implementation are working with the original as expected in FHIRpath Lab:

resource to test:

{
    "resourceType": "Observation",
    "status": "final",
    "category": [
        {
            "coding": [
                {
                    "system": "http://terminology.hl7.org/CodeSystem/observation-category",
                    "code": "laboratory"
                }
            ]
        }
    ],
    "code": {
        "coding": [
            {
                "system": "http://hl7.eu/fhir/laboratory/CodeSystem/lab-localCs-eu-lab",
                "code": "3002989",
                "display": "Hepatitis Panel, Acute with Reflex to HBsAg Confirmation and Reflex to HCV by Quantitative NAAT"
            }
        ],
        "text": "Acute Hepatitis Panel, reflex to confirmation"
    },
    "subject": {
        "reference": "Patient/8472931c-fbd0-437b-9ed1-4f66472c78b5"
    },
    "effectiveDateTime": "2022-10-25T13:35:00+01:00",
    "performer": [
        {
            "display": "MUDr. Aleš Procházka"
        }
    ],
    "hasMember": [
        {
            "reference": "Observation/104a5829-565b-46a6-85d6-36751ef79a40"
        },
        {
            "reference": "Observation/01b8ec35-9b20-45a4-bd41-42eeae2fd521"
        },
        {
            "reference": "Observation/096e27da-0768-47e4-b33c-9f1be93e1f88"
        },
        {
            "reference": "Observation/861e7b48-5497-410a-bed8-2cde814e09fc"
        },
        {
            "reference": "Observation/cc96d499-3e0e-4588-a021-4fe576766112"
        }
    ]
}
@dotasek dotasek added bug Something isn't working fhirpath labels Oct 17, 2023
Copy link

stale bot commented Apr 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 13, 2024
@oliveregger
Copy link
Contributor Author

this is still an issue, at least it can be reproduced with FhirPathTester

@stale stale bot removed the wontfix This will not be worked on label Apr 15, 2024
Copy link

stale bot commented Oct 30, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 30, 2024
@stale stale bot closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fhirpath wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants