openchs-models 1.33.53 → 1.33.54
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/ReportCard.js +20 -1
- package/dist/Schema.js +6 -1
- package/package.json +1 -1
package/dist/ReportCard.js
CHANGED
|
@@ -15,6 +15,7 @@ var _EncounterType = _interopRequireDefault(require("./EncounterType"));
|
|
|
15
15
|
var _Duration = _interopRequireDefault(require("./Duration"));
|
|
16
16
|
var _NestedReportCardResult = _interopRequireDefault(require("./reports/NestedReportCardResult"));
|
|
17
17
|
var _CustomCardConfig = _interopRequireDefault(require("./CustomCardConfig"));
|
|
18
|
+
var _AttendanceType = _interopRequireDefault(require("./AttendanceType"));
|
|
18
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
20
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
20
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -151,6 +152,9 @@ class ReportCard extends _BaseEntity.default {
|
|
|
151
152
|
if (resource.actionDetail.encounterTypeUUID) {
|
|
152
153
|
reportCard.actionDetailEncounterType = entityService.findByUUID(resource.actionDetail.encounterTypeUUID, _EncounterType.default.schema.name);
|
|
153
154
|
}
|
|
155
|
+
if (resource.actionDetail.attendanceTypeUUID) {
|
|
156
|
+
reportCard.actionDetailAttendanceType = entityService.findByUUID(resource.actionDetail.attendanceTypeUUID, _AttendanceType.default.schema.name);
|
|
157
|
+
}
|
|
154
158
|
reportCard.actionDetailVisitType = resource.actionDetail.visitType || null;
|
|
155
159
|
}
|
|
156
160
|
reportCard.customCardConfig = entityService.findByUUID(_ResourceUtil.default.getUUIDFor(resource, "customCardConfigUUID"), _CustomCardConfig.default.schema.name);
|
|
@@ -217,6 +221,12 @@ class ReportCard extends _BaseEntity.default {
|
|
|
217
221
|
set actionDetailVisitType(x) {
|
|
218
222
|
this.that.actionDetailVisitType = x;
|
|
219
223
|
}
|
|
224
|
+
get actionDetailAttendanceType() {
|
|
225
|
+
return this.toEntity("actionDetailAttendanceType", _AttendanceType.default);
|
|
226
|
+
}
|
|
227
|
+
set actionDetailAttendanceType(x) {
|
|
228
|
+
this.that.actionDetailAttendanceType = this.fromObject(x);
|
|
229
|
+
}
|
|
220
230
|
get onActionCompletion() {
|
|
221
231
|
return this.that.onActionCompletion;
|
|
222
232
|
}
|
|
@@ -226,6 +236,9 @@ class ReportCard extends _BaseEntity.default {
|
|
|
226
236
|
isActionDoVisit() {
|
|
227
237
|
return this.action === ReportCard.actionTypes.DoVisit;
|
|
228
238
|
}
|
|
239
|
+
isActionMarkAttendance() {
|
|
240
|
+
return this.action === ReportCard.actionTypes.MarkAttendance;
|
|
241
|
+
}
|
|
229
242
|
isScheduledVisitType() {
|
|
230
243
|
return this.actionDetailVisitType === ReportCard.visitTypes.Scheduled;
|
|
231
244
|
}
|
|
@@ -252,7 +265,8 @@ _defineProperty(ReportCard, "cardTypes", {
|
|
|
252
265
|
});
|
|
253
266
|
_defineProperty(ReportCard, "actionTypes", {
|
|
254
267
|
ViewSubjectProfile: "ViewSubjectProfile",
|
|
255
|
-
DoVisit: "DoVisit"
|
|
268
|
+
DoVisit: "DoVisit",
|
|
269
|
+
MarkAttendance: "MarkAttendance"
|
|
256
270
|
});
|
|
257
271
|
_defineProperty(ReportCard, "visitTypes", {
|
|
258
272
|
Scheduled: "Scheduled",
|
|
@@ -336,6 +350,11 @@ _defineProperty(ReportCard, "schema", {
|
|
|
336
350
|
type: "string",
|
|
337
351
|
optional: true
|
|
338
352
|
},
|
|
353
|
+
actionDetailAttendanceType: {
|
|
354
|
+
type: "object",
|
|
355
|
+
objectType: "AttendanceType",
|
|
356
|
+
optional: true
|
|
357
|
+
},
|
|
339
358
|
onActionCompletion: {
|
|
340
359
|
type: "string",
|
|
341
360
|
optional: true
|
package/dist/Schema.js
CHANGED
|
@@ -186,7 +186,7 @@ function createRealmConfig() {
|
|
|
186
186
|
return doCompact;
|
|
187
187
|
},
|
|
188
188
|
//order is important, should be arranged according to the dependency
|
|
189
|
-
schemaVersion:
|
|
189
|
+
schemaVersion: 213,
|
|
190
190
|
onMigration: function (oldDB, newDB) {
|
|
191
191
|
console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
|
|
192
192
|
if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
|
|
@@ -823,6 +823,11 @@ function createRealmConfig() {
|
|
|
823
823
|
// (bool default false). Realm backfills the new boolean and the new
|
|
824
824
|
// schemas have no pre-existing rows.
|
|
825
825
|
}
|
|
826
|
+
if (oldDB.schemaVersion < 213) {
|
|
827
|
+
// Additive: ReportCard.actionDetailAttendanceType (optional ref to
|
|
828
|
+
// AttendanceType) for the new MarkAttendance action. Existing rows
|
|
829
|
+
// remain null.
|
|
830
|
+
}
|
|
826
831
|
}
|
|
827
832
|
};
|
|
828
833
|
}
|