c2-clinical 1.0.151 → 1.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flow/group/GroupFormUnitsFlow.d.ts +1 -1
- package/dist/flow/group/GroupFormUnitsFlow.js +6 -4
- package/dist/flow/group/item/GetEnablesFormUnitsFlowItem.d.ts +1 -1
- package/dist/flow/group/item/GetEnablesFormUnitsFlowItem.js +4 -2
- package/dist/flow/on-answer/ProcessAnswerFlowTester.js +4 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IFormUnit, IRow } from "../../models/form/FormUnit";
|
|
2
2
|
declare class GroupFormUnitsFlow {
|
|
3
|
-
execute(formUnits: IFormUnit[]): IRow[];
|
|
3
|
+
execute(formUnits: IFormUnit[], allQuestions?: IFormUnit[]): IRow[];
|
|
4
4
|
}
|
|
5
5
|
declare const _default: GroupFormUnitsFlow;
|
|
6
6
|
export default _default;
|
|
@@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const BuildTreeFlowItem_1 = __importDefault(require("./item/BuildTreeFlowItem"));
|
|
7
|
-
const GetEnablesFormUnitsFlowItem_1 = __importDefault(require("./item/GetEnablesFormUnitsFlowItem"));
|
|
8
7
|
class GroupFormUnitsFlow {
|
|
9
|
-
execute(formUnits) {
|
|
10
|
-
const questionsEnableds =
|
|
11
|
-
|
|
8
|
+
execute(formUnits, allQuestions) {
|
|
9
|
+
// const questionsEnableds = GetEnablesFormUnitsFlowItem.execute(
|
|
10
|
+
// formUnits,
|
|
11
|
+
// allQuestions ?? formUnits
|
|
12
|
+
// );
|
|
13
|
+
const questionsWithOrganizedChilds = BuildTreeFlowItem_1.default.execute(formUnits);
|
|
12
14
|
return questionsWithOrganizedChilds;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IFormUnit } from "../../../models/form/FormUnit";
|
|
2
2
|
declare class GetEnablesFormUnitsFlowItem {
|
|
3
|
-
execute(formUnits: IFormUnit[]): IFormUnit[];
|
|
3
|
+
execute(formUnits: IFormUnit[], allQuestions?: IFormUnit[]): IFormUnit[];
|
|
4
4
|
}
|
|
5
5
|
declare const _default: GetEnablesFormUnitsFlowItem;
|
|
6
6
|
export default _default;
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const BuildFormulaFlowItemTester_1 = __importDefault(require("../../item/BuildFormulaFlowItemTester"));
|
|
7
7
|
const ExecFormulaFlowItem_1 = __importDefault(require("../../item/ExecFormulaFlowItem"));
|
|
8
8
|
class GetEnablesFormUnitsFlowItem {
|
|
9
|
-
execute(formUnits) {
|
|
10
|
-
const answers =
|
|
9
|
+
execute(formUnits, allQuestions) {
|
|
10
|
+
const answers = allQuestions
|
|
11
|
+
? allQuestions.filter((unit) => !!unit.answer || unit.answer === 0)
|
|
12
|
+
: formUnits.filter((unit) => !!unit.answer || unit.answer === 0);
|
|
11
13
|
return formUnits?.filter((unit) => {
|
|
12
14
|
if (!unit.active)
|
|
13
15
|
return false;
|
|
@@ -30,6 +30,10 @@ class ProcessAnswerFlowTester {
|
|
|
30
30
|
if (relationed.formulaToDescription) {
|
|
31
31
|
relationed.description = ExecFormulaFlowTester_1.default.execute(relationed.formulaToDescription, allQuestionsAnswereds, attendanceMetActivities);
|
|
32
32
|
}
|
|
33
|
+
// formulaToEnable
|
|
34
|
+
if (relationed.formulaToEnable) {
|
|
35
|
+
relationed.enable = ExecFormulaFlowTester_1.default.execute(relationed.formulaToEnable, allQuestionsAnswereds, attendanceMetActivities);
|
|
36
|
+
}
|
|
33
37
|
// formulaToReferenceValue
|
|
34
38
|
if (relationed?.formulaToReferenceValue) {
|
|
35
39
|
relationed.referenceValue = ExecFormulaFlowTester_1.default.execute(relationed.formulaToReferenceValue, allQuestionsAnswereds, attendanceMetActivities);
|
package/package.json
CHANGED