openchs-models 1.32.8 → 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 +0 -15
- package/dist/StandardReportCardType.js +54 -42
- package/dist/application/FormElementGroup.js +15 -2
- package/package.json +1 -1
package/dist/Schema.js
CHANGED
|
@@ -921,21 +921,6 @@ function createRealmConfig() {
|
|
|
921
921
|
if (oldDB.schemaVersion < 191) {
|
|
922
922
|
newDB.delete(newDB.objects("CustomDashboardCache"));
|
|
923
923
|
}
|
|
924
|
-
|
|
925
|
-
if (oldDB.schemaVersion < 197) {
|
|
926
|
-
const oldObjects = oldDB.objects(_FormElementGroup.default.schema.name);
|
|
927
|
-
const newObjects = newDB.objects(_FormElementGroup.default.schema.name); // loop through all objects and set the name property in the
|
|
928
|
-
// new schema to display property
|
|
929
|
-
|
|
930
|
-
for (const objectIndex in oldObjects) {
|
|
931
|
-
const oldObject = oldObjects[objectIndex];
|
|
932
|
-
const newObject = newObjects[objectIndex];
|
|
933
|
-
|
|
934
|
-
if (!_lodash.default.isEmpty(oldObject.display) && oldObject.name !== oldObject.display) {
|
|
935
|
-
newObject.name = oldObject.display;
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
924
|
}
|
|
940
925
|
};
|
|
941
926
|
}
|
|
@@ -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;
|
|
@@ -48,6 +48,14 @@ class FormElementGroup extends _BaseEntity.default {
|
|
|
48
48
|
this.that.displayOrder = x;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
get display() {
|
|
52
|
+
return this.that.display;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
set display(x) {
|
|
56
|
+
this.that.display = x;
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
get formElements() {
|
|
52
60
|
return this.toEntityList("formElements", _FormElement.default);
|
|
53
61
|
}
|
|
@@ -113,7 +121,7 @@ class FormElementGroup extends _BaseEntity.default {
|
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
static fromResource(resource, entityService) {
|
|
116
|
-
const formElementGroup = _General.default.assignFields(resource, new FormElementGroup(), ["uuid", "name", "displayOrder", "voided", "rule", "startTime", "stayTime", "timed", "textColour", "backgroundColour"]);
|
|
124
|
+
const formElementGroup = _General.default.assignFields(resource, new FormElementGroup(), ["uuid", "name", "displayOrder", "display", "voided", "rule", "startTime", "stayTime", "timed", "textColour", "backgroundColour"]);
|
|
117
125
|
|
|
118
126
|
formElementGroup.form = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "formUUID"), _Form.default.schema.name);
|
|
119
127
|
return formElementGroup;
|
|
@@ -234,7 +242,7 @@ class FormElementGroup extends _BaseEntity.default {
|
|
|
234
242
|
}
|
|
235
243
|
|
|
236
244
|
get translatedFieldValue() {
|
|
237
|
-
return this.
|
|
245
|
+
return this.display;
|
|
238
246
|
}
|
|
239
247
|
|
|
240
248
|
removeFormElement(formElementName) {
|
|
@@ -283,6 +291,7 @@ class FormElementGroup extends _BaseEntity.default {
|
|
|
283
291
|
uuid: this.uuid,
|
|
284
292
|
name: this.name,
|
|
285
293
|
displayOrder: this.displayOrder,
|
|
294
|
+
display: this.display,
|
|
286
295
|
formElements: this.formElements,
|
|
287
296
|
formUUID: this.form.uuid,
|
|
288
297
|
startTime: this.startTime,
|
|
@@ -302,6 +311,10 @@ _defineProperty(FormElementGroup, "schema", {
|
|
|
302
311
|
uuid: "string",
|
|
303
312
|
name: "string",
|
|
304
313
|
displayOrder: "double",
|
|
314
|
+
display: {
|
|
315
|
+
type: "string",
|
|
316
|
+
optional: true
|
|
317
|
+
},
|
|
305
318
|
formElements: {
|
|
306
319
|
type: "list",
|
|
307
320
|
objectType: "FormElement"
|