openchs-models 1.27.4 → 1.27.5
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/Makefile +3 -1
- package/dist/Observation.js +12 -4
- package/dist/application/Form.js +8 -0
- package/dist/application/FormElementGroup.js +4 -0
- package/package.json +1 -1
package/Makefile
CHANGED
|
@@ -31,9 +31,11 @@ publish:
|
|
|
31
31
|
copy-dist-to-avni-client:
|
|
32
32
|
cp -r * ../avni-client/packages/openchs-android/node_modules/openchs-models/
|
|
33
33
|
|
|
34
|
-
deploy-to-avni-client:
|
|
34
|
+
deploy-to-avni-client-only:
|
|
35
35
|
$(if $(local),$(call _deploy,$(local)/packages/openchs-android/node_modules/openchs-models))
|
|
36
36
|
|
|
37
|
+
deploy-to-avni-client: build deploy-to-avni-client-only
|
|
38
|
+
|
|
37
39
|
deploy-to-avni-web:
|
|
38
40
|
$(if $(local),$(call _deploy,$(local)/node_modules/openchs-models))
|
|
39
41
|
|
package/dist/Observation.js
CHANGED
|
@@ -19,6 +19,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
19
|
|
|
20
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
21
|
|
|
22
|
+
const clone = function (concept, valueJSON) {
|
|
23
|
+
const observation = new Observation();
|
|
24
|
+
observation.concept = concept;
|
|
25
|
+
observation.valueJSON = valueJSON;
|
|
26
|
+
return observation;
|
|
27
|
+
};
|
|
28
|
+
|
|
22
29
|
class Observation {
|
|
23
30
|
static create(concept, value, abnormal = false) {
|
|
24
31
|
const observation = new Observation();
|
|
@@ -136,10 +143,11 @@ class Observation {
|
|
|
136
143
|
}
|
|
137
144
|
|
|
138
145
|
cloneForEdit() {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
return clone(this.concept.cloneForReference(), this.getValueWrapper().cloneForEdit());
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
shallowClone() {
|
|
150
|
+
return clone(this.concept, this.valueJSON);
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
getValueWrapper() {
|
package/dist/application/Form.js
CHANGED
|
@@ -253,6 +253,14 @@ class Form {
|
|
|
253
253
|
return mandatoryConcepts;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
getAllFormElementConcepts() {
|
|
257
|
+
let concepts = [];
|
|
258
|
+
this.formElementGroups.forEach(feg => {
|
|
259
|
+
concepts = _lodash.default.concat(concepts, feg.getAllFormElementConcepts());
|
|
260
|
+
});
|
|
261
|
+
return concepts;
|
|
262
|
+
}
|
|
263
|
+
|
|
256
264
|
}
|
|
257
265
|
|
|
258
266
|
_defineProperty(Form, "schema", {
|