openchs-models 1.33.51 → 1.33.53
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/AttendanceType.js +8 -8
- package/dist/Session.js +6 -2
- package/package.json +1 -1
package/dist/AttendanceType.js
CHANGED
|
@@ -15,11 +15,11 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
const CONFIG_KEYS = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
SHARE_RULE: "
|
|
22
|
-
AUTO_SHARE_ON_SAVE: "
|
|
18
|
+
SESSION_OUTCOME_REASON_CONCEPT: "sessionOutcomeReasonConcept",
|
|
19
|
+
ABSENCE_REASON_CONCEPT: "absenceReasonConcept",
|
|
20
|
+
FOLLOW_UP_ENCOUNTER_TYPE: "followUpEncounterType",
|
|
21
|
+
SHARE_RULE: "shareRule",
|
|
22
|
+
AUTO_SHARE_ON_SAVE: "autoShareOnSave"
|
|
23
23
|
};
|
|
24
24
|
class AttendanceType extends _BaseEntity.default {
|
|
25
25
|
constructor(that = null) {
|
|
@@ -85,13 +85,13 @@ class AttendanceType extends _BaseEntity.default {
|
|
|
85
85
|
this.config = JSON.stringify(obj || {});
|
|
86
86
|
}
|
|
87
87
|
getSessionOutcomeReasonConceptUUID() {
|
|
88
|
-
return this.getConfig()[CONFIG_KEYS.
|
|
88
|
+
return this.getConfig()[CONFIG_KEYS.SESSION_OUTCOME_REASON_CONCEPT] || null;
|
|
89
89
|
}
|
|
90
90
|
getAbsenceReasonConceptUUID() {
|
|
91
|
-
return this.getConfig()[CONFIG_KEYS.
|
|
91
|
+
return this.getConfig()[CONFIG_KEYS.ABSENCE_REASON_CONCEPT] || null;
|
|
92
92
|
}
|
|
93
93
|
getFollowUpEncounterTypeUUID() {
|
|
94
|
-
return this.getConfig()[CONFIG_KEYS.
|
|
94
|
+
return this.getConfig()[CONFIG_KEYS.FOLLOW_UP_ENCOUNTER_TYPE] || null;
|
|
95
95
|
}
|
|
96
96
|
getShareRule() {
|
|
97
97
|
return this.getConfig()[CONFIG_KEYS.SHARE_RULE] || null;
|
package/dist/Session.js
CHANGED
|
@@ -107,9 +107,13 @@ class Session extends _BaseEntity.default {
|
|
|
107
107
|
|
|
108
108
|
// Caller iterates the returned records and persists them in the same realm.write.
|
|
109
109
|
// rosterByStudentUUID: { [studentUUID]: { status: 'Present'|'Absent', reasonConceptUUID?: string } }
|
|
110
|
-
|
|
110
|
+
// reasonConceptUUID: optional session-level reason. Required by the server for
|
|
111
|
+
// Mark-Anyway-Held (Held on weekly_off/public_holiday); ignored on a working day.
|
|
112
|
+
// Default null preserves prior semantics (e.g. re-mark-Held after DidntHappen
|
|
113
|
+
// clears the previously-stored reason).
|
|
114
|
+
markHeld(rosterByStudentUUID, reasonConceptUUID = null) {
|
|
111
115
|
this.status = Session.status.HELD;
|
|
112
|
-
this.reasonConceptUUID = null;
|
|
116
|
+
this.reasonConceptUUID = reasonConceptUUID || null;
|
|
113
117
|
this.markedAt = new Date();
|
|
114
118
|
const records = [];
|
|
115
119
|
_lodash.default.forOwn(rosterByStudentUUID || {}, (entry, studentUUID) => {
|