Skip to content

Commit

Permalink
add test cases around iif()
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Nov 21, 2023
1 parent eaab4ad commit a864342
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions r4/fhirpath/tests-fhir-r4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,11 @@ Any text enclosed within is ignored
<test name="testIif10" inputfile="patient-example.xml">
<expression invalid="execution">('item1' | 'item2').iif(true, 'true-result', 'false-result')</expression>
</test>

<test name="testIif11" inputfile="patient-example.xml">
<expression>('context').iif($this = 'context','true-result', 'false-result')</expression>
<output type="string">true-result</output>
</test>
</group>

<group name="testToInteger">
Expand Down
6 changes: 6 additions & 0 deletions r4b/fhirpath/tests-fhir-r4b.xml
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,12 @@ Any text enclosed within is ignored
<test name="testIif10" inputfile="patient-example.xml">
<expression invalid="execution">('item1' | 'item2').iif(true, 'true-result', 'false-result')</expression>
</test>

<test name="testIif11" inputfile="patient-example.xml">
<expression>('context').iif($this = 'context','true-result', 'false-result')</expression>
<output type="string">true-result</output>
</test>

</group>

<group name="testToInteger">
Expand Down
4 changes: 2 additions & 2 deletions r5/fhirpath/tests-fhir-r5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ Any text enclosed within is ignored
</test>
<!-- Verify the input collection is being set as the iterator for the iif function (on the single item) -->
<test name="testIif11" inputfile="patient-example.xml">
<expression>('context').iif(true, $this, 'false-result')</expression>
<output type="string">context</output>
<expression>('context').iif($this = 'context','true-result', 'false-result')</expression>
<output type="string">true-result</output>
</test>
</group>

Expand Down

0 comments on commit a864342

Please sign in to comment.