findDuplicate2SFormWithinRange( )
检测同一日期范围内给定货品在双部分表单实例中的重复数据(位于平面部分或重复部分中)。数据由表单 ID 标识,该表单 ID 具有提供的搜索关键字或日期范围的重复项值。规则目标应位于相应的重复部分项上。
前两个参数应始终是日期范围。可以提供其他搜索关键字。
- 不能使用下拉列表、单选按钮或复选框值作为函数参数或目标。
- 如果变量设计为保存部分日期,则必须以相同的部分日期格式提供该参数的值。
- 如果记录没有为所需日期输入数据,则跳过记录进行比较。
这是一个聚集函数。如果目标位于两部分表单的重复部分,则将为每个实例运行规则。
语法
findDuplicate2SFormWithinRange(formInstance,'startDateVariable','endDateVariable','variable1',...)
参数
注意:
允许在规则表达式的其他位置重复使用传递给此函数的变量,但是必须使用单引号将变量添加为参数。参数 | 必选/可选 | 说明 |
---|---|---|
formInstance |
可选 | 指明要在其中执行搜索的表单实例。
|
startDateVariable |
必需 | 重复表单上的日期项,用作要评估的日期范围的开始日期。 |
endDateVariable |
必需 | 重复表单上的日期项,用作要评估的日期范围的结束日期。 |
variable(s) |
可选 | 要检查的项变量,使用单引号传入。 |
返回值
布尔值(true 或 false):
- 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.
父主题:两个部分表单函数