openchs-models 1.33.2 → 1.33.5
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/.circleci/config.yml +15 -5
- package/.commit-message.txt +21 -0
- package/.nvmrc +1 -1
- package/Makefile +32 -10
- package/REALM_V12_NOTES.md +46 -0
- package/dist/AbstractEncounter.js +4 -105
- package/dist/AddressLevel.js +5 -62
- package/dist/ApprovalStatus.js +4 -17
- package/dist/BaseEntity.js +5 -42
- package/dist/BeneficiaryModePin.js +4 -13
- package/dist/Checklist.js +6 -52
- package/dist/ChecklistDetail.js +4 -22
- package/dist/ChecklistItem.js +16 -96
- package/dist/ChecklistItemDetail.js +4 -43
- package/dist/ChecklistItemStatus.js +4 -33
- package/dist/Comment.js +6 -51
- package/dist/CommentThread.js +4 -26
- package/dist/CompositeDuration.js +1 -18
- package/dist/Concept.js +5 -107
- package/dist/ConceptAnswer.js +4 -21
- package/dist/CustomDashboardCache.js +4 -38
- package/dist/CustomFilter.js +5 -15
- package/dist/Dashboard.js +4 -23
- package/dist/DashboardCache.js +4 -23
- package/dist/DashboardSection.js +4 -24
- package/dist/DashboardSectionCardMapping.js +4 -21
- package/dist/Displayable.js +3 -11
- package/dist/Documentation.js +4 -21
- package/dist/DocumentationItem.js +4 -20
- package/dist/Duration.js +4 -39
- package/dist/Encounter.js +6 -41
- package/dist/EncounterType.js +4 -26
- package/dist/EntityApprovalStatus.js +6 -56
- package/dist/EntityMetaData.js +7 -105
- package/dist/EntityQueue.js +4 -15
- package/dist/EntityRule.js +1 -29
- package/dist/EntitySyncStatus.js +4 -19
- package/dist/Extension.js +4 -18
- package/dist/Family.js +4 -56
- package/dist/FileFormat.js +0 -7
- package/dist/Gender.js +4 -17
- package/dist/GroupDashboard.js +4 -23
- package/dist/GroupPrivileges.js +4 -28
- package/dist/GroupRole.js +4 -34
- package/dist/GroupSubject.js +6 -59
- package/dist/Groups.js +4 -14
- package/dist/Identifier.js +4 -20
- package/dist/IdentifierAssignment.js +6 -45
- package/dist/IdentifierSource.js +4 -15
- package/dist/Individual.js +17 -265
- package/dist/LocaleMapping.js +4 -13
- package/dist/LocationHierarchy.js +4 -25
- package/dist/Media.js +35 -35
- package/dist/MediaQueue.js +4 -26
- package/dist/MigrationsHelper.js +15 -22
- package/dist/MyGroups.js +4 -14
- package/dist/News.js +4 -31
- package/dist/Observation.js +4 -54
- package/dist/ObservationsHolder.js +104 -216
- package/dist/OrganisationConfig.js +4 -19
- package/dist/PersistedObject.js +1 -19
- package/dist/PhoneNumber.js +0 -11
- package/dist/PlatformTranslation.js +4 -17
- package/dist/Privilege.js +5 -22
- package/dist/Program.js +4 -39
- package/dist/ProgramEncounter.js +6 -48
- package/dist/ProgramEnrolment.js +8 -162
- package/dist/ReferenceEntity.js +1 -10
- package/dist/ReportCard.js +5 -60
- package/dist/ResetSync.js +4 -17
- package/dist/Rule.js +4 -28
- package/dist/RuleDependency.js +4 -17
- package/dist/RuleFailureTelemetry.js +4 -36
- package/dist/Schema.js +16 -268
- package/dist/SchemaNames.js +3 -46
- package/dist/Settings.js +4 -53
- package/dist/StandardReportCardType.js +4 -39
- package/dist/SubjectMigration.js +6 -45
- package/dist/SubjectType.js +6 -72
- package/dist/SyncTelemetry.js +4 -40
- package/dist/Translation.js +4 -17
- package/dist/UserInfo.js +4 -33
- package/dist/application/DashboardCacheFilter.js +4 -24
- package/dist/application/Filter.js +3 -16
- package/dist/application/Form.js +6 -93
- package/dist/application/FormElement.js +5 -100
- package/dist/application/FormElementGroup.js +4 -75
- package/dist/application/FormElementStatus.js +1 -11
- package/dist/application/FormMapping.js +6 -44
- package/dist/application/Format.js +4 -20
- package/dist/application/KeyValue.js +4 -19
- package/dist/application/MenuItem.js +4 -35
- package/dist/application/MultiSelectFilter.js +1 -11
- package/dist/application/NullProgramEnrolment.js +0 -8
- package/dist/application/SingleSelectFilter.js +1 -12
- package/dist/application/StaticFormElementGroup.js +0 -11
- package/dist/application/StringKeyNumericValue.js +4 -17
- package/dist/application/ValidationResult.js +6 -20
- package/dist/application/ValidationResults.js +1 -14
- package/dist/application/WorkItem.js +4 -20
- package/dist/application/WorkList.js +1 -24
- package/dist/application/WorkLists.js +1 -13
- package/dist/assignment/UserSubjectAssignment.js +6 -26
- package/dist/draft/DraftEncounter.js +4 -40
- package/dist/draft/DraftSubject.js +4 -46
- package/dist/error/IgnorableSyncError.js +1 -6
- package/dist/error/SyncError.js +1 -6
- package/dist/framework/ArrayHelper.js +3 -11
- package/dist/framework/DefinedObjectSchema.js +4 -12
- package/dist/framework/RealmCollectionHelper.js +1 -9
- package/dist/framework/RealmEmbeddedObjectHandler.js +126 -0
- package/dist/framework/RealmListProxy.js +1 -10
- package/dist/framework/RealmObjectSchema.js +1 -11
- package/dist/framework/RealmProxy.js +15 -39
- package/dist/framework/RealmResultsProxy.js +3 -37
- package/dist/framework/RealmResultsProxyHandler.js +2 -5
- package/dist/geo/Point.js +4 -17
- package/dist/index.js +9 -137
- package/dist/location/Locations.js +1 -6
- package/dist/observation/MultipleCodedValues.js +1 -21
- package/dist/observation/PrimitiveValue.js +1 -17
- package/dist/observation/QuestionGroup.js +1 -36
- package/dist/observation/RepeatableQuestionGroup.js +4 -27
- package/dist/observation/SingleCodedValue.js +1 -15
- package/dist/program/SubjectProgramEligibility.js +6 -56
- package/dist/relationship/IndividualRelation.js +6 -18
- package/dist/relationship/IndividualRelationGenderMapping.js +4 -22
- package/dist/relationship/IndividualRelationship.js +6 -51
- package/dist/relationship/IndividualRelationshipType.js +4 -24
- package/dist/relationship/IndividualRelative.js +4 -31
- package/dist/reports/DashboardFilter.js +4 -20
- package/dist/reports/DashboardFilterConfig.js +5 -85
- package/dist/reports/NestedReportCardResult.js +5 -35
- package/dist/reports/Range.js +4 -13
- package/dist/reports/ReportCardResult.js +5 -24
- package/dist/service/MetaDataService.js +1 -30
- package/dist/task/Task.js +6 -62
- package/dist/task/TaskStatus.js +4 -21
- package/dist/task/TaskType.js +4 -23
- package/dist/task/TaskUnAssignment.js +6 -30
- package/dist/utility/AgeUtil.js +1 -15
- package/dist/utility/ArrayUtil.js +1 -6
- package/dist/utility/AuditUtil.js +1 -8
- package/dist/utility/DateTimeUtil.js +1 -8
- package/dist/utility/General.js +4 -71
- package/dist/utility/JsonStringify.js +15 -28
- package/dist/utility/MergeUtil.js +1 -10
- package/dist/utility/ResourceUtil.js +1 -7
- package/dist/videos/Video.js +4 -23
- package/dist/videos/VideoTelemetric.js +6 -37
- package/package.json +6 -3
- package/scripts/validateSchemas.js +40 -0
- package/tsconfig.json +1 -1
- package/yarn.lock +0 -6744
|
@@ -4,47 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.GroupSubjectTypeFilter = exports.ObservationBasedFilter = void 0;
|
|
7
|
-
|
|
8
7
|
var _CustomFilter = _interopRequireDefault(require("../CustomFilter"));
|
|
9
|
-
|
|
10
8
|
var _Concept = _interopRequireDefault(require("../Concept"));
|
|
11
|
-
|
|
12
9
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
|
-
|
|
14
10
|
var _DateTimeUtil = _interopRequireDefault(require("../utility/DateTimeUtil"));
|
|
15
|
-
|
|
16
11
|
var _Range = _interopRequireDefault(require("./Range"));
|
|
17
|
-
|
|
18
12
|
var _Gender = _interopRequireDefault(require("../Gender"));
|
|
19
|
-
|
|
20
13
|
var _AddressLevel = _interopRequireDefault(require("../AddressLevel"));
|
|
21
|
-
|
|
22
14
|
var _Individual = _interopRequireDefault(require("../Individual"));
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
28
19
|
const widgetConceptDataTypes = [_Concept.default.dataType.Date, _Concept.default.dataType.DateTime, _Concept.default.dataType.Time, _Concept.default.dataType.Numeric];
|
|
29
20
|
const conceptEntityTypes = {
|
|
30
21
|
[_Concept.default.dataType.Coded]: _Concept.default.schema.name,
|
|
31
22
|
[_Concept.default.dataType.Location]: _AddressLevel.default.schema.name
|
|
32
23
|
};
|
|
33
|
-
|
|
34
24
|
class ObservationBasedFilter {
|
|
35
25
|
constructor() {
|
|
36
26
|
_defineProperty(this, "scope", void 0);
|
|
37
|
-
|
|
38
27
|
_defineProperty(this, "concept", void 0);
|
|
39
|
-
|
|
40
28
|
_defineProperty(this, "programs", void 0);
|
|
41
|
-
|
|
42
29
|
_defineProperty(this, "encounterTypes", void 0);
|
|
43
|
-
|
|
44
30
|
this.programs = [];
|
|
45
31
|
this.encounterTypes = [];
|
|
46
32
|
}
|
|
47
|
-
|
|
48
33
|
isValid() {
|
|
49
34
|
const {
|
|
50
35
|
concept,
|
|
@@ -53,16 +38,13 @@ class ObservationBasedFilter {
|
|
|
53
38
|
} = this;
|
|
54
39
|
return !_lodash.default.isNil(concept) && (!_lodash.default.isEmpty(programs) || !_lodash.default.isEmpty(encounterTypes) || this.scope === _CustomFilter.default.scope.Registration);
|
|
55
40
|
}
|
|
56
|
-
|
|
57
41
|
isMultiEntityType() {
|
|
58
42
|
return [_Concept.default.dataType.Coded, _Concept.default.dataType.Location].includes(this.concept.datatype);
|
|
59
43
|
}
|
|
60
|
-
|
|
61
44
|
getEntityType() {
|
|
62
45
|
if (this.isMultiEntityType()) return conceptEntityTypes[this.concept.datatype];
|
|
63
46
|
throw new Error("Unsupported concept data type for getting entity type: " + this.concept.datatype);
|
|
64
47
|
}
|
|
65
|
-
|
|
66
48
|
toServerRequest() {
|
|
67
49
|
return {
|
|
68
50
|
scope: this.scope,
|
|
@@ -71,62 +53,47 @@ class ObservationBasedFilter {
|
|
|
71
53
|
encounterTypeUUIDs: this.encounterTypes.map(x => x.uuid)
|
|
72
54
|
};
|
|
73
55
|
}
|
|
74
|
-
|
|
75
56
|
isWidgetRequired() {
|
|
76
57
|
return widgetConceptDataTypes.includes(_lodash.default.get(this.concept, "dataType"));
|
|
77
58
|
}
|
|
78
|
-
|
|
79
59
|
setPrograms(programs) {
|
|
80
60
|
this.programs = programs;
|
|
81
61
|
}
|
|
82
|
-
|
|
83
62
|
setEncounterTypes(encounterTypes) {
|
|
84
63
|
this.encounterTypes = encounterTypes;
|
|
85
64
|
}
|
|
86
|
-
|
|
87
65
|
setScope(scope) {
|
|
88
66
|
if (this.scope !== scope) {
|
|
89
67
|
this.scope = scope;
|
|
90
|
-
|
|
91
68
|
if (!this.willObservationBeInScopeOfEncounter()) {
|
|
92
69
|
this.encounterTypes = [];
|
|
93
70
|
}
|
|
94
|
-
|
|
95
71
|
if (!this.willObservationBeInScopeOfProgramEnrolment()) {
|
|
96
72
|
this.programs = [];
|
|
97
73
|
}
|
|
98
74
|
}
|
|
99
75
|
}
|
|
100
|
-
|
|
101
76
|
willObservationBeInScopeOfProgramEnrolment() {
|
|
102
77
|
return [_CustomFilter.default.scope.ProgramEnrolment, _CustomFilter.default.scope.ProgramEncounter].includes(this.scope);
|
|
103
78
|
}
|
|
104
|
-
|
|
105
79
|
willObservationBeInScopeOfEncounter() {
|
|
106
80
|
return [_CustomFilter.default.scope.ProgramEncounter, _CustomFilter.default.scope.Encounter].includes(this.scope);
|
|
107
81
|
}
|
|
108
|
-
|
|
109
82
|
}
|
|
110
|
-
|
|
111
83
|
exports.ObservationBasedFilter = ObservationBasedFilter;
|
|
112
|
-
|
|
113
84
|
class GroupSubjectTypeFilter {
|
|
114
85
|
constructor() {
|
|
115
86
|
_defineProperty(this, "subjectType", void 0);
|
|
116
87
|
}
|
|
117
|
-
|
|
118
88
|
isValid() {
|
|
119
89
|
return !_lodash.default.isNil(this.subjectType);
|
|
120
90
|
}
|
|
121
|
-
|
|
122
91
|
toServerRequest() {
|
|
123
92
|
return {
|
|
124
93
|
subjectTypeUUID: this.subjectType.uuid
|
|
125
94
|
};
|
|
126
95
|
}
|
|
127
|
-
|
|
128
96
|
}
|
|
129
|
-
|
|
130
97
|
exports.GroupSubjectTypeFilter = GroupSubjectTypeFilter;
|
|
131
98
|
const dateFilterTypes = [_CustomFilter.default.type.RegistrationDate, _CustomFilter.default.type.EnrolmentDate, _CustomFilter.default.type.EncounterDate, _CustomFilter.default.type.ProgramEncounterDate, _CustomFilter.default.type.AsOnDate];
|
|
132
99
|
const entityTypes = {
|
|
@@ -134,50 +101,36 @@ const entityTypes = {
|
|
|
134
101
|
[_CustomFilter.default.type.Address]: _AddressLevel.default.schema.name,
|
|
135
102
|
[_CustomFilter.default.type.GroupSubject]: _Individual.default.schema.name
|
|
136
103
|
};
|
|
137
|
-
|
|
138
104
|
function isDateDataType(dashboardFilterConfig) {
|
|
139
105
|
return dateFilterTypes.includes(dashboardFilterConfig.type) || dashboardFilterConfig.isConceptTypeFilter() && dashboardFilterConfig.observationBasedFilter.concept.datatype === _Concept.default.dataType.Date;
|
|
140
106
|
}
|
|
141
|
-
|
|
142
107
|
function isDateTimeDataType(dashboardFilterConfig) {
|
|
143
108
|
return dashboardFilterConfig.isConceptTypeFilter() && dashboardFilterConfig.observationBasedFilter.concept.datatype === _Concept.default.dataType.DateTime;
|
|
144
109
|
}
|
|
145
|
-
|
|
146
110
|
function isTimeDataType(dashboardFilterConfig) {
|
|
147
111
|
return dashboardFilterConfig.isConceptTypeFilter() && dashboardFilterConfig.observationBasedFilter.concept.datatype === _Concept.default.dataType.Time;
|
|
148
112
|
}
|
|
149
|
-
|
|
150
113
|
class DashboardFilterConfig {
|
|
151
114
|
constructor() {
|
|
152
115
|
_defineProperty(this, "subjectType", void 0);
|
|
153
|
-
|
|
154
116
|
_defineProperty(this, "type", void 0);
|
|
155
|
-
|
|
156
117
|
_defineProperty(this, "widget", void 0);
|
|
157
|
-
|
|
158
118
|
_defineProperty(this, "groupSubjectTypeFilter", void 0);
|
|
159
|
-
|
|
160
119
|
_defineProperty(this, "observationBasedFilter", void 0);
|
|
161
|
-
}
|
|
162
|
-
|
|
120
|
+
} //CustomFilter.widget
|
|
163
121
|
toDisplayText() {
|
|
164
122
|
let s = `Type: ${this.type}.`;
|
|
165
|
-
|
|
166
123
|
if (this.isRangeWidget()) {
|
|
167
124
|
s += ` Widget: ${this.widget}.`;
|
|
168
125
|
}
|
|
169
|
-
|
|
170
126
|
if (this.isConceptTypeFilter()) {
|
|
171
127
|
s += ` Concept: ${this.observationBasedFilter.concept.name}. DataType: ${this.observationBasedFilter.concept.datatype}.`;
|
|
172
128
|
}
|
|
173
|
-
|
|
174
129
|
return s;
|
|
175
130
|
}
|
|
176
|
-
|
|
177
131
|
isRangeWidget() {
|
|
178
132
|
return this.widget === _CustomFilter.default.widget.Range;
|
|
179
133
|
}
|
|
180
|
-
|
|
181
134
|
getInputDataType() {
|
|
182
135
|
if (this.isConceptTypeFilter()) {
|
|
183
136
|
if (this.isRangeWidget()) {
|
|
@@ -194,84 +147,64 @@ class DashboardFilterConfig {
|
|
|
194
147
|
} else if (this.type === _CustomFilter.default.type.SubjectType) {
|
|
195
148
|
return DashboardFilterConfig.dataTypes.formMetaData;
|
|
196
149
|
}
|
|
197
|
-
|
|
198
150
|
throw new Error("Unsupported filter type: " + this.type);
|
|
199
151
|
}
|
|
200
|
-
|
|
201
152
|
isDateFilterType() {
|
|
202
153
|
return isDateDataType(this) && !this.isRangeWidget();
|
|
203
154
|
}
|
|
204
|
-
|
|
205
155
|
isDateRangeFilterType() {
|
|
206
156
|
return isDateDataType(this) && this.isRangeWidget();
|
|
207
157
|
}
|
|
208
|
-
|
|
209
158
|
isDateTimeFilterType() {
|
|
210
159
|
return isDateTimeDataType(this) && !this.isRangeWidget();
|
|
211
160
|
}
|
|
212
|
-
|
|
213
161
|
isDateTimeRangeFilterType() {
|
|
214
162
|
return isDateTimeDataType(this) && this.isRangeWidget();
|
|
215
163
|
}
|
|
216
|
-
|
|
217
164
|
isTimeFilterType() {
|
|
218
165
|
return isTimeDataType(this) && !this.isRangeWidget();
|
|
219
166
|
}
|
|
220
|
-
|
|
221
167
|
isTimeRangeFilterType() {
|
|
222
168
|
return isTimeDataType(this) && this.isRangeWidget();
|
|
223
169
|
}
|
|
224
|
-
|
|
225
170
|
isNumericRangeFilterType() {
|
|
226
171
|
return this.isConceptTypeFilter() && this.observationBasedFilter.concept.datatype === _Concept.default.dataType.Numeric && this.isRangeWidget();
|
|
227
172
|
}
|
|
228
|
-
|
|
229
173
|
isDateLikeFilterType() {
|
|
230
174
|
return this.isDateFilterType() || this.isDateTimeFilterType() || this.isTimeFilterType();
|
|
231
175
|
}
|
|
232
|
-
|
|
233
176
|
isDateLikeRangeFilterType() {
|
|
234
177
|
return this.isDateRangeFilterType() || this.isDateTimeRangeFilterType() || this.isTimeRangeFilterType();
|
|
235
178
|
}
|
|
236
|
-
|
|
237
179
|
isMultiEntityType() {
|
|
238
180
|
return [_CustomFilter.default.type.Gender, _CustomFilter.default.type.Address, _CustomFilter.default.type.GroupSubject].includes(this.type) || this.isConceptTypeFilter() && this.observationBasedFilter.isMultiEntityType();
|
|
239
181
|
}
|
|
240
|
-
|
|
241
182
|
getEntityType() {
|
|
242
183
|
if (this.isMultiEntityType()) {
|
|
243
184
|
return _lodash.default.isNil(entityTypes[this.type]) ? this.observationBasedFilter.getEntityType() : entityTypes[this.type];
|
|
244
185
|
}
|
|
245
|
-
|
|
246
186
|
throw new Error("Unsupported filter type: " + this.type);
|
|
247
187
|
}
|
|
248
|
-
|
|
249
188
|
isConceptTypeFilter() {
|
|
250
189
|
return this.type === _CustomFilter.default.type.Concept;
|
|
251
190
|
}
|
|
252
|
-
|
|
253
191
|
isNonCodedObservationDataType() {
|
|
254
192
|
return this.isConceptTypeFilter() && this.observationBasedFilter.concept.datatype !== _Concept.default.dataType.Coded;
|
|
255
193
|
}
|
|
256
|
-
|
|
257
194
|
isGroupSubjectTypeFilter() {
|
|
258
195
|
return this.type === _CustomFilter.default.type.GroupSubject;
|
|
259
196
|
}
|
|
260
|
-
|
|
261
197
|
requiresSpecificSubjectType() {
|
|
262
198
|
return ![_CustomFilter.default.type.SubjectType, _CustomFilter.default.type.AsOnDate].includes(this.type);
|
|
263
199
|
}
|
|
264
|
-
|
|
265
200
|
isAsOnDateFilter() {
|
|
266
201
|
return this.type === _CustomFilter.default.type.AsOnDate;
|
|
267
202
|
}
|
|
268
|
-
|
|
269
203
|
isValid() {
|
|
270
204
|
const valid = !_lodash.default.isNil(this.type);
|
|
271
205
|
if (!valid) return valid;
|
|
272
206
|
if (this.isConceptTypeFilter()) return this.observationBasedFilter.isValid();else if (this.isGroupSubjectTypeFilter()) return this.groupSubjectTypeFilter.isValid();else if (this.isWidgetRequired()) return !_lodash.default.isNil(this.widget);else return true;
|
|
273
207
|
}
|
|
274
|
-
|
|
275
208
|
toServerRequest() {
|
|
276
209
|
const request = {
|
|
277
210
|
type: this.type,
|
|
@@ -281,7 +214,6 @@ class DashboardFilterConfig {
|
|
|
281
214
|
if (this.isConceptTypeFilter()) request.observationBasedFilter = this.observationBasedFilter.toServerRequest();else if (this.isGroupSubjectTypeFilter()) request.groupSubjectTypeFilter = this.groupSubjectTypeFilter.toServerRequest();
|
|
282
215
|
return request;
|
|
283
216
|
}
|
|
284
|
-
|
|
285
217
|
setType(type) {
|
|
286
218
|
if (type !== this.type) {
|
|
287
219
|
this.type = type;
|
|
@@ -290,7 +222,6 @@ class DashboardFilterConfig {
|
|
|
290
222
|
this.observationBasedFilter = type === _CustomFilter.default.type.Concept ? new ObservationBasedFilter() : null;
|
|
291
223
|
}
|
|
292
224
|
}
|
|
293
|
-
|
|
294
225
|
isWidgetRequired() {
|
|
295
226
|
const {
|
|
296
227
|
RegistrationDate,
|
|
@@ -298,36 +229,28 @@ class DashboardFilterConfig {
|
|
|
298
229
|
ProgramEncounterDate,
|
|
299
230
|
EncounterDate
|
|
300
231
|
} = _CustomFilter.default.getDashboardFilterTypes();
|
|
301
|
-
|
|
302
232
|
return [RegistrationDate, EnrolmentDate, ProgramEncounterDate, EncounterDate].includes(this.type) || this.isConceptTypeFilter() && this.observationBasedFilter.isWidgetRequired();
|
|
303
233
|
}
|
|
304
|
-
|
|
305
234
|
setSubjectType(subjectType) {
|
|
306
235
|
if (_lodash.default.get(subjectType, "uuid") !== _lodash.default.get(this.subjectType, "uuid")) {
|
|
307
236
|
this.subjectType = subjectType;
|
|
308
237
|
}
|
|
309
238
|
}
|
|
310
|
-
|
|
311
239
|
willObservationBeInScopeOfProgramEnrolment() {
|
|
312
240
|
return this.isConceptTypeFilter() && this.observationBasedFilter.willObservationBeInScopeOfProgramEnrolment();
|
|
313
241
|
}
|
|
314
|
-
|
|
315
242
|
willObservationBeInScopeOfEncounter() {
|
|
316
243
|
return this.isConceptTypeFilter() && this.observationBasedFilter.willObservationBeInScopeOfEncounter();
|
|
317
244
|
}
|
|
318
|
-
|
|
319
245
|
validate(filterValue) {
|
|
320
246
|
if (this.isDateRangeFilterType()) {
|
|
321
247
|
return _DateTimeUtil.default.validateDateRange(filterValue.minValue, filterValue.maxValue);
|
|
322
248
|
}
|
|
323
|
-
|
|
324
249
|
if (this.isTimeRangeFilterType()) {
|
|
325
250
|
return _DateTimeUtil.default.validateTimeRange(filterValue.minValue, filterValue.maxValue);
|
|
326
251
|
}
|
|
327
|
-
|
|
328
252
|
return [true];
|
|
329
253
|
}
|
|
330
|
-
|
|
331
254
|
clone() {
|
|
332
255
|
const clone = new DashboardFilterConfig();
|
|
333
256
|
clone.type = this.type;
|
|
@@ -337,13 +260,10 @@ class DashboardFilterConfig {
|
|
|
337
260
|
clone.observationBasedFilter = this.observationBasedFilter;
|
|
338
261
|
return clone;
|
|
339
262
|
}
|
|
340
|
-
|
|
341
263
|
}
|
|
342
|
-
|
|
343
264
|
_defineProperty(DashboardFilterConfig, "dataTypes", {
|
|
344
265
|
array: "array",
|
|
345
266
|
formMetaData: "formMetaData"
|
|
346
267
|
});
|
|
347
|
-
|
|
348
268
|
var _default = DashboardFilterConfig;
|
|
349
269
|
exports.default = _default;
|
|
@@ -4,27 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
-
|
|
10
8
|
var _BaseEntity = _interopRequireDefault(require("../BaseEntity"));
|
|
11
|
-
|
|
12
9
|
var _General = _interopRequireDefault(require("../utility/General"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
14
|
class NestedReportCardResult extends _BaseEntity.default {
|
|
19
15
|
// transient state
|
|
16
|
+
|
|
20
17
|
constructor(that) {
|
|
21
18
|
super(that);
|
|
22
|
-
|
|
23
19
|
_defineProperty(this, "clickable", void 0);
|
|
24
|
-
|
|
25
20
|
_defineProperty(this, "hasErrorMsg", void 0);
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
static create(primaryValue, secondaryValue, clickable, hasErrorMsg, itemKey) {
|
|
29
23
|
const nestedReportCardResult = new NestedReportCardResult();
|
|
30
24
|
nestedReportCardResult.uuid = _General.default.randomUUID();
|
|
@@ -35,95 +29,72 @@ class NestedReportCardResult extends _BaseEntity.default {
|
|
|
35
29
|
nestedReportCardResult.itemKey = itemKey;
|
|
36
30
|
return nestedReportCardResult;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
get dashboard() {
|
|
40
33
|
return this.that.dashboard;
|
|
41
34
|
}
|
|
42
|
-
|
|
43
35
|
set dashboard(x) {
|
|
44
36
|
this.that.dashboard = x;
|
|
45
37
|
}
|
|
46
|
-
|
|
47
38
|
get reportCard() {
|
|
48
39
|
return this.that.reportCard;
|
|
49
40
|
}
|
|
50
|
-
|
|
51
41
|
set reportCard(x) {
|
|
52
42
|
this.that.reportCard = x;
|
|
53
43
|
}
|
|
54
|
-
|
|
55
44
|
get primaryValue() {
|
|
56
45
|
return this.that.primaryValue;
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
set primaryValue(x) {
|
|
60
48
|
this.that.primaryValue = x;
|
|
61
49
|
}
|
|
62
|
-
|
|
63
50
|
get secondaryValue() {
|
|
64
51
|
return this.that.secondaryValue;
|
|
65
52
|
}
|
|
66
|
-
|
|
67
53
|
set secondaryValue(x) {
|
|
68
54
|
this.that.secondaryValue = x;
|
|
69
55
|
}
|
|
70
|
-
|
|
71
56
|
get itemKey() {
|
|
72
57
|
return this.that.itemKey;
|
|
73
58
|
}
|
|
74
|
-
|
|
75
59
|
set itemKey(x) {
|
|
76
60
|
this.that.itemKey = x;
|
|
77
61
|
}
|
|
78
|
-
|
|
79
62
|
get cardName() {
|
|
80
63
|
return this.that.cardName;
|
|
81
64
|
}
|
|
82
|
-
|
|
83
65
|
set cardName(x) {
|
|
84
66
|
this.that.cardName = x;
|
|
85
67
|
}
|
|
86
|
-
|
|
87
68
|
get cardColor() {
|
|
88
69
|
return this.that.cardColor;
|
|
89
70
|
}
|
|
90
|
-
|
|
91
71
|
set cardColor(x) {
|
|
92
72
|
this.that.cardColor = x;
|
|
93
73
|
}
|
|
94
|
-
|
|
95
74
|
get textColor() {
|
|
96
75
|
return this.that.textColor;
|
|
97
76
|
}
|
|
98
|
-
|
|
99
77
|
set textColor(x) {
|
|
100
78
|
this.that.textColor = x;
|
|
101
79
|
}
|
|
102
|
-
|
|
103
80
|
get reportCardUUID() {
|
|
104
81
|
return this.that.reportCardUUID;
|
|
105
82
|
}
|
|
106
|
-
|
|
107
83
|
set reportCardUUID(x) {
|
|
108
84
|
this.that.reportCardUUID = x;
|
|
109
85
|
}
|
|
110
|
-
|
|
111
86
|
static fromQueryResult(ruleResult, reportCard, index) {
|
|
112
87
|
const nestedReportCardResult = NestedReportCardResult.create(ruleResult.primaryValue, ruleResult.secondaryValue, _lodash.default.isFunction(ruleResult.lineListFunction), ruleResult.hasErrorMsg, reportCard.getCardId(index));
|
|
113
|
-
|
|
114
88
|
if (ruleResult.hasErrorMsg) {
|
|
115
89
|
return nestedReportCardResult;
|
|
116
90
|
}
|
|
117
|
-
|
|
118
91
|
nestedReportCardResult.cardName = ruleResult.cardName;
|
|
119
92
|
nestedReportCardResult.cardColor = _lodash.default.isNil(ruleResult.cardColor) ? reportCard.colour : ruleResult.cardColor;
|
|
120
93
|
nestedReportCardResult.textColor = ruleResult.textColor;
|
|
121
94
|
nestedReportCardResult.reportCardUUID = reportCard.uuid;
|
|
122
95
|
return nestedReportCardResult;
|
|
123
96
|
}
|
|
124
|
-
|
|
125
97
|
}
|
|
126
|
-
|
|
127
98
|
_defineProperty(NestedReportCardResult, "schema", {
|
|
128
99
|
name: "NestedReportCardResult",
|
|
129
100
|
embedded: true,
|
|
@@ -140,6 +111,5 @@ _defineProperty(NestedReportCardResult, "schema", {
|
|
|
140
111
|
reportCardUUID: "string"
|
|
141
112
|
}
|
|
142
113
|
});
|
|
143
|
-
|
|
144
114
|
var _default = NestedReportCardResult;
|
|
145
115
|
exports.default = _default;
|
package/dist/reports/Range.js
CHANGED
|
@@ -4,34 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
12
|
class Range {
|
|
15
13
|
constructor(minValue, maxValue) {
|
|
16
14
|
_defineProperty(this, "minValue", void 0);
|
|
17
|
-
|
|
18
15
|
_defineProperty(this, "maxValue", void 0);
|
|
19
|
-
|
|
20
16
|
this.minValue = minValue;
|
|
21
17
|
this.maxValue = maxValue;
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
static empty() {
|
|
25
20
|
return new Range(null, null);
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
isEmpty() {
|
|
29
23
|
return _lodash.default.isNil(this.minValue) || _lodash.default.isNil(this.maxValue);
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
}
|
|
33
|
-
|
|
34
26
|
_defineProperty(Range, "DateRange", "DateRange");
|
|
35
|
-
|
|
36
27
|
var _default = Range;
|
|
37
28
|
exports.default = _default;
|
|
@@ -4,59 +4,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
-
|
|
10
8
|
var _BaseEntity = _interopRequireDefault(require("../BaseEntity"));
|
|
11
|
-
|
|
12
9
|
var _General = _interopRequireDefault(require("../utility/General"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
14
|
class ReportCardResult extends _BaseEntity.default {
|
|
19
15
|
// transient state
|
|
16
|
+
|
|
20
17
|
constructor(that) {
|
|
21
18
|
super(that);
|
|
22
|
-
|
|
23
19
|
_defineProperty(this, "clickable", void 0);
|
|
24
|
-
|
|
25
20
|
_defineProperty(this, "hasErrorMsg", void 0);
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
get primaryValue() {
|
|
29
23
|
return this.that.primaryValue;
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
set primaryValue(x) {
|
|
33
26
|
this.that.primaryValue = x;
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
get secondaryValue() {
|
|
37
29
|
return this.that.secondaryValue;
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
set secondaryValue(x) {
|
|
41
32
|
this.that.secondaryValue = x;
|
|
42
33
|
}
|
|
43
|
-
|
|
44
34
|
get dashboard() {
|
|
45
35
|
return this.that.dashboard;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
37
|
set dashboard(x) {
|
|
49
38
|
this.that.dashboard = x;
|
|
50
39
|
}
|
|
51
|
-
|
|
52
40
|
get reportCard() {
|
|
53
41
|
return this.that.reportCard;
|
|
54
42
|
}
|
|
55
|
-
|
|
56
43
|
set reportCard(x) {
|
|
57
44
|
this.that.reportCard = x;
|
|
58
45
|
}
|
|
59
|
-
|
|
60
46
|
static create(primaryValue, secondaryValue, clickable, hasErrorMsg = false) {
|
|
61
47
|
const reportCardResult = new ReportCardResult();
|
|
62
48
|
reportCardResult.uuid = _General.default.randomUUID();
|
|
@@ -66,17 +52,13 @@ class ReportCardResult extends _BaseEntity.default {
|
|
|
66
52
|
reportCardResult.hasErrorMsg = hasErrorMsg;
|
|
67
53
|
return reportCardResult;
|
|
68
54
|
}
|
|
69
|
-
|
|
70
55
|
static fromQueryResult(result) {
|
|
71
56
|
return ReportCardResult.create(result.primaryValue, result.secondaryValue, _lodash.default.isFunction(result.lineListFunction), result.hasErrorMsg);
|
|
72
57
|
}
|
|
73
|
-
|
|
74
58
|
get lineListFunction() {
|
|
75
59
|
return _lodash.default.noop;
|
|
76
60
|
}
|
|
77
|
-
|
|
78
61
|
}
|
|
79
|
-
|
|
80
62
|
_defineProperty(ReportCardResult, "schema", {
|
|
81
63
|
name: "ReportCardResult",
|
|
82
64
|
embedded: true,
|
|
@@ -88,6 +70,5 @@ _defineProperty(ReportCardResult, "schema", {
|
|
|
88
70
|
secondaryValue: "string"
|
|
89
71
|
}
|
|
90
72
|
});
|
|
91
|
-
|
|
92
73
|
var _default = ReportCardResult;
|
|
93
74
|
exports.default = _default;
|