Clinical Quality Language Release 1 STU2 (w/ Errata) (1.2.1)

This is Clinical Quality Language STU2.1 (1.2 Published w/ Errata) in it's permanent home (it will always be available at this URL). It has been superseded by 1.4.
For a full list of available versions, see the Directory of published versions .

Clinical Decision Support Work GroupMaturity Level: 4Ballot Status: STU 2.1

Appendix I – FHIRPath Function Translation

This appendix provides detailed mappings for each FHIRPath function in terms of the ELM output produced.

1. .all()

X.all(<condition>) === AllTrue(X $this let a: <condition> where a return a)

2. .allFalse()

X.allFalse() === AllTrue(X A return not A)

3. .allTrue()

X.allTrue() === AllTrue(X)

4. .anyFalse()

X.anyFalse() === AnyTrue(X A return not A)

5. .anyTrue()

X.anyTrue() === AnyTrue(X)

6. .as()

X.as(<type>) === X as <type>

X.as(<type>) === X a where a is <type> return a as <type>

7. .children()

8. .combine()

children(X) === Children(X)

X.combine(Y) === Flatten(\{ X, Y })

9. .contains()

X.contains(Y) === PositionOf(Y, X) >= 0

10. .count()

X.count() === Count(X)

11. .descendents()

12. .distinct()

descendents(X) === Descendents(X)

X.distinct() === distinct X

13. .empty()

X.empty() === not exists X

14. .endsWith()

X.endsWith(Y) === EndsWith(X, Y)

15. .exists()

X.exists() === exists X

X.exists(<condition>) === exists (X $this where <condition>)

16. .first()

X.first() === First(X)

17. .iif()

X.iif(Y) === if X then Y else null

X.iif(Y, Z) === if X then Y else Z

18. .indexOf()

X.indexOf(Y) === PositionOf(Y, X) // Note carefully the order of arguments here, it’s the opposite of IndexOf

19. .is()

X.is(<type>) === X is <type>

20. .isDistinct()

X.isDistinct() === Count(X) = Count(distinct X)

21. .last()

X.last() === Last(X)

22. .lastIndexOf()

X.lastIndexOf(Y) === LastPositionOf(Y, X) // Note carefully the order of arguments here, it’s the opposite of lastIndexOf.

23. .length()

X.length() === Length(X)

24. .matches()

X.matches(Y) === Matches(X, Y)

25. .ofType()

X.ofType(T) === X $this where $this is T

Note that the argument T is required to be a literal string, and is interpreted as the name of a type. For non-named-types, type specifier syntax applies.

26. .not()

X.not() === not X

27. .now()

now() === Now()

28. .repeat()

X.repeat(<element>) === Repeat(X, <element>)

The type of X.repeat(<element>) is inferred as the type of:

X.select(<element>).select(<element>)

29. .replace()

X.replace(Y, Z) === Replace(X, Y, Z)

30. .replaceMatches()

X.replaceMatches(Y, Z) === ReplaceMatches(X, Y, Z)

31. .select()

If the result type of <element> is not list-valued:

X.select(<element>) === X $this let a: <element> where a is not null return a

If the result type of <element> is list-valued:

X.select(<element>) === Flatten(X $this let a: <element> where a is not null return a)

32. .single()

X.single() === singleton from X

33. .skip()

X.skip(Y) === Slice(X, Y, null)

34. .startsWith()

X.startsWith(Y) === StartsWith(X, Y)

35. .subsetOf()

X.subsetOf(Y) === X included in Y

36. .substring()

X.substring(Y) === SubString(X, Y)

X.substring(Y, Z) === SubString(X, Y, Z)

37. .supersetOf()

X.supersetOf(Y) === X includes Y

38. .tail()

X.tail() === Slice(X, 1, null)

39. .take()

X.take(Y) === Slice(X, 0, Y)

40. .toBoolean()

X.toBoolean() === ToBoolean(X)

41. .toDateTime()

X.toDateTime() === ToDateTime(X)

42. .today()

today() === Today()

43. .toDecimal()

X.toDecimal() === ToDecimal(X)

44. .toInteger()

X.toInteger() === ToInteger(X)

45. .toString()

X.toString() === ToString(X)

46. .toTime()

X.toTime() === ToTime(X)

47. .trace()

X.output(Y) === Trace(X, Y) // Add to ELM

48. .where()

X.where(<condition>) === X $this where <condition>