c2-clinical 1.0.83 → 1.0.85

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.
@@ -15,7 +15,7 @@ class BuildFormulaFlowItem {
15
15
  const variables = [...new Set(matches)];
16
16
  for (const variable of variables) {
17
17
  const variablePure = variable.match(/\$\{([^}]+)\}/) ?? [];
18
- const questionAnswered = answers.find((a) => a.reference.code === variablePure[1]);
18
+ const questionAnswered = answers.find((a) => a.reference?.code === variablePure[1]);
19
19
  if (questionAnswered?.answer !== undefined && questionAnswered?.answer !== "") {
20
20
  formula = formula.replaceAll(variable, questionAnswered?.answer);
21
21
  }
@@ -1,7 +1,8 @@
1
- import { IFormUnit, IRequestGraphicData, IValidationQuestion } from "./form/FormUnit";
1
+ import { Types } from "mongoose";
2
2
  import { IDefault } from "./Default";
3
+ import { IFormUnit, IRequestGraphicData, IValidationQuestion } from "./form/FormUnit";
3
4
  export interface IAnswer extends IDefault {
4
- reference: IFormUnit;
5
+ reference: IFormUnit | Types.ObjectId;
5
6
  validations: IValidationQuestion[];
6
7
  requestGraphicData: IRequestGraphicData[];
7
8
  answer: any;
@@ -55,6 +55,7 @@ export interface IFormUnit extends IDefault {
55
55
  show: boolean;
56
56
  readOnly: boolean;
57
57
  required: boolean;
58
+ ellegibleForComparison: boolean;
58
59
  codeEnableFreeText: string;
59
60
  labelFreeText: string;
60
61
  graphicData: any;
@@ -219,6 +220,7 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
219
220
  }>;
220
221
  show: any;
221
222
  readOnly: any;
223
+ ellegibleForComparison: any;
222
224
  requestGraphicData: Types.DocumentArray<{
223
225
  method: string;
224
226
  url: string;
@@ -330,6 +332,7 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
330
332
  }>;
331
333
  show: any;
332
334
  readOnly: any;
335
+ ellegibleForComparison: any;
333
336
  requestGraphicData: Types.DocumentArray<{
334
337
  method: string;
335
338
  url: string;
@@ -441,6 +444,7 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
441
444
  }>;
442
445
  show: any;
443
446
  readOnly: any;
447
+ ellegibleForComparison: any;
444
448
  requestGraphicData: Types.DocumentArray<{
445
449
  method: string;
446
450
  url: string;
@@ -60,6 +60,7 @@ exports.FormUnitSchema = new mongoose_1.Schema({
60
60
  show: { type: Boolean, required: true, default: true }, //determina se a pergunta é exibida nos formulario (IDADE EM DIAS POR EXEMPLO, perguntas necessárias para alguns calculos mas q nao fazem sentido exibi-las)
61
61
  readOnly: { type: Boolean, default: false },
62
62
  required: { type: Boolean, default: false },
63
+ ellegibleForComparison: { type: Boolean, default: false },
63
64
  //DADOS PARA PERGUNTAS CHOICE_SINGLE E CHOICE_MULTIPLE
64
65
  codeEnableFreeText: { type: String },
65
66
  labelFreeText: { type: String },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.83",
3
+ "version": "1.0.85",
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>",