c2-clinical 1.0.6 → 1.0.8

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.
@@ -16,7 +16,9 @@ export declare enum TypeFormUnitEnum {
16
16
  */
17
17
  export declare enum TypeAnswerEnum {
18
18
  CHOICE_SINGLE = "CHOICE_SINGLE",
19
+ CHOICE_SINGLE_WITH_OTHER = "CHOICE_SINGLE_WITH_OTHER",
19
20
  CHOICE_MULTIPLE = "CHOICE_MULTIPLE",
21
+ CHOICE_MULTIPLE_WITH_OTHER = "CHOICE_MULTIPLE_WITH_OTHER",
20
22
  OPEN_TEXT = "OPEN_TEXT",
21
23
  OPEN_TEXT_AREA = "OPEN_TEXT_AREA",
22
24
  OPEN_TEXT_AREA_ADVANCED = "OPEN_TEXT_AREA_ADVANCED",// modelo WORD
@@ -72,6 +74,7 @@ export interface IFormUnit extends IDefault {
72
74
  sequence: number;
73
75
  code: string;
74
76
  description: string;
77
+ example: string;
75
78
  parent: Types.ObjectId | IFormUnit;
76
79
  line: number;
77
80
  column: number;
@@ -166,6 +169,25 @@ export declare const QuestionOptionSchema: Schema<any, import("mongoose").Model<
166
169
  } & {
167
170
  __v: number;
168
171
  }>;
172
+ export declare const ValidationSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
173
+ _id: false;
174
+ }, {
175
+ type: string;
176
+ typeOutput: string;
177
+ formulaToMessage: string;
178
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
179
+ type: string;
180
+ typeOutput: string;
181
+ formulaToMessage: string;
182
+ }>, {}> & import("mongoose").FlatRecord<{
183
+ type: string;
184
+ typeOutput: string;
185
+ formulaToMessage: string;
186
+ }> & {
187
+ _id: Types.ObjectId;
188
+ } & {
189
+ __v: number;
190
+ }>;
169
191
  export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
170
192
  timestamps: {
171
193
  createdAt: string;
@@ -176,6 +198,7 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
176
198
  required: any;
177
199
  category: string;
178
200
  sequence: number;
201
+ formulaToEnable: string;
179
202
  code: string;
180
203
  active: any;
181
204
  form: any;
@@ -243,8 +266,8 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
243
266
  }>;
244
267
  description?: string | null | undefined;
245
268
  account?: any;
246
- formulaToEnable?: string | null | undefined;
247
269
  reference?: any;
270
+ example?: string | null | undefined;
248
271
  parent?: any;
249
272
  line?: number | null | undefined;
250
273
  column?: number | null | undefined;
@@ -257,6 +280,7 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
257
280
  required: any;
258
281
  category: string;
259
282
  sequence: number;
283
+ formulaToEnable: string;
260
284
  code: string;
261
285
  active: any;
262
286
  form: any;
@@ -324,8 +348,8 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
324
348
  }>;
325
349
  description?: string | null | undefined;
326
350
  account?: any;
327
- formulaToEnable?: string | null | undefined;
328
351
  reference?: any;
352
+ example?: string | null | undefined;
329
353
  parent?: any;
330
354
  line?: number | null | undefined;
331
355
  column?: number | null | undefined;
@@ -338,6 +362,7 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
338
362
  required: any;
339
363
  category: string;
340
364
  sequence: number;
365
+ formulaToEnable: string;
341
366
  code: string;
342
367
  active: any;
343
368
  form: any;
@@ -405,8 +430,8 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
405
430
  }>;
406
431
  description?: string | null | undefined;
407
432
  account?: any;
408
- formulaToEnable?: string | null | undefined;
409
433
  reference?: any;
434
+ example?: string | null | undefined;
410
435
  parent?: any;
411
436
  line?: number | null | undefined;
412
437
  column?: number | null | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormUnitSchema = exports.QuestionOptionSchema = exports.RequestGraphicDataSchema = exports.TypeMessageEnum = exports.TypeOutputValidationEnum = exports.TypeValidationEnum = exports.TypeAnswerEnum = exports.TypeFormUnitEnum = void 0;
3
+ exports.FormUnitSchema = exports.ValidationSchema = exports.QuestionOptionSchema = exports.RequestGraphicDataSchema = exports.TypeMessageEnum = exports.TypeOutputValidationEnum = exports.TypeValidationEnum = exports.TypeAnswerEnum = exports.TypeFormUnitEnum = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const Form_1 = require("./Form");
6
6
  /**
@@ -20,7 +20,9 @@ var TypeFormUnitEnum;
20
20
  var TypeAnswerEnum;
21
21
  (function (TypeAnswerEnum) {
22
22
  TypeAnswerEnum["CHOICE_SINGLE"] = "CHOICE_SINGLE";
23
+ TypeAnswerEnum["CHOICE_SINGLE_WITH_OTHER"] = "CHOICE_SINGLE_WITH_OTHER";
23
24
  TypeAnswerEnum["CHOICE_MULTIPLE"] = "CHOICE_MULTIPLE";
25
+ TypeAnswerEnum["CHOICE_MULTIPLE_WITH_OTHER"] = "CHOICE_MULTIPLE_WITH_OTHER";
24
26
  TypeAnswerEnum["OPEN_TEXT"] = "OPEN_TEXT";
25
27
  TypeAnswerEnum["OPEN_TEXT_AREA"] = "OPEN_TEXT_AREA";
26
28
  TypeAnswerEnum["OPEN_TEXT_AREA_ADVANCED"] = "OPEN_TEXT_AREA_ADVANCED";
@@ -76,6 +78,15 @@ exports.QuestionOptionSchema = new mongoose_1.Schema({
76
78
  color: { type: String },
77
79
  active: { type: Boolean, required: true, default: true }
78
80
  }, { _id: false });
81
+ exports.ValidationSchema = new mongoose_1.Schema({
82
+ type: { type: String, enum: TypeValidationEnum, required: true },
83
+ typeOutput: {
84
+ type: String,
85
+ enum: TypeOutputValidationEnum,
86
+ default: TypeOutputValidationEnum.TEXT
87
+ },
88
+ formulaToMessage: { type: String, required: true }
89
+ }, { _id: false });
79
90
  exports.FormUnitSchema = new mongoose_1.Schema({
80
91
  //account só é usado quando for montado por uma conta, quando for modelo disponível a todos ele deve estar sem preenchimento
81
92
  account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account" },
@@ -84,6 +95,7 @@ exports.FormUnitSchema = new mongoose_1.Schema({
84
95
  sequence: { type: Number, required: true, immutable: true },
85
96
  code: { type: String, required: true },
86
97
  description: { type: String },
98
+ example: { type: String },
87
99
  parent: { type: mongoose_1.Schema.Types.ObjectId, ref: "form-unit" },
88
100
  line: { type: Number },
89
101
  column: { type: Number },
@@ -97,20 +109,8 @@ exports.FormUnitSchema = new mongoose_1.Schema({
97
109
  measurementUnit: { type: String },
98
110
  options: { type: [exports.QuestionOptionSchema] },
99
111
  formulaToAnswer: { type: String },
100
- formulaToEnable: { type: String },
101
- validations: {
102
- type: [
103
- {
104
- type: { type: String, enum: TypeValidationEnum, required: true },
105
- typeOutput: {
106
- type: String,
107
- enum: TypeOutputValidationEnum,
108
- default: TypeOutputValidationEnum.TEXT
109
- },
110
- formulaToMessage: { type: String, required: true }
111
- }
112
- ]
113
- },
112
+ formulaToEnable: { type: String, default: "true" },
113
+ validations: { type: [exports.ValidationSchema] },
114
114
  active: { type: Boolean, required: true, default: true }, //perguntas que nao serão consideradas ao realizar qualquer operacao
115
115
  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)
116
116
  readOnly: { type: Boolean, default: false },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
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>",