openchs-models 1.32.33 → 1.32.35
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 +7 -2
- package/dist/Observation.js +2 -0
- package/dist/ObservationsHolder.js +15 -1
- package/dist/Program.js +10 -0
- package/dist/Schema.js +7 -1
- package/dist/application/Form.js +3 -3
- package/dist/application/FormElement.js +1 -2
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/Concept.js
CHANGED
|
@@ -267,11 +267,15 @@ class Concept extends _BaseEntity.default {
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
isMediaConcept() {
|
|
270
|
+
return _lodash.default.includes([Concept.dataType.Image, Concept.dataType.ImageV2, Concept.dataType.Video, Concept.dataType.File], this.datatype);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
isMediaSelectConcept() {
|
|
270
274
|
return _lodash.default.includes([Concept.dataType.Image, Concept.dataType.Video, Concept.dataType.File], this.datatype);
|
|
271
275
|
}
|
|
272
276
|
|
|
273
277
|
isSelectConcept() {
|
|
274
|
-
return this.isCodedConcept() || this.isSubjectConcept() || this.isEncounterConcept() || this.
|
|
278
|
+
return this.isCodedConcept() || this.isSubjectConcept() || this.isEncounterConcept() || this.isMediaSelectConcept();
|
|
275
279
|
}
|
|
276
280
|
|
|
277
281
|
isDurationConcept() {
|
|
@@ -406,6 +410,7 @@ _defineProperty(Concept, "dataType", {
|
|
|
406
410
|
Notes: "Notes",
|
|
407
411
|
NA: "NA",
|
|
408
412
|
Image: "Image",
|
|
413
|
+
ImageV2: "ImageV2",
|
|
409
414
|
Video: "Video",
|
|
410
415
|
Audio: "Audio",
|
|
411
416
|
Id: "Id",
|
|
@@ -418,7 +423,7 @@ _defineProperty(Concept, "dataType", {
|
|
|
418
423
|
Encounter: "Encounter",
|
|
419
424
|
|
|
420
425
|
get Media() {
|
|
421
|
-
return [this.Image, this.Video, this.Audio, this.File];
|
|
426
|
+
return [this.Image, this.ImageV2, this.Video, this.Audio, this.File];
|
|
422
427
|
}
|
|
423
428
|
|
|
424
429
|
});
|
package/dist/Observation.js
CHANGED
|
@@ -86,6 +86,8 @@ class Observation extends _PersistedObject.default {
|
|
|
86
86
|
return new _Displayable.default(valueWrapper.asDisplayDate(), null);
|
|
87
87
|
} else if (observation.concept.datatype === _Concept.default.dataType.Time) {
|
|
88
88
|
return new _Displayable.default(valueWrapper.asDisplayTime(), null);
|
|
89
|
+
} else if (observation.concept.datatype === _Concept.default.dataType.ImageV2) {
|
|
90
|
+
return new _Displayable.default(JSON.parse(valueWrapper.getValue()), null);
|
|
89
91
|
} else if (valueWrapper.isSingleCoded) {
|
|
90
92
|
if (observation.concept.datatype === _Concept.default.dataType.Subject) {
|
|
91
93
|
const uuid = valueWrapper.getValue();
|
|
@@ -142,6 +142,8 @@ class ObservationsHolder {
|
|
|
142
142
|
formElementsIncludingRepeatableElements.push(newFormElement);
|
|
143
143
|
});
|
|
144
144
|
});
|
|
145
|
+
|
|
146
|
+
formElementsIncludingRepeatableElements.push(fe);
|
|
145
147
|
} else if (_lodash.default.isNil(fe.groupUuid)) {
|
|
146
148
|
formElementsIncludingRepeatableElements.push(fe);
|
|
147
149
|
}
|
|
@@ -487,7 +489,19 @@ class ObservationsHolder {
|
|
|
487
489
|
if (observation) {
|
|
488
490
|
const valueWrapper = observation.getValueWrapper();
|
|
489
491
|
|
|
490
|
-
if (
|
|
492
|
+
if (observation.concept.datatype === _Concept.default.dataType.ImageV2) {
|
|
493
|
+
const mediaObjects = JSON.parse(valueWrapper.getValue());
|
|
494
|
+
|
|
495
|
+
const newAnswers = _lodash.default.map(mediaObjects, mediaObject => {
|
|
496
|
+
if (mediaObject.uri === oldValue) {
|
|
497
|
+
mediaObject.uri = newValue;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return mediaObject;
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
observation.valueJSON = new _PrimitiveValue.default(JSON.stringify(newAnswers), _Concept.default.dataType.ImageV2);
|
|
504
|
+
} else if (valueWrapper.isMultipleCoded) {
|
|
491
505
|
const answers = valueWrapper.getValue();
|
|
492
506
|
|
|
493
507
|
const oldValueIndex = _lodash.default.indexOf(answers, oldValue);
|
package/dist/Program.js
CHANGED
|
@@ -68,6 +68,14 @@ class Program extends _ReferenceEntity.default {
|
|
|
68
68
|
this.that.manualEligibilityCheckRequired = x;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
get showGrowthChart() {
|
|
72
|
+
return this.that.showGrowthChart;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
set showGrowthChart(x) {
|
|
76
|
+
this.that.showGrowthChart = x;
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
get enrolmentSummaryRule() {
|
|
72
80
|
return this.that.enrolmentSummaryRule;
|
|
73
81
|
}
|
|
@@ -118,6 +126,7 @@ class Program extends _ReferenceEntity.default {
|
|
|
118
126
|
program.programSubjectLabel = operationalProgram.programSubjectLabel || operationalProgram.name || program.name;
|
|
119
127
|
program.enrolmentSummaryRule = operationalProgram.enrolmentSummaryRule;
|
|
120
128
|
program.manualEligibilityCheckRequired = operationalProgram.manualEligibilityCheckRequired;
|
|
129
|
+
program.showGrowthChart = operationalProgram.showGrowthChart;
|
|
121
130
|
program.manualEnrolmentEligibilityCheckRule = operationalProgram.manualEnrolmentEligibilityCheckRule;
|
|
122
131
|
program.enrolmentEligibilityCheckRule = operationalProgram.enrolmentEligibilityCheckRule;
|
|
123
132
|
program.allowMultipleEnrolments = operationalProgram.allowMultipleEnrolments;
|
|
@@ -162,6 +171,7 @@ _defineProperty(Program, "schema", {
|
|
|
162
171
|
optional: true
|
|
163
172
|
},
|
|
164
173
|
manualEligibilityCheckRequired: 'bool',
|
|
174
|
+
showGrowthChart: 'bool',
|
|
165
175
|
manualEnrolmentEligibilityCheckRule: {
|
|
166
176
|
type: 'string',
|
|
167
177
|
optional: true
|
package/dist/Schema.js
CHANGED
|
@@ -283,7 +283,7 @@ function createRealmConfig() {
|
|
|
283
283
|
return doCompact;
|
|
284
284
|
},
|
|
285
285
|
//order is important, should be arranged according to the dependency
|
|
286
|
-
schemaVersion:
|
|
286
|
+
schemaVersion: 199,
|
|
287
287
|
onMigration: function (oldDB, newDB) {
|
|
288
288
|
console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
|
|
289
289
|
if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
|
|
@@ -965,6 +965,12 @@ function createRealmConfig() {
|
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
|
+
|
|
969
|
+
if (oldDB.schemaVersion < 199) {
|
|
970
|
+
_lodash.default.forEach(newDB.objects("Program"), program => {
|
|
971
|
+
program.showGrowthChart = _lodash.default.toLower(program.name) === "child";
|
|
972
|
+
});
|
|
973
|
+
}
|
|
968
974
|
}
|
|
969
975
|
};
|
|
970
976
|
}
|
package/dist/application/Form.js
CHANGED
|
@@ -305,12 +305,12 @@ class Form extends _BaseEntity.default {
|
|
|
305
305
|
|
|
306
306
|
const orderedFormElements = _lodash.default.sortBy(childFormElements, fe => fe.displayOrder);
|
|
307
307
|
|
|
308
|
-
_lodash.default.forEach(orderedFormElements, formElement => this.addSortedObservations(formElement, observations, orderedChildObs));
|
|
308
|
+
_lodash.default.forEach(orderedFormElements, formElement => this.addSortedObservations(formElement, observations, orderedChildObs, true));
|
|
309
309
|
|
|
310
310
|
return orderedChildObs;
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
addSortedObservations(formElement, observations, orderedObservations) {
|
|
313
|
+
addSortedObservations(formElement, observations, orderedObservations, forQGChildren = false) {
|
|
314
314
|
const concept = formElement.concept;
|
|
315
315
|
const foundObs = observations.find(obs => obs.concept.uuid === concept.uuid);
|
|
316
316
|
|
|
@@ -326,7 +326,7 @@ class Form extends _BaseEntity.default {
|
|
|
326
326
|
orderedObservations.push(clonedObs);
|
|
327
327
|
}
|
|
328
328
|
} else {
|
|
329
|
-
if (!_lodash.default.isNil(foundObs)) {
|
|
329
|
+
if (!_lodash.default.isNil(foundObs) && (_lodash.default.isNil(formElement.groupUuid) || forQGChildren)) {
|
|
330
330
|
foundObs.styles = formElement.styles;
|
|
331
331
|
orderedObservations.push(foundObs);
|
|
332
332
|
}
|
|
@@ -478,8 +478,7 @@ _defineProperty(FormElement, "keys", {
|
|
|
478
478
|
groupSubjectRoleUUID: "groupSubjectRoleUUID",
|
|
479
479
|
allowedTypes: "allowedTypes",
|
|
480
480
|
allowedMaxSize: "allowedMaxSize",
|
|
481
|
-
displayAllGroupMembers: "displayAllGroupMembers"
|
|
482
|
-
searchOptions: "searchOptions"
|
|
481
|
+
displayAllGroupMembers: "displayAllGroupMembers"
|
|
483
482
|
});
|
|
484
483
|
|
|
485
484
|
_defineProperty(FormElement, "values", {
|
package/dist/index.js
CHANGED
|
@@ -165,6 +165,12 @@ Object.defineProperty(exports, "FormMapping", {
|
|
|
165
165
|
return _FormMapping.default;
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
+
Object.defineProperty(exports, "findMediaObservations", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _Media.findMediaObservations;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
168
174
|
Object.defineProperty(exports, "MenuItem", {
|
|
169
175
|
enumerable: true,
|
|
170
176
|
get: function () {
|
|
@@ -864,6 +870,8 @@ var _Form = _interopRequireDefault(require("./application/Form"));
|
|
|
864
870
|
|
|
865
871
|
var _FormMapping = _interopRequireDefault(require("./application/FormMapping"));
|
|
866
872
|
|
|
873
|
+
var _Media = require("./Media");
|
|
874
|
+
|
|
867
875
|
var _MenuItem = _interopRequireDefault(require("./application/MenuItem"));
|
|
868
876
|
|
|
869
877
|
var _Gender = _interopRequireDefault(require("./Gender"));
|