openchs-models 1.31.78 → 1.31.80
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/CustomFilter.js
CHANGED
|
@@ -41,8 +41,7 @@ _defineProperty(CustomFilter, "type", {
|
|
|
41
41
|
EncounterDate: "EncounterDate",
|
|
42
42
|
Address: "Address",
|
|
43
43
|
Concept: "Concept",
|
|
44
|
-
GroupSubject: "GroupSubject"
|
|
45
|
-
SubjectType: "SubjectType"
|
|
44
|
+
GroupSubject: "GroupSubject"
|
|
46
45
|
});
|
|
47
46
|
|
|
48
47
|
_defineProperty(CustomFilter, "scope", {
|
package/dist/MediaQueue.js
CHANGED
|
@@ -9,6 +9,8 @@ var _General = _interopRequireDefault(require("./utility/General"));
|
|
|
9
9
|
|
|
10
10
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
11
11
|
|
|
12
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
16
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -67,7 +69,7 @@ class MediaQueue extends _BaseEntity.default {
|
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
static create(entityUUID, entityName, fileName, type, entityTargetField, conceptUUID, uuid = _General.default.randomUUID()) {
|
|
70
|
-
|
|
72
|
+
const mediaQueue = new MediaQueue();
|
|
71
73
|
mediaQueue.entityUUID = entityUUID;
|
|
72
74
|
mediaQueue.uuid = uuid;
|
|
73
75
|
mediaQueue.entityName = entityName;
|
|
@@ -90,6 +92,18 @@ class MediaQueue extends _BaseEntity.default {
|
|
|
90
92
|
return mediaQueueItem;
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
getDisplayText() {
|
|
96
|
+
// generate safe to string
|
|
97
|
+
let str = "";
|
|
98
|
+
if (!_lodash.default.isNil(this.entityName)) str += "EntityName: " + this.entityName + ", ";
|
|
99
|
+
if (!_lodash.default.isNil(this.entityUUID)) str += "EntityUUID: " + this.entityUUID + ", ";
|
|
100
|
+
if (!_lodash.default.isNil(this.entityTargetField)) str += "EntityTargetField: " + this.entityTargetField + ", ";
|
|
101
|
+
if (!_lodash.default.isNil(this.fileName)) str += "FileName: " + this.fileName + ", ";
|
|
102
|
+
if (!_lodash.default.isNil(this.type)) str += "Type: " + this.type + ", ";
|
|
103
|
+
if (!_lodash.default.isNil(this.conceptUUID)) str += "ConceptUUID: " + this.conceptUUID;
|
|
104
|
+
return str;
|
|
105
|
+
}
|
|
106
|
+
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
_defineProperty(MediaQueue, "schema", {
|
package/dist/ReportCard.js
CHANGED
|
@@ -15,16 +15,14 @@ var _StandardReportCardType = _interopRequireDefault(require("./StandardReportCa
|
|
|
15
15
|
|
|
16
16
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
17
17
|
|
|
18
|
-
var _SubjectType = _interopRequireDefault(require("./SubjectType"));
|
|
19
|
-
|
|
20
|
-
var _Program = _interopRequireDefault(require("./Program"));
|
|
21
|
-
|
|
22
|
-
var _EncounterType = _interopRequireDefault(require("./EncounterType"));
|
|
23
|
-
|
|
24
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
19
|
|
|
26
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
21
|
|
|
22
|
+
function throwInvalidIndexError(index, reportCardsLength) {
|
|
23
|
+
throw new Error(`Invalid index ${index} specified for reportCard with length ${reportCardsLength}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
28
26
|
class ReportCard extends _BaseEntity.default {
|
|
29
27
|
constructor(that = null) {
|
|
30
28
|
super(that);
|
|
@@ -98,30 +96,6 @@ class ReportCard extends _BaseEntity.default {
|
|
|
98
96
|
get textColor() {
|
|
99
97
|
return _lodash.default.isNil(this.standardReportCardType) ? '#ffffff' : this.standardReportCardType.textColor;
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
get standardReportCardInputSubjectTypes() {
|
|
103
|
-
return this.toEntityList("standardReportCardInputSubjectTypes", _SubjectType.default);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
set standardReportCardInputSubjectTypes(x) {
|
|
107
|
-
this.that.standardReportCardInputSubjectTypes = this.fromEntityList(x);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
get standardReportCardInputPrograms() {
|
|
111
|
-
return this.toEntityList("standardReportCardInputPrograms", _Program.default);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
set standardReportCardInputPrograms(x) {
|
|
115
|
-
this.that.standardReportCardInputPrograms = this.fromEntityList(x);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
get standardReportCardInputEncounterTypes() {
|
|
119
|
-
return this.toEntityList("standardReportCardInputEncounterTypes", _EncounterType.default);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
set standardReportCardInputEncounterTypes(x) {
|
|
123
|
-
this.that.standardReportCardInputEncounterTypes = this.fromEntityList(x);
|
|
124
|
-
}
|
|
125
99
|
/**
|
|
126
100
|
* Helper method used to generate unique key value for Nested Report Cards using UUID and Index of the Report Card.
|
|
127
101
|
* The Nested Report Card's query responses would be mapped to the corresponding Dashboard Report cards using the UUID and Index.
|
|
@@ -158,14 +132,6 @@ class ReportCard extends _BaseEntity.default {
|
|
|
158
132
|
return _lodash.default.isNil(this.standardReportCardType) ? false : this.standardReportCardType.isTaskType();
|
|
159
133
|
}
|
|
160
134
|
|
|
161
|
-
isStandardReportType() {
|
|
162
|
-
return !_lodash.default.isNil(this.standardReportCardType);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
isSubjectTypeFilterSupported() {
|
|
166
|
-
return this.isStandardReportType() && this.standardReportCardType.isSubjectTypeFilterSupported();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
135
|
}
|
|
170
136
|
|
|
171
137
|
_defineProperty(ReportCard, "schema", {
|
|
@@ -200,20 +166,8 @@ _defineProperty(ReportCard, "schema", {
|
|
|
200
166
|
type: "int",
|
|
201
167
|
default: 1,
|
|
202
168
|
optional: true
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
standardReportCardInputSubjectTypes: {
|
|
206
|
-
type: "list",
|
|
207
|
-
objectType: "SubjectType"
|
|
208
|
-
},
|
|
209
|
-
standardReportCardInputPrograms: {
|
|
210
|
-
type: "list",
|
|
211
|
-
objectType: "Program"
|
|
212
|
-
},
|
|
213
|
-
standardReportCardInputEncounterTypes: {
|
|
214
|
-
type: "list",
|
|
215
|
-
objectType: "EncounterType"
|
|
216
|
-
}
|
|
169
|
+
} //Used only by nested ReportCards
|
|
170
|
+
|
|
217
171
|
}
|
|
218
172
|
});
|
|
219
173
|
|
|
@@ -118,10 +118,6 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
118
118
|
return typeToStatusMap[this.name];
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
isSubjectTypeFilterSupported() {
|
|
122
|
-
return [StandardReportCardType.type.ScheduledVisits, StandardReportCardType.type.OverdueVisits].includes(this.name);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
121
|
}
|
|
126
122
|
|
|
127
123
|
_defineProperty(StandardReportCardType, "schema", {
|
|
@@ -111,8 +111,6 @@ const dateFilterTypes = [_CustomFilter.default.type.RegistrationDate, _CustomFil
|
|
|
111
111
|
|
|
112
112
|
class DashboardFilterConfig {
|
|
113
113
|
constructor() {
|
|
114
|
-
_defineProperty(this, "subjectType", void 0);
|
|
115
|
-
|
|
116
114
|
_defineProperty(this, "type", void 0);
|
|
117
115
|
|
|
118
116
|
_defineProperty(this, "widget", void 0);
|
|
@@ -142,10 +140,6 @@ class DashboardFilterConfig {
|
|
|
142
140
|
return this.type === _CustomFilter.default.type.GroupSubject;
|
|
143
141
|
}
|
|
144
142
|
|
|
145
|
-
isSubjectTypeFilter() {
|
|
146
|
-
return this.type === _CustomFilter.default.type.SubjectType;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
143
|
isValid() {
|
|
150
144
|
const valid = !_lodash.default.isNil(this.type);
|
|
151
145
|
if (!valid) return valid;
|
|
@@ -155,7 +149,6 @@ class DashboardFilterConfig {
|
|
|
155
149
|
toServerRequest() {
|
|
156
150
|
const request = {
|
|
157
151
|
type: this.type,
|
|
158
|
-
subjectTypeUUID: this.subjectType && this.subjectType.uuid,
|
|
159
152
|
widget: this.widget
|
|
160
153
|
};
|
|
161
154
|
if (this.isConceptTypeFilter()) request.observationBasedFilter = this.observationBasedFilter.toServerRequest();else if (this.isGroupSubjectTypeFilter()) request.groupSubjectTypeFilter = this.groupSubjectTypeFilter.toServerRequest();
|
|
@@ -182,12 +175,6 @@ class DashboardFilterConfig {
|
|
|
182
175
|
return [RegistrationDate, EnrolmentDate, ProgramEncounterDate, EncounterDate].includes(this.type) || this.isConceptTypeFilter() && this.observationBasedFilter.isWidgetRequired();
|
|
183
176
|
}
|
|
184
177
|
|
|
185
|
-
setSubjectType(subjectType) {
|
|
186
|
-
if (_lodash.default.get(subjectType, "uuid") !== _lodash.default.get(this.subjectType, "uuid")) {
|
|
187
|
-
this.subjectType = subjectType;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
178
|
willObservationBeInScopeOfProgramEnrolment() {
|
|
192
179
|
return this.isConceptTypeFilter() && this.observationBasedFilter.willObservationBeInScopeOfProgramEnrolment();
|
|
193
180
|
}
|
|
@@ -213,7 +200,6 @@ class DashboardFilterConfig {
|
|
|
213
200
|
clone() {
|
|
214
201
|
const clone = new DashboardFilterConfig();
|
|
215
202
|
clone.type = this.type;
|
|
216
|
-
clone.subjectType = this.subjectType;
|
|
217
203
|
clone.widget = this.widget;
|
|
218
204
|
clone.groupSubjectTypeFilter = this.groupSubjectTypeFilter;
|
|
219
205
|
clone.observationBasedFilter = this.observationBasedFilter;
|