c2-clinical 1.0.148 → 1.0.150
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/__tests__/flow/on-answer/OnAnswerQuestionsFlowTester.test.js +53 -4297
- package/dist/flow/group/item/BuildTreeFlowItem.js +3 -0
- package/dist/flow/group/item/GetEnablesFormUnitsFlowItem.js +1 -1
- package/dist/flow/on-answer/ProcessAnswerFlowTester.js +4 -1
- package/dist/flow/on-answer/item/GetAnswerRelationedsFlowItemTester.js +1 -1
- package/package.json +1 -1
|
@@ -36,6 +36,9 @@ class BuildTreeFlowItem {
|
|
|
36
36
|
return lines;
|
|
37
37
|
}
|
|
38
38
|
const rootFormUnit = questions.filter((q) => !q.parent);
|
|
39
|
+
if (!rootFormUnit?.length) {
|
|
40
|
+
return buildRows({ parent: undefined, children: questions });
|
|
41
|
+
}
|
|
39
42
|
return buildRows({ parent: undefined, children: rootFormUnit });
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -7,7 +7,7 @@ const BuildFormulaFlowItemTester_1 = __importDefault(require("../../item/BuildFo
|
|
|
7
7
|
const ExecFormulaFlowItem_1 = __importDefault(require("../../item/ExecFormulaFlowItem"));
|
|
8
8
|
class GetEnablesFormUnitsFlowItem {
|
|
9
9
|
execute(formUnits) {
|
|
10
|
-
const answers = formUnits.filter((unit) => unit.answer
|
|
10
|
+
const answers = formUnits.filter((unit) => !!unit.answer || unit.answer === 0);
|
|
11
11
|
return formUnits?.filter((unit) => {
|
|
12
12
|
if (!unit.active)
|
|
13
13
|
return false;
|
|
@@ -8,12 +8,15 @@ const GetAnswerRelationedsFlowItemTester_1 = __importDefault(require("./item/Get
|
|
|
8
8
|
class ProcessAnswerFlowTester {
|
|
9
9
|
execute(questionAnswered, bankAnswer, attendanceMetActivities) {
|
|
10
10
|
if (questionAnswered.code === "CURRENT_IMC_TABLE_RESULT") {
|
|
11
|
-
console.log("debug");
|
|
11
|
+
// console.log("debug");
|
|
12
12
|
}
|
|
13
13
|
const answerRelacioneds = GetAnswerRelationedsFlowItemTester_1.default.execute(questionAnswered, bankAnswer);
|
|
14
14
|
const autoAnswereds = [];
|
|
15
15
|
const allQuestionsAnswereds = bankAnswer?.filter((q) => q.answer !== "" && q.answer !== undefined);
|
|
16
16
|
answerRelacioneds.forEach((relationed) => {
|
|
17
|
+
if (questionAnswered.code === "IMC") {
|
|
18
|
+
// console.log("debug");
|
|
19
|
+
}
|
|
17
20
|
//executa fórmula para answer
|
|
18
21
|
if (relationed.code !== questionAnswered.code && relationed.formulaToAnswer) {
|
|
19
22
|
const answerCalculated = ExecFormulaFlowTester_1.default.execute(relationed.formulaToAnswer, allQuestionsAnswereds, attendanceMetActivities);
|
|
@@ -5,7 +5,7 @@ class GetAnswerRelationedsFlowItemTester {
|
|
|
5
5
|
const regex = new RegExp(`\\$\{${questionAnswered.code}\}`, "i");
|
|
6
6
|
const questionsRelationeds = bankAnswer?.filter((fu) => {
|
|
7
7
|
if (fu.code === "CURRENT_HEIGHT_TABLE_RESULT") {
|
|
8
|
-
console.log("debug");
|
|
8
|
+
// console.log("debug");
|
|
9
9
|
}
|
|
10
10
|
return (regex.test(fu.formulaToAnswer) ||
|
|
11
11
|
regex.test(fu.formulaToReferenceValue) ||
|
package/package.json
CHANGED