openchs-models 1.31.30 → 1.31.32
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
|
@@ -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; }
|
|
@@ -650,7 +638,7 @@ class EntityMetaData {
|
|
|
650
638
|
}
|
|
651
639
|
|
|
652
640
|
static embeddedEntities() {
|
|
653
|
-
return
|
|
641
|
+
return _lodash.default.filter(_Schema.default.getInstance().getEntities(), entity => entity.schema.embedded);
|
|
654
642
|
}
|
|
655
643
|
|
|
656
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;
|