openchs-models 1.31.33 → 1.31.34
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
CHANGED
|
@@ -127,9 +127,7 @@ 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
|
|
131
130
|
|
|
132
|
-
entityService && entityService.deleteObjects(conceptResource["uuid"], Concept.schema.name, "keyValues");
|
|
133
131
|
concept.keyValues = _lodash.default.map(conceptResource.keyValues, _KeyValue.default.fromResource);
|
|
134
132
|
return concept;
|
|
135
133
|
}
|
|
@@ -155,20 +153,18 @@ class Concept extends _BaseEntity.default {
|
|
|
155
153
|
concept.name = name;
|
|
156
154
|
concept.datatype = dataType;
|
|
157
155
|
concept.uuid = uuid;
|
|
158
|
-
concept.keyValues = keyValues;
|
|
156
|
+
concept.keyValues = _lodash.default.map(keyValues, _KeyValue.default.fromResource);
|
|
159
157
|
return concept;
|
|
160
158
|
}
|
|
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
|
+
|
|
161
165
|
|
|
162
166
|
cloneForReference() {
|
|
163
|
-
|
|
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;
|
|
167
|
+
return this;
|
|
172
168
|
}
|
|
173
169
|
|
|
174
170
|
_valuePresent(value) {
|
package/dist/EntityMetaData.js
CHANGED
|
@@ -634,7 +634,11 @@ class EntityMetaData {
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
static entitiesLoadedFromServer() {
|
|
637
|
-
return _lodash.default.differenceBy(_Schema.default.getInstance().getEntities(), [_Settings.default, _LocaleMapping.default], "schema.name");
|
|
637
|
+
return _lodash.default.differenceBy(_Schema.default.getInstance().getEntities(), [_Settings.default, _LocaleMapping.default].concat(EntityMetaData.embeddedEntities()), "schema.name");
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
static embeddedEntities() {
|
|
641
|
+
return _lodash.default.filter(_Schema.default.getInstance().getEntities(), entity => entity.schema.embedded);
|
|
638
642
|
}
|
|
639
643
|
|
|
640
644
|
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
|
|
167
|
+
return clone(this.concept, this.getValueWrapper().cloneForEdit());
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
shallowClone() {
|
|
@@ -143,9 +143,7 @@ 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;
|
|
147
|
-
|
|
148
|
-
entityService.deleteObjects(resource["uuid"], FormElement.schema.name, "keyValues");
|
|
146
|
+
formElement.concept = concept;
|
|
149
147
|
formElement.keyValues = _lodash.default.map(resource.keyValues, _KeyValue.default.fromResource);
|
|
150
148
|
formElement.validFormat = _Format.default.fromResource(resource["validFormat"]);
|
|
151
149
|
return formElement;
|
|
@@ -394,7 +392,7 @@ class FormElement extends _BaseEntity.default {
|
|
|
394
392
|
formElement.name = this.name;
|
|
395
393
|
formElement.displayOrder = this.displayOrder;
|
|
396
394
|
formElement.mandatory = this.mandatory;
|
|
397
|
-
formElement.keyValues = this.keyValues;
|
|
395
|
+
formElement.keyValues = _lodash.default.map(this.keyValues, _KeyValue.default.fromResource);
|
|
398
396
|
formElement.concept = this.concept;
|
|
399
397
|
formElement.type = this.type;
|
|
400
398
|
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 = JSON.stringify(resource.value);
|
|
20
|
+
keyValue.value = typeof resource.value !== "string" ? JSON.stringify(resource.value) : resource.value;
|
|
21
21
|
return keyValue;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -55,6 +55,14 @@ 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
|
+
|
|
58
66
|
|
|
59
67
|
create(schemaName, properties, updateMode = "never") {
|
|
60
68
|
const underlyingObject = _lodash.default.isNil(properties.that) ? properties : properties.that;
|