openchs-models 1.27.26 → 1.27.27
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/Schema.js +9 -6
- package/package.json +1 -1
package/dist/Schema.js
CHANGED
|
@@ -671,38 +671,41 @@ function createRealmConfig() {
|
|
|
671
671
|
let entityApprovalStatus = oldObjects[i];
|
|
672
672
|
|
|
673
673
|
if (oldObjects[i].entityType === 'Subject') {
|
|
674
|
-
const subject = oldDB.objects(_Individual.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID);
|
|
674
|
+
const subject = oldDB.objects(_Individual.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID)[0];
|
|
675
675
|
|
|
676
676
|
if (subject) {
|
|
677
677
|
newObjects[i].entityTypeUuid = subject.subjectType.uuid;
|
|
678
678
|
}
|
|
679
679
|
} else if (oldObjects[i].entityType === 'ProgramEnrolment') {
|
|
680
|
-
const programEnrolment = oldDB.objects(_ProgramEnrolment.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID);
|
|
680
|
+
const programEnrolment = oldDB.objects(_ProgramEnrolment.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID)[0];
|
|
681
681
|
|
|
682
682
|
if (programEnrolment) {
|
|
683
683
|
newObjects[i].entityTypeUuid = programEnrolment.program.uuid;
|
|
684
684
|
}
|
|
685
685
|
} else if (oldObjects[i].entityType === 'ChecklistItem') {
|
|
686
|
-
const checklistItem = oldDB.objects(_ChecklistItem.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID);
|
|
686
|
+
const checklistItem = oldDB.objects(_ChecklistItem.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID)[0];
|
|
687
687
|
|
|
688
688
|
if (checklistItem) {
|
|
689
689
|
newObjects[i].entityTypeUuid = checklistItem.checklist.programEnrolment.program.uuid;
|
|
690
690
|
}
|
|
691
691
|
} else if (oldObjects[i].entityType === 'Encounter') {
|
|
692
|
-
const encounter = oldDB.objects(_Encounter.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID);
|
|
692
|
+
const encounter = oldDB.objects(_Encounter.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID)[0];
|
|
693
693
|
|
|
694
694
|
if (encounter) {
|
|
695
695
|
newObjects[i].entityTypeUuid = encounter.encounterType.uuid;
|
|
696
696
|
}
|
|
697
697
|
} else if (oldObjects[i].entityType === 'ProgramEncounter') {
|
|
698
|
-
const programEncounter = oldDB.objects(_ProgramEncounter.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID);
|
|
698
|
+
const programEncounter = oldDB.objects(_ProgramEncounter.default.schema.name).filtered("uuid = $0", entityApprovalStatus.entityUUID)[0];
|
|
699
699
|
|
|
700
700
|
if (programEncounter) {
|
|
701
701
|
newObjects[i].entityTypeUuid = programEncounter.encounterType.uuid;
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
const entityApprovalStatusSyncStatus = newDB.objects(_EntitySyncStatus.default.schema.name).filtered("entityName = $0", "EntityApprovalStatus");
|
|
704
707
|
|
|
705
|
-
|
|
708
|
+
if (entityApprovalStatusSyncStatus[0]) {
|
|
706
709
|
newDB.delete(entityApprovalStatusSyncStatus);
|
|
707
710
|
}
|
|
708
711
|
}
|