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.
@@ -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
- SESSION_OUTCOME_REASON_CONCEPT_UUID: "session_outcome_reason_concept_uuid",
19
- ABSENCE_REASON_CONCEPT_UUID: "absence_reason_concept_uuid",
20
- FOLLOW_UP_ENCOUNTER_TYPE_UUID: "follow_up_encounter_type_uuid",
21
- SHARE_RULE: "share_rule",
22
- AUTO_SHARE_ON_SAVE: "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.SESSION_OUTCOME_REASON_CONCEPT_UUID] || null;
88
+ return this.getConfig()[CONFIG_KEYS.SESSION_OUTCOME_REASON_CONCEPT] || null;
89
89
  }
90
90
  getAbsenceReasonConceptUUID() {
91
- return this.getConfig()[CONFIG_KEYS.ABSENCE_REASON_CONCEPT_UUID] || null;
91
+ return this.getConfig()[CONFIG_KEYS.ABSENCE_REASON_CONCEPT] || null;
92
92
  }
93
93
  getFollowUpEncounterTypeUUID() {
94
- return this.getConfig()[CONFIG_KEYS.FOLLOW_UP_ENCOUNTER_TYPE_UUID] || null;
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
- markHeld(rosterByStudentUUID) {
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) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openchs-models",
3
3
  "description": "OpenCHS data model to be used by front end clients",
4
- "version": "1.33.51",
4
+ "version": "1.33.53",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",