c2-clinical 1.0.142 → 1.0.144

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.
@@ -1,6 +1,5 @@
1
- import { IFormUnit } from "../../models/form/FormUnit";
2
1
  declare class ConvertChartDataFlow {
3
- execute(formUnitChart: IFormUnit): any;
2
+ execute(graphicData: any): any;
4
3
  }
5
4
  declare const _default: ConvertChartDataFlow;
6
5
  export default _default;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class ConvertChartDataFlow {
4
- execute(formUnitChart) {
4
+ execute(graphicData) {
5
5
  const reviver = (key, value) => {
6
6
  if (typeof value === "string" && value.startsWith("function"))
7
7
  return new Function(`return ${value}`)();
8
8
  return value;
9
9
  };
10
- const graphicData = JSON.parse(JSON.stringify(formUnitChart.graphicData?.staticGraphicData), reviver);
11
- return graphicData;
10
+ const graphicDataConverted = JSON.parse(JSON.stringify(graphicData), reviver);
11
+ return graphicDataConverted;
12
12
  }
13
13
  }
14
14
  exports.default = new ConvertChartDataFlow();
@@ -5,7 +5,7 @@ declare class OnAnswerQuestionsFlowTester {
5
5
  bank: IFormUnit[];
6
6
  autoAnswereds: IFormUnit[];
7
7
  };
8
- executeByRows(answered: IFormUnit, lines: IRow[], metActivitiesPatient: IMetActivityPatient[]): {
8
+ executeByRows(answered: IFormUnit | IFormUnit[], lines: IRow[], metActivitiesPatient: IMetActivityPatient[]): {
9
9
  bank: IFormUnit[];
10
10
  lines: IRow[];
11
11
  };
@@ -17,11 +17,20 @@ class OnAnswerQuestionsFlowTester {
17
17
  return { bank: answersBank, autoAnswereds: questionsRelacionedsAnswereds };
18
18
  }
19
19
  executeByRows(answered, lines, metActivitiesPatient) {
20
- const bankAnswer = ConvertRowToFormUnitsFlowItem_1.default.execute(lines);
21
- const { bank } = this.execute(answered, bankAnswer, metActivitiesPatient);
20
+ let bankAnswer = ConvertRowToFormUnitsFlowItem_1.default.execute(lines);
21
+ if (Array.isArray(answered)) {
22
+ answered.forEach((answer) => {
23
+ const ret = this.execute(answer, bankAnswer, metActivitiesPatient);
24
+ bankAnswer = ret.bank;
25
+ });
26
+ }
27
+ else {
28
+ const ret = this.execute(answered, bankAnswer, metActivitiesPatient);
29
+ bankAnswer = ret.bank;
30
+ }
22
31
  return {
23
- bank,
24
- lines: GroupFormUnitsFlow_1.default.execute(bank)
32
+ bank: bankAnswer,
33
+ lines: GroupFormUnitsFlow_1.default.execute(bankAnswer)
25
34
  };
26
35
  }
27
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.142",
3
+ "version": "1.0.144",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://github.com/cabralsilva/c2-clinical.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",