c2-clinical 1.0.177 → 1.0.178

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.
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const GroupFormUnitsFlow_1 = __importDefault(require("../group/GroupFormUnitsFlow"));
7
7
  const ConvertRowToFormUnitsFlowItem_1 = __importDefault(require("./item/ConvertRowToFormUnitsFlowItem"));
8
8
  const ProcessAnswerFlowTester_1 = __importDefault(require("./ProcessAnswerFlowTester"));
9
+ const enum_1 = require("../../models/enum");
9
10
  class OnAnswerQuestionsFlowTester {
10
11
  execute(answered, answersBank, metActivitiesPatient = []) {
11
12
  const questionAnswered = answersBank.find((q) => q._id.toString() === answered._id.toString());
@@ -29,6 +30,26 @@ class OnAnswerQuestionsFlowTester {
29
30
  const ret = this.execute(answered, bankAnswer, metActivitiesPatient);
30
31
  bankAnswer = ret.bank;
31
32
  }
33
+ //processar os graficos
34
+ bankAnswer
35
+ .filter((fu) => fu.type === enum_1.TypeFormUnitEnum.GRAPHIC)
36
+ .forEach((fu) => {
37
+ if (fu.requestGraphicData?.length) {
38
+ fu.requestGraphicData?.forEach((request) => {
39
+ var currentPointOfGraphic = {};
40
+ request.codes?.forEach((code) => {
41
+ const answer = bankAnswer.find((fu) => fu.code === code);
42
+ if (answer) {
43
+ currentPointOfGraphic = {
44
+ ...currentPointOfGraphic,
45
+ [answer.description]: answer.answer
46
+ };
47
+ }
48
+ });
49
+ request.dataset.data = [...request.dataset.data, currentPointOfGraphic];
50
+ });
51
+ }
52
+ });
32
53
  return {
33
54
  bank: bankAnswer,
34
55
  lines: GroupFormUnitsFlow_1.default.execute(bankAnswer)
@@ -7,9 +7,6 @@ const ExecFormulaFlowTester_1 = __importDefault(require("./ExecFormulaFlowTester
7
7
  const GetAnswerRelationedsFlowItemTester_1 = __importDefault(require("./item/GetAnswerRelationedsFlowItemTester"));
8
8
  class ProcessAnswerFlowTester {
9
9
  execute(questionAnswered, bankAnswer, attendanceMetActivities) {
10
- if (questionAnswered.code === "CURRENT_IMC_TABLE_RESULT") {
11
- // console.log("debug");
12
- }
13
10
  const answerRelacioneds = GetAnswerRelationedsFlowItemTester_1.default.execute(questionAnswered, bankAnswer);
14
11
  const autoAnswereds = [];
15
12
  const allQuestionsAnswereds = bankAnswer?.filter((q) => q.answer !== "" && q.answer !== undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.177",
3
+ "version": "1.0.178",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": {
6
6
  "type": "git",