openchs-models 1.33.2 → 1.33.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +15 -5
- package/.commit-message.txt +21 -0
- package/.nvmrc +1 -1
- package/Makefile +32 -10
- package/REALM_V12_NOTES.md +46 -0
- package/dist/AbstractEncounter.js +4 -105
- package/dist/AddressLevel.js +5 -62
- package/dist/ApprovalStatus.js +4 -17
- package/dist/BaseEntity.js +5 -42
- package/dist/BeneficiaryModePin.js +4 -13
- package/dist/Checklist.js +6 -52
- package/dist/ChecklistDetail.js +4 -22
- package/dist/ChecklistItem.js +16 -96
- package/dist/ChecklistItemDetail.js +4 -43
- package/dist/ChecklistItemStatus.js +4 -33
- package/dist/Comment.js +6 -51
- package/dist/CommentThread.js +4 -26
- package/dist/CompositeDuration.js +1 -18
- package/dist/Concept.js +5 -107
- package/dist/ConceptAnswer.js +4 -21
- package/dist/CustomDashboardCache.js +4 -38
- package/dist/CustomFilter.js +5 -15
- package/dist/Dashboard.js +4 -23
- package/dist/DashboardCache.js +4 -23
- package/dist/DashboardSection.js +4 -24
- package/dist/DashboardSectionCardMapping.js +4 -21
- package/dist/Displayable.js +3 -11
- package/dist/Documentation.js +4 -21
- package/dist/DocumentationItem.js +4 -20
- package/dist/Duration.js +4 -39
- package/dist/Encounter.js +6 -41
- package/dist/EncounterType.js +4 -26
- package/dist/EntityApprovalStatus.js +6 -56
- package/dist/EntityMetaData.js +7 -105
- package/dist/EntityQueue.js +4 -15
- package/dist/EntityRule.js +1 -29
- package/dist/EntitySyncStatus.js +4 -19
- package/dist/Extension.js +4 -18
- package/dist/Family.js +4 -56
- package/dist/FileFormat.js +0 -7
- package/dist/Gender.js +4 -17
- package/dist/GroupDashboard.js +4 -23
- package/dist/GroupPrivileges.js +4 -28
- package/dist/GroupRole.js +4 -34
- package/dist/GroupSubject.js +6 -59
- package/dist/Groups.js +4 -14
- package/dist/Identifier.js +4 -20
- package/dist/IdentifierAssignment.js +6 -45
- package/dist/IdentifierSource.js +4 -15
- package/dist/Individual.js +17 -265
- package/dist/LocaleMapping.js +4 -13
- package/dist/LocationHierarchy.js +4 -25
- package/dist/Media.js +35 -35
- package/dist/MediaQueue.js +4 -26
- package/dist/MigrationsHelper.js +15 -22
- package/dist/MyGroups.js +4 -14
- package/dist/News.js +4 -31
- package/dist/Observation.js +4 -54
- package/dist/ObservationsHolder.js +104 -216
- package/dist/OrganisationConfig.js +4 -19
- package/dist/PersistedObject.js +1 -19
- package/dist/PhoneNumber.js +0 -11
- package/dist/PlatformTranslation.js +4 -17
- package/dist/Privilege.js +5 -22
- package/dist/Program.js +4 -39
- package/dist/ProgramEncounter.js +6 -48
- package/dist/ProgramEnrolment.js +8 -162
- package/dist/ReferenceEntity.js +1 -10
- package/dist/ReportCard.js +5 -60
- package/dist/ResetSync.js +4 -17
- package/dist/Rule.js +4 -28
- package/dist/RuleDependency.js +4 -17
- package/dist/RuleFailureTelemetry.js +4 -36
- package/dist/Schema.js +16 -268
- package/dist/SchemaNames.js +3 -46
- package/dist/Settings.js +4 -53
- package/dist/StandardReportCardType.js +4 -39
- package/dist/SubjectMigration.js +6 -45
- package/dist/SubjectType.js +6 -72
- package/dist/SyncTelemetry.js +4 -40
- package/dist/Translation.js +4 -17
- package/dist/UserInfo.js +4 -33
- package/dist/application/DashboardCacheFilter.js +4 -24
- package/dist/application/Filter.js +3 -16
- package/dist/application/Form.js +6 -93
- package/dist/application/FormElement.js +5 -100
- package/dist/application/FormElementGroup.js +4 -75
- package/dist/application/FormElementStatus.js +1 -11
- package/dist/application/FormMapping.js +6 -44
- package/dist/application/Format.js +4 -20
- package/dist/application/KeyValue.js +4 -19
- package/dist/application/MenuItem.js +4 -35
- package/dist/application/MultiSelectFilter.js +1 -11
- package/dist/application/NullProgramEnrolment.js +0 -8
- package/dist/application/SingleSelectFilter.js +1 -12
- package/dist/application/StaticFormElementGroup.js +0 -11
- package/dist/application/StringKeyNumericValue.js +4 -17
- package/dist/application/ValidationResult.js +6 -20
- package/dist/application/ValidationResults.js +1 -14
- package/dist/application/WorkItem.js +4 -20
- package/dist/application/WorkList.js +1 -24
- package/dist/application/WorkLists.js +1 -13
- package/dist/assignment/UserSubjectAssignment.js +6 -26
- package/dist/draft/DraftEncounter.js +4 -40
- package/dist/draft/DraftSubject.js +4 -46
- package/dist/error/IgnorableSyncError.js +1 -6
- package/dist/error/SyncError.js +1 -6
- package/dist/framework/ArrayHelper.js +3 -11
- package/dist/framework/DefinedObjectSchema.js +4 -12
- package/dist/framework/RealmCollectionHelper.js +1 -9
- package/dist/framework/RealmListProxy.js +1 -10
- package/dist/framework/RealmObjectSchema.js +1 -11
- package/dist/framework/RealmProxy.js +2 -31
- package/dist/framework/RealmResultsProxy.js +3 -37
- package/dist/framework/RealmResultsProxyHandler.js +2 -5
- package/dist/geo/Point.js +4 -17
- package/dist/index.js +2 -137
- package/dist/location/Locations.js +1 -6
- package/dist/observation/MultipleCodedValues.js +1 -21
- package/dist/observation/PrimitiveValue.js +1 -17
- package/dist/observation/QuestionGroup.js +1 -36
- package/dist/observation/RepeatableQuestionGroup.js +4 -27
- package/dist/observation/SingleCodedValue.js +1 -15
- package/dist/program/SubjectProgramEligibility.js +6 -56
- package/dist/relationship/IndividualRelation.js +6 -18
- package/dist/relationship/IndividualRelationGenderMapping.js +4 -22
- package/dist/relationship/IndividualRelationship.js +6 -51
- package/dist/relationship/IndividualRelationshipType.js +4 -24
- package/dist/relationship/IndividualRelative.js +4 -31
- package/dist/reports/DashboardFilter.js +4 -20
- package/dist/reports/DashboardFilterConfig.js +5 -85
- package/dist/reports/NestedReportCardResult.js +5 -35
- package/dist/reports/Range.js +4 -13
- package/dist/reports/ReportCardResult.js +5 -24
- package/dist/service/MetaDataService.js +1 -30
- package/dist/task/Task.js +6 -62
- package/dist/task/TaskStatus.js +4 -21
- package/dist/task/TaskType.js +4 -23
- package/dist/task/TaskUnAssignment.js +6 -30
- package/dist/utility/AgeUtil.js +1 -15
- package/dist/utility/ArrayUtil.js +1 -6
- package/dist/utility/AuditUtil.js +1 -8
- package/dist/utility/DateTimeUtil.js +1 -8
- package/dist/utility/General.js +4 -71
- package/dist/utility/JsonStringify.js +15 -28
- package/dist/utility/MergeUtil.js +1 -10
- package/dist/utility/ResourceUtil.js +1 -7
- package/dist/videos/Video.js +4 -23
- package/dist/videos/VideoTelemetric.js +6 -37
- package/package.json +6 -3
- package/scripts/validateSchemas.js +40 -0
- package/tsconfig.json +1 -1
- package/yarn.lock +0 -6744
package/dist/GroupSubject.js
CHANGED
|
@@ -4,109 +4,79 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
9
|
-
|
|
10
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
|
-
|
|
12
9
|
var _Individual = _interopRequireDefault(require("./Individual"));
|
|
13
|
-
|
|
14
10
|
var _ResourceUtil = _interopRequireDefault(require("./utility/ResourceUtil"));
|
|
15
|
-
|
|
16
11
|
var _General = _interopRequireDefault(require("./utility/General"));
|
|
17
|
-
|
|
18
12
|
var _GroupRole = _interopRequireDefault(require("./GroupRole"));
|
|
19
|
-
|
|
20
13
|
var _AuditUtil = require("./utility/AuditUtil");
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
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; }
|
|
29
|
-
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
20
|
class GroupSubject extends _BaseEntity.default {
|
|
31
21
|
constructor(that = null) {
|
|
32
22
|
super(that);
|
|
33
23
|
}
|
|
34
|
-
|
|
35
24
|
get groupSubject() {
|
|
36
25
|
return this.toEntity("groupSubject", _Individual.default);
|
|
37
26
|
}
|
|
38
|
-
|
|
39
27
|
set groupSubject(x) {
|
|
40
28
|
this.that.groupSubject = this.fromObject(x);
|
|
41
29
|
}
|
|
42
|
-
|
|
43
30
|
get memberSubject() {
|
|
44
31
|
return this.toEntity("memberSubject", _Individual.default);
|
|
45
32
|
}
|
|
46
|
-
|
|
47
33
|
set memberSubject(x) {
|
|
48
34
|
this.that.memberSubject = this.fromObject(x);
|
|
49
35
|
}
|
|
50
|
-
|
|
51
36
|
get groupRole() {
|
|
52
37
|
return this.toEntity("groupRole", _GroupRole.default);
|
|
53
38
|
}
|
|
54
|
-
|
|
55
39
|
set groupRole(x) {
|
|
56
40
|
this.that.groupRole = this.fromObject(x);
|
|
57
41
|
}
|
|
58
|
-
|
|
59
42
|
get membershipStartDate() {
|
|
60
43
|
return this.that.membershipStartDate;
|
|
61
44
|
}
|
|
62
|
-
|
|
63
45
|
set membershipStartDate(x) {
|
|
64
46
|
this.that.membershipStartDate = x;
|
|
65
47
|
}
|
|
66
|
-
|
|
67
48
|
get membershipEndDate() {
|
|
68
49
|
return this.that.membershipEndDate;
|
|
69
50
|
}
|
|
70
|
-
|
|
71
51
|
set membershipEndDate(x) {
|
|
72
52
|
this.that.membershipEndDate = x;
|
|
73
53
|
}
|
|
74
|
-
|
|
75
54
|
get createdBy() {
|
|
76
55
|
return this.that.createdBy;
|
|
77
56
|
}
|
|
78
|
-
|
|
79
57
|
set createdBy(x) {
|
|
80
58
|
this.that.createdBy = x;
|
|
81
59
|
}
|
|
82
|
-
|
|
83
60
|
get lastModifiedBy() {
|
|
84
61
|
return this.that.lastModifiedBy;
|
|
85
62
|
}
|
|
86
|
-
|
|
87
63
|
set lastModifiedBy(x) {
|
|
88
64
|
this.that.lastModifiedBy = x;
|
|
89
65
|
}
|
|
90
|
-
|
|
91
66
|
get createdByUUID() {
|
|
92
67
|
return this.that.createdByUUID;
|
|
93
68
|
}
|
|
94
|
-
|
|
95
69
|
set createdByUUID(x) {
|
|
96
70
|
this.that.createdByUUID = x;
|
|
97
71
|
}
|
|
98
|
-
|
|
99
72
|
get lastModifiedByUUID() {
|
|
100
73
|
return this.that.lastModifiedByUUID;
|
|
101
74
|
}
|
|
102
|
-
|
|
103
75
|
set lastModifiedByUUID(x) {
|
|
104
76
|
this.that.lastModifiedByUUID = x;
|
|
105
77
|
}
|
|
106
|
-
|
|
107
78
|
get toResource() {
|
|
108
79
|
const resource = _lodash.default.pick(this, ["uuid"]);
|
|
109
|
-
|
|
110
80
|
resource.groupSubjectUUID = this.groupSubject.uuid;
|
|
111
81
|
resource.memberSubjectUUID = this.memberSubject.uuid;
|
|
112
82
|
resource.groupRoleUUID = this.groupRole.uuid;
|
|
@@ -115,7 +85,6 @@ class GroupSubject extends _BaseEntity.default {
|
|
|
115
85
|
resource.voided = this.voided;
|
|
116
86
|
return resource;
|
|
117
87
|
}
|
|
118
|
-
|
|
119
88
|
static createEmptyInstance(uuid) {
|
|
120
89
|
const groupSubjectEntity = new GroupSubject();
|
|
121
90
|
groupSubjectEntity.uuid = uuid || _General.default.randomUUID();
|
|
@@ -124,7 +93,6 @@ class GroupSubject extends _BaseEntity.default {
|
|
|
124
93
|
groupSubjectEntity.groupRole = _GroupRole.default.createEmptyInstance();
|
|
125
94
|
return groupSubjectEntity;
|
|
126
95
|
}
|
|
127
|
-
|
|
128
96
|
static create({
|
|
129
97
|
uuid,
|
|
130
98
|
groupSubject,
|
|
@@ -141,29 +109,22 @@ class GroupSubject extends _BaseEntity.default {
|
|
|
141
109
|
groupSubjectEntity.membershipEndDate = membershipEndDate.value;
|
|
142
110
|
return groupSubjectEntity;
|
|
143
111
|
}
|
|
144
|
-
|
|
145
112
|
static fromResource(resource, entityService) {
|
|
146
113
|
const childResource = resource;
|
|
147
114
|
const childEntityClass = GroupSubject;
|
|
148
115
|
const parentSchema = _Individual.default.schema.name;
|
|
149
116
|
const groupSubjectParentIdField = "groupSubjectUUID";
|
|
150
117
|
const memberSubjectParentIdField = "memberSubjectUUID";
|
|
151
|
-
|
|
152
118
|
const groupOrHouseholdSubject = _BaseEntity.default.getParentEntity(entityService, childEntityClass, childResource, groupSubjectParentIdField, parentSchema);
|
|
153
|
-
|
|
154
119
|
const memberSubject = _BaseEntity.default.getParentEntity(entityService, childEntityClass, childResource, memberSubjectParentIdField, parentSchema, true, GroupSubject.EXPLICIT_ERROR_CODE_KEY_FOR_MISSING_MEMBER);
|
|
155
|
-
|
|
156
120
|
const groupRole = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "groupRoleUUID"), _GroupRole.default.schema.name);
|
|
157
|
-
|
|
158
121
|
const groupSubjectEntity = _General.default.assignFields(resource, new GroupSubject(), ["uuid", "voided"], ["membershipStartDate", "membershipEndDate"]);
|
|
159
|
-
|
|
160
122
|
groupSubjectEntity.groupSubject = groupOrHouseholdSubject;
|
|
161
123
|
groupSubjectEntity.memberSubject = memberSubject;
|
|
162
124
|
groupSubjectEntity.groupRole = groupRole;
|
|
163
125
|
(0, _AuditUtil.mapAuditFields)(groupSubjectEntity, resource);
|
|
164
126
|
return groupSubjectEntity;
|
|
165
127
|
}
|
|
166
|
-
|
|
167
128
|
cloneForEdit() {
|
|
168
129
|
const groupSubjectEntity = new GroupSubject();
|
|
169
130
|
groupSubjectEntity.uuid = this.uuid;
|
|
@@ -175,7 +136,6 @@ class GroupSubject extends _BaseEntity.default {
|
|
|
175
136
|
groupSubjectEntity.voided = this.voided;
|
|
176
137
|
return groupSubjectEntity;
|
|
177
138
|
}
|
|
178
|
-
|
|
179
139
|
toJSON() {
|
|
180
140
|
return {
|
|
181
141
|
uuid: this.uuid,
|
|
@@ -187,45 +147,33 @@ class GroupSubject extends _BaseEntity.default {
|
|
|
187
147
|
voided: this.voided
|
|
188
148
|
};
|
|
189
149
|
}
|
|
190
|
-
|
|
191
150
|
getRelationshipWithHeadOfHousehold(relatives) {
|
|
192
151
|
if (this.groupRole.isHeadOfHousehold) {
|
|
193
152
|
return "headOfHousehold";
|
|
194
153
|
}
|
|
195
|
-
|
|
196
154
|
const headOfHouseholdGroupSubject = this.groupSubject.getHeadOfHouseholdGroupSubject();
|
|
197
|
-
|
|
198
155
|
if (_lodash.default.isEmpty(headOfHouseholdGroupSubject)) {
|
|
199
156
|
return "unavailable";
|
|
200
157
|
}
|
|
201
|
-
|
|
202
158
|
const subjectRelatives = relatives.filter(({
|
|
203
159
|
relative
|
|
204
160
|
}) => relative.uuid === this.memberSubject.uuid);
|
|
205
|
-
|
|
206
161
|
if (subjectRelatives.length === 0) {
|
|
207
162
|
return "unavailable";
|
|
208
163
|
}
|
|
209
|
-
|
|
210
164
|
return subjectRelatives[0].relation.name;
|
|
211
165
|
}
|
|
212
|
-
|
|
213
166
|
getRole() {
|
|
214
167
|
return this.groupRole.role;
|
|
215
168
|
}
|
|
216
|
-
|
|
217
169
|
getRoleDescription(relatives) {
|
|
218
170
|
if (this.groupSubject.isHousehold()) {
|
|
219
171
|
return this.getRelationshipWithHeadOfHousehold(relatives);
|
|
220
172
|
}
|
|
221
|
-
|
|
222
173
|
return this.getRole();
|
|
223
174
|
}
|
|
224
|
-
|
|
225
175
|
}
|
|
226
|
-
|
|
227
176
|
_defineProperty(GroupSubject, "EXPLICIT_ERROR_CODE_KEY_FOR_MISSING_MEMBER", 'GroupSubjectMapping-MemberSubject-Association');
|
|
228
|
-
|
|
229
177
|
_defineProperty(GroupSubject, "schema", {
|
|
230
178
|
name: "GroupSubject",
|
|
231
179
|
primaryKey: "uuid",
|
|
@@ -254,6 +202,5 @@ _defineProperty(GroupSubject, "schema", {
|
|
|
254
202
|
}
|
|
255
203
|
}, _AuditUtil.AuditFields)
|
|
256
204
|
});
|
|
257
|
-
|
|
258
205
|
var _default = GroupSubject;
|
|
259
206
|
exports.default = _default;
|
package/dist/Groups.js
CHANGED
|
@@ -4,34 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
12
|
class Groups extends _BaseEntity.default {
|
|
15
13
|
constructor(that = null) {
|
|
16
14
|
super(that);
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
get name() {
|
|
20
17
|
return this.that.name;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
set name(x) {
|
|
24
20
|
this.that.name = x;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
get hasAllPrivileges() {
|
|
28
23
|
return this.that.hasAllPrivileges;
|
|
29
24
|
}
|
|
30
|
-
|
|
31
25
|
set hasAllPrivileges(x) {
|
|
32
26
|
this.that.hasAllPrivileges = x;
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
static fromResource(resource) {
|
|
36
29
|
let groups = new Groups();
|
|
37
30
|
groups.uuid = resource.uuid;
|
|
@@ -39,9 +32,7 @@ class Groups extends _BaseEntity.default {
|
|
|
39
32
|
groups.hasAllPrivileges = resource.hasAllPrivileges;
|
|
40
33
|
return groups;
|
|
41
34
|
}
|
|
42
|
-
|
|
43
35
|
}
|
|
44
|
-
|
|
45
36
|
_defineProperty(Groups, "schema", {
|
|
46
37
|
name: "Groups",
|
|
47
38
|
primaryKey: "uuid",
|
|
@@ -54,6 +45,5 @@ _defineProperty(Groups, "schema", {
|
|
|
54
45
|
}
|
|
55
46
|
}
|
|
56
47
|
});
|
|
57
|
-
|
|
58
48
|
var _default = Groups;
|
|
59
49
|
exports.default = _default;
|
package/dist/Identifier.js
CHANGED
|
@@ -4,64 +4,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
-
|
|
10
8
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
11
|
-
|
|
12
9
|
var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
14
|
class Identifier extends _BaseEntity.default {
|
|
19
15
|
get value() {
|
|
20
16
|
return this.that.value;
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
set value(x) {
|
|
24
19
|
this.that.value = x;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
constructor(that = null) {
|
|
28
22
|
super(that);
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
static fromObs(obs) {
|
|
32
25
|
const identifier = new Identifier();
|
|
33
|
-
|
|
34
26
|
if (_lodash.default.isObject(obs)) {
|
|
35
27
|
identifier.value = obs.value;
|
|
36
28
|
identifier.uuid = obs.uuid;
|
|
37
29
|
} else {
|
|
38
30
|
identifier.value = obs;
|
|
39
31
|
}
|
|
40
|
-
|
|
41
32
|
return identifier;
|
|
42
33
|
}
|
|
43
|
-
|
|
44
34
|
toString() {
|
|
45
35
|
return this.value;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
37
|
cloneForEdit() {
|
|
49
38
|
const clone = new Identifier();
|
|
50
39
|
clone.uuid = this.uuid;
|
|
51
40
|
clone.value = this.value;
|
|
52
41
|
return clone;
|
|
53
42
|
}
|
|
54
|
-
|
|
55
43
|
getValue() {
|
|
56
44
|
return this.value;
|
|
57
45
|
}
|
|
58
|
-
|
|
59
46
|
get toResource() {
|
|
60
47
|
return this.value;
|
|
61
48
|
}
|
|
62
|
-
|
|
63
49
|
}
|
|
64
|
-
|
|
65
50
|
_defineProperty(Identifier, "schema", {
|
|
66
51
|
name: _SchemaNames.default.Identifier,
|
|
67
52
|
primaryKey: "uuid",
|
|
@@ -70,6 +55,5 @@ _defineProperty(Identifier, "schema", {
|
|
|
70
55
|
value: "string"
|
|
71
56
|
}
|
|
72
57
|
});
|
|
73
|
-
|
|
74
58
|
var _default = Identifier;
|
|
75
59
|
exports.default = _default;
|
|
@@ -4,134 +4,98 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _ResourceUtil = _interopRequireDefault(require("./utility/ResourceUtil"));
|
|
9
|
-
|
|
10
8
|
var _General = _interopRequireDefault(require("./utility/General"));
|
|
11
|
-
|
|
12
9
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
13
|
-
|
|
14
10
|
var _Individual = _interopRequireDefault(require("./Individual"));
|
|
15
|
-
|
|
16
11
|
var _ProgramEnrolment = _interopRequireDefault(require("./ProgramEnrolment"));
|
|
17
|
-
|
|
18
12
|
var _IdentifierSource = _interopRequireDefault(require("./IdentifierSource"));
|
|
19
|
-
|
|
20
13
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
21
|
-
|
|
22
14
|
var _AuditUtil = require("./utility/AuditUtil");
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
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; }
|
|
31
|
-
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
32
21
|
class IdentifierAssignment extends _BaseEntity.default {
|
|
33
22
|
constructor(that = null) {
|
|
34
23
|
super(that);
|
|
35
24
|
}
|
|
36
|
-
|
|
37
25
|
get identifierSource() {
|
|
38
26
|
return this.toEntity("identifierSource", _IdentifierSource.default);
|
|
39
27
|
}
|
|
40
|
-
|
|
41
28
|
set identifierSource(x) {
|
|
42
29
|
this.that.identifierSource = this.fromObject(x);
|
|
43
30
|
}
|
|
44
|
-
|
|
45
31
|
get identifier() {
|
|
46
32
|
return this.that.identifier;
|
|
47
33
|
}
|
|
48
|
-
|
|
49
34
|
set identifier(x) {
|
|
50
35
|
this.that.identifier = x;
|
|
51
36
|
}
|
|
52
|
-
|
|
53
37
|
get assignmentOrder() {
|
|
54
38
|
return this.that.assignmentOrder;
|
|
55
39
|
}
|
|
56
|
-
|
|
57
40
|
set assignmentOrder(x) {
|
|
58
41
|
this.that.assignmentOrder = x;
|
|
59
42
|
}
|
|
60
|
-
|
|
61
43
|
get individual() {
|
|
62
44
|
return this.toEntity("individual", _Individual.default);
|
|
63
45
|
}
|
|
64
|
-
|
|
65
46
|
set individual(x) {
|
|
66
47
|
this.that.individual = this.fromObject(x);
|
|
67
48
|
}
|
|
68
|
-
|
|
69
49
|
get programEnrolment() {
|
|
70
50
|
return this.toEntity("programEnrolment", _ProgramEnrolment.default);
|
|
71
51
|
}
|
|
72
|
-
|
|
73
52
|
set programEnrolment(x) {
|
|
74
53
|
this.that.programEnrolment = this.fromObject(x);
|
|
75
54
|
}
|
|
76
|
-
|
|
77
55
|
get used() {
|
|
78
56
|
return this.that.used;
|
|
79
57
|
}
|
|
80
|
-
|
|
81
58
|
set used(x) {
|
|
82
59
|
this.that.used = x;
|
|
83
60
|
}
|
|
84
|
-
|
|
85
61
|
get createdBy() {
|
|
86
62
|
return this.that.createdBy;
|
|
87
63
|
}
|
|
88
|
-
|
|
89
64
|
set createdBy(x) {
|
|
90
65
|
this.that.createdBy = x;
|
|
91
66
|
}
|
|
92
|
-
|
|
93
67
|
get lastModifiedBy() {
|
|
94
68
|
return this.that.lastModifiedBy;
|
|
95
69
|
}
|
|
96
|
-
|
|
97
70
|
set lastModifiedBy(x) {
|
|
98
71
|
this.that.lastModifiedBy = x;
|
|
99
72
|
}
|
|
100
|
-
|
|
101
73
|
get createdByUUID() {
|
|
102
74
|
return this.that.createdByUUID;
|
|
103
75
|
}
|
|
104
|
-
|
|
105
76
|
set createdByUUID(x) {
|
|
106
77
|
this.that.createdByUUID = x;
|
|
107
78
|
}
|
|
108
|
-
|
|
109
79
|
get lastModifiedByUUID() {
|
|
110
80
|
return this.that.lastModifiedByUUID;
|
|
111
81
|
}
|
|
112
|
-
|
|
113
82
|
set lastModifiedByUUID(x) {
|
|
114
83
|
this.that.lastModifiedByUUID = x;
|
|
115
84
|
}
|
|
116
|
-
|
|
117
85
|
static fromResource(identifierAssignmentResource, entityService) {
|
|
118
86
|
const identifierAssignment = _General.default.assignFields(identifierAssignmentResource, new IdentifierAssignment(), ["uuid", "identifier", "assignmentOrder", "voided", "used"]);
|
|
119
|
-
|
|
120
87
|
identifierAssignment.identifierSource = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(identifierAssignmentResource, "identifierSourceUUID"), _IdentifierSource.default.schema.name);
|
|
121
88
|
identifierAssignment.individual = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(identifierAssignmentResource, "individualUUID"), _Individual.default.schema.name);
|
|
122
89
|
identifierAssignment.programEnrolment = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(identifierAssignmentResource, "programEnrolmentUUID"), _ProgramEnrolment.default.schema.name);
|
|
123
90
|
(0, _AuditUtil.mapAuditFields)(identifierAssignment, identifierAssignmentResource);
|
|
124
91
|
return identifierAssignment;
|
|
125
92
|
}
|
|
126
|
-
|
|
127
93
|
get toResource() {
|
|
128
94
|
const resource = _lodash.default.pick(this, ["uuid", "identifier", "assignmentOrder", "voided", "used"]);
|
|
129
|
-
|
|
130
95
|
resource.individualUUID = this.individual ? this.individual.uuid : null;
|
|
131
96
|
resource.programEnrolmentUUID = this.programEnrolment ? this.programEnrolment.uuid : null;
|
|
132
97
|
return resource;
|
|
133
98
|
}
|
|
134
|
-
|
|
135
99
|
clone() {
|
|
136
100
|
let identifierAssignment = new IdentifierAssignment();
|
|
137
101
|
identifierAssignment.uuid = this.uuid;
|
|
@@ -143,11 +107,8 @@ class IdentifierAssignment extends _BaseEntity.default {
|
|
|
143
107
|
identifierAssignment.voided = this.voided;
|
|
144
108
|
return identifierAssignment;
|
|
145
109
|
}
|
|
146
|
-
|
|
147
110
|
}
|
|
148
|
-
|
|
149
111
|
exports.default = IdentifierAssignment;
|
|
150
|
-
|
|
151
112
|
_defineProperty(IdentifierAssignment, "schema", {
|
|
152
113
|
name: "IdentifierAssignment",
|
|
153
114
|
primaryKey: "uuid",
|
package/dist/IdentifierSource.js
CHANGED
|
@@ -4,48 +4,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _General = _interopRequireDefault(require("./utility/General"));
|
|
9
|
-
|
|
10
8
|
var _ReferenceEntity = _interopRequireDefault(require("./ReferenceEntity"));
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
13
|
class IdentifierSource extends _ReferenceEntity.default {
|
|
17
14
|
constructor(that = null) {
|
|
18
15
|
super(that);
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
get name() {
|
|
22
18
|
return this.that.name;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
set name(x) {
|
|
26
21
|
this.that.name = x;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
static fromResource(resource) {
|
|
30
24
|
return _ReferenceEntity.default.fromResource(resource, new IdentifierSource());
|
|
31
25
|
}
|
|
32
|
-
|
|
33
26
|
static create(name) {
|
|
34
27
|
let identifierSource = new IdentifierSource();
|
|
35
28
|
identifierSource.uuid = _General.default.randomUUID();
|
|
36
29
|
identifierSource.name = name;
|
|
37
30
|
return identifierSource;
|
|
38
31
|
}
|
|
39
|
-
|
|
40
32
|
clone() {
|
|
41
33
|
let identifierSource = new IdentifierSource();
|
|
42
34
|
identifierSource.uuid = this.uuid;
|
|
43
35
|
identifierSource.name = this.name;
|
|
44
36
|
return identifierSource;
|
|
45
37
|
}
|
|
46
|
-
|
|
47
38
|
}
|
|
48
|
-
|
|
49
39
|
_defineProperty(IdentifierSource, "schema", {
|
|
50
40
|
name: 'IdentifierSource',
|
|
51
41
|
primaryKey: 'uuid',
|
|
@@ -54,6 +44,5 @@ _defineProperty(IdentifierSource, "schema", {
|
|
|
54
44
|
name: 'string'
|
|
55
45
|
}
|
|
56
46
|
});
|
|
57
|
-
|
|
58
47
|
var _default = IdentifierSource;
|
|
59
48
|
exports.default = _default;
|