findDuplicate2SFormWithinRange( )

检测同一日期范围内给定货品在双部分表单实例中的重复数据(位于平面部分或重复部分中)。数据由表单 ID 标识,该表单 ID 具有提供的搜索关键字或日期范围的重复项值。规则目标应位于相应的重复部分项上。

前两个参数应始终为日期范围。可以提供其他搜索关键字。

  • 不能将下拉列表、单选按钮或复选框值用作函数参数或目标。
  • 如果变量设计为保存部分日期,则必须以相同的部分日期格式为该参数提供值。
  • 如果记录没有为所需日期输入数据,则跳过该记录进行比较。

这是聚集函数。如果目标位于双节表单的重复部分,则将为每个实例运行规则。

语法

findDuplicate2SFormWithinRange(formInstance,'startDateVariable','endDateVariable','variable1',...)

参数

注:

允许在规则表达式的其他位置重用传递到此函数的变量,但是您必须使用单引号将变量添加为参数。
参数 必填/可选 说明
formInstance 可选 指明要在其中执行搜索的表单实例。
  • 如果平面部分中的 null 和变量,则将在平面部分中搜索所有表单实例的重复项。
  • 如果表部分中有 null 和变量,则将在所有表单实例的所有表行中搜索重复项。
  • 如果提供了 formInstance 值,将针对指定实例的所有表行执行搜索。
startDateVariable 必需 重复表单上的日期项,用作要评估的日期范围的开始日期。
endDateVariable 必需 重复表单上的日期项,用作要评估的日期范围的结束日期。
variable(s) 可选 要检查的项变量,使用单引号传入。

返回值

Boolean(true 或 false)value:
  • True (如果发现重复的值)。
  • 如果找不到重复的值,则为

示例

示例 3-63 检查所有两部分表单实例中是否存在相同开始日期范围和症状值内的任何实例。

// Given 5 repeating form instances with items "onsetStartDate", "onsetEndDate and "Symptom"
if (findDuplicate2SFormWithinRange(null,'itmOnsetDateStart','itmOnsetDateEnd','itmSymptom') === true) {
  return false;
} else {
  return true;
}
 
// Fires a query if more than 1 repeating instance in a two-section form is found within the same date range and with the same symptom.
//
// Note: If any repeating instance of the two-section form has a null start or end date then the system assumes a date in order to successfully
// perform the date range overlap check. If the start date is null then the system assumes it to be 01 Jan 0001 and if the
// end date is null then it is assumed to be 01 Dec 3099.