pathling icon indicating copy to clipboard operation
pathling copied to clipboard

Implement String concatenation with + operator incorrect

Open piotrszul opened this issue 9 months ago • 2 comments

String concatenation with + operator produces incorrect result (the value of the first argument).

(Math 6 exlusions)

Details

Expected: null but got: c ==> expected: <null> but was: <c>

  • 'c' + Patient.name.given[0] [** Null in concatenation is treated as an empty collection (2)]

Expected: onetwo but got: one ==> expected: <onetwo> but was: <one>

  • s5 + s6 [** Can concatenate two strings with +]

(FHIR R4 Exlclusions) Details

Expected: true but got: false ==> expected: <true> but was: <false>

  • 'a'+'b' = 'ab' [** testPlus4]

piotrszul avatar Feb 20 '25 05:02 piotrszul

We don't actually support this, so the task is to either:

  1. Make it impossible
  2. Implement it properly as a new feature

johngrimes avatar Feb 24 '25 04:02 johngrimes

Changed to be a new feature as not implemented in previous versions.

piotrszul avatar Mar 24 '25 02:03 piotrszul

We need to make a decision on what data types we are going to support for the math and comparison operators.

At the moment this doesn't seem to work at all for strings.

johngrimes avatar Jun 04 '25 00:06 johngrimes

The current error message is au.csiro.pathling.errors.InvalidUserInputError: + operator does not support left operand: ??, which indicates a bug or incomplete implementation.

johngrimes avatar Jun 04 '25 00:06 johngrimes