openchs-models 1.31.34 → 1.31.35
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 +0 -1
- package/Makefile +0 -4
- package/dist/AbstractEncounter.js +0 -53
- package/dist/AddressLevel.js +1 -1
- package/dist/Checklist.js +2 -41
- package/dist/ChecklistItem.js +5 -43
- package/dist/ChecklistItemDetail.js +1 -1
- package/dist/ChecklistItemStatus.js +2 -3
- package/dist/Comment.js +2 -41
- package/dist/Concept.js +13 -9
- package/dist/DashboardCache.js +37 -21
- package/dist/Encounter.js +10 -22
- package/dist/EntityApprovalStatus.js +2 -41
- package/dist/EntityMetaData.js +1 -5
- package/dist/Family.js +2 -2
- package/dist/GroupSubject.js +2 -41
- package/dist/IdentifierAssignment.js +2 -41
- package/dist/Individual.js +6 -44
- package/dist/Observation.js +3 -8
- package/dist/ObservationsHolder.js +76 -42
- package/dist/ProgramEncounter.js +8 -22
- package/dist/ProgramEnrolment.js +8 -46
- package/dist/ReportCard.js +6 -63
- package/dist/Schema.js +6 -121
- package/dist/SchemaNames.js +4 -12
- package/dist/SubjectMigration.js +2 -41
- package/dist/SubjectType.js +3 -5
- package/dist/UserInfo.js +0 -13
- package/dist/VisitScheduleConfig.js +73 -0
- package/dist/VisitScheduleInterval.js +71 -0
- package/dist/application/Form.js +1 -13
- package/dist/application/FormElement.js +6 -4
- package/dist/application/Format.js +0 -1
- package/dist/application/KeyValue.js +1 -2
- package/dist/application/StringKeyNumericValue.js +0 -1
- package/dist/assignment/UserSubjectAssignment.js +2 -41
- package/dist/draft/DraftEncounter.js +6 -6
- package/dist/draft/DraftSubject.js +2 -2
- package/dist/framework/RealmProxy.js +1 -9
- package/dist/framework/RealmResultsProxy.js +0 -8
- package/dist/geo/Point.js +1 -2
- package/dist/index.js +23 -9
- package/dist/program/SubjectProgramEligibility.js +3 -42
- package/dist/relationship/IndividualRelationship.js +7 -42
- package/dist/service/MetaDataService.js +5 -80
- package/dist/task/Task.js +4 -43
- package/dist/task/TaskUnAssignment.js +2 -41
- package/dist/utility/ResourceUtil.js +0 -4
- package/package.json +1 -1
- package/dist/application/DashboardCacheFilter.js +0 -80
- package/dist/utility/AuditUtil.js +0 -39
package/.circleci/config.yml
CHANGED
package/Makefile
CHANGED
|
@@ -28,12 +28,8 @@ deploy-to-avni-client-only:
|
|
|
28
28
|
deploy-to-avni-web-only:
|
|
29
29
|
$(call _deploy,../avni-webapp/node_modules/openchs-models)
|
|
30
30
|
|
|
31
|
-
deploy-to-avni-rule-server-only:
|
|
32
|
-
$(call _deploy,../rule-server/node_modules/openchs-models)
|
|
33
|
-
|
|
34
31
|
deploy-to-avni-client: build deploy-to-avni-client-only
|
|
35
32
|
deploy-to-avni-web: build deploy-to-avni-web-only
|
|
36
|
-
deploy-to-avni-rule-server: build deploy-to-avni-rule-server-only
|
|
37
33
|
|
|
38
34
|
deploy-to-avni-project: build
|
|
39
35
|
$(if $(local),$(call _deploy,$(local)/node_modules/openchs-models))
|
|
@@ -33,8 +33,6 @@ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
|
33
33
|
|
|
34
34
|
var _MergeUtil = _interopRequireDefault(require("./utility/MergeUtil"));
|
|
35
35
|
|
|
36
|
-
var _AuditUtil = require("./utility/AuditUtil");
|
|
37
|
-
|
|
38
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
37
|
|
|
40
38
|
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; }
|
|
@@ -138,54 +136,6 @@ class AbstractEncounter extends _BaseEntity.default {
|
|
|
138
136
|
this.that.approvalStatuses = this.fromEntityList(x);
|
|
139
137
|
}
|
|
140
138
|
|
|
141
|
-
get createdBy() {
|
|
142
|
-
return this.that.createdBy;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
set createdBy(x) {
|
|
146
|
-
this.that.createdBy = x;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
get lastModifiedBy() {
|
|
150
|
-
return this.that.lastModifiedBy;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
set lastModifiedBy(x) {
|
|
154
|
-
this.that.lastModifiedBy = x;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
get createdByUUID() {
|
|
158
|
-
return this.that.createdByUUID;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
set createdByUUID(x) {
|
|
162
|
-
this.that.createdByUUID = x;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
get lastModifiedByUUID() {
|
|
166
|
-
return this.that.lastModifiedByUUID;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
set lastModifiedByUUID(x) {
|
|
170
|
-
this.that.lastModifiedByUUID = x;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
get filledBy() {
|
|
174
|
-
return this.that.filledBy;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
set filledBy(x) {
|
|
178
|
-
this.that.filledBy = x;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
get filledByUUID() {
|
|
182
|
-
return this.that.filledByUUID;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
set filledByUUID(x) {
|
|
186
|
-
this.that.filledByUUID = x;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
139
|
validate() {
|
|
190
140
|
return _lodash.default.isNil(this.encounterDateTime) ? [new _ValidationResult.default(false, AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME, "emptyValidationMessage")] : [_ValidationResult.default.successful(AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME)];
|
|
191
141
|
}
|
|
@@ -256,9 +206,6 @@ class AbstractEncounter extends _BaseEntity.default {
|
|
|
256
206
|
encounter.name = resource.name;
|
|
257
207
|
if (!_lodash.default.isNil(resource.encounterLocation)) encounter.encounterLocation = _Point.default.fromResource(resource.encounterLocation);
|
|
258
208
|
if (!_lodash.default.isNil(resource.cancelLocation)) encounter.cancelLocation = _Point.default.fromResource(resource.cancelLocation);
|
|
259
|
-
(0, _AuditUtil.mapAuditFields)(encounter, resource);
|
|
260
|
-
encounter.filledBy = _ResourceUtil.default.getFieldValue(resource, "filledBy");
|
|
261
|
-
encounter.filledByUUID = _ResourceUtil.default.getFieldValue(resource, "filledByUUID");
|
|
262
209
|
return encounter;
|
|
263
210
|
}
|
|
264
211
|
|
package/dist/AddressLevel.js
CHANGED
package/dist/Checklist.js
CHANGED
|
@@ -23,14 +23,8 @@ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
|
23
23
|
|
|
24
24
|
var _EntityApprovalStatus = _interopRequireDefault(require("./EntityApprovalStatus"));
|
|
25
25
|
|
|
26
|
-
var _AuditUtil = require("./utility/AuditUtil");
|
|
27
|
-
|
|
28
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
27
|
|
|
30
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
-
|
|
32
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
-
|
|
34
28
|
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; }
|
|
35
29
|
|
|
36
30
|
class Checklist extends _BaseEntity.default {
|
|
@@ -70,38 +64,6 @@ class Checklist extends _BaseEntity.default {
|
|
|
70
64
|
this.that.programEnrolment = this.fromObject(x);
|
|
71
65
|
}
|
|
72
66
|
|
|
73
|
-
get createdBy() {
|
|
74
|
-
return this.that.createdBy;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
set createdBy(x) {
|
|
78
|
-
this.that.createdBy = x;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
get lastModifiedBy() {
|
|
82
|
-
return this.that.lastModifiedBy;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
set lastModifiedBy(x) {
|
|
86
|
-
this.that.lastModifiedBy = x;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
get createdByUUID() {
|
|
90
|
-
return this.that.createdByUUID;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
set createdByUUID(x) {
|
|
94
|
-
this.that.createdByUUID = x;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
get lastModifiedByUUID() {
|
|
98
|
-
return this.that.lastModifiedByUUID;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
set lastModifiedByUUID(x) {
|
|
102
|
-
this.that.lastModifiedByUUID = x;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
67
|
static create() {
|
|
106
68
|
const checklist = new Checklist();
|
|
107
69
|
checklist.uuid = _General.default.randomUUID();
|
|
@@ -117,7 +79,6 @@ class Checklist extends _BaseEntity.default {
|
|
|
117
79
|
const checklistDetail = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(checklistResource, "checklistDetailUUID"), _ChecklistDetail.default.schema.name);
|
|
118
80
|
checklist.programEnrolment = programEnrolment;
|
|
119
81
|
checklist.detail = checklistDetail;
|
|
120
|
-
(0, _AuditUtil.mapAuditFields)(checklist, checklistResource);
|
|
121
82
|
return checklist;
|
|
122
83
|
}
|
|
123
84
|
|
|
@@ -176,7 +137,7 @@ class Checklist extends _BaseEntity.default {
|
|
|
176
137
|
_defineProperty(Checklist, "schema", {
|
|
177
138
|
name: _SchemaNames.default.Checklist,
|
|
178
139
|
primaryKey: "uuid",
|
|
179
|
-
properties:
|
|
140
|
+
properties: {
|
|
180
141
|
uuid: "string",
|
|
181
142
|
detail: "ChecklistDetail",
|
|
182
143
|
baseDate: "date",
|
|
@@ -185,7 +146,7 @@ _defineProperty(Checklist, "schema", {
|
|
|
185
146
|
objectType: "ChecklistItem"
|
|
186
147
|
},
|
|
187
148
|
programEnrolment: "ProgramEnrolment"
|
|
188
|
-
}
|
|
149
|
+
}
|
|
189
150
|
});
|
|
190
151
|
|
|
191
152
|
_defineProperty(Checklist, "merge", () => _BaseEntity.default.mergeOn("items"));
|
package/dist/ChecklistItem.js
CHANGED
|
@@ -31,14 +31,8 @@ var _Observation = _interopRequireDefault(require("./Observation"));
|
|
|
31
31
|
|
|
32
32
|
var _MergeUtil = _interopRequireDefault(require("./utility/MergeUtil"));
|
|
33
33
|
|
|
34
|
-
var _AuditUtil = require("./utility/AuditUtil");
|
|
35
|
-
|
|
36
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
35
|
|
|
38
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
41
|
-
|
|
42
36
|
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; }
|
|
43
37
|
|
|
44
38
|
const mergeMap = new Map([[_SchemaNames.default.EntityApprovalStatus, "approvalStatuses"]]);
|
|
@@ -84,38 +78,6 @@ class ChecklistItem extends _BaseEntity.default {
|
|
|
84
78
|
return _lodash.default.maxBy(this.approvalStatuses, 'statusDateTime');
|
|
85
79
|
}
|
|
86
80
|
|
|
87
|
-
get createdBy() {
|
|
88
|
-
return this.that.createdBy;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
set createdBy(x) {
|
|
92
|
-
this.that.createdBy = x;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
get lastModifiedBy() {
|
|
96
|
-
return this.that.lastModifiedBy;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
set lastModifiedBy(x) {
|
|
100
|
-
this.that.lastModifiedBy = x;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
get createdByUUID() {
|
|
104
|
-
return this.that.createdByUUID;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
set createdByUUID(x) {
|
|
108
|
-
this.that.createdByUUID = x;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
get lastModifiedByUUID() {
|
|
112
|
-
return this.that.lastModifiedByUUID;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
set lastModifiedByUUID(x) {
|
|
116
|
-
this.that.lastModifiedByUUID = x;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
81
|
static create({
|
|
120
82
|
uuid = _General.default.randomUUID(),
|
|
121
83
|
observations = [],
|
|
@@ -138,7 +100,6 @@ class ChecklistItem extends _BaseEntity.default {
|
|
|
138
100
|
|
|
139
101
|
checklistItem.checklist = checklist;
|
|
140
102
|
checklistItem.detail = checklistItemDetail;
|
|
141
|
-
(0, _AuditUtil.mapAuditFields)(checklistItem, checklistItemResource);
|
|
142
103
|
return checklistItem;
|
|
143
104
|
}
|
|
144
105
|
|
|
@@ -353,7 +314,7 @@ class ChecklistItem extends _BaseEntity.default {
|
|
|
353
314
|
_defineProperty(ChecklistItem, "schema", {
|
|
354
315
|
name: _SchemaNames.default.ChecklistItem,
|
|
355
316
|
primaryKey: "uuid",
|
|
356
|
-
properties:
|
|
317
|
+
properties: {
|
|
357
318
|
uuid: "string",
|
|
358
319
|
detail: "ChecklistItemDetail",
|
|
359
320
|
completionDate: {
|
|
@@ -362,7 +323,7 @@ _defineProperty(ChecklistItem, "schema", {
|
|
|
362
323
|
},
|
|
363
324
|
observations: {
|
|
364
325
|
type: "list",
|
|
365
|
-
objectType: "
|
|
326
|
+
objectType: "Observation"
|
|
366
327
|
},
|
|
367
328
|
checklist: "Checklist",
|
|
368
329
|
approvalStatuses: {
|
|
@@ -372,8 +333,9 @@ _defineProperty(ChecklistItem, "schema", {
|
|
|
372
333
|
latestEntityApprovalStatus: {
|
|
373
334
|
type: "EntityApprovalStatus",
|
|
374
335
|
optional: true
|
|
375
|
-
}
|
|
376
|
-
|
|
336
|
+
} //Reporting purposes
|
|
337
|
+
|
|
338
|
+
}
|
|
377
339
|
});
|
|
378
340
|
|
|
379
341
|
_defineProperty(ChecklistItem, "merge", childEntityName => _MergeUtil.default.getMergeFunction(childEntityName, mergeMap));
|
|
@@ -126,11 +126,10 @@ class ChecklistItemStatus extends _PersistedObject.default {
|
|
|
126
126
|
|
|
127
127
|
_defineProperty(ChecklistItemStatus, "schema", {
|
|
128
128
|
name: _SchemaNames.default.ChecklistItemStatus,
|
|
129
|
-
embedded: true,
|
|
130
129
|
properties: {
|
|
131
130
|
state: "string",
|
|
132
|
-
from:
|
|
133
|
-
to:
|
|
131
|
+
from: "StringKeyNumericValue",
|
|
132
|
+
to: "StringKeyNumericValue",
|
|
134
133
|
color: {
|
|
135
134
|
type: "string",
|
|
136
135
|
default: "yellow"
|
package/dist/Comment.js
CHANGED
|
@@ -19,14 +19,8 @@ var _CommentThread = _interopRequireDefault(require("./CommentThread"));
|
|
|
19
19
|
|
|
20
20
|
var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
21
21
|
|
|
22
|
-
var _AuditUtil = require("./utility/AuditUtil");
|
|
23
|
-
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
23
|
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
29
|
-
|
|
30
24
|
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; }
|
|
31
25
|
|
|
32
26
|
class Comment extends _BaseEntity.default {
|
|
@@ -90,38 +84,6 @@ class Comment extends _BaseEntity.default {
|
|
|
90
84
|
this.that.commentThread = this.fromObject(x);
|
|
91
85
|
}
|
|
92
86
|
|
|
93
|
-
get createdBy() {
|
|
94
|
-
return this.that.createdBy;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
set createdBy(x) {
|
|
98
|
-
this.that.createdBy = x;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
get lastModifiedBy() {
|
|
102
|
-
return this.that.lastModifiedBy;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
set lastModifiedBy(x) {
|
|
106
|
-
this.that.lastModifiedBy = x;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
get createdByUUID() {
|
|
110
|
-
return this.that.createdByUUID;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
set createdByUUID(x) {
|
|
114
|
-
this.that.createdByUUID = x;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
get lastModifiedByUUID() {
|
|
118
|
-
return this.that.lastModifiedByUUID;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
set lastModifiedByUUID(x) {
|
|
122
|
-
this.that.lastModifiedByUUID = x;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
87
|
get toResource() {
|
|
126
88
|
const resource = _lodash.default.pick(this, ["uuid", "text", "voided"]);
|
|
127
89
|
|
|
@@ -136,7 +98,6 @@ class Comment extends _BaseEntity.default {
|
|
|
136
98
|
comment.createdByUsername = resource["createdBy"];
|
|
137
99
|
comment.subject = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "individualUUID"), _Individual.default.schema.name);
|
|
138
100
|
comment.commentThread = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "commentThreadUUID"), _CommentThread.default.schema.name);
|
|
139
|
-
(0, _AuditUtil.mapAuditFields)(comment, resource);
|
|
140
101
|
return comment;
|
|
141
102
|
}
|
|
142
103
|
|
|
@@ -193,7 +154,7 @@ class Comment extends _BaseEntity.default {
|
|
|
193
154
|
_defineProperty(Comment, "schema", {
|
|
194
155
|
name: _SchemaNames.default.Comment,
|
|
195
156
|
primaryKey: "uuid",
|
|
196
|
-
properties:
|
|
157
|
+
properties: {
|
|
197
158
|
uuid: "string",
|
|
198
159
|
text: "string",
|
|
199
160
|
subject: "Individual",
|
|
@@ -206,7 +167,7 @@ _defineProperty(Comment, "schema", {
|
|
|
206
167
|
type: "bool",
|
|
207
168
|
default: false
|
|
208
169
|
}
|
|
209
|
-
}
|
|
170
|
+
}
|
|
210
171
|
});
|
|
211
172
|
|
|
212
173
|
var _default = Comment;
|
package/dist/Concept.js
CHANGED
|
@@ -127,7 +127,9 @@ class Concept extends _BaseEntity.default {
|
|
|
127
127
|
concept.hiNormal = conceptResource.highNormal;
|
|
128
128
|
concept.unit = conceptResource.unit;
|
|
129
129
|
concept.voided = conceptResource.voided || false; //This change should be independently deployable irrespective of server
|
|
130
|
+
//remove orphan keyValues (because KeyValue doesn't have primary key
|
|
130
131
|
|
|
132
|
+
entityService && entityService.deleteObjects(conceptResource["uuid"], Concept.schema.name, "keyValues");
|
|
131
133
|
concept.keyValues = _lodash.default.map(conceptResource.keyValues, _KeyValue.default.fromResource);
|
|
132
134
|
return concept;
|
|
133
135
|
}
|
|
@@ -153,18 +155,20 @@ class Concept extends _BaseEntity.default {
|
|
|
153
155
|
concept.name = name;
|
|
154
156
|
concept.datatype = dataType;
|
|
155
157
|
concept.uuid = uuid;
|
|
156
|
-
concept.keyValues =
|
|
158
|
+
concept.keyValues = keyValues;
|
|
157
159
|
return concept;
|
|
158
160
|
}
|
|
159
|
-
/**
|
|
160
|
-
* This should never be cloned and used for reference as this is metadata which is not to be modified during transactional data operations
|
|
161
|
-
*
|
|
162
|
-
* @returns {Concept}
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
161
|
|
|
166
162
|
cloneForReference() {
|
|
167
|
-
|
|
163
|
+
const concept = Concept.create(this.name, this.datatype, this.keyValues);
|
|
164
|
+
concept.uuid = this.uuid;
|
|
165
|
+
concept.unit = this.unit;
|
|
166
|
+
concept.lowAbsolute = this.lowAbsolute;
|
|
167
|
+
concept.lowNormal = this.lowNormal;
|
|
168
|
+
concept.hiNormal = this.hiNormal;
|
|
169
|
+
concept.hiAbsolute = this.hiAbsolute;
|
|
170
|
+
concept.answers = this.answers || [];
|
|
171
|
+
return concept;
|
|
168
172
|
}
|
|
169
173
|
|
|
170
174
|
_valuePresent(value) {
|
|
@@ -371,7 +375,7 @@ _defineProperty(Concept, "schema", {
|
|
|
371
375
|
},
|
|
372
376
|
keyValues: {
|
|
373
377
|
type: "list",
|
|
374
|
-
objectType:
|
|
378
|
+
objectType: "KeyValue"
|
|
375
379
|
},
|
|
376
380
|
voided: {
|
|
377
381
|
type: "bool",
|
package/dist/DashboardCache.js
CHANGED
|
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
9
|
-
|
|
10
|
-
var _DashboardCacheFilter = _interopRequireDefault(require("./application/DashboardCacheFilter"));
|
|
11
|
-
|
|
12
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
9
|
|
|
10
|
+
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
11
|
+
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
|
|
16
14
|
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; }
|
|
@@ -20,6 +18,14 @@ class DashboardCache extends _BaseEntity.default {
|
|
|
20
18
|
super(that);
|
|
21
19
|
}
|
|
22
20
|
|
|
21
|
+
get updatedAt() {
|
|
22
|
+
return this.that.updatedAt;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set updatedAt(x) {
|
|
26
|
+
this.that.updatedAt = x;
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
get cardJSON() {
|
|
24
30
|
return this.that.cardJSON;
|
|
25
31
|
}
|
|
@@ -36,34 +42,43 @@ class DashboardCache extends _BaseEntity.default {
|
|
|
36
42
|
this.that.filterJSON = x;
|
|
37
43
|
}
|
|
38
44
|
|
|
39
|
-
static
|
|
45
|
+
static create(updatedAt, cardJSON, filterJSON) {
|
|
40
46
|
const dashboardCache = new DashboardCache();
|
|
41
47
|
dashboardCache.uuid = this.rowUUID;
|
|
42
|
-
dashboardCache.
|
|
43
|
-
dashboardCache.cardJSON =
|
|
48
|
+
dashboardCache.updatedAt = updatedAt;
|
|
49
|
+
dashboardCache.cardJSON = cardJSON;
|
|
50
|
+
dashboardCache.filterJSON = filterJSON;
|
|
44
51
|
return dashboardCache;
|
|
45
52
|
}
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
static getFilterJSONFromState(state) {
|
|
55
|
+
const filterCache = {
|
|
56
|
+
date: state.date,
|
|
57
|
+
selectedPrograms: state.selectedPrograms,
|
|
58
|
+
selectedEncounterTypes: state.selectedEncounterTypes,
|
|
59
|
+
selectedGeneralEncounterTypes: state.selectedGeneralEncounterTypes,
|
|
60
|
+
selectedCustomFilters: state.selectedCustomFilters,
|
|
61
|
+
selectedGenders: state.selectedGenders,
|
|
62
|
+
programs: state.programs,
|
|
63
|
+
individualFilters: state.individualFilters,
|
|
64
|
+
encountersFilters: state.encountersFilters,
|
|
65
|
+
enrolmentFilters: state.enrolmentFilters,
|
|
66
|
+
generalEncountersFilters: state.generalEncountersFilters,
|
|
67
|
+
selectedSubjectType: state.subjectType
|
|
68
|
+
};
|
|
69
|
+
return state.subjectType && _lodash.default.isEmpty(state.subjectType.name) ? _lodash.default.omit(filterCache, ['selectedSubjectType']) : filterCache;
|
|
49
70
|
}
|
|
50
71
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!_lodash.default.isEmpty(filter.filterDate)) {
|
|
55
|
-
filter.filterDate = new Date(filter.filterDate);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return filter;
|
|
72
|
+
static createEmptyInstance() {
|
|
73
|
+
return new DashboardCache();
|
|
59
74
|
}
|
|
60
75
|
|
|
61
|
-
|
|
62
|
-
this.
|
|
76
|
+
getCardJSON() {
|
|
77
|
+
return this.cardJSON && JSON.parse(this.cardJSON) || {};
|
|
63
78
|
}
|
|
64
79
|
|
|
65
|
-
|
|
66
|
-
this.
|
|
80
|
+
getFilterJSON() {
|
|
81
|
+
return this.filterJSON && JSON.parse(this.filterJSON) || {};
|
|
67
82
|
}
|
|
68
83
|
|
|
69
84
|
}
|
|
@@ -75,6 +90,7 @@ _defineProperty(DashboardCache, "schema", {
|
|
|
75
90
|
primaryKey: "uuid",
|
|
76
91
|
properties: {
|
|
77
92
|
uuid: "string",
|
|
93
|
+
updatedAt: "date",
|
|
78
94
|
cardJSON: "string",
|
|
79
95
|
filterJSON: "string"
|
|
80
96
|
}
|
package/dist/Encounter.js
CHANGED
|
@@ -19,20 +19,16 @@ var _General = _interopRequireDefault(require("./utility/General"));
|
|
|
19
19
|
|
|
20
20
|
var _EncounterType = _interopRequireDefault(require("./EncounterType"));
|
|
21
21
|
|
|
22
|
+
var _Point = _interopRequireDefault(require("./geo/Point"));
|
|
23
|
+
|
|
22
24
|
var _EntityApprovalStatus = _interopRequireDefault(require("./EntityApprovalStatus"));
|
|
23
25
|
|
|
24
26
|
var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
25
27
|
|
|
26
28
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
27
29
|
|
|
28
|
-
var _AuditUtil = require("./utility/AuditUtil");
|
|
29
|
-
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
32
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
-
|
|
34
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
35
|
-
|
|
36
32
|
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; }
|
|
37
33
|
|
|
38
34
|
class Encounter extends _AbstractEncounter.default {
|
|
@@ -122,7 +118,7 @@ class Encounter extends _AbstractEncounter.default {
|
|
|
122
118
|
_defineProperty(Encounter, "schema", {
|
|
123
119
|
name: _SchemaNames.default.Encounter,
|
|
124
120
|
primaryKey: "uuid",
|
|
125
|
-
properties:
|
|
121
|
+
properties: {
|
|
126
122
|
uuid: "string",
|
|
127
123
|
encounterType: "EncounterType",
|
|
128
124
|
encounterDateTime: {
|
|
@@ -132,10 +128,10 @@ _defineProperty(Encounter, "schema", {
|
|
|
132
128
|
individual: _SchemaNames.default.Individual,
|
|
133
129
|
observations: {
|
|
134
130
|
type: "list",
|
|
135
|
-
objectType: "
|
|
131
|
+
objectType: "Observation"
|
|
136
132
|
},
|
|
137
133
|
encounterLocation: {
|
|
138
|
-
type:
|
|
134
|
+
type: "Point",
|
|
139
135
|
optional: true
|
|
140
136
|
},
|
|
141
137
|
name: {
|
|
@@ -156,10 +152,10 @@ _defineProperty(Encounter, "schema", {
|
|
|
156
152
|
},
|
|
157
153
|
cancelObservations: {
|
|
158
154
|
type: "list",
|
|
159
|
-
objectType: "
|
|
155
|
+
objectType: "Observation"
|
|
160
156
|
},
|
|
161
157
|
cancelLocation: {
|
|
162
|
-
type:
|
|
158
|
+
type: "Point",
|
|
163
159
|
optional: true
|
|
164
160
|
},
|
|
165
161
|
voided: {
|
|
@@ -173,17 +169,9 @@ _defineProperty(Encounter, "schema", {
|
|
|
173
169
|
latestEntityApprovalStatus: {
|
|
174
170
|
type: "EntityApprovalStatus",
|
|
175
171
|
optional: true
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
type: "string",
|
|
180
|
-
optional: true
|
|
181
|
-
},
|
|
182
|
-
filledByUUID: {
|
|
183
|
-
type: "string",
|
|
184
|
-
optional: true
|
|
185
|
-
}
|
|
186
|
-
})
|
|
172
|
+
} //Reporting purposes
|
|
173
|
+
|
|
174
|
+
}
|
|
187
175
|
});
|
|
188
176
|
|
|
189
177
|
_defineProperty(Encounter, "validationKeys", {
|
|
@@ -17,14 +17,8 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
17
17
|
|
|
18
18
|
var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
19
19
|
|
|
20
|
-
var _AuditUtil = require("./utility/AuditUtil");
|
|
21
|
-
|
|
22
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
21
|
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
-
|
|
28
22
|
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; }
|
|
29
23
|
|
|
30
24
|
function getMatchingApprovalStatusEntities(entities, approvalStatus_status) {
|
|
@@ -108,38 +102,6 @@ class EntityApprovalStatus extends _BaseEntity.default {
|
|
|
108
102
|
this.that.autoApproved = x;
|
|
109
103
|
}
|
|
110
104
|
|
|
111
|
-
get createdBy() {
|
|
112
|
-
return this.that.createdBy;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
set createdBy(x) {
|
|
116
|
-
this.that.createdBy = x;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
get lastModifiedBy() {
|
|
120
|
-
return this.that.lastModifiedBy;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
set lastModifiedBy(x) {
|
|
124
|
-
this.that.lastModifiedBy = x;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
get createdByUUID() {
|
|
128
|
-
return this.that.createdByUUID;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
set createdByUUID(x) {
|
|
132
|
-
this.that.createdByUUID = x;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
get lastModifiedByUUID() {
|
|
136
|
-
return this.that.lastModifiedByUUID;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
set lastModifiedByUUID(x) {
|
|
140
|
-
this.that.lastModifiedByUUID = x;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
105
|
get toResource() {
|
|
144
106
|
const resource = _lodash.default.pick(this, ["uuid", "entityType", "approvalStatusComment", "autoApproved", "voided"]);
|
|
145
107
|
|
|
@@ -155,7 +117,6 @@ class EntityApprovalStatus extends _BaseEntity.default {
|
|
|
155
117
|
|
|
156
118
|
entityApprovalStatus.approvalStatus = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "approvalStatusUUID"), _ApprovalStatus.default.schema.name);
|
|
157
119
|
entityApprovalStatus.entityUUID = _ResourceUtil.default.getUUIDFor(resource, "entityUUID");
|
|
158
|
-
(0, _AuditUtil.mapAuditFields)(entityApprovalStatus, resource);
|
|
159
120
|
return entityApprovalStatus;
|
|
160
121
|
}
|
|
161
122
|
|
|
@@ -212,7 +173,7 @@ class EntityApprovalStatus extends _BaseEntity.default {
|
|
|
212
173
|
_defineProperty(EntityApprovalStatus, "schema", {
|
|
213
174
|
name: _SchemaNames.default.EntityApprovalStatus,
|
|
214
175
|
primaryKey: "uuid",
|
|
215
|
-
properties:
|
|
176
|
+
properties: {
|
|
216
177
|
uuid: "string",
|
|
217
178
|
entityUUID: "string",
|
|
218
179
|
approvalStatus: "ApprovalStatus",
|
|
@@ -234,7 +195,7 @@ _defineProperty(EntityApprovalStatus, "schema", {
|
|
|
234
195
|
type: "bool",
|
|
235
196
|
default: false
|
|
236
197
|
}
|
|
237
|
-
}
|
|
198
|
+
}
|
|
238
199
|
});
|
|
239
200
|
|
|
240
201
|
_defineProperty(EntityApprovalStatus, "entityType", {
|