Skip to content

Conversation

@luisfabib
Copy link
Owner

@luisfabib luisfabib commented Jan 19, 2026

This PR fixes the incorrect resolution of the $this variable in FHIRPath expressions when used within nested function calls. Previously, $this would maintain the outer collection item context instead of updating to reflect the current evaluation context for certain FHIRPath functions (e.g., string and math functions that take arguments).

Fixed

@luisfabib luisfabib added bugfix fhir.path Related to the FHIRPath module labels Jan 19, 2026
@luisfabib luisfabib merged commit 24e79a8 into main Jan 19, 2026
3 checks passed
@luisfabib luisfabib deleted the fix-fhirpath-invocations-context branch January 19, 2026 13:58
luisfabib added a commit that referenced this pull request Jan 23, 2026
commit 3f16bfe
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 16:08:16 2026 +0100

    Fix Primitive Extension Placeholder Cardinality for FHIR List-Type Fields (#207)

commit 71c2a75
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 12:50:04 2026 +0100

    Add placeholder elements for `Extension.value` type choice values in R4, R4B, R5 (#206)

commit 24e79a8
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 14:58:13 2026 +0100

    Fix FHIRPath `$this` context in nested function call (#203)

commit e837e1f
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 11:03:21 2026 +0100

    Refactor FHIR constraint validators from field-level to model-level validation (#201)

commit f5e28f6
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:36:29 2026 +0100

    Fix FHIR `eld-11` constraint validation expression R5 `ElementDefinition` (#199)

commit 05cbe2b
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:11:58 2026 +0100

    Fix FHIRPath environment variable precedence in nested evaluations (#197)

commit 99cdcd1
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 16:56:43 2026 +0100

    Fix FHIRPath Ambiguity Issues Where Negative Numbers Conflicted With Subtraction Operators  (#198)

commit 79ec56e
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 14:59:56 2026 +0100

    Fix FHIRPath `Union` Operation `TypeError` with Incomparable Types (#196)
luisfabib added a commit that referenced this pull request Jan 23, 2026
commit 3f16bfe
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 16:08:16 2026 +0100

    Fix Primitive Extension Placeholder Cardinality for FHIR List-Type Fields (#207)

commit 71c2a75
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 12:50:04 2026 +0100

    Add placeholder elements for `Extension.value` type choice values in R4, R4B, R5 (#206)

commit 24e79a8
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 14:58:13 2026 +0100

    Fix FHIRPath `$this` context in nested function call (#203)

commit e837e1f
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 11:03:21 2026 +0100

    Refactor FHIR constraint validators from field-level to model-level validation (#201)

commit f5e28f6
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:36:29 2026 +0100

    Fix FHIR `eld-11` constraint validation expression R5 `ElementDefinition` (#199)

commit 05cbe2b
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:11:58 2026 +0100

    Fix FHIRPath environment variable precedence in nested evaluations (#197)

commit 99cdcd1
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 16:56:43 2026 +0100

    Fix FHIRPath Ambiguity Issues Where Negative Numbers Conflicted With Subtraction Operators  (#198)

commit 79ec56e
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 14:59:56 2026 +0100

    Fix FHIRPath `Union` Operation `TypeError` with Incomparable Types (#196)
luisfabib added a commit that referenced this pull request Jan 23, 2026
commit 3f16bfe
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 16:08:16 2026 +0100

    Fix Primitive Extension Placeholder Cardinality for FHIR List-Type Fields (#207)

commit 71c2a75
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 12:50:04 2026 +0100

    Add placeholder elements for `Extension.value` type choice values in R4, R4B, R5 (#206)

commit 24e79a8
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 14:58:13 2026 +0100

    Fix FHIRPath `$this` context in nested function call (#203)

commit e837e1f
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 11:03:21 2026 +0100

    Refactor FHIR constraint validators from field-level to model-level validation (#201)

commit f5e28f6
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:36:29 2026 +0100

    Fix FHIR `eld-11` constraint validation expression R5 `ElementDefinition` (#199)

commit 05cbe2b
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:11:58 2026 +0100

    Fix FHIRPath environment variable precedence in nested evaluations (#197)

commit 99cdcd1
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 16:56:43 2026 +0100

    Fix FHIRPath Ambiguity Issues Where Negative Numbers Conflicted With Subtraction Operators  (#198)

commit 79ec56e
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 14:59:56 2026 +0100

    Fix FHIRPath `Union` Operation `TypeError` with Incomparable Types (#196)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fhir.path Related to the FHIRPath module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FHIRPath $this context resolves incorrectly in nested function calls

2 participants