c2-clinical 1.0.4 → 1.0.5
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,6 @@
|
|
|
1
1
|
import { Schema, Types } from "mongoose";
|
|
2
|
-
import { CategoryFormEnum, IForm } from "./Form";
|
|
3
2
|
import { IDefault } from "../IDefault";
|
|
3
|
+
import { CategoryFormEnum, IForm } from "./Form";
|
|
4
4
|
/**
|
|
5
5
|
* Define o tipo da unidade de formulário
|
|
6
6
|
*/
|
|
@@ -31,11 +31,13 @@ export declare enum TypeAnswerEnum {
|
|
|
31
31
|
BOOLEAN = "BOOLEAN",
|
|
32
32
|
DATE = "DATE"
|
|
33
33
|
}
|
|
34
|
-
export declare enum
|
|
34
|
+
export declare enum TypeValidationEnum {
|
|
35
35
|
TIP = "TIP",
|
|
36
|
-
WARNING = "WARNING"
|
|
36
|
+
WARNING = "WARNING",
|
|
37
|
+
REQUIRED = "REQUIRED",
|
|
38
|
+
VALIDATION = "VALIDATION"
|
|
37
39
|
}
|
|
38
|
-
export declare enum
|
|
40
|
+
export declare enum TypeOutputValidationEnum {
|
|
39
41
|
TEXT = "TEXT",
|
|
40
42
|
LINK = "LINK",
|
|
41
43
|
VIDEO_LINK = "VIDEO_LINK"
|
|
@@ -60,11 +62,10 @@ export interface IGraphicRequestHttp {
|
|
|
60
62
|
body: any;
|
|
61
63
|
dataset: any;
|
|
62
64
|
}
|
|
63
|
-
export interface
|
|
64
|
-
type:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
content: string;
|
|
65
|
+
export interface IValidationQuestion {
|
|
66
|
+
type: TypeValidationEnum;
|
|
67
|
+
typeOutput: TypeOutputValidationEnum;
|
|
68
|
+
formulaToMessage: string;
|
|
68
69
|
}
|
|
69
70
|
export interface IFormUnit extends IDefault {
|
|
70
71
|
reference: Types.ObjectId | IFormUnit;
|
|
@@ -82,7 +83,7 @@ export interface IFormUnit extends IDefault {
|
|
|
82
83
|
options: IQuestionOption[];
|
|
83
84
|
formulaToAnswer: string;
|
|
84
85
|
formulaToEnable: string;
|
|
85
|
-
|
|
86
|
+
validations: IValidationQuestion[];
|
|
86
87
|
active: boolean;
|
|
87
88
|
show: boolean;
|
|
88
89
|
readOnly: boolean;
|
|
@@ -182,21 +183,18 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
182
183
|
active: any;
|
|
183
184
|
formulaToEnable?: string | null | undefined;
|
|
184
185
|
}>;
|
|
185
|
-
|
|
186
|
-
type
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
typeContent?: string | null | undefined;
|
|
186
|
+
validations: Types.DocumentArray<{
|
|
187
|
+
type: string;
|
|
188
|
+
typeOutput: string;
|
|
189
|
+
formulaToMessage: string;
|
|
190
190
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
191
|
-
type
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
typeContent?: string | null | undefined;
|
|
191
|
+
type: string;
|
|
192
|
+
typeOutput: string;
|
|
193
|
+
formulaToMessage: string;
|
|
195
194
|
}> & {
|
|
196
|
-
type
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
typeContent?: string | null | undefined;
|
|
195
|
+
type: string;
|
|
196
|
+
typeOutput: string;
|
|
197
|
+
formulaToMessage: string;
|
|
200
198
|
}>;
|
|
201
199
|
show: any;
|
|
202
200
|
readOnly: any;
|
|
@@ -254,21 +252,18 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
254
252
|
active: any;
|
|
255
253
|
formulaToEnable?: string | null | undefined;
|
|
256
254
|
}>;
|
|
257
|
-
|
|
258
|
-
type
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
typeContent?: string | null | undefined;
|
|
255
|
+
validations: Types.DocumentArray<{
|
|
256
|
+
type: string;
|
|
257
|
+
typeOutput: string;
|
|
258
|
+
formulaToMessage: string;
|
|
262
259
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
263
|
-
type
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
typeContent?: string | null | undefined;
|
|
260
|
+
type: string;
|
|
261
|
+
typeOutput: string;
|
|
262
|
+
formulaToMessage: string;
|
|
267
263
|
}> & {
|
|
268
|
-
type
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
typeContent?: string | null | undefined;
|
|
264
|
+
type: string;
|
|
265
|
+
typeOutput: string;
|
|
266
|
+
formulaToMessage: string;
|
|
272
267
|
}>;
|
|
273
268
|
show: any;
|
|
274
269
|
readOnly: any;
|
|
@@ -326,21 +321,18 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
326
321
|
active: any;
|
|
327
322
|
formulaToEnable?: string | null | undefined;
|
|
328
323
|
}>;
|
|
329
|
-
|
|
330
|
-
type
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
typeContent?: string | null | undefined;
|
|
324
|
+
validations: Types.DocumentArray<{
|
|
325
|
+
type: string;
|
|
326
|
+
typeOutput: string;
|
|
327
|
+
formulaToMessage: string;
|
|
334
328
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
335
|
-
type
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
typeContent?: string | null | undefined;
|
|
329
|
+
type: string;
|
|
330
|
+
typeOutput: string;
|
|
331
|
+
formulaToMessage: string;
|
|
339
332
|
}> & {
|
|
340
|
-
type
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
typeContent?: string | null | undefined;
|
|
333
|
+
type: string;
|
|
334
|
+
typeOutput: string;
|
|
335
|
+
formulaToMessage: string;
|
|
344
336
|
}>;
|
|
345
337
|
show: any;
|
|
346
338
|
readOnly: any;
|
|
@@ -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.
|
|
3
|
+
exports.FormUnitSchema = 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
|
/**
|
|
@@ -35,17 +35,19 @@ var TypeAnswerEnum;
|
|
|
35
35
|
TypeAnswerEnum["BOOLEAN"] = "BOOLEAN";
|
|
36
36
|
TypeAnswerEnum["DATE"] = "DATE";
|
|
37
37
|
})(TypeAnswerEnum || (exports.TypeAnswerEnum = TypeAnswerEnum = {}));
|
|
38
|
-
var
|
|
39
|
-
(function (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
var TypeValidationEnum;
|
|
39
|
+
(function (TypeValidationEnum) {
|
|
40
|
+
TypeValidationEnum["TIP"] = "TIP";
|
|
41
|
+
TypeValidationEnum["WARNING"] = "WARNING";
|
|
42
|
+
TypeValidationEnum["REQUIRED"] = "REQUIRED";
|
|
43
|
+
TypeValidationEnum["VALIDATION"] = "VALIDATION";
|
|
44
|
+
})(TypeValidationEnum || (exports.TypeValidationEnum = TypeValidationEnum = {}));
|
|
45
|
+
var TypeOutputValidationEnum;
|
|
46
|
+
(function (TypeOutputValidationEnum) {
|
|
47
|
+
TypeOutputValidationEnum["TEXT"] = "TEXT";
|
|
48
|
+
TypeOutputValidationEnum["LINK"] = "LINK";
|
|
49
|
+
TypeOutputValidationEnum["VIDEO_LINK"] = "VIDEO_LINK";
|
|
50
|
+
})(TypeOutputValidationEnum || (exports.TypeOutputValidationEnum = TypeOutputValidationEnum = {}));
|
|
49
51
|
/**
|
|
50
52
|
* Utilizado para FormUnitTypeEnum = MESSAGE
|
|
51
53
|
*/
|
|
@@ -93,13 +95,16 @@ exports.FormUnitSchema = new mongoose_1.Schema({
|
|
|
93
95
|
options: { type: [exports.QuestionOptionSchema] },
|
|
94
96
|
formulaToAnswer: { type: String },
|
|
95
97
|
formulaToEnable: { type: String },
|
|
96
|
-
|
|
98
|
+
validations: {
|
|
97
99
|
type: [
|
|
98
100
|
{
|
|
99
|
-
type: { type: String, enum:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
type: { type: String, enum: TypeValidationEnum, required: true },
|
|
102
|
+
typeOutput: {
|
|
103
|
+
type: String,
|
|
104
|
+
enum: TypeOutputValidationEnum,
|
|
105
|
+
default: TypeOutputValidationEnum.TEXT
|
|
106
|
+
},
|
|
107
|
+
formulaToMessage: { type: String, required: true }
|
|
103
108
|
}
|
|
104
109
|
]
|
|
105
110
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Schema, Types } from "mongoose";
|
|
2
|
-
import { IFormUnit,
|
|
2
|
+
import { IFormUnit, IValidationQuestion, IRequestGraphicData } from "../form/FormUnit";
|
|
3
3
|
import { IDefault } from "../IDefault";
|
|
4
4
|
import { IQPC } from "./QPC";
|
|
5
5
|
export interface IQPCAnswer extends IDefault {
|
|
6
6
|
qpc: Types.ObjectId | IQPC;
|
|
7
7
|
reference: Types.ObjectId | IFormUnit;
|
|
8
8
|
answer: any;
|
|
9
|
-
messages:
|
|
9
|
+
messages: IValidationQuestion[];
|
|
10
10
|
requestGraphicData: IRequestGraphicData[];
|
|
11
11
|
}
|
|
12
12
|
export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
@@ -17,22 +17,6 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
|
|
|
17
17
|
}, {} & {
|
|
18
18
|
account: any;
|
|
19
19
|
reference: any;
|
|
20
|
-
messages: Types.DocumentArray<{
|
|
21
|
-
type?: string | null | undefined;
|
|
22
|
-
content?: string | null | undefined;
|
|
23
|
-
formula?: string | null | undefined;
|
|
24
|
-
typeContent?: string | null | undefined;
|
|
25
|
-
}, Types.Subdocument<Types.ObjectId, any, {
|
|
26
|
-
type?: string | null | undefined;
|
|
27
|
-
content?: string | null | undefined;
|
|
28
|
-
formula?: string | null | undefined;
|
|
29
|
-
typeContent?: string | null | undefined;
|
|
30
|
-
}> & {
|
|
31
|
-
type?: string | null | undefined;
|
|
32
|
-
content?: string | null | undefined;
|
|
33
|
-
formula?: string | null | undefined;
|
|
34
|
-
typeContent?: string | null | undefined;
|
|
35
|
-
}>;
|
|
36
20
|
requestGraphicData: Types.DocumentArray<{
|
|
37
21
|
url: string;
|
|
38
22
|
method: string;
|
|
@@ -50,10 +34,6 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
|
|
|
50
34
|
dataset?: any;
|
|
51
35
|
}>;
|
|
52
36
|
qpc: any;
|
|
53
|
-
answer?: any;
|
|
54
|
-
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
55
|
-
account: any;
|
|
56
|
-
reference: any;
|
|
57
37
|
messages: Types.DocumentArray<{
|
|
58
38
|
type?: string | null | undefined;
|
|
59
39
|
content?: string | null | undefined;
|
|
@@ -70,6 +50,10 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
|
|
|
70
50
|
formula?: string | null | undefined;
|
|
71
51
|
typeContent?: string | null | undefined;
|
|
72
52
|
}>;
|
|
53
|
+
answer?: any;
|
|
54
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
55
|
+
account: any;
|
|
56
|
+
reference: any;
|
|
73
57
|
requestGraphicData: Types.DocumentArray<{
|
|
74
58
|
url: string;
|
|
75
59
|
method: string;
|
|
@@ -87,10 +71,6 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
|
|
|
87
71
|
dataset?: any;
|
|
88
72
|
}>;
|
|
89
73
|
qpc: any;
|
|
90
|
-
answer?: any;
|
|
91
|
-
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
92
|
-
account: any;
|
|
93
|
-
reference: any;
|
|
94
74
|
messages: Types.DocumentArray<{
|
|
95
75
|
type?: string | null | undefined;
|
|
96
76
|
content?: string | null | undefined;
|
|
@@ -107,6 +87,10 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
|
|
|
107
87
|
formula?: string | null | undefined;
|
|
108
88
|
typeContent?: string | null | undefined;
|
|
109
89
|
}>;
|
|
90
|
+
answer?: any;
|
|
91
|
+
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
92
|
+
account: any;
|
|
93
|
+
reference: any;
|
|
110
94
|
requestGraphicData: Types.DocumentArray<{
|
|
111
95
|
url: string;
|
|
112
96
|
method: string;
|
|
@@ -124,6 +108,22 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
|
|
|
124
108
|
dataset?: any;
|
|
125
109
|
}>;
|
|
126
110
|
qpc: any;
|
|
111
|
+
messages: Types.DocumentArray<{
|
|
112
|
+
type?: string | null | undefined;
|
|
113
|
+
content?: string | null | undefined;
|
|
114
|
+
formula?: string | null | undefined;
|
|
115
|
+
typeContent?: string | null | undefined;
|
|
116
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
117
|
+
type?: string | null | undefined;
|
|
118
|
+
content?: string | null | undefined;
|
|
119
|
+
formula?: string | null | undefined;
|
|
120
|
+
typeContent?: string | null | undefined;
|
|
121
|
+
}> & {
|
|
122
|
+
type?: string | null | undefined;
|
|
123
|
+
content?: string | null | undefined;
|
|
124
|
+
formula?: string | null | undefined;
|
|
125
|
+
typeContent?: string | null | undefined;
|
|
126
|
+
}>;
|
|
127
127
|
answer?: any;
|
|
128
128
|
}> & {
|
|
129
129
|
_id: Types.ObjectId;
|
|
@@ -11,9 +11,9 @@ exports.QPCAnswerSchema = new mongoose_1.Schema({
|
|
|
11
11
|
messages: {
|
|
12
12
|
type: [
|
|
13
13
|
{
|
|
14
|
-
type: { type: String, enum: FormUnit_1.
|
|
14
|
+
type: { type: String, enum: FormUnit_1.TypeValidationEnum },
|
|
15
15
|
formula: { type: String },
|
|
16
|
-
typeContent: { type: String, enum: FormUnit_1.
|
|
16
|
+
typeContent: { type: String, enum: FormUnit_1.TypeOutputValidationEnum },
|
|
17
17
|
content: { type: String }
|
|
18
18
|
}
|
|
19
19
|
]
|
package/package.json
CHANGED