openchs-models 1.33.21 → 1.33.22
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/dist/Individual.js +0 -18
- package/dist/ObservationsHolder.js +0 -1
- package/dist/Schema.js +2 -3
- package/dist/index.js +0 -7
- package/package.json +1 -1
- package/dist/SubjectLocation.js +0 -83
package/dist/Individual.js
CHANGED
|
@@ -20,7 +20,6 @@ var _ObservationsHolder = _interopRequireDefault(require("./ObservationsHolder")
|
|
|
20
20
|
var _Media = require("./Media");
|
|
21
21
|
var _Point = _interopRequireDefault(require("./geo/Point"));
|
|
22
22
|
var _SubjectType = _interopRequireDefault(require("./SubjectType"));
|
|
23
|
-
var _SubjectLocation = _interopRequireDefault(require("./SubjectLocation"));
|
|
24
23
|
var _Observation = _interopRequireDefault(require("./Observation"));
|
|
25
24
|
var _GroupSubject = _interopRequireDefault(require("./GroupSubject"));
|
|
26
25
|
var _EntityApprovalStatus = _interopRequireDefault(require("./EntityApprovalStatus"));
|
|
@@ -144,12 +143,6 @@ class Individual extends _BaseEntity.default {
|
|
|
144
143
|
set registrationLocation(x) {
|
|
145
144
|
this.that.registrationLocation = this.fromObject(x);
|
|
146
145
|
}
|
|
147
|
-
get subjectLocation() {
|
|
148
|
-
return this.toEntity("subjectLocation", _SubjectLocation.default);
|
|
149
|
-
}
|
|
150
|
-
set subjectLocation(x) {
|
|
151
|
-
this.that.subjectLocation = this.fromObject(x);
|
|
152
|
-
}
|
|
153
146
|
get latestEntityApprovalStatus() {
|
|
154
147
|
return _lodash.default.maxBy(this.approvalStatuses, 'statusDateTime');
|
|
155
148
|
}
|
|
@@ -241,9 +234,6 @@ class Individual extends _BaseEntity.default {
|
|
|
241
234
|
if (!_lodash.default.isNil(this.registrationLocation)) {
|
|
242
235
|
resource["registrationLocation"] = this.registrationLocation.toResource;
|
|
243
236
|
}
|
|
244
|
-
if (!_lodash.default.isNil(this.subjectLocation)) {
|
|
245
|
-
resource["subjectLocation"] = this.subjectLocation.toResource;
|
|
246
|
-
}
|
|
247
237
|
resource["observations"] = [];
|
|
248
238
|
this.observations.forEach(obs => {
|
|
249
239
|
resource["observations"].push(obs.toResource);
|
|
@@ -286,7 +276,6 @@ class Individual extends _BaseEntity.default {
|
|
|
286
276
|
individual.lowestAddressLevel = this.initLowestAddressLevel(addressLevel, subjectType, entityService);
|
|
287
277
|
individual.name = individual.nameString;
|
|
288
278
|
if (!_lodash.default.isNil(individualResource.registrationLocation)) individual.registrationLocation = _Point.default.fromResource(individualResource.registrationLocation);
|
|
289
|
-
if (!_lodash.default.isNil(individualResource.subjectLocation)) individual.subjectLocation = _SubjectLocation.default.fromResource(individualResource.subjectLocation);
|
|
290
279
|
individual.subjectType = subjectType;
|
|
291
280
|
(0, _AuditUtil.mapAuditFields)(individual, individualResource);
|
|
292
281
|
return individual;
|
|
@@ -525,7 +514,6 @@ class Individual extends _BaseEntity.default {
|
|
|
525
514
|
individual.lowestAddressLevel = _lodash.default.isNil(this.lowestAddressLevel) ? null : _lodash.default.assignIn({}, this.lowestAddressLevel);
|
|
526
515
|
individual.observations = _ObservationsHolder.default.clone(this.observations);
|
|
527
516
|
individual.registrationLocation = _lodash.default.isNil(this.registrationLocation) ? null : this.registrationLocation.clone();
|
|
528
|
-
individual.subjectLocation = _lodash.default.isNil(this.subjectLocation) ? null : this.subjectLocation.clone();
|
|
529
517
|
individual.relationships = this.relationships;
|
|
530
518
|
individual.groupSubjects = this.groupSubjects;
|
|
531
519
|
individual.groups = this.groups;
|
|
@@ -851,7 +839,6 @@ class Individual extends _BaseEntity.default {
|
|
|
851
839
|
groups: this.groups,
|
|
852
840
|
voided: this.voided,
|
|
853
841
|
registrationLocation: this.registrationLocation,
|
|
854
|
-
subjectLocation: this.subjectLocation,
|
|
855
842
|
subjectType: this.subjectType,
|
|
856
843
|
comments: this.comments
|
|
857
844
|
};
|
|
@@ -936,11 +923,6 @@ _defineProperty(Individual, "schema", {
|
|
|
936
923
|
objectType: 'Point',
|
|
937
924
|
optional: true
|
|
938
925
|
},
|
|
939
|
-
subjectLocation: {
|
|
940
|
-
type: 'object',
|
|
941
|
-
objectType: 'SubjectLocation',
|
|
942
|
-
optional: true
|
|
943
|
-
},
|
|
944
926
|
comments: {
|
|
945
927
|
type: "list",
|
|
946
928
|
objectType: "Comment"
|
|
@@ -288,7 +288,6 @@ class ObservationsHolder {
|
|
|
288
288
|
let observation = this.getObservation(concept);
|
|
289
289
|
if (!_lodash.default.isEmpty(observation)) {
|
|
290
290
|
_ArrayHelper.default.remove(this.observations, obs => obs.concept.uuid === observation.concept.uuid);
|
|
291
|
-
if (duration.isEmpty) return null;
|
|
292
291
|
}
|
|
293
292
|
observation = _Observation.default.create(concept, duration);
|
|
294
293
|
this.observations.push(observation);
|
package/dist/Schema.js
CHANGED
|
@@ -96,10 +96,9 @@ var _MigrationsHelper = _interopRequireDefault(require("./MigrationsHelper"));
|
|
|
96
96
|
var _MetaDataService = _interopRequireDefault(require("./service/MetaDataService"));
|
|
97
97
|
var _ReportCardResult = _interopRequireDefault(require("./reports/ReportCardResult"));
|
|
98
98
|
var _NestedReportCardResult = _interopRequireDefault(require("./reports/NestedReportCardResult"));
|
|
99
|
-
var _SubjectLocation = _interopRequireDefault(require("./SubjectLocation"));
|
|
100
99
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
101
100
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
102
|
-
const entities = [_ReportCardResult.default, _NestedReportCardResult.default,
|
|
101
|
+
const entities = [_ReportCardResult.default, _NestedReportCardResult.default, _DashboardFilter.default, _LocaleMapping.default, _Settings.default, _ConceptAnswer.default, _ConceptMedia.default, _Concept.default, _EncounterType.default, _Gender.default, _AddressLevel.LocationMapping, _AddressLevel.default, _KeyValue.default, _Form.default, _FormMapping.default, _FormElementGroup.default, _FormElement.default, _SubjectType.default, _Individual.default, _Program.default, _ProgramEnrolment.default, _Observation.default, _ProgramEncounter.default, _Encounter.default, _EntitySyncStatus.default, _EntityQueue.default, _Checklist.default, _ChecklistItem.default, _Format.default, _UserInfo.default, _StringKeyNumericValue.default, _Family.default, _IndividualRelation.default, _IndividualRelationGenderMapping.default, _IndividualRelationshipType.default, _IndividualRelationship.default, _RuleDependency.default, _Rule.default, _ChecklistItemStatus.default, _ChecklistDetail.default, _ChecklistItemDetail.default, _VideoTelemetric.default, _Video.default, _MediaQueue.default, _Point.default, _SyncTelemetry.default, _IdentifierSource.default, _IdentifierAssignment.default, _RuleFailureTelemetry.default, _BeneficiaryModePin.default, _OrganisationConfig.default, _PlatformTranslation.default, _Translation.default, _Groups.default, _MyGroups.default, _GroupPrivileges.default, _Privilege.default, _GroupRole.default, _GroupSubject.default, _DashboardCache.default, _CustomDashboardCache.default, _LocationHierarchy.default, _ReportCard.default, _Dashboard.default, _DashboardSectionCardMapping.default, _DraftSubject.default, _StandardReportCardType.default, _ApprovalStatus.default, _EntityApprovalStatus.default, _GroupDashboard.default, _DashboardSection.default, _News.default, _Comment.default, _CommentThread.default, _Extension.default, _SubjectMigration.default, _ResetSync.default, _Documentation.default, _DocumentationItem.default, _TaskType.default, _TaskStatus.default, _Task.default, _TaskUnAssignment.default, _DraftEncounter.default, _SubjectProgramEligibility.default, _MenuItem.default, _UserSubjectAssignment.default];
|
|
103
102
|
function migrateObjectTypeFieldToEmbedded(newDB, oldDB, schemaName, field, creatorFn) {
|
|
104
103
|
console.log(`schema: ${schemaName}, field: ${field}`);
|
|
105
104
|
newDB.objects(schemaName).forEach(newDbParentEntity => {
|
|
@@ -178,7 +177,7 @@ function createRealmConfig() {
|
|
|
178
177
|
return doCompact;
|
|
179
178
|
},
|
|
180
179
|
//order is important, should be arranged according to the dependency
|
|
181
|
-
schemaVersion:
|
|
180
|
+
schemaVersion: 205,
|
|
182
181
|
onMigration: function (oldDB, newDB) {
|
|
183
182
|
console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
|
|
184
183
|
if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
|
package/dist/index.js
CHANGED
|
@@ -831,12 +831,6 @@ Object.defineProperty(exports, "NestedReportCardResult", {
|
|
|
831
831
|
return _NestedReportCardResult.default;
|
|
832
832
|
}
|
|
833
833
|
});
|
|
834
|
-
Object.defineProperty(exports, "SubjectLocation", {
|
|
835
|
-
enumerable: true,
|
|
836
|
-
get: function () {
|
|
837
|
-
return _SubjectLocation.default;
|
|
838
|
-
}
|
|
839
|
-
});
|
|
840
834
|
var _AbstractEncounter = _interopRequireDefault(require("./AbstractEncounter"));
|
|
841
835
|
var _AddressLevel = _interopRequireWildcard(require("./AddressLevel"));
|
|
842
836
|
var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
@@ -970,6 +964,5 @@ var _Locations = _interopRequireDefault(require("./location/Locations"));
|
|
|
970
964
|
var _Range = _interopRequireDefault(require("./reports/Range"));
|
|
971
965
|
var _ReportCardResult = _interopRequireDefault(require("./reports/ReportCardResult"));
|
|
972
966
|
var _NestedReportCardResult = _interopRequireDefault(require("./reports/NestedReportCardResult"));
|
|
973
|
-
var _SubjectLocation = _interopRequireDefault(require("./SubjectLocation"));
|
|
974
967
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
975
968
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/package.json
CHANGED
package/dist/SubjectLocation.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _PersistedObject = _interopRequireDefault(require("./PersistedObject"));
|
|
8
|
-
var _Point = _interopRequireDefault(require("./geo/Point"));
|
|
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); }
|
|
13
|
-
class SubjectLocation extends _PersistedObject.default {
|
|
14
|
-
constructor(that = null) {
|
|
15
|
-
super(that);
|
|
16
|
-
}
|
|
17
|
-
get coordinates() {
|
|
18
|
-
return this.toEntity("coordinates", _Point.default);
|
|
19
|
-
}
|
|
20
|
-
set coordinates(x) {
|
|
21
|
-
this.that.coordinates = this.fromObject(x);
|
|
22
|
-
}
|
|
23
|
-
get accuracy() {
|
|
24
|
-
return this.that.accuracy;
|
|
25
|
-
}
|
|
26
|
-
set accuracy(accuracy) {
|
|
27
|
-
this.that.accuracy = accuracy;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Convenience methods for latitude/longitude access
|
|
31
|
-
get latitude() {
|
|
32
|
-
return this.coordinates ? this.coordinates.y : null;
|
|
33
|
-
}
|
|
34
|
-
get longitude() {
|
|
35
|
-
return this.coordinates ? this.coordinates.x : null;
|
|
36
|
-
}
|
|
37
|
-
static newInstance(position, accuracy) {
|
|
38
|
-
const subjectLocation = new SubjectLocation();
|
|
39
|
-
subjectLocation.coordinates = position;
|
|
40
|
-
subjectLocation.accuracy = accuracy;
|
|
41
|
-
return subjectLocation;
|
|
42
|
-
}
|
|
43
|
-
static fromResource(resource) {
|
|
44
|
-
const subjectLocation = new SubjectLocation();
|
|
45
|
-
if (resource.coordinates) {
|
|
46
|
-
subjectLocation.coordinates = _Point.default.fromResource(resource.coordinates);
|
|
47
|
-
}
|
|
48
|
-
subjectLocation.accuracy = resource.accuracy;
|
|
49
|
-
return subjectLocation;
|
|
50
|
-
}
|
|
51
|
-
get toResource() {
|
|
52
|
-
const resource = {};
|
|
53
|
-
if (this.coordinates) {
|
|
54
|
-
resource.coordinates = this.coordinates.toResource;
|
|
55
|
-
}
|
|
56
|
-
resource.accuracy = this.accuracy;
|
|
57
|
-
return resource;
|
|
58
|
-
}
|
|
59
|
-
clone() {
|
|
60
|
-
const cloned = new SubjectLocation();
|
|
61
|
-
if (this.coordinates) {
|
|
62
|
-
cloned.coordinates = this.coordinates.clone();
|
|
63
|
-
}
|
|
64
|
-
cloned.accuracy = this.accuracy;
|
|
65
|
-
return cloned;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
_defineProperty(SubjectLocation, "schema", {
|
|
69
|
-
name: "SubjectLocation",
|
|
70
|
-
properties: {
|
|
71
|
-
coordinates: {
|
|
72
|
-
type: 'object',
|
|
73
|
-
objectType: 'Point',
|
|
74
|
-
optional: true
|
|
75
|
-
},
|
|
76
|
-
accuracy: {
|
|
77
|
-
type: "double",
|
|
78
|
-
optional: true
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var _default = SubjectLocation;
|
|
83
|
-
exports.default = _default;
|