openchs-models 1.31.16 → 1.31.19
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/dist/AbstractEncounter.js +53 -0
- package/dist/Checklist.js +41 -2
- package/dist/ChecklistItem.js +42 -4
- package/dist/Comment.js +41 -2
- package/dist/Encounter.js +18 -4
- package/dist/EntityApprovalStatus.js +41 -2
- package/dist/GroupSubject.js +41 -2
- package/dist/IdentifierAssignment.js +41 -2
- package/dist/Individual.js +42 -4
- package/dist/ProgramEncounter.js +18 -4
- package/dist/ProgramEnrolment.js +42 -4
- package/dist/SubjectMigration.js +41 -2
- package/dist/UserInfo.js +13 -0
- package/dist/assignment/UserSubjectAssignment.js +41 -2
- package/dist/program/SubjectProgramEligibility.js +41 -2
- package/dist/relationship/IndividualRelationship.js +41 -6
- package/dist/task/Task.js +41 -2
- 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/.circleci/config.yml
CHANGED
|
@@ -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/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: {
|
|
@@ -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));
|
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/Encounter.js
CHANGED
|
@@ -27,8 +27,14 @@ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
|
27
27
|
|
|
28
28
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
29
29
|
|
|
30
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
31
|
+
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
33
|
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
32
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; }
|
|
33
39
|
|
|
34
40
|
class Encounter extends _AbstractEncounter.default {
|
|
@@ -118,7 +124,7 @@ class Encounter extends _AbstractEncounter.default {
|
|
|
118
124
|
_defineProperty(Encounter, "schema", {
|
|
119
125
|
name: _SchemaNames.default.Encounter,
|
|
120
126
|
primaryKey: "uuid",
|
|
121
|
-
properties: {
|
|
127
|
+
properties: _objectSpread({
|
|
122
128
|
uuid: "string",
|
|
123
129
|
encounterType: "EncounterType",
|
|
124
130
|
encounterDateTime: {
|
|
@@ -169,9 +175,17 @@ _defineProperty(Encounter, "schema", {
|
|
|
169
175
|
latestEntityApprovalStatus: {
|
|
170
176
|
type: "EntityApprovalStatus",
|
|
171
177
|
optional: true
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
}
|
|
179
|
+
}, _AuditUtil.AuditFields, {
|
|
180
|
+
filledBy: {
|
|
181
|
+
type: "string",
|
|
182
|
+
optional: true
|
|
183
|
+
},
|
|
184
|
+
filledByUUID: {
|
|
185
|
+
type: "string",
|
|
186
|
+
optional: true
|
|
187
|
+
}
|
|
188
|
+
})
|
|
175
189
|
});
|
|
176
190
|
|
|
177
191
|
_defineProperty(Encounter, "validationKeys", {
|
|
@@ -17,8 +17,14 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
17
17
|
|
|
18
18
|
var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
19
19
|
|
|
20
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
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
|
+
|
|
22
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; }
|
|
23
29
|
|
|
24
30
|
function getMatchingApprovalStatusEntities(entities, approvalStatus_status) {
|
|
@@ -102,6 +108,38 @@ class EntityApprovalStatus extends _BaseEntity.default {
|
|
|
102
108
|
this.that.autoApproved = x;
|
|
103
109
|
}
|
|
104
110
|
|
|
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
|
+
|
|
105
143
|
get toResource() {
|
|
106
144
|
const resource = _lodash.default.pick(this, ["uuid", "entityType", "approvalStatusComment", "autoApproved", "voided"]);
|
|
107
145
|
|
|
@@ -117,6 +155,7 @@ class EntityApprovalStatus extends _BaseEntity.default {
|
|
|
117
155
|
|
|
118
156
|
entityApprovalStatus.approvalStatus = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "approvalStatusUUID"), _ApprovalStatus.default.schema.name);
|
|
119
157
|
entityApprovalStatus.entityUUID = _ResourceUtil.default.getUUIDFor(resource, "entityUUID");
|
|
158
|
+
(0, _AuditUtil.mapAuditFields)(entityApprovalStatus, resource);
|
|
120
159
|
return entityApprovalStatus;
|
|
121
160
|
}
|
|
122
161
|
|
|
@@ -173,7 +212,7 @@ class EntityApprovalStatus extends _BaseEntity.default {
|
|
|
173
212
|
_defineProperty(EntityApprovalStatus, "schema", {
|
|
174
213
|
name: _SchemaNames.default.EntityApprovalStatus,
|
|
175
214
|
primaryKey: "uuid",
|
|
176
|
-
properties: {
|
|
215
|
+
properties: _objectSpread({
|
|
177
216
|
uuid: "string",
|
|
178
217
|
entityUUID: "string",
|
|
179
218
|
approvalStatus: "ApprovalStatus",
|
|
@@ -195,7 +234,7 @@ _defineProperty(EntityApprovalStatus, "schema", {
|
|
|
195
234
|
type: "bool",
|
|
196
235
|
default: false
|
|
197
236
|
}
|
|
198
|
-
}
|
|
237
|
+
}, _AuditUtil.AuditFields)
|
|
199
238
|
});
|
|
200
239
|
|
|
201
240
|
_defineProperty(EntityApprovalStatus, "entityType", {
|
package/dist/GroupSubject.js
CHANGED
|
@@ -17,8 +17,14 @@ var _General = _interopRequireDefault(require("./utility/General"));
|
|
|
17
17
|
|
|
18
18
|
var _GroupRole = _interopRequireDefault(require("./GroupRole"));
|
|
19
19
|
|
|
20
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
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
|
+
|
|
22
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; }
|
|
23
29
|
|
|
24
30
|
class GroupSubject extends _BaseEntity.default {
|
|
@@ -66,6 +72,38 @@ class GroupSubject extends _BaseEntity.default {
|
|
|
66
72
|
this.that.membershipEndDate = x;
|
|
67
73
|
}
|
|
68
74
|
|
|
75
|
+
get createdBy() {
|
|
76
|
+
return this.that.createdBy;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
set createdBy(x) {
|
|
80
|
+
this.that.createdBy = x;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get lastModifiedBy() {
|
|
84
|
+
return this.that.lastModifiedBy;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
set lastModifiedBy(x) {
|
|
88
|
+
this.that.lastModifiedBy = x;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get createdByUUID() {
|
|
92
|
+
return this.that.createdByUUID;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
set createdByUUID(x) {
|
|
96
|
+
this.that.createdByUUID = x;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get lastModifiedByUUID() {
|
|
100
|
+
return this.that.lastModifiedByUUID;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
set lastModifiedByUUID(x) {
|
|
104
|
+
this.that.lastModifiedByUUID = x;
|
|
105
|
+
}
|
|
106
|
+
|
|
69
107
|
get toResource() {
|
|
70
108
|
const resource = _lodash.default.pick(this, ["uuid"]);
|
|
71
109
|
|
|
@@ -122,6 +160,7 @@ class GroupSubject extends _BaseEntity.default {
|
|
|
122
160
|
groupSubjectEntity.groupSubject = groupOrHouseholdSubject;
|
|
123
161
|
groupSubjectEntity.memberSubject = memberSubject;
|
|
124
162
|
groupSubjectEntity.groupRole = groupRole;
|
|
163
|
+
(0, _AuditUtil.mapAuditFields)(groupSubjectEntity, resource);
|
|
125
164
|
return groupSubjectEntity;
|
|
126
165
|
}
|
|
127
166
|
|
|
@@ -190,7 +229,7 @@ _defineProperty(GroupSubject, "EXPLICIT_ERROR_CODE_KEY_FOR_MISSING_MEMBER", 'Gro
|
|
|
190
229
|
_defineProperty(GroupSubject, "schema", {
|
|
191
230
|
name: "GroupSubject",
|
|
192
231
|
primaryKey: "uuid",
|
|
193
|
-
properties: {
|
|
232
|
+
properties: _objectSpread({
|
|
194
233
|
uuid: "string",
|
|
195
234
|
groupSubject: "Individual",
|
|
196
235
|
memberSubject: "Individual",
|
|
@@ -204,7 +243,7 @@ _defineProperty(GroupSubject, "schema", {
|
|
|
204
243
|
type: "bool",
|
|
205
244
|
default: false
|
|
206
245
|
}
|
|
207
|
-
}
|
|
246
|
+
}, _AuditUtil.AuditFields)
|
|
208
247
|
});
|
|
209
248
|
|
|
210
249
|
var _default = GroupSubject;
|
|
@@ -19,8 +19,14 @@ var _IdentifierSource = _interopRequireDefault(require("./IdentifierSource"));
|
|
|
19
19
|
|
|
20
20
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
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 IdentifierAssignment extends _BaseEntity.default {
|
|
@@ -76,12 +82,45 @@ class IdentifierAssignment extends _BaseEntity.default {
|
|
|
76
82
|
this.that.used = x;
|
|
77
83
|
}
|
|
78
84
|
|
|
85
|
+
get createdBy() {
|
|
86
|
+
return this.that.createdBy;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
set createdBy(x) {
|
|
90
|
+
this.that.createdBy = x;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get lastModifiedBy() {
|
|
94
|
+
return this.that.lastModifiedBy;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
set lastModifiedBy(x) {
|
|
98
|
+
this.that.lastModifiedBy = x;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get createdByUUID() {
|
|
102
|
+
return this.that.createdByUUID;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
set createdByUUID(x) {
|
|
106
|
+
this.that.createdByUUID = x;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get lastModifiedByUUID() {
|
|
110
|
+
return this.that.lastModifiedByUUID;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
set lastModifiedByUUID(x) {
|
|
114
|
+
this.that.lastModifiedByUUID = x;
|
|
115
|
+
}
|
|
116
|
+
|
|
79
117
|
static fromResource(identifierAssignmentResource, entityService) {
|
|
80
118
|
const identifierAssignment = _General.default.assignFields(identifierAssignmentResource, new IdentifierAssignment(), ["uuid", "identifier", "assignmentOrder", "voided"]);
|
|
81
119
|
|
|
82
120
|
identifierAssignment.identifierSource = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(identifierAssignmentResource, "identifierSourceUUID"), _IdentifierSource.default.schema.name);
|
|
83
121
|
identifierAssignment.individual = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(identifierAssignmentResource, "individualUUID"), _Individual.default.schema.name);
|
|
84
122
|
identifierAssignment.programEnrolment = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(identifierAssignmentResource, "programEnrolmentUUID"), _ProgramEnrolment.default.schema.name);
|
|
123
|
+
(0, _AuditUtil.mapAuditFields)(identifierAssignment, identifierAssignmentResource);
|
|
85
124
|
return identifierAssignment;
|
|
86
125
|
}
|
|
87
126
|
|
|
@@ -112,7 +151,7 @@ exports.default = IdentifierAssignment;
|
|
|
112
151
|
_defineProperty(IdentifierAssignment, "schema", {
|
|
113
152
|
name: "IdentifierAssignment",
|
|
114
153
|
primaryKey: "uuid",
|
|
115
|
-
properties: {
|
|
154
|
+
properties: _objectSpread({
|
|
116
155
|
uuid: "string",
|
|
117
156
|
identifierSource: "IdentifierSource",
|
|
118
157
|
identifier: "string",
|
|
@@ -134,5 +173,5 @@ _defineProperty(IdentifierAssignment, "schema", {
|
|
|
134
173
|
default: false,
|
|
135
174
|
optional: false
|
|
136
175
|
}
|
|
137
|
-
}
|
|
176
|
+
}, _AuditUtil.AuditFields)
|
|
138
177
|
});
|
package/dist/Individual.js
CHANGED
|
@@ -53,8 +53,14 @@ var _MergeUtil = _interopRequireDefault(require("./utility/MergeUtil"));
|
|
|
53
53
|
|
|
54
54
|
var _AgeUtil = _interopRequireDefault(require("./utility/AgeUtil"));
|
|
55
55
|
|
|
56
|
+
var _AuditUtil = require("./utility/AuditUtil");
|
|
57
|
+
|
|
56
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
57
59
|
|
|
60
|
+
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; }
|
|
61
|
+
|
|
62
|
+
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; }
|
|
63
|
+
|
|
58
64
|
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; }
|
|
59
65
|
|
|
60
66
|
const mergeMap = new Map([[_SchemaNames.default.ProgramEnrolment, "enrolments"], [_SchemaNames.default.Encounter, "encounters"], [_SchemaNames.default.IndividualRelationship, "relationships"], [_SchemaNames.default.EntityApprovalStatus, "approvalStatuses"], [_SchemaNames.default.Comment, "comments"]]);
|
|
@@ -228,6 +234,38 @@ class Individual extends _BaseEntity.default {
|
|
|
228
234
|
this.that.approvalStatuses = this.fromEntityList(x);
|
|
229
235
|
}
|
|
230
236
|
|
|
237
|
+
get createdBy() {
|
|
238
|
+
return this.that.createdBy;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
set createdBy(x) {
|
|
242
|
+
this.that.createdBy = x;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
get lastModifiedBy() {
|
|
246
|
+
return this.that.lastModifiedBy;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
set lastModifiedBy(x) {
|
|
250
|
+
this.that.lastModifiedBy = x;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
get createdByUUID() {
|
|
254
|
+
return this.that.createdByUUID;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
set createdByUUID(x) {
|
|
258
|
+
this.that.createdByUUID = x;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
get lastModifiedByUUID() {
|
|
262
|
+
return this.that.lastModifiedByUUID;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
set lastModifiedByUUID(x) {
|
|
266
|
+
this.that.lastModifiedByUUID = x;
|
|
267
|
+
}
|
|
268
|
+
|
|
231
269
|
static createEmptyInstance() {
|
|
232
270
|
const individual = new Individual();
|
|
233
271
|
individual.uuid = _General.default.randomUUID();
|
|
@@ -318,6 +356,7 @@ class Individual extends _BaseEntity.default {
|
|
|
318
356
|
individual.name = individual.nameString;
|
|
319
357
|
if (!_lodash.default.isNil(individualResource.registrationLocation)) individual.registrationLocation = _Point.default.fromResource(individualResource.registrationLocation);
|
|
320
358
|
individual.subjectType = subjectType;
|
|
359
|
+
(0, _AuditUtil.mapAuditFields)(individual, individualResource);
|
|
321
360
|
return individual;
|
|
322
361
|
}
|
|
323
362
|
|
|
@@ -1020,7 +1059,7 @@ class Individual extends _BaseEntity.default {
|
|
|
1020
1059
|
_defineProperty(Individual, "schema", {
|
|
1021
1060
|
name: _SchemaNames.default.Individual,
|
|
1022
1061
|
primaryKey: "uuid",
|
|
1023
|
-
properties: {
|
|
1062
|
+
properties: _objectSpread({
|
|
1024
1063
|
uuid: "string",
|
|
1025
1064
|
subjectType: "SubjectType",
|
|
1026
1065
|
name: "string",
|
|
@@ -1094,9 +1133,8 @@ _defineProperty(Individual, "schema", {
|
|
|
1094
1133
|
latestEntityApprovalStatus: {
|
|
1095
1134
|
type: "EntityApprovalStatus",
|
|
1096
1135
|
optional: true
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
}
|
|
1136
|
+
}
|
|
1137
|
+
}, _AuditUtil.AuditFields)
|
|
1100
1138
|
});
|
|
1101
1139
|
|
|
1102
1140
|
_defineProperty(Individual, "validationKeys", {
|