openchs-models 1.31.32 → 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 +12 -8
- package/dist/EntityMetaData.js +1 -5
- package/dist/Observation.js +1 -1
- package/dist/application/Form.js +13 -1
- package/dist/application/FormElement.js +4 -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
|
@@ -127,7 +127,9 @@ class Concept extends _BaseEntity.default {
|
|
|
127
127
|
concept.hiNormal = conceptResource.highNormal;
|
|
128
128
|
concept.unit = conceptResource.unit;
|
|
129
129
|
concept.voided = conceptResource.voided || false; //This change should be independently deployable irrespective of server
|
|
130
|
+
//remove orphan keyValues (because KeyValue doesn't have primary key
|
|
130
131
|
|
|
132
|
+
entityService && entityService.deleteObjects(conceptResource["uuid"], Concept.schema.name, "keyValues");
|
|
131
133
|
concept.keyValues = _lodash.default.map(conceptResource.keyValues, _KeyValue.default.fromResource);
|
|
132
134
|
return concept;
|
|
133
135
|
}
|
|
@@ -153,18 +155,20 @@ class Concept extends _BaseEntity.default {
|
|
|
153
155
|
concept.name = name;
|
|
154
156
|
concept.datatype = dataType;
|
|
155
157
|
concept.uuid = uuid;
|
|
156
|
-
concept.keyValues =
|
|
158
|
+
concept.keyValues = keyValues;
|
|
157
159
|
return concept;
|
|
158
160
|
}
|
|
159
|
-
/**
|
|
160
|
-
* This should never be cloned and used for reference as this is metadata which is not to be modified during transactional data operations
|
|
161
|
-
*
|
|
162
|
-
* @returns {Concept}
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
161
|
|
|
166
162
|
cloneForReference() {
|
|
167
|
-
|
|
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;
|
|
168
172
|
}
|
|
169
173
|
|
|
170
174
|
_valuePresent(value) {
|
package/dist/EntityMetaData.js
CHANGED
|
@@ -634,11 +634,7 @@ class EntityMetaData {
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
static entitiesLoadedFromServer() {
|
|
637
|
-
return _lodash.default.differenceBy(_Schema.default.getInstance().getEntities(), [_Settings.default, _LocaleMapping.default]
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
static embeddedEntities() {
|
|
641
|
-
return _lodash.default.filter(_Schema.default.getInstance().getEntities(), entity => entity.schema.embedded);
|
|
637
|
+
return _lodash.default.differenceBy(_Schema.default.getInstance().getEntities(), [_Settings.default, _LocaleMapping.default], "schema.name");
|
|
642
638
|
}
|
|
643
639
|
|
|
644
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
|
|
@@ -143,7 +143,9 @@ class FormElement extends _BaseEntity.default {
|
|
|
143
143
|
formElement.formElementGroup = formElementGroup;
|
|
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
|
-
formElement.concept = concept;
|
|
146
|
+
formElement.concept = concept; //remove orphan keyValues (because KeyValue doesn't have primary key
|
|
147
|
+
|
|
148
|
+
entityService.deleteObjects(resource["uuid"], FormElement.schema.name, "keyValues");
|
|
147
149
|
formElement.keyValues = _lodash.default.map(resource.keyValues, _KeyValue.default.fromResource);
|
|
148
150
|
formElement.validFormat = _Format.default.fromResource(resource["validFormat"]);
|
|
149
151
|
return formElement;
|
|
@@ -392,7 +394,7 @@ class FormElement extends _BaseEntity.default {
|
|
|
392
394
|
formElement.name = this.name;
|
|
393
395
|
formElement.displayOrder = this.displayOrder;
|
|
394
396
|
formElement.mandatory = this.mandatory;
|
|
395
|
-
formElement.keyValues =
|
|
397
|
+
formElement.keyValues = this.keyValues;
|
|
396
398
|
formElement.concept = this.concept;
|
|
397
399
|
formElement.type = this.type;
|
|
398
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;
|