openchs-models 1.31.31 → 1.31.33
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/Concept.js +11 -10
- package/dist/EntityMetaData.js +1 -17
- package/dist/Observation.js +1 -1
- package/dist/application/Form.js +13 -1
- package/dist/application/FormElement.js +2 -2
- package/dist/application/KeyValue.js +1 -1
- package/dist/framework/RealmProxy.js +0 -8
- package/package.json +1 -1
package/dist/Concept.js
CHANGED
|
@@ -128,9 +128,8 @@ class Concept extends _BaseEntity.default {
|
|
|
128
128
|
concept.unit = conceptResource.unit;
|
|
129
129
|
concept.voided = conceptResource.voided || false; //This change should be independently deployable irrespective of server
|
|
130
130
|
//remove orphan keyValues (because KeyValue doesn't have primary key
|
|
131
|
-
// entityService &&
|
|
132
|
-
// entityService.deleteObjects(conceptResource["uuid"], Concept.schema.name, "keyValues");
|
|
133
131
|
|
|
132
|
+
entityService && entityService.deleteObjects(conceptResource["uuid"], Concept.schema.name, "keyValues");
|
|
134
133
|
concept.keyValues = _lodash.default.map(conceptResource.keyValues, _KeyValue.default.fromResource);
|
|
135
134
|
return concept;
|
|
136
135
|
}
|
|
@@ -156,18 +155,20 @@ class Concept extends _BaseEntity.default {
|
|
|
156
155
|
concept.name = name;
|
|
157
156
|
concept.datatype = dataType;
|
|
158
157
|
concept.uuid = uuid;
|
|
159
|
-
concept.keyValues =
|
|
158
|
+
concept.keyValues = keyValues;
|
|
160
159
|
return concept;
|
|
161
160
|
}
|
|
162
|
-
/**
|
|
163
|
-
* This should never be cloned and used for reference as this is metadata which is not to be modified during transactional data operations
|
|
164
|
-
*
|
|
165
|
-
* @returns {Concept}
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
161
|
|
|
169
162
|
cloneForReference() {
|
|
170
|
-
|
|
163
|
+
const concept = Concept.create(this.name, this.datatype, this.keyValues);
|
|
164
|
+
concept.uuid = this.uuid;
|
|
165
|
+
concept.unit = this.unit;
|
|
166
|
+
concept.lowAbsolute = this.lowAbsolute;
|
|
167
|
+
concept.lowNormal = this.lowNormal;
|
|
168
|
+
concept.hiNormal = this.hiNormal;
|
|
169
|
+
concept.hiAbsolute = this.hiAbsolute;
|
|
170
|
+
concept.answers = this.answers || [];
|
|
171
|
+
return concept;
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
_valuePresent(value) {
|
package/dist/EntityMetaData.js
CHANGED
|
@@ -147,18 +147,6 @@ var _UserSubjectAssignment = _interopRequireDefault(require("./assignment/UserSu
|
|
|
147
147
|
|
|
148
148
|
var _DashboardFilter = _interopRequireDefault(require("./reports/DashboardFilter"));
|
|
149
149
|
|
|
150
|
-
var _KeyValue = _interopRequireDefault(require("./application/KeyValue"));
|
|
151
|
-
|
|
152
|
-
var _Observation = _interopRequireDefault(require("./Observation"));
|
|
153
|
-
|
|
154
|
-
var _Format = _interopRequireDefault(require("./application/Format"));
|
|
155
|
-
|
|
156
|
-
var _StringKeyNumericValue = _interopRequireDefault(require("./application/StringKeyNumericValue"));
|
|
157
|
-
|
|
158
|
-
var _ChecklistItemStatus = _interopRequireDefault(require("./ChecklistItemStatus"));
|
|
159
|
-
|
|
160
|
-
var _Point = _interopRequireDefault(require("./geo/Point"));
|
|
161
|
-
|
|
162
150
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
163
151
|
|
|
164
152
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -646,11 +634,7 @@ class EntityMetaData {
|
|
|
646
634
|
}
|
|
647
635
|
|
|
648
636
|
static entitiesLoadedFromServer() {
|
|
649
|
-
return _lodash.default.differenceBy(_Schema.default.getInstance().getEntities(), [_Settings.default, _LocaleMapping.default]
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
static embeddedEntities() {
|
|
653
|
-
return [_KeyValue.default, _Observation.default, _Format.default, _StringKeyNumericValue.default, _ChecklistItemStatus.default, _Point.default];
|
|
637
|
+
return _lodash.default.differenceBy(_Schema.default.getInstance().getEntities(), [_Settings.default, _LocaleMapping.default], "schema.name");
|
|
654
638
|
}
|
|
655
639
|
|
|
656
640
|
static findByName(entityName) {
|
package/dist/Observation.js
CHANGED
|
@@ -164,7 +164,7 @@ class Observation extends _PersistedObject.default {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
cloneForEdit() {
|
|
167
|
-
return clone(this.concept, this.getValueWrapper().cloneForEdit());
|
|
167
|
+
return clone(this.concept.cloneForReference(), this.getValueWrapper().cloneForEdit());
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
shallowClone() {
|
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
|
|
@@ -144,8 +144,8 @@ class FormElement extends _BaseEntity.default {
|
|
|
144
144
|
formElement.groupUuid = _ResourceUtil.default.getUUIDFor(resource, "groupQuestionUUID");
|
|
145
145
|
formElement.documentation = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "documentationUUID"), _Documentation.default.schema.name);
|
|
146
146
|
formElement.concept = concept; //remove orphan keyValues (because KeyValue doesn't have primary key
|
|
147
|
-
// entityService.deleteObjects(resource["uuid"], FormElement.schema.name, "keyValues");
|
|
148
147
|
|
|
148
|
+
entityService.deleteObjects(resource["uuid"], FormElement.schema.name, "keyValues");
|
|
149
149
|
formElement.keyValues = _lodash.default.map(resource.keyValues, _KeyValue.default.fromResource);
|
|
150
150
|
formElement.validFormat = _Format.default.fromResource(resource["validFormat"]);
|
|
151
151
|
return formElement;
|
|
@@ -394,7 +394,7 @@ class FormElement extends _BaseEntity.default {
|
|
|
394
394
|
formElement.name = this.name;
|
|
395
395
|
formElement.displayOrder = this.displayOrder;
|
|
396
396
|
formElement.mandatory = this.mandatory;
|
|
397
|
-
formElement.keyValues =
|
|
397
|
+
formElement.keyValues = this.keyValues;
|
|
398
398
|
formElement.concept = this.concept;
|
|
399
399
|
formElement.type = this.type;
|
|
400
400
|
formElement.formElementGroup = this.formElementGroup;
|
|
@@ -17,7 +17,7 @@ class KeyValue extends _PersistedObject.default {
|
|
|
17
17
|
static fromResource(resource) {
|
|
18
18
|
const keyValue = new KeyValue();
|
|
19
19
|
keyValue.key = resource.key;
|
|
20
|
-
keyValue.value =
|
|
20
|
+
keyValue.value = JSON.stringify(resource.value);
|
|
21
21
|
return keyValue;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -55,14 +55,6 @@ class RealmProxy {
|
|
|
55
55
|
close() {
|
|
56
56
|
return this.realmDb.close();
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* @param schemaName
|
|
61
|
-
* @param properties
|
|
62
|
-
* @param updateMode , all === true, modified , never === false
|
|
63
|
-
* @returns {*}
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
58
|
|
|
67
59
|
create(schemaName, properties, updateMode = "never") {
|
|
68
60
|
const underlyingObject = _lodash.default.isNil(properties.that) ? properties : properties.that;
|