c2-clinical 1.0.40 → 1.0.42
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.
- package/dist/models/Recurrence.d.ts +1 -6
- package/dist/models/Recurrence.js +0 -5
- package/dist/models/enum.d.ts +13 -5
- package/dist/models/enum.js +10 -1
- package/dist/models/qa/QA.d.ts +13 -3
- package/dist/models/qa/QA.js +43 -2
- package/package.json +1 -1
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import * as mongoose from "mongoose";
|
|
2
2
|
export declare enum RecurrencePeriod {
|
|
3
|
-
INTERVAL_DAILY_FIXED = "INTERVAL_DAILY_FIXED",
|
|
4
3
|
DAYS_SPECIFIC = "DAYS_SPECIFIC",
|
|
5
4
|
DAILY = "DAILY",
|
|
6
5
|
WEEKLY = "WEEKLY",
|
|
7
|
-
|
|
8
|
-
MONTHLY = "MONTHLY",
|
|
9
|
-
BI_MONTHLY = "BI_MONTHLY",
|
|
10
|
-
TRI_MONTHLY = "TRI_MONTHLY",
|
|
11
|
-
YEARLY = "YEARLY"
|
|
6
|
+
MONTHLY = "MONTHLY"
|
|
12
7
|
}
|
|
13
8
|
export declare enum RecurrenceDaysOfWeek {
|
|
14
9
|
"SUNDAY" = "SUNDAY",
|
|
@@ -37,15 +37,10 @@ exports.RecurrenceSchema = exports.RecurrenceDaysOfMonth = exports.RecurrenceDay
|
|
|
37
37
|
const mongoose = __importStar(require("mongoose"));
|
|
38
38
|
var RecurrencePeriod;
|
|
39
39
|
(function (RecurrencePeriod) {
|
|
40
|
-
RecurrencePeriod["INTERVAL_DAILY_FIXED"] = "INTERVAL_DAILY_FIXED";
|
|
41
40
|
RecurrencePeriod["DAYS_SPECIFIC"] = "DAYS_SPECIFIC";
|
|
42
41
|
RecurrencePeriod["DAILY"] = "DAILY";
|
|
43
42
|
RecurrencePeriod["WEEKLY"] = "WEEKLY";
|
|
44
|
-
RecurrencePeriod["BI_WEEKLY"] = "BI_WEEKLY";
|
|
45
43
|
RecurrencePeriod["MONTHLY"] = "MONTHLY";
|
|
46
|
-
RecurrencePeriod["BI_MONTHLY"] = "BI_MONTHLY";
|
|
47
|
-
RecurrencePeriod["TRI_MONTHLY"] = "TRI_MONTHLY";
|
|
48
|
-
RecurrencePeriod["YEARLY"] = "YEARLY";
|
|
49
44
|
})(RecurrencePeriod || (exports.RecurrencePeriod = RecurrencePeriod = {}));
|
|
50
45
|
var RecurrenceDaysOfWeek;
|
|
51
46
|
(function (RecurrenceDaysOfWeek) {
|
package/dist/models/enum.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
export declare enum QAStatusEnum {
|
|
2
|
+
ANSWERED = "ANSWERED",
|
|
3
|
+
DUED = "DUED",
|
|
4
|
+
SCHEDULED = "SCHEDULED",
|
|
5
|
+
AWAITING_SEND = "AWAITING_SEND",
|
|
6
|
+
NOT_ANSWERED = "NOT_ANSWERED",
|
|
7
|
+
UNDEFINED = "UNDEFINED"
|
|
8
|
+
}
|
|
1
9
|
export declare enum ChannelNotificationEnum {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
10
|
+
EMAIL = "EMAIL",
|
|
11
|
+
WHATSAPP = "WHATSAPP",
|
|
12
|
+
APP = "APP"
|
|
5
13
|
}
|
|
6
14
|
export declare enum GenreEnum {
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
MALE = "MALE",
|
|
16
|
+
FEMALE = "FEMALE"
|
|
9
17
|
}
|
|
10
18
|
export declare enum StatusQPCEnum {
|
|
11
19
|
AWAITING_IMPORT = "AWAITING_IMPORT",
|
package/dist/models/enum.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeMessageEnum = exports.TypeOutputValidationEnum = exports.TypeValidationEnum = exports.TypeAnswerEnum = exports.TypeFormUnitEnum = exports.OwnerEnum = exports.TypeFormEnum = exports.CategoryFormEnum = exports.MetTargetConditionEnum = exports.StatusQPCEnum = exports.GenreEnum = exports.ChannelNotificationEnum = void 0;
|
|
3
|
+
exports.TypeMessageEnum = exports.TypeOutputValidationEnum = exports.TypeValidationEnum = exports.TypeAnswerEnum = exports.TypeFormUnitEnum = exports.OwnerEnum = exports.TypeFormEnum = exports.CategoryFormEnum = exports.MetTargetConditionEnum = exports.StatusQPCEnum = exports.GenreEnum = exports.ChannelNotificationEnum = exports.QAStatusEnum = void 0;
|
|
4
|
+
var QAStatusEnum;
|
|
5
|
+
(function (QAStatusEnum) {
|
|
6
|
+
QAStatusEnum["ANSWERED"] = "ANSWERED";
|
|
7
|
+
QAStatusEnum["DUED"] = "DUED";
|
|
8
|
+
QAStatusEnum["SCHEDULED"] = "SCHEDULED";
|
|
9
|
+
QAStatusEnum["AWAITING_SEND"] = "AWAITING_SEND";
|
|
10
|
+
QAStatusEnum["NOT_ANSWERED"] = "NOT_ANSWERED";
|
|
11
|
+
QAStatusEnum["UNDEFINED"] = "UNDEFINED";
|
|
12
|
+
})(QAStatusEnum || (exports.QAStatusEnum = QAStatusEnum = {}));
|
|
4
13
|
var ChannelNotificationEnum;
|
|
5
14
|
(function (ChannelNotificationEnum) {
|
|
6
15
|
ChannelNotificationEnum["EMAIL"] = "EMAIL";
|
package/dist/models/qa/QA.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface IQA extends IDefault {
|
|
|
10
10
|
answeredDateTime: Date;
|
|
11
11
|
sendAppointmentDateTime: Date;
|
|
12
12
|
dueDate: Date;
|
|
13
|
+
sent: boolean;
|
|
13
14
|
code: string;
|
|
14
15
|
}
|
|
15
16
|
export declare const QASchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
@@ -17,33 +18,42 @@ export declare const QASchema: Schema<any, import("mongoose").Model<any, any, an
|
|
|
17
18
|
createdAt: string;
|
|
18
19
|
updatedAt: string;
|
|
19
20
|
};
|
|
21
|
+
toJSON: {
|
|
22
|
+
virtuals: true;
|
|
23
|
+
};
|
|
24
|
+
toObject: {
|
|
25
|
+
virtuals: true;
|
|
26
|
+
};
|
|
20
27
|
}, {} & {
|
|
21
28
|
account: any;
|
|
22
29
|
form: any;
|
|
23
30
|
patient: any;
|
|
24
31
|
programming: any;
|
|
32
|
+
sendAppointmentDateTime: NativeDate;
|
|
33
|
+
sent: string;
|
|
25
34
|
code?: string | null | undefined;
|
|
26
35
|
answeredDateTime?: NativeDate | null | undefined;
|
|
27
36
|
dueDate?: NativeDate | null | undefined;
|
|
28
|
-
sendAppointmentDateTime?: NativeDate | null | undefined;
|
|
29
37
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
30
38
|
account: any;
|
|
31
39
|
form: any;
|
|
32
40
|
patient: any;
|
|
33
41
|
programming: any;
|
|
42
|
+
sendAppointmentDateTime: NativeDate;
|
|
43
|
+
sent: string;
|
|
34
44
|
code?: string | null | undefined;
|
|
35
45
|
answeredDateTime?: NativeDate | null | undefined;
|
|
36
46
|
dueDate?: NativeDate | null | undefined;
|
|
37
|
-
sendAppointmentDateTime?: NativeDate | null | undefined;
|
|
38
47
|
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
39
48
|
account: any;
|
|
40
49
|
form: any;
|
|
41
50
|
patient: any;
|
|
42
51
|
programming: any;
|
|
52
|
+
sendAppointmentDateTime: NativeDate;
|
|
53
|
+
sent: string;
|
|
43
54
|
code?: string | null | undefined;
|
|
44
55
|
answeredDateTime?: NativeDate | null | undefined;
|
|
45
56
|
dueDate?: NativeDate | null | undefined;
|
|
46
|
-
sendAppointmentDateTime?: NativeDate | null | undefined;
|
|
47
57
|
}> & {
|
|
48
58
|
_id: Types.ObjectId;
|
|
49
59
|
} & {
|
package/dist/models/qa/QA.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
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");
|
|
5
6
|
exports.QASchema = new mongoose_1.Schema({
|
|
6
7
|
account: { type: mongoose_1.Types.ObjectId, ref: "account", required: true },
|
|
7
8
|
patient: { type: mongoose_1.Types.ObjectId, ref: "patient", required: true },
|
|
@@ -9,8 +10,48 @@ exports.QASchema = new mongoose_1.Schema({
|
|
|
9
10
|
form: { type: mongoose_1.Types.ObjectId, ref: "form", required: true },
|
|
10
11
|
dueDate: { type: Date },
|
|
11
12
|
answeredDateTime: { type: Date },
|
|
12
|
-
sendAppointmentDateTime: { type: Date },
|
|
13
|
+
sendAppointmentDateTime: { type: Date, required: true },
|
|
14
|
+
sent: { type: String, default: false },
|
|
13
15
|
code: { type: String }
|
|
14
16
|
}, {
|
|
15
|
-
timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
|
|
17
|
+
timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" },
|
|
18
|
+
toJSON: { virtuals: true },
|
|
19
|
+
toObject: { virtuals: true }
|
|
16
20
|
});
|
|
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
|
package/package.json
CHANGED