openchs-models 1.30.76 → 1.30.78

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.
@@ -68,6 +68,14 @@ class IdentifierAssignment extends _BaseEntity.default {
68
68
  this.that.programEnrolment = this.fromObject(x);
69
69
  }
70
70
 
71
+ get used() {
72
+ return this.that.used;
73
+ }
74
+
75
+ set used(x) {
76
+ this.that.used = x;
77
+ }
78
+
71
79
  static fromResource(identifierAssignmentResource, entityService) {
72
80
  const identifierAssignment = _General.default.assignFields(identifierAssignmentResource, new IdentifierAssignment(), ["uuid", "identifier", "assignmentOrder", "voided"]);
73
81
 
@@ -120,6 +128,11 @@ _defineProperty(IdentifierAssignment, "schema", {
120
128
  programEnrolment: {
121
129
  type: "ProgramEnrolment",
122
130
  optional: true
131
+ },
132
+ used: {
133
+ type: "bool",
134
+ default: false,
135
+ optional: false
123
136
  }
124
137
  }
125
138
  });
package/dist/Privilege.js CHANGED
@@ -89,7 +89,8 @@ _defineProperty(Privilege, "privilegeName", {
89
89
  approveSubject: "Approve Subject",
90
90
  approveEnrolment: "Approve Enrolment",
91
91
  approveEncounter: "Approve Encounter",
92
- approveChecklistItem: "Approve ChecklistItem"
92
+ approveChecklistItem: "Approve ChecklistItem",
93
+ viewEditEntitiesOnDataEntryApp: 'View Or Edit Entities On DataEntry App'
93
94
  });
94
95
 
95
96
  _defineProperty(Privilege, "PrivilegeType", {
@@ -149,7 +150,8 @@ _defineProperty(Privilege, "PrivilegeType", {
149
150
  EditConcept: "EditConcept",
150
151
  EditChecklistConfiguration: "EditChecklistConfiguration",
151
152
  DownloadBundle: "DownloadBundle",
152
- EditTaskType: "EditTaskType"
153
+ EditTaskType: "EditTaskType",
154
+ ViewEditEntitiesOnDataEntryApp: "ViewEditEntitiesOnDataEntryApp"
153
155
  });
154
156
 
155
157
  _defineProperty(Privilege, "privilegeEntityType", {
@@ -161,7 +163,8 @@ _defineProperty(Privilege, "privilegeEntityType", {
161
163
  analytics: "Analytics",
162
164
  messaging: "Messaging",
163
165
  nonTransaction: "NonTransaction",
164
- task: "Task"
166
+ task: "Task",
167
+ dataEntryApp: "DataEntryApp"
165
168
  });
166
169
 
167
170
  _defineProperty(Privilege, "schemaToPrivilegeMetadata", [{
package/dist/Schema.js CHANGED
@@ -200,7 +200,7 @@ const entities = [_DashboardFilter.default, _LocaleMapping.default, _Settings.de
200
200
  function createRealmConfig() {
201
201
  return {
202
202
  //order is important, should be arranged according to the dependency
203
- schemaVersion: 178,
203
+ schemaVersion: 179,
204
204
  onMigration: function (oldDB, newDB) {
205
205
  console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
206
206
 
@@ -766,6 +766,14 @@ function createRealmConfig() {
766
766
  const pushOnlyEntities = newDB.objects(_SchemaNames.default.EntitySyncStatus).filtered("entityName = 'EntityApprovalStatus' OR entityName = 'SyncTelemetry' OR entityName = 'VideoTelemetric' OR entityName = 'RuleFailureTelemetry'");
767
767
  newDB.delete(pushOnlyEntities);
768
768
  }
769
+
770
+ if (oldDB.schemaVersion < 179) {
771
+ _lodash.default.forEach(newDB.objects(_IdentifierAssignment.default.schema.name), identifierAssignment => {
772
+ if (identifierAssignment.individual !== null || identifierAssignment.programEnrolment !== null) {
773
+ identifierAssignment.used = true;
774
+ }
775
+ });
776
+ }
769
777
  }
770
778
  };
771
779
  }
@@ -140,6 +140,7 @@ class FormElementGroup extends _BaseEntity.default {
140
140
  }
141
141
 
142
142
  addFormElement(formElement) {
143
+ formElement.formElementGroup = this;
143
144
  this.formElements.push(formElement);
144
145
  }
145
146
 
@@ -64,7 +64,8 @@ class ValidationResult {
64
64
 
65
65
  _defineProperty(ValidationResult, "ValidationTypes", {
66
66
  Form: "Form",
67
- Rule: "Rule"
67
+ Rule: "Rule",
68
+ Database: "Database"
68
69
  });
69
70
 
70
71
  var _default = ValidationResult;
@@ -59,7 +59,9 @@ class RealmResultsProxy {
59
59
  }
60
60
 
61
61
  getAt(index) {
62
- return this.createEntity(this.realmCollection[index]);
62
+ const realmCollectionElement = this.realmCollection[index];
63
+ if (_lodash.default.isNil(realmCollectionElement)) return null;
64
+ return this.createEntity(realmCollectionElement);
63
65
  }
64
66
 
65
67
  forEach(callback, thisArg) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openchs-models",
3
3
  "description": "OpenCHS data model to be used by front end clients",
4
- "version": "1.30.76",
4
+ "version": "1.30.78",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",