openchs-models 1.32.7 → 1.32.9
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/Schema.js +1 -1
- package/dist/StandardReportCardType.js +54 -42
- package/package.json +1 -1
package/dist/Schema.js
CHANGED
|
@@ -283,7 +283,7 @@ function createRealmConfig() {
|
|
|
283
283
|
return doCompact;
|
|
284
284
|
},
|
|
285
285
|
//order is important, should be arranged according to the dependency
|
|
286
|
-
schemaVersion:
|
|
286
|
+
schemaVersion: 197,
|
|
287
287
|
onMigration: function (oldDB, newDB) {
|
|
288
288
|
console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
|
|
289
289
|
if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
|
|
@@ -42,28 +42,36 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
42
42
|
this.that.description = x;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
get type() {
|
|
46
|
+
return this.that.type;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
set type(x) {
|
|
50
|
+
this.that.type = x;
|
|
51
|
+
}
|
|
52
|
+
|
|
45
53
|
get iconName() {
|
|
46
54
|
const typeIcon = {
|
|
47
|
-
[StandardReportCardType.
|
|
48
|
-
[StandardReportCardType.
|
|
49
|
-
[StandardReportCardType.
|
|
50
|
-
[StandardReportCardType.
|
|
51
|
-
[StandardReportCardType.
|
|
52
|
-
[StandardReportCardType.
|
|
55
|
+
[StandardReportCardType.types.Approved]: 'check-circle',
|
|
56
|
+
[StandardReportCardType.types.Rejected]: 'cancel',
|
|
57
|
+
[StandardReportCardType.types.PendingApproval]: 'av-timer',
|
|
58
|
+
[StandardReportCardType.types.Comments]: 'message',
|
|
59
|
+
[StandardReportCardType.types.CallTasks]: 'call',
|
|
60
|
+
[StandardReportCardType.types.OpenSubjectTasks]: 'sticky-note-2'
|
|
53
61
|
};
|
|
54
|
-
return typeIcon[this.
|
|
62
|
+
return typeIcon[this.type];
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
get cardColor() {
|
|
58
66
|
const typeCardColor = {
|
|
59
|
-
[StandardReportCardType.
|
|
60
|
-
[StandardReportCardType.
|
|
61
|
-
[StandardReportCardType.
|
|
62
|
-
[StandardReportCardType.
|
|
63
|
-
[StandardReportCardType.
|
|
64
|
-
[StandardReportCardType.
|
|
67
|
+
[StandardReportCardType.types.Approved]: '#00897b',
|
|
68
|
+
[StandardReportCardType.types.Rejected]: '#bf360c',
|
|
69
|
+
[StandardReportCardType.types.PendingApproval]: '#6a1b9a',
|
|
70
|
+
[StandardReportCardType.types.Comments]: '#3949ab',
|
|
71
|
+
[StandardReportCardType.types.CallTasks]: '#69a672',
|
|
72
|
+
[StandardReportCardType.types.OpenSubjectTasks]: '#717cac'
|
|
65
73
|
};
|
|
66
|
-
return typeCardColor[this.
|
|
74
|
+
return typeCardColor[this.type];
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
get textColor() {
|
|
@@ -71,61 +79,61 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
static fromResource(resource) {
|
|
74
|
-
return _General.default.assignFields(resource, new StandardReportCardType(), ["uuid", "name", "description", "voided"]);
|
|
82
|
+
return _General.default.assignFields(resource, new StandardReportCardType(), ["uuid", "name", "description", "voided", "type"]);
|
|
75
83
|
}
|
|
76
84
|
|
|
77
85
|
isStandardCard() {
|
|
78
|
-
return _lodash.default.includes([...this.approvalTypes(), StandardReportCardType.
|
|
86
|
+
return _lodash.default.includes([...this.approvalTypes(), StandardReportCardType.types.Comments, StandardReportCardType.types.CallTasks, StandardReportCardType.types.OpenSubjectTasks], this.type);
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
approvalTypes() {
|
|
82
|
-
return [StandardReportCardType.
|
|
90
|
+
return [StandardReportCardType.types.PendingApproval, StandardReportCardType.types.Approved, StandardReportCardType.types.Rejected];
|
|
83
91
|
}
|
|
84
92
|
|
|
85
93
|
defaultTypes() {
|
|
86
|
-
return [StandardReportCardType.
|
|
94
|
+
return [StandardReportCardType.types.ScheduledVisits, StandardReportCardType.types.OverdueVisits, StandardReportCardType.types.RecentRegistrations, StandardReportCardType.types.RecentEnrolments, StandardReportCardType.types.RecentVisits, StandardReportCardType.types.Total];
|
|
87
95
|
}
|
|
88
96
|
|
|
89
97
|
isApprovalType() {
|
|
90
|
-
return _lodash.default.includes(this.approvalTypes(), this.
|
|
98
|
+
return _lodash.default.includes(this.approvalTypes(), this.type);
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
isCommentType() {
|
|
94
|
-
return this.
|
|
102
|
+
return this.type === StandardReportCardType.types.Comments;
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
isTaskType() {
|
|
98
|
-
return _lodash.default.includes([StandardReportCardType.
|
|
106
|
+
return _lodash.default.includes([StandardReportCardType.types.CallTasks, StandardReportCardType.types.OpenSubjectTasks], this.type);
|
|
99
107
|
}
|
|
100
108
|
|
|
101
109
|
isChecklistType() {
|
|
102
|
-
return this.
|
|
110
|
+
return this.type === StandardReportCardType.types.DueChecklist;
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
getTaskTypeType() {
|
|
106
|
-
switch (this.
|
|
107
|
-
case StandardReportCardType.
|
|
114
|
+
switch (this.type) {
|
|
115
|
+
case StandardReportCardType.types.CallTasks:
|
|
108
116
|
return _TaskType.default.TaskTypeName.Call;
|
|
109
117
|
|
|
110
|
-
case StandardReportCardType.
|
|
118
|
+
case StandardReportCardType.types.OpenSubjectTasks:
|
|
111
119
|
return _TaskType.default.TaskTypeName.OpenSubject;
|
|
112
120
|
}
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
isDefaultType() {
|
|
116
|
-
return _lodash.default.includes(this.defaultTypes(), this.
|
|
124
|
+
return _lodash.default.includes(this.defaultTypes(), this.type);
|
|
117
125
|
}
|
|
118
126
|
|
|
119
127
|
getApprovalStatusForType() {
|
|
120
|
-
return typeToStatusMap[this.
|
|
128
|
+
return typeToStatusMap[this.type];
|
|
121
129
|
}
|
|
122
130
|
|
|
123
131
|
isSubjectTypeFilterSupported() {
|
|
124
|
-
return [StandardReportCardType.
|
|
132
|
+
return [StandardReportCardType.types.ScheduledVisits, StandardReportCardType.types.OverdueVisits, StandardReportCardType.types.RecentRegistrations, StandardReportCardType.types.RecentEnrolments, StandardReportCardType.types.RecentVisits, StandardReportCardType.types.Total].includes(this.type);
|
|
125
133
|
}
|
|
126
134
|
|
|
127
135
|
isRecentType() {
|
|
128
|
-
return [StandardReportCardType.
|
|
136
|
+
return [StandardReportCardType.types.RecentRegistrations, StandardReportCardType.types.RecentEnrolments, StandardReportCardType.types.RecentVisits].includes(this.type);
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
}
|
|
@@ -140,6 +148,10 @@ _defineProperty(StandardReportCardType, "schema", {
|
|
|
140
148
|
type: "string",
|
|
141
149
|
optional: true
|
|
142
150
|
},
|
|
151
|
+
type: {
|
|
152
|
+
type: "string",
|
|
153
|
+
optional: true
|
|
154
|
+
},
|
|
143
155
|
voided: {
|
|
144
156
|
type: "bool",
|
|
145
157
|
default: false
|
|
@@ -147,28 +159,28 @@ _defineProperty(StandardReportCardType, "schema", {
|
|
|
147
159
|
}
|
|
148
160
|
});
|
|
149
161
|
|
|
150
|
-
_defineProperty(StandardReportCardType, "
|
|
151
|
-
PendingApproval: "
|
|
162
|
+
_defineProperty(StandardReportCardType, "types", {
|
|
163
|
+
PendingApproval: "PendingApproval",
|
|
152
164
|
Approved: "Approved",
|
|
153
165
|
Rejected: "Rejected",
|
|
154
|
-
ScheduledVisits: "
|
|
155
|
-
OverdueVisits: "
|
|
156
|
-
RecentRegistrations: "
|
|
157
|
-
RecentEnrolments: "
|
|
158
|
-
RecentVisits: "
|
|
166
|
+
ScheduledVisits: "ScheduledVisits",
|
|
167
|
+
OverdueVisits: "OverdueVisits",
|
|
168
|
+
RecentRegistrations: "RecentRegistrations",
|
|
169
|
+
RecentEnrolments: "RecentEnrolments",
|
|
170
|
+
RecentVisits: "RecentVisits",
|
|
159
171
|
Total: "Total",
|
|
160
172
|
Comments: "Comments",
|
|
161
|
-
CallTasks: "
|
|
162
|
-
OpenSubjectTasks: "
|
|
163
|
-
DueChecklist: "
|
|
173
|
+
CallTasks: "CallTasks",
|
|
174
|
+
OpenSubjectTasks: "OpenSubjectTasks",
|
|
175
|
+
DueChecklist: "DueChecklist"
|
|
164
176
|
});
|
|
165
177
|
|
|
166
178
|
_defineProperty(StandardReportCardType, "recentCardDurationUnits", [_Duration.default.Day, _Duration.default.Week, _Duration.default.Month]);
|
|
167
179
|
|
|
168
180
|
const typeToStatusMap = {
|
|
169
|
-
[StandardReportCardType.
|
|
170
|
-
[StandardReportCardType.
|
|
171
|
-
[StandardReportCardType.
|
|
181
|
+
[StandardReportCardType.types.PendingApproval]: _ApprovalStatus.default.statuses.Pending,
|
|
182
|
+
[StandardReportCardType.types.Approved]: _ApprovalStatus.default.statuses.Approved,
|
|
183
|
+
[StandardReportCardType.types.Rejected]: _ApprovalStatus.default.statuses.Rejected
|
|
172
184
|
};
|
|
173
185
|
var _default = StandardReportCardType;
|
|
174
186
|
exports.default = _default;
|