openchs-models 1.31.35 → 1.31.37
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 +1 -0
- package/.editorconfig +1 -1
- package/Makefile +4 -0
- package/dist/AbstractEncounter.js +53 -0
- package/dist/AddressLevel.js +1 -1
- package/dist/Checklist.js +41 -2
- package/dist/ChecklistItem.js +43 -5
- package/dist/ChecklistItemDetail.js +1 -1
- package/dist/ChecklistItemStatus.js +3 -2
- package/dist/Comment.js +41 -2
- package/dist/Concept.js +9 -13
- package/dist/DashboardCache.js +21 -37
- package/dist/Encounter.js +22 -10
- package/dist/EntityApprovalStatus.js +41 -2
- package/dist/EntityMetaData.js +5 -1
- package/dist/Family.js +2 -2
- package/dist/GroupSubject.js +41 -2
- package/dist/IdentifierAssignment.js +41 -2
- package/dist/Individual.js +44 -6
- package/dist/Observation.js +8 -3
- package/dist/ObservationsHolder.js +42 -76
- package/dist/ProgramEncounter.js +22 -8
- package/dist/ProgramEnrolment.js +46 -8
- package/dist/ReportCard.js +63 -6
- package/dist/Schema.js +173 -6
- package/dist/SchemaNames.js +12 -4
- package/dist/SubjectMigration.js +41 -2
- package/dist/SubjectType.js +5 -3
- package/dist/UserInfo.js +13 -0
- package/dist/application/DashboardCacheFilter.js +80 -0
- package/dist/application/FormElement.js +4 -6
- package/dist/application/Format.js +1 -0
- package/dist/application/KeyValue.js +2 -1
- package/dist/application/StringKeyNumericValue.js +1 -0
- package/dist/assignment/UserSubjectAssignment.js +41 -2
- package/dist/draft/DraftEncounter.js +6 -6
- package/dist/draft/DraftSubject.js +2 -2
- package/dist/framework/RealmProxy.js +9 -1
- package/dist/framework/RealmResultsProxy.js +8 -0
- package/dist/geo/Point.js +2 -1
- package/dist/index.js +8 -16
- package/dist/program/SubjectProgramEligibility.js +42 -3
- package/dist/relationship/IndividualRelationship.js +42 -7
- package/dist/service/MetaDataService.js +80 -5
- package/dist/task/Task.js +43 -4
- package/dist/task/TaskUnAssignment.js +41 -2
- package/dist/utility/AuditUtil.js +39 -0
- package/dist/utility/ResourceUtil.js +4 -0
- package/package.json +1 -1
- package/dist/VisitScheduleConfig.js +0 -73
- package/dist/VisitScheduleInterval.js +0 -71
package/.circleci/config.yml
CHANGED
package/.editorconfig
CHANGED
package/Makefile
CHANGED
|
@@ -28,8 +28,12 @@ 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
|
+
|
|
31
34
|
deploy-to-avni-client: build deploy-to-avni-client-only
|
|
32
35
|
deploy-to-avni-web: build deploy-to-avni-web-only
|
|
36
|
+
deploy-to-avni-rule-server: build deploy-to-avni-rule-server-only
|
|
33
37
|
|
|
34
38
|
deploy-to-avni-project: build
|
|
35
39
|
$(if $(local),$(call _deploy,$(local)/node_modules/openchs-models))
|
|
@@ -33,6 +33,8 @@ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
|
33
33
|
|
|
34
34
|
var _MergeUtil = _interopRequireDefault(require("./utility/MergeUtil"));
|
|
35
35
|
|
|
36
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
37
|
+
|
|
36
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
39
|
|
|
38
40
|
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; }
|
|
@@ -136,6 +138,54 @@ class AbstractEncounter extends _BaseEntity.default {
|
|
|
136
138
|
this.that.approvalStatuses = this.fromEntityList(x);
|
|
137
139
|
}
|
|
138
140
|
|
|
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
|
+
|
|
139
189
|
validate() {
|
|
140
190
|
return _lodash.default.isNil(this.encounterDateTime) ? [new _ValidationResult.default(false, AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME, "emptyValidationMessage")] : [_ValidationResult.default.successful(AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME)];
|
|
141
191
|
}
|
|
@@ -206,6 +256,9 @@ class AbstractEncounter extends _BaseEntity.default {
|
|
|
206
256
|
encounter.name = resource.name;
|
|
207
257
|
if (!_lodash.default.isNil(resource.encounterLocation)) encounter.encounterLocation = _Point.default.fromResource(resource.encounterLocation);
|
|
208
258
|
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");
|
|
209
262
|
return encounter;
|
|
210
263
|
}
|
|
211
264
|
|
package/dist/AddressLevel.js
CHANGED
package/dist/Checklist.js
CHANGED
|
@@ -23,8 +23,14 @@ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
|
23
23
|
|
|
24
24
|
var _EntityApprovalStatus = _interopRequireDefault(require("./EntityApprovalStatus"));
|
|
25
25
|
|
|
26
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
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
|
+
|
|
28
34
|
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
35
|
|
|
30
36
|
class Checklist extends _BaseEntity.default {
|
|
@@ -64,6 +70,38 @@ class Checklist extends _BaseEntity.default {
|
|
|
64
70
|
this.that.programEnrolment = this.fromObject(x);
|
|
65
71
|
}
|
|
66
72
|
|
|
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
|
+
|
|
67
105
|
static create() {
|
|
68
106
|
const checklist = new Checklist();
|
|
69
107
|
checklist.uuid = _General.default.randomUUID();
|
|
@@ -79,6 +117,7 @@ class Checklist extends _BaseEntity.default {
|
|
|
79
117
|
const checklistDetail = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(checklistResource, "checklistDetailUUID"), _ChecklistDetail.default.schema.name);
|
|
80
118
|
checklist.programEnrolment = programEnrolment;
|
|
81
119
|
checklist.detail = checklistDetail;
|
|
120
|
+
(0, _AuditUtil.mapAuditFields)(checklist, checklistResource);
|
|
82
121
|
return checklist;
|
|
83
122
|
}
|
|
84
123
|
|
|
@@ -137,7 +176,7 @@ class Checklist extends _BaseEntity.default {
|
|
|
137
176
|
_defineProperty(Checklist, "schema", {
|
|
138
177
|
name: _SchemaNames.default.Checklist,
|
|
139
178
|
primaryKey: "uuid",
|
|
140
|
-
properties: {
|
|
179
|
+
properties: _objectSpread({
|
|
141
180
|
uuid: "string",
|
|
142
181
|
detail: "ChecklistDetail",
|
|
143
182
|
baseDate: "date",
|
|
@@ -146,7 +185,7 @@ _defineProperty(Checklist, "schema", {
|
|
|
146
185
|
objectType: "ChecklistItem"
|
|
147
186
|
},
|
|
148
187
|
programEnrolment: "ProgramEnrolment"
|
|
149
|
-
}
|
|
188
|
+
}, _AuditUtil.AuditFields)
|
|
150
189
|
});
|
|
151
190
|
|
|
152
191
|
_defineProperty(Checklist, "merge", () => _BaseEntity.default.mergeOn("items"));
|
package/dist/ChecklistItem.js
CHANGED
|
@@ -31,8 +31,14 @@ var _Observation = _interopRequireDefault(require("./Observation"));
|
|
|
31
31
|
|
|
32
32
|
var _MergeUtil = _interopRequireDefault(require("./utility/MergeUtil"));
|
|
33
33
|
|
|
34
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
35
|
+
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
37
|
|
|
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
|
+
|
|
36
42
|
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
43
|
|
|
38
44
|
const mergeMap = new Map([[_SchemaNames.default.EntityApprovalStatus, "approvalStatuses"]]);
|
|
@@ -78,6 +84,38 @@ class ChecklistItem extends _BaseEntity.default {
|
|
|
78
84
|
return _lodash.default.maxBy(this.approvalStatuses, 'statusDateTime');
|
|
79
85
|
}
|
|
80
86
|
|
|
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
|
+
|
|
81
119
|
static create({
|
|
82
120
|
uuid = _General.default.randomUUID(),
|
|
83
121
|
observations = [],
|
|
@@ -100,6 +138,7 @@ class ChecklistItem extends _BaseEntity.default {
|
|
|
100
138
|
|
|
101
139
|
checklistItem.checklist = checklist;
|
|
102
140
|
checklistItem.detail = checklistItemDetail;
|
|
141
|
+
(0, _AuditUtil.mapAuditFields)(checklistItem, checklistItemResource);
|
|
103
142
|
return checklistItem;
|
|
104
143
|
}
|
|
105
144
|
|
|
@@ -314,7 +353,7 @@ class ChecklistItem extends _BaseEntity.default {
|
|
|
314
353
|
_defineProperty(ChecklistItem, "schema", {
|
|
315
354
|
name: _SchemaNames.default.ChecklistItem,
|
|
316
355
|
primaryKey: "uuid",
|
|
317
|
-
properties: {
|
|
356
|
+
properties: _objectSpread({
|
|
318
357
|
uuid: "string",
|
|
319
358
|
detail: "ChecklistItemDetail",
|
|
320
359
|
completionDate: {
|
|
@@ -323,7 +362,7 @@ _defineProperty(ChecklistItem, "schema", {
|
|
|
323
362
|
},
|
|
324
363
|
observations: {
|
|
325
364
|
type: "list",
|
|
326
|
-
objectType: "
|
|
365
|
+
objectType: "EmbeddedObservation"
|
|
327
366
|
},
|
|
328
367
|
checklist: "Checklist",
|
|
329
368
|
approvalStatuses: {
|
|
@@ -333,9 +372,8 @@ _defineProperty(ChecklistItem, "schema", {
|
|
|
333
372
|
latestEntityApprovalStatus: {
|
|
334
373
|
type: "EntityApprovalStatus",
|
|
335
374
|
optional: true
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
}
|
|
375
|
+
}
|
|
376
|
+
}, _AuditUtil.AuditFields)
|
|
339
377
|
});
|
|
340
378
|
|
|
341
379
|
_defineProperty(ChecklistItem, "merge", childEntityName => _MergeUtil.default.getMergeFunction(childEntityName, mergeMap));
|
|
@@ -126,10 +126,11 @@ class ChecklistItemStatus extends _PersistedObject.default {
|
|
|
126
126
|
|
|
127
127
|
_defineProperty(ChecklistItemStatus, "schema", {
|
|
128
128
|
name: _SchemaNames.default.ChecklistItemStatus,
|
|
129
|
+
embedded: true,
|
|
129
130
|
properties: {
|
|
130
131
|
state: "string",
|
|
131
|
-
from:
|
|
132
|
-
to:
|
|
132
|
+
from: _SchemaNames.default.StringKeyNumericValue,
|
|
133
|
+
to: _SchemaNames.default.StringKeyNumericValue,
|
|
133
134
|
color: {
|
|
134
135
|
type: "string",
|
|
135
136
|
default: "yellow"
|
package/dist/Comment.js
CHANGED
|
@@ -19,8 +19,14 @@ var _CommentThread = _interopRequireDefault(require("./CommentThread"));
|
|
|
19
19
|
|
|
20
20
|
var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
21
21
|
|
|
22
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
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
|
+
|
|
24
30
|
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; }
|
|
25
31
|
|
|
26
32
|
class Comment extends _BaseEntity.default {
|
|
@@ -84,6 +90,38 @@ class Comment extends _BaseEntity.default {
|
|
|
84
90
|
this.that.commentThread = this.fromObject(x);
|
|
85
91
|
}
|
|
86
92
|
|
|
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
|
+
|
|
87
125
|
get toResource() {
|
|
88
126
|
const resource = _lodash.default.pick(this, ["uuid", "text", "voided"]);
|
|
89
127
|
|
|
@@ -98,6 +136,7 @@ class Comment extends _BaseEntity.default {
|
|
|
98
136
|
comment.createdByUsername = resource["createdBy"];
|
|
99
137
|
comment.subject = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "individualUUID"), _Individual.default.schema.name);
|
|
100
138
|
comment.commentThread = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "commentThreadUUID"), _CommentThread.default.schema.name);
|
|
139
|
+
(0, _AuditUtil.mapAuditFields)(comment, resource);
|
|
101
140
|
return comment;
|
|
102
141
|
}
|
|
103
142
|
|
|
@@ -154,7 +193,7 @@ class Comment extends _BaseEntity.default {
|
|
|
154
193
|
_defineProperty(Comment, "schema", {
|
|
155
194
|
name: _SchemaNames.default.Comment,
|
|
156
195
|
primaryKey: "uuid",
|
|
157
|
-
properties: {
|
|
196
|
+
properties: _objectSpread({
|
|
158
197
|
uuid: "string",
|
|
159
198
|
text: "string",
|
|
160
199
|
subject: "Individual",
|
|
@@ -167,7 +206,7 @@ _defineProperty(Comment, "schema", {
|
|
|
167
206
|
type: "bool",
|
|
168
207
|
default: false
|
|
169
208
|
}
|
|
170
|
-
}
|
|
209
|
+
}, _AuditUtil.AuditFields)
|
|
171
210
|
});
|
|
172
211
|
|
|
173
212
|
var _default = Comment;
|
package/dist/Concept.js
CHANGED
|
@@ -127,9 +127,7 @@ 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
|
|
131
130
|
|
|
132
|
-
entityService && entityService.deleteObjects(conceptResource["uuid"], Concept.schema.name, "keyValues");
|
|
133
131
|
concept.keyValues = _lodash.default.map(conceptResource.keyValues, _KeyValue.default.fromResource);
|
|
134
132
|
return concept;
|
|
135
133
|
}
|
|
@@ -155,20 +153,18 @@ class Concept extends _BaseEntity.default {
|
|
|
155
153
|
concept.name = name;
|
|
156
154
|
concept.datatype = dataType;
|
|
157
155
|
concept.uuid = uuid;
|
|
158
|
-
concept.keyValues = keyValues;
|
|
156
|
+
concept.keyValues = _lodash.default.map(keyValues, _KeyValue.default.fromResource);
|
|
159
157
|
return concept;
|
|
160
158
|
}
|
|
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
|
+
|
|
161
165
|
|
|
162
166
|
cloneForReference() {
|
|
163
|
-
|
|
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;
|
|
167
|
+
return this;
|
|
172
168
|
}
|
|
173
169
|
|
|
174
170
|
_valuePresent(value) {
|
|
@@ -375,7 +371,7 @@ _defineProperty(Concept, "schema", {
|
|
|
375
371
|
},
|
|
376
372
|
keyValues: {
|
|
377
373
|
type: "list",
|
|
378
|
-
objectType:
|
|
374
|
+
objectType: _SchemaNames.default.KeyValue
|
|
379
375
|
},
|
|
380
376
|
voided: {
|
|
381
377
|
type: "bool",
|
package/dist/DashboardCache.js
CHANGED
|
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
-
|
|
10
8
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
11
9
|
|
|
10
|
+
var _DashboardCacheFilter = _interopRequireDefault(require("./application/DashboardCacheFilter"));
|
|
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; }
|
|
@@ -18,14 +20,6 @@ class DashboardCache extends _BaseEntity.default {
|
|
|
18
20
|
super(that);
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
get updatedAt() {
|
|
22
|
-
return this.that.updatedAt;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
set updatedAt(x) {
|
|
26
|
-
this.that.updatedAt = x;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
23
|
get cardJSON() {
|
|
30
24
|
return this.that.cardJSON;
|
|
31
25
|
}
|
|
@@ -42,43 +36,34 @@ class DashboardCache extends _BaseEntity.default {
|
|
|
42
36
|
this.that.filterJSON = x;
|
|
43
37
|
}
|
|
44
38
|
|
|
45
|
-
static
|
|
39
|
+
static createEmptyInstance() {
|
|
46
40
|
const dashboardCache = new DashboardCache();
|
|
47
41
|
dashboardCache.uuid = this.rowUUID;
|
|
48
|
-
dashboardCache.
|
|
49
|
-
dashboardCache.cardJSON =
|
|
50
|
-
dashboardCache.filterJSON = filterJSON;
|
|
42
|
+
dashboardCache.filterJSON = JSON.stringify(_DashboardCacheFilter.default.createEmptyInstance());
|
|
43
|
+
dashboardCache.cardJSON = "{}";
|
|
51
44
|
return dashboardCache;
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
|
|
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;
|
|
47
|
+
getCard() {
|
|
48
|
+
return this.cardJSON && JSON.parse(this.cardJSON) || {};
|
|
70
49
|
}
|
|
71
50
|
|
|
72
|
-
|
|
73
|
-
|
|
51
|
+
getFilter() {
|
|
52
|
+
const filter = this.filterJSON && JSON.parse(this.filterJSON) || {};
|
|
53
|
+
|
|
54
|
+
if (!_lodash.default.isEmpty(filter.filterDate)) {
|
|
55
|
+
filter.filterDate = new Date(filter.filterDate);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return filter;
|
|
74
59
|
}
|
|
75
60
|
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
setFilter(value) {
|
|
62
|
+
this.filterJSON = JSON.stringify(value);
|
|
78
63
|
}
|
|
79
64
|
|
|
80
|
-
|
|
81
|
-
|
|
65
|
+
setCard(value) {
|
|
66
|
+
this.cardJSON = JSON.stringify(value);
|
|
82
67
|
}
|
|
83
68
|
|
|
84
69
|
}
|
|
@@ -90,7 +75,6 @@ _defineProperty(DashboardCache, "schema", {
|
|
|
90
75
|
primaryKey: "uuid",
|
|
91
76
|
properties: {
|
|
92
77
|
uuid: "string",
|
|
93
|
-
updatedAt: "date",
|
|
94
78
|
cardJSON: "string",
|
|
95
79
|
filterJSON: "string"
|
|
96
80
|
}
|
package/dist/Encounter.js
CHANGED
|
@@ -19,16 +19,20 @@ 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
|
-
|
|
24
22
|
var _EntityApprovalStatus = _interopRequireDefault(require("./EntityApprovalStatus"));
|
|
25
23
|
|
|
26
24
|
var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
27
25
|
|
|
28
26
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
29
27
|
|
|
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
|
+
|
|
32
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; }
|
|
33
37
|
|
|
34
38
|
class Encounter extends _AbstractEncounter.default {
|
|
@@ -118,7 +122,7 @@ class Encounter extends _AbstractEncounter.default {
|
|
|
118
122
|
_defineProperty(Encounter, "schema", {
|
|
119
123
|
name: _SchemaNames.default.Encounter,
|
|
120
124
|
primaryKey: "uuid",
|
|
121
|
-
properties: {
|
|
125
|
+
properties: _objectSpread({
|
|
122
126
|
uuid: "string",
|
|
123
127
|
encounterType: "EncounterType",
|
|
124
128
|
encounterDateTime: {
|
|
@@ -128,10 +132,10 @@ _defineProperty(Encounter, "schema", {
|
|
|
128
132
|
individual: _SchemaNames.default.Individual,
|
|
129
133
|
observations: {
|
|
130
134
|
type: "list",
|
|
131
|
-
objectType: "
|
|
135
|
+
objectType: "EmbeddedObservation"
|
|
132
136
|
},
|
|
133
137
|
encounterLocation: {
|
|
134
|
-
type:
|
|
138
|
+
type: _SchemaNames.default.EmbeddedPoint,
|
|
135
139
|
optional: true
|
|
136
140
|
},
|
|
137
141
|
name: {
|
|
@@ -152,10 +156,10 @@ _defineProperty(Encounter, "schema", {
|
|
|
152
156
|
},
|
|
153
157
|
cancelObservations: {
|
|
154
158
|
type: "list",
|
|
155
|
-
objectType: "
|
|
159
|
+
objectType: "EmbeddedObservation"
|
|
156
160
|
},
|
|
157
161
|
cancelLocation: {
|
|
158
|
-
type:
|
|
162
|
+
type: _SchemaNames.default.EmbeddedPoint,
|
|
159
163
|
optional: true
|
|
160
164
|
},
|
|
161
165
|
voided: {
|
|
@@ -169,9 +173,17 @@ _defineProperty(Encounter, "schema", {
|
|
|
169
173
|
latestEntityApprovalStatus: {
|
|
170
174
|
type: "EntityApprovalStatus",
|
|
171
175
|
optional: true
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
}
|
|
177
|
+
}, _AuditUtil.AuditFields, {
|
|
178
|
+
filledBy: {
|
|
179
|
+
type: "string",
|
|
180
|
+
optional: true
|
|
181
|
+
},
|
|
182
|
+
filledByUUID: {
|
|
183
|
+
type: "string",
|
|
184
|
+
optional: true
|
|
185
|
+
}
|
|
186
|
+
})
|
|
175
187
|
});
|
|
176
188
|
|
|
177
189
|
_defineProperty(Encounter, "validationKeys", {
|