openchs-models 1.32.23 → 1.32.25
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 +3 -2
- package/dist/ProgramEnrolment.js +3 -3
- package/dist/Schema.js +7 -1
- package/dist/application/FormElement.js +1 -2
- package/package.json +1 -1
package/dist/Concept.js
CHANGED
|
@@ -267,7 +267,7 @@ class Concept extends _BaseEntity.default {
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
isMediaConcept() {
|
|
270
|
-
return _lodash.default.includes([Concept.dataType.Image, Concept.dataType.Video, Concept.dataType.File], this.datatype);
|
|
270
|
+
return _lodash.default.includes([Concept.dataType.Image, Concept.dataType.ImageV2, Concept.dataType.Video, Concept.dataType.File], this.datatype);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
isSelectConcept() {
|
|
@@ -406,6 +406,7 @@ _defineProperty(Concept, "dataType", {
|
|
|
406
406
|
Notes: "Notes",
|
|
407
407
|
NA: "NA",
|
|
408
408
|
Image: "Image",
|
|
409
|
+
ImageV2: "ImageV2",
|
|
409
410
|
Video: "Video",
|
|
410
411
|
Audio: "Audio",
|
|
411
412
|
Id: "Id",
|
|
@@ -418,7 +419,7 @@ _defineProperty(Concept, "dataType", {
|
|
|
418
419
|
Encounter: "Encounter",
|
|
419
420
|
|
|
420
421
|
get Media() {
|
|
421
|
-
return [this.Image, this.Video, this.Audio, this.File];
|
|
422
|
+
return [this.Image, this.ImageV2, this.Video, this.Audio, this.File];
|
|
422
423
|
}
|
|
423
424
|
|
|
424
425
|
});
|
package/dist/ProgramEnrolment.js
CHANGED
|
@@ -465,7 +465,7 @@ class ProgramEnrolment extends _BaseEntity.default {
|
|
|
465
465
|
|
|
466
466
|
for (let i = 0; i < encounters.length; i++) {
|
|
467
467
|
encounter = encounters[i];
|
|
468
|
-
observation = encounters[i].findObservation(conceptNameOrUuid
|
|
468
|
+
observation = encounters[i].findObservation(conceptNameOrUuid, parentConceptNameOrUuid);
|
|
469
469
|
if (!_lodash.default.isNil(observation)) return {
|
|
470
470
|
observation: observation,
|
|
471
471
|
date: encounter.encounterDateTime
|
|
@@ -473,7 +473,7 @@ class ProgramEnrolment extends _BaseEntity.default {
|
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
if (checkInEnrolment) return {
|
|
476
|
-
observation: this.findObservation(conceptNameOrUuid
|
|
476
|
+
observation: this.findObservation(conceptNameOrUuid, parentConceptNameOrUuid),
|
|
477
477
|
date: this.enrolmentDateTime
|
|
478
478
|
};
|
|
479
479
|
return {};
|
|
@@ -487,7 +487,7 @@ class ProgramEnrolment extends _BaseEntity.default {
|
|
|
487
487
|
findObservation(conceptNameOrUuid, parentConceptNameOrUuid) {
|
|
488
488
|
const observations = _lodash.default.isNil(parentConceptNameOrUuid) ? this.observations : this.findGroupedObservation(parentConceptNameOrUuid);
|
|
489
489
|
return _lodash.default.find(observations, observation => {
|
|
490
|
-
return observation.concept.name
|
|
490
|
+
return observation.concept.name === conceptNameOrUuid || observation.concept.uuid === conceptNameOrUuid;
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
493
|
|
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
|
}
|
|
@@ -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", {
|