openchs-models 1.31.41 → 1.31.42
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 +12 -0
- package/dist/Schema.js +0 -5
- package/dist/application/Form.js +13 -1
- package/package.json +1 -1
package/dist/Individual.js
CHANGED
|
@@ -891,6 +891,18 @@ class Individual extends _BaseEntity.default {
|
|
|
891
891
|
return _lodash.default.filter(this.getEncounters(true), encounter => !encounter.encounterDateTime && _lodash.default.isNil(encounter.cancelDateTime));
|
|
892
892
|
}
|
|
893
893
|
|
|
894
|
+
everScheduledEncounters() {
|
|
895
|
+
return _lodash.default.filter(this.getEncounters(true), encounter => !_lodash.default.isNil(encounter.earliestVisitDateTime) && _lodash.default.isNil(encounter.cancelDateTime));
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
scheduledEncountersOfType(encounterTypeName) {
|
|
899
|
+
return this.scheduledEncounters().filter(scheduledEncounter => scheduledEncounter.encounterType.name === encounterTypeName);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
everScheduledEncountersOfType(encounterTypeName) {
|
|
903
|
+
return this.everScheduledEncounters().filter(scheduledEncounter => scheduledEncounter.encounterType.name === encounterTypeName);
|
|
904
|
+
}
|
|
905
|
+
|
|
894
906
|
findObservationInLastEncounter(conceptNameOrUuid, currentEncounter) {
|
|
895
907
|
const lastEncounter = this.findLastEncounterOfType(currentEncounter, _lodash.default.get(currentEncounter, 'encounterType'));
|
|
896
908
|
return lastEncounter ? lastEncounter.findObservation(conceptNameOrUuid) : null;
|
package/dist/Schema.js
CHANGED
|
@@ -375,11 +375,6 @@ function migrateAllEmbeddedForTxnData(oldDB, newDB) {
|
|
|
375
375
|
|
|
376
376
|
function createRealmConfig() {
|
|
377
377
|
return {
|
|
378
|
-
shouldCompact: function (totalBytes, usedBytes) {
|
|
379
|
-
const doCompact = totalBytes / usedBytes > 1.1;
|
|
380
|
-
console.log("Should compact", totalBytes, usedBytes, doCompact);
|
|
381
|
-
return doCompact;
|
|
382
|
-
},
|
|
383
378
|
//order is important, should be arranged according to the dependency
|
|
384
379
|
schemaVersion: 185,
|
|
385
380
|
onMigration: function (oldDB, newDB) {
|
package/dist/application/Form.js
CHANGED
|
@@ -66,6 +66,14 @@ class Form extends _BaseEntity.default {
|
|
|
66
66
|
this.that.decisionRule = x;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
get editFormRule() {
|
|
70
|
+
return this.that.editFormRule;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
set editFormRule(x) {
|
|
74
|
+
this.that.editFormRule = x;
|
|
75
|
+
}
|
|
76
|
+
|
|
69
77
|
get visitScheduleRule() {
|
|
70
78
|
return this.that.visitScheduleRule;
|
|
71
79
|
}
|
|
@@ -118,7 +126,7 @@ class Form extends _BaseEntity.default {
|
|
|
118
126
|
this.deleteOutOfSyncDrafts(entityService, resource.uuid);
|
|
119
127
|
}
|
|
120
128
|
|
|
121
|
-
return _General.default.assignFields(resource, new Form(), ["uuid", "name", "formType", "decisionRule", "visitScheduleRule", "taskScheduleRule", "validationRule", "checklistsRule", "taskScheduleRule"]);
|
|
129
|
+
return _General.default.assignFields(resource, new Form(), ["uuid", "name", "formType", "decisionRule", "editFormRule", "visitScheduleRule", "taskScheduleRule", "validationRule", "checklistsRule", "taskScheduleRule"]);
|
|
122
130
|
}
|
|
123
131
|
|
|
124
132
|
static deleteOutOfSyncDrafts(entityService, formUUID) {
|
|
@@ -348,6 +356,10 @@ _defineProperty(Form, "schema", {
|
|
|
348
356
|
type: "string",
|
|
349
357
|
optional: true
|
|
350
358
|
},
|
|
359
|
+
editFormRule: {
|
|
360
|
+
type: "string",
|
|
361
|
+
optional: true
|
|
362
|
+
},
|
|
351
363
|
visitScheduleRule: {
|
|
352
364
|
type: "string",
|
|
353
365
|
optional: true
|