Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added IBIME functions

...

Table 8. Information functions

Function

Description

ISBLANK(value)

Value refers to an empty value.

ISNUMBER(value)

Value refers to a number.

IBIME Function list

Take into account that the following functions are used for data transformation, so probably some of them don't make sense in validation rules. Most functions are just calls to XQuery native functions

4.1. Logical functions

Table 9. IBIME Logical functions

Function

Description

logical1 AND logical2

Logical AND operator

logical1 OR logical2

Logical OR operator

NOT(logical)

Logical NOT operator

TRUE

Returns the logical value TRUE.

FALSE

Returns the logical value FALSE.

*We don't specify an IF function, as the conditions are expressed as filter/function pairs

4.2. Math and trigonometry functions

Table 10. IBIME Math and trigonometry functions

Function

Description

abs(number)

Absolute value from the expression

ceiling(number)

Turns a Real number to its nearest greater Integer

floor(number)

Turns a Real number to its nearest lesserInteger

round(number)

Turns a Real number to its lesser (<=0.5) or greater (>0.5) Integer

round-half-to-even(real,long)

Rounds a real number with the required decimals

toFloat(number or string)

Transforms a number or string to Float

toInteger(number or string)

Transforms a number or string to Integer

random()

Returns a random number

4.3. Text functions

Table 11. IBIME Text functions

Function

Description

left(String, Int)

Trims a string from the left a number of characters

right(String, Int)

Trims a string from the right a number of characters

starts-with(String, String)

Returns if a string starts with another string

ends-with(String, String)

Returns if a string ends with another string

lower-case(String)

Returns the lowercase string of the string

upper-case(String)

Returns the uppercase string of the string

capitalize-first(String)

Returns the string with the first letter in uppercase

compare(String, String)

Returns an integer (-1, 0, 1) resulting of the comparison of the strings

contains(String, String)

Returns if a string contains another string

matches(String, Regex)

Returns if a string matches a regular expression

concat(String, String)

Concatenates two strings (resulting in another string)

index-of-string-first(String, String)

Returns an integer representing the first position of a substring within a string

normalize-space(String)

Returns the string without all the spaces and identation characters

substring(String, Int)

Returns the string that is the substring of the string from a position. example: substring("abcd",2)="bcd"

substring(String, Int, Int)

Returns the string that is the substring of the string from a position with a length given. example: substring("abcd",1,2)="bc"

substring-before(String, String)

Returns the string that is the substring that appears before the first occurrence of another specified string.  example: substring-before("abcd","b")="a"

substring-after(String, String)

Returns the string that is the substring that appears after the first occurrence of another specified string. example: substring-after("abcd","b")="cd"

replace(string, Regex, String)

Replaces all the occurrences of the regular expression by the chosen string.    example: replace("baba","b","cd")="cdacda"

replace-first(string, Regex, String)

Replaces the first occurrence of the regular expression by the chosen string.    example: replace-first("baba","b","cd")="cdaba"

string-length(String)Returns the length of the string
toString(value)Transforms parameter to a string
base64-encode(value)Transforms anything to a base64 string.

4.4. Statistical functions

Table 12. IBIME Statistical functions

Function

Description

count(path, [condition])

Counts the number of times the path is repeated on the source data (with optional condition)

sum(path, [condition])

Sums the numeric values on the selected path (with optional condition)
max(path,[condition])Returns the maximum value on the selected path (with optional condition)

min(path, [condition])

Returns the minimum value on the selected path (with optional condition)

avg(path, [condition])

Returns the average for the numeric values on the selected path that (with optional condition)

4.5. Date and time functions

Table 13. IBIME Date and time functions

Function

Description

toISODate(date,"yyyy-MM-dd")

Transforms a string to a ISO date, being first parameter the date you want to read and the second parameter the pattern to read it

toISOTime(time,"HH:mm:ss")

Transforms a string to a ISO time, being first parameter the date you want to read and the second parameter the pattern to read it

toISODateTime(datetime,"yyyy-MM-dd'T'HH:mm:ss")

Transforms a string to a ISO date time, being first parameter the date you want to read and the second parameter the pattern to read it

monthNameFromValue(Int, Int)

Returns the name of the month from a value (from 1 = January to 12 = December) and a length of the desired output string. Any 0 or negative length returns the full word

day-from-date(date)

Extracts days value from an ISO Date

day-from-dateTime(datetime)

Extracts days value from an ISO DateTime

month-from-dateTime(datetime)Extracts months value from an ISO DateTime
month-from-date(date)Extracts months value from an ISO Date
year-from-dateTime(datetime)Extracts year value from an ISO DateTime
year-from-date(date)Extracts year value from an ISO Date

hours-from-dateTime(datetime)

Extracts hours value from an ISO DateTime

hours-from-time(time)

Extracts hours value from an ISO Time

minutes-from-dateTime(datetime)

TExtracts minutes value from an ISO DateTime

minutes-from-time(time)

Extracts minutes value from an ISO Time

seconds-from-dateTime(datetime)Extracts seconds value from an ISO DateTime
seconds-from-time(time)Extracts seconds value from an ISO Time
current-dateTime()Gets current system datetime
current-date()Gets current system date
current-time()Gets current system time
current-dateTime-TZ()Gets current system datetime with timezone
current-date-TZ()Gets current system date with timezone
current-time-TZ()Gets current system time with timezone
toDate(String)Transforms current String in ISO format to a Date
toTime(String)Transforms current String in ISO format to a Time
toDateTime(String)Transforms current String in ISO format to a DateTime
days-from-duration(Duration)

calculates the total number of whole days in a normalized duration value. This is not necessarily the same as the integer that appears before the D in the value. For example, if the duration is P1DT36H, the function returns 2 rather than 1. This is because 36 hours is equal to 1.5 days, and the normalized value is therefore P2DT12H. This function does not round the number of days; if the duration is 2 days and 23 hours, it returns the integer 2.

total-days-from-duration(Duration)Returns the total number of days in Duration. If it is an uneven number of days, it will return a fractional part.
hours-from-duration(Duration)Calculates the hours component of a normalized duration value, as an integer between -23 and 23 (inclusive). This is not necessarily the same as the integer that appears before the H in the value. For example, if the duration is PT1H90M, the function returns 2 rather than 1. This is because 90 minutes is equal to 1.5 hours, and the normalized value is therefore PT2H30M. Likewise, if the duration is PT36H, the result is 12, because the normalized value is P1DT12H.
total-hours-from-duration(Duration)Returns the total number of hours in Duration. If it is an uneven number of hours, it will return a fractional part.
minutes-from-duration(Duration)Calculates the minutes component of a normalized duration value, as an integer between -59 and 59 inclusive. This is not necessarily the same as the integer that appears before the M in the value. For example, if the duration is PT1M90S, the function returns 2 rather than 1. This is because 90 seconds is equal to 1.5 minutes, and the normalized value is therefore PT2M30S. Likewise, if the duration is PT90M, the result is 30, because the normalized value is PT1H30M.
total-minutes-from-duration(Duration)Returns the total number of minutes in Duration;. If it is an uneven number of minutes, it will return a fractional part.
seconds-from-duration(Duration)Calculates the seconds component of a normalized duration value, as a decimal number between -60 and 60 exclusive. This is not necessarily the same as the number that appears before the S in the value. For example, if the duration is PT90S, the function returns 30 rather than 90. This is because 60 of those seconds are considered to be one minute, and the normalized value would therefore be PT1M30S.
total-seconds-from-duration(Duration)Returns the total number of seconds in Duration

4.6. Archetype functions

Table 14. IBIME archetype-based functions

Function

Description

code()atXXXX code from related to where the function is defined
archetypeName()Archetype identifier
text()Text from nearest father in target archetype (default language)
text("atXXXX")Text from selected target archetype node (default language)
text("atXXXX", Lang)Text from selected target archetype node in the selected language
description()Description from nearest father in target archetype (default language)
description("atXXXX")Description from selected target archetype node (default language)
description("atXXXX", Lang)Description from selected target archetype node in the selected language

uuid()

This function generates a unique identifier.

node-id(path)

Returns an unique id calculated from the source structure path

4.7. Ontology query functions

Table 15. IBIME ontology query functions

Function

Description

detDescription(code)

Returns the description of a given ontology code

in(Code, Expression)Evaluates if a given code is contained in the subset defined in the expression

* We moved from dedicated "descendants", "ascendants", etc. to just execute Snomed expressions (in snomed expression syntax)

4.8. Information functions

Table 16. IBIME Information functions

Function

Description

isnull(value)

Value refers to an empty value.

* XQuery contains a generic "instance of" function, so no dedicated "isnumber" or "isstring" is not needed

 

Rules in Archetypes - natural language

...