c2-clinical 1.0.59 → 1.0.61

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.
@@ -4,6 +4,7 @@ export declare enum QAStatusEnum {
4
4
  SCHEDULED = "SCHEDULED",
5
5
  AWAITING_SEND = "AWAITING_SEND",
6
6
  NOT_ANSWERED = "NOT_ANSWERED",
7
+ CANCELED = "CANCELED",
7
8
  UNDEFINED = "UNDEFINED"
8
9
  }
9
10
  export declare enum ChannelNotificationEnum {
@@ -91,10 +92,15 @@ export declare enum TypeButtonAction {
91
92
  CONFIRM_MODAL = "CONFIRM_MODAL"
92
93
  }
93
94
  export declare enum TypeValidationEnum {
94
- TIP = "TIP",
95
95
  WARNING = "WARNING",
96
96
  VALIDATION = "VALIDATION"
97
97
  }
98
+ export declare enum TypeTipEnum {
99
+ IMAGE = "IMAGE",
100
+ VIDEO = "VIDEO",
101
+ HTML = "HTML",
102
+ TEXT = "TEXT"
103
+ }
98
104
  export declare enum TypeOutputValidationEnum {
99
105
  TEXT = "TEXT",
100
106
  LINK = "LINK",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TypeMessageEnum = exports.TypeOutputValidationEnum = exports.TypeValidationEnum = exports.TypeButtonAction = exports.VariantViewEnum = exports.TypeAnswerEnum = exports.TypeFormUnitEnum = exports.OwnerEnum = exports.TypeFormEnum = exports.CategoryFormEnum = exports.MetTargetConditionEnum = exports.StatusQPCEnum = exports.GenreEnum = exports.ChannelNotificationEnum = exports.QAStatusEnum = void 0;
3
+ exports.TypeMessageEnum = exports.TypeOutputValidationEnum = exports.TypeTipEnum = exports.TypeValidationEnum = exports.TypeButtonAction = exports.VariantViewEnum = exports.TypeAnswerEnum = exports.TypeFormUnitEnum = exports.OwnerEnum = exports.TypeFormEnum = exports.CategoryFormEnum = exports.MetTargetConditionEnum = exports.StatusQPCEnum = exports.GenreEnum = exports.ChannelNotificationEnum = exports.QAStatusEnum = void 0;
4
4
  var QAStatusEnum;
5
5
  (function (QAStatusEnum) {
6
6
  QAStatusEnum["ANSWERED"] = "ANSWERED";
@@ -8,6 +8,7 @@ var QAStatusEnum;
8
8
  QAStatusEnum["SCHEDULED"] = "SCHEDULED";
9
9
  QAStatusEnum["AWAITING_SEND"] = "AWAITING_SEND";
10
10
  QAStatusEnum["NOT_ANSWERED"] = "NOT_ANSWERED";
11
+ QAStatusEnum["CANCELED"] = "CANCELED";
11
12
  QAStatusEnum["UNDEFINED"] = "UNDEFINED";
12
13
  })(QAStatusEnum || (exports.QAStatusEnum = QAStatusEnum = {}));
13
14
  var ChannelNotificationEnum;
@@ -107,10 +108,16 @@ var TypeButtonAction;
107
108
  })(TypeButtonAction || (exports.TypeButtonAction = TypeButtonAction = {}));
108
109
  var TypeValidationEnum;
109
110
  (function (TypeValidationEnum) {
110
- TypeValidationEnum["TIP"] = "TIP";
111
111
  TypeValidationEnum["WARNING"] = "WARNING";
112
112
  TypeValidationEnum["VALIDATION"] = "VALIDATION";
113
113
  })(TypeValidationEnum || (exports.TypeValidationEnum = TypeValidationEnum = {}));
114
+ var TypeTipEnum;
115
+ (function (TypeTipEnum) {
116
+ TypeTipEnum["IMAGE"] = "IMAGE";
117
+ TypeTipEnum["VIDEO"] = "VIDEO";
118
+ TypeTipEnum["HTML"] = "HTML";
119
+ TypeTipEnum["TEXT"] = "TEXT";
120
+ })(TypeTipEnum || (exports.TypeTipEnum = TypeTipEnum = {}));
114
121
  var TypeOutputValidationEnum;
115
122
  (function (TypeOutputValidationEnum) {
116
123
  TypeOutputValidationEnum["TEXT"] = "TEXT";
@@ -1,6 +1,6 @@
1
1
  import { Schema, Types } from "mongoose";
2
2
  import { IDefault } from "../Default";
3
- import { CategoryFormEnum, TypeAnswerEnum, TypeButtonAction, TypeFormUnitEnum, TypeOutputValidationEnum, TypeValidationEnum, VariantViewEnum } from "../enum";
3
+ import { CategoryFormEnum, TypeAnswerEnum, TypeButtonAction, TypeFormUnitEnum, TypeOutputValidationEnum, TypeTipEnum, TypeValidationEnum, VariantViewEnum } from "../enum";
4
4
  import { IForm } from "./Form";
5
5
  export interface IModalConfig {
6
6
  title: string;
@@ -8,6 +8,14 @@ export interface IModalConfig {
8
8
  labelButtonCancel: string;
9
9
  labelButtonConfirm: string;
10
10
  }
11
+ export interface ITip {
12
+ type: TypeTipEnum;
13
+ title: string;
14
+ text: string;
15
+ html: string;
16
+ url: string;
17
+ thumb: string;
18
+ }
11
19
  /**
12
20
  * Utilizado para FormUnitTypeEnum = GRAPHIC
13
21
  */
@@ -51,6 +59,8 @@ export interface IFormUnit extends IDefault {
51
59
  requestGraphicData: IRequestGraphicData[];
52
60
  children?: IFormUnit[];
53
61
  modalConfig?: IModalConfig;
62
+ showTips?: boolean;
63
+ tips?: ITip[];
54
64
  }
55
65
  export interface IQuestionOption {
56
66
  sequence: number;
@@ -223,6 +233,29 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
223
233
  body?: any;
224
234
  dataset?: any;
225
235
  }>;
236
+ showTips: any;
237
+ tips: Types.DocumentArray<{
238
+ type: string;
239
+ text?: string | null | undefined;
240
+ url?: string | null | undefined;
241
+ thumb?: string | null | undefined;
242
+ title?: string | null | undefined;
243
+ html?: string | null | undefined;
244
+ }, Types.Subdocument<Types.ObjectId, any, {
245
+ type: string;
246
+ text?: string | null | undefined;
247
+ url?: string | null | undefined;
248
+ thumb?: string | null | undefined;
249
+ title?: string | null | undefined;
250
+ html?: string | null | undefined;
251
+ }> & {
252
+ type: string;
253
+ text?: string | null | undefined;
254
+ url?: string | null | undefined;
255
+ thumb?: string | null | undefined;
256
+ title?: string | null | undefined;
257
+ html?: string | null | undefined;
258
+ }>;
226
259
  account?: any;
227
260
  description?: string | null | undefined;
228
261
  reference?: any;
@@ -309,6 +342,29 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
309
342
  body?: any;
310
343
  dataset?: any;
311
344
  }>;
345
+ showTips: any;
346
+ tips: Types.DocumentArray<{
347
+ type: string;
348
+ text?: string | null | undefined;
349
+ url?: string | null | undefined;
350
+ thumb?: string | null | undefined;
351
+ title?: string | null | undefined;
352
+ html?: string | null | undefined;
353
+ }, Types.Subdocument<Types.ObjectId, any, {
354
+ type: string;
355
+ text?: string | null | undefined;
356
+ url?: string | null | undefined;
357
+ thumb?: string | null | undefined;
358
+ title?: string | null | undefined;
359
+ html?: string | null | undefined;
360
+ }> & {
361
+ type: string;
362
+ text?: string | null | undefined;
363
+ url?: string | null | undefined;
364
+ thumb?: string | null | undefined;
365
+ title?: string | null | undefined;
366
+ html?: string | null | undefined;
367
+ }>;
312
368
  account?: any;
313
369
  description?: string | null | undefined;
314
370
  reference?: any;
@@ -395,6 +451,29 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
395
451
  body?: any;
396
452
  dataset?: any;
397
453
  }>;
454
+ showTips: any;
455
+ tips: Types.DocumentArray<{
456
+ type: string;
457
+ text?: string | null | undefined;
458
+ url?: string | null | undefined;
459
+ thumb?: string | null | undefined;
460
+ title?: string | null | undefined;
461
+ html?: string | null | undefined;
462
+ }, Types.Subdocument<Types.ObjectId, any, {
463
+ type: string;
464
+ text?: string | null | undefined;
465
+ url?: string | null | undefined;
466
+ thumb?: string | null | undefined;
467
+ title?: string | null | undefined;
468
+ html?: string | null | undefined;
469
+ }> & {
470
+ type: string;
471
+ text?: string | null | undefined;
472
+ url?: string | null | undefined;
473
+ thumb?: string | null | undefined;
474
+ title?: string | null | undefined;
475
+ html?: string | null | undefined;
476
+ }>;
398
477
  account?: any;
399
478
  description?: string | null | undefined;
400
479
  reference?: any;
@@ -65,10 +65,25 @@ exports.FormUnitSchema = new mongoose_1.Schema({
65
65
  requestGraphicData: { type: [exports.RequestGraphicDataSchema] },
66
66
  //DADOS PARA MODAL
67
67
  modalConfig: {
68
- title: { type: String },
69
- description: { type: String },
70
- labelButtonCancel: { type: String },
71
- labelButtonConfirm: { type: String }
68
+ type: {
69
+ title: { type: String },
70
+ description: { type: String },
71
+ labelButtonCancel: { type: String },
72
+ labelButtonConfirm: { type: String }
73
+ }
74
+ },
75
+ showTips: { type: Boolean, default: true }, // Indica se os tips serão exibidos ou não, replicado aos filhos (via parent)
76
+ tips: {
77
+ type: [
78
+ {
79
+ type: { type: String, enum: enum_1.TypeTipEnum, required: true },
80
+ title: { type: String }, // Título do tip
81
+ text: { type: String }, // Conteúdo em texto.
82
+ html: { type: String }, // Conteúdo em HTML, etc.
83
+ url: { type: String }, // URL para imagens ou vídeos
84
+ thumb: { type: String } // Miniatura para imagens ou vídeos
85
+ }
86
+ ]
72
87
  }
73
88
  }, {
74
89
  timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
@@ -12,6 +12,7 @@ export interface IQA extends IDefault {
12
12
  sendAppointmentDateTime: Date;
13
13
  dueDate: Date;
14
14
  sent: boolean;
15
+ canceled: boolean;
15
16
  code: string;
16
17
  status: QAStatusEnum;
17
18
  }
@@ -20,18 +21,13 @@ export declare const QASchema: Schema<any, import("mongoose").Model<any, any, an
20
21
  createdAt: string;
21
22
  updatedAt: string;
22
23
  };
23
- toJSON: {
24
- virtuals: true;
25
- };
26
- toObject: {
27
- virtuals: true;
28
- };
29
24
  }, {} & {
30
25
  account: any;
31
26
  form: any;
32
27
  patient: any;
33
28
  sendAppointmentDateTime: NativeDate;
34
29
  sent: any;
30
+ canceled: any;
35
31
  code?: string | null | undefined;
36
32
  programming?: any;
37
33
  dueDate?: NativeDate | null | undefined;
@@ -42,6 +38,7 @@ export declare const QASchema: Schema<any, import("mongoose").Model<any, any, an
42
38
  patient: any;
43
39
  sendAppointmentDateTime: NativeDate;
44
40
  sent: any;
41
+ canceled: any;
45
42
  code?: string | null | undefined;
46
43
  programming?: any;
47
44
  dueDate?: NativeDate | null | undefined;
@@ -52,6 +49,7 @@ export declare const QASchema: Schema<any, import("mongoose").Model<any, any, an
52
49
  patient: any;
53
50
  sendAppointmentDateTime: NativeDate;
54
51
  sent: any;
52
+ canceled: any;
55
53
  code?: string | null | undefined;
56
54
  programming?: any;
57
55
  dueDate?: NativeDate | null | undefined;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QASchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
- const enum_1 = require("../enum");
6
5
  exports.QASchema = new mongoose_1.Schema({
7
6
  account: { type: mongoose_1.Types.ObjectId, ref: "account", required: true },
8
7
  patient: { type: mongoose_1.Types.ObjectId, ref: "patient", required: true },
@@ -12,46 +11,8 @@ exports.QASchema = new mongoose_1.Schema({
12
11
  answeredDateTime: { type: Date },
13
12
  sendAppointmentDateTime: { type: Date, required: true },
14
13
  sent: { type: Boolean, default: false },
14
+ canceled: { type: Boolean, default: false },
15
15
  code: { type: String }
16
16
  }, {
17
- timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" },
18
- toJSON: { virtuals: true },
19
- toObject: { virtuals: true }
17
+ timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
20
18
  });
21
- exports.QASchema.virtual("status").get(function () {
22
- const now = new Date();
23
- const sent = this.sent === true;
24
- const answered = !!this.answeredDateTime;
25
- const sendAppointmentPast = this.sendAppointmentDateTime < now;
26
- const dueDatePast = this.dueDate < now;
27
- if (answered) {
28
- return enum_1.QAStatusEnum.ANSWERED;
29
- }
30
- if (dueDatePast) {
31
- return enum_1.QAStatusEnum.DUED;
32
- }
33
- if (!sent && sendAppointmentPast) {
34
- return enum_1.QAStatusEnum.AWAITING_SEND;
35
- }
36
- if (sent && !answered) {
37
- return enum_1.QAStatusEnum.NOT_ANSWERED;
38
- }
39
- return enum_1.QAStatusEnum.SCHEDULED;
40
- });
41
- // sent | pasou a data de sendAppointDate | answeredDate exists | passou a data de duedDate | status
42
- // 0 0 0 0 SCHEDULED
43
- // 0 0 0 1 DUED
44
- // 0 0 1 0 ANSWERED
45
- // 0 0 1 1 ANSWERED
46
- // 0 1 0 0 AWAITING_SEND
47
- // 0 1 0 1 DUED
48
- // 0 1 1 0 ANSWERED
49
- // 0 1 1 1 ANSWERED
50
- // 1 0 0 0 NOT_ANSWERED
51
- // 1 0 0 1 DUED
52
- // 1 0 1 0 ANSWERED
53
- // 1 0 1 1 ANSWERED
54
- // 1 1 0 0 NOT_ANSWERED
55
- // 1 1 0 1 DUED
56
- // 1 1 1 0 ANSWERED
57
- // 1 1 1 1 ANSWERED
@@ -19,3 +19,4 @@ exports.QAProgrammingSchema = new mongoose_1.Schema({
19
19
  }, {
20
20
  timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
21
21
  });
22
+ exports.QAProgrammingSchema.index({ form: 1, patient: 1 }, { unique: false });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
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>",