openchs-models 1.33.29 → 1.33.31

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.
@@ -140,6 +140,18 @@ class ReportCard extends _BaseEntity.default {
140
140
  });
141
141
  reportCard.setStandardReportCardInputRecentDurationJSON(resource.standardReportCardInputRecentDuration);
142
142
  reportCard.action = resource.action || null;
143
+ if (resource.actionDetail) {
144
+ if (resource.actionDetail.subjectTypeUUID) {
145
+ reportCard.actionDetailSubjectType = entityService.findByUUID(resource.actionDetail.subjectTypeUUID, _SubjectType.default.schema.name);
146
+ }
147
+ if (resource.actionDetail.programUUID) {
148
+ reportCard.actionDetailProgram = entityService.findByUUID(resource.actionDetail.programUUID, _Program.default.schema.name);
149
+ }
150
+ if (resource.actionDetail.encounterTypeUUID) {
151
+ reportCard.actionDetailEncounterType = entityService.findByUUID(resource.actionDetail.encounterTypeUUID, _EncounterType.default.schema.name);
152
+ }
153
+ reportCard.actionDetailVisitType = resource.actionDetail.visitType || null;
154
+ }
143
155
  return reportCard;
144
156
  }
145
157
  isStandardTaskType() {
@@ -179,11 +191,45 @@ class ReportCard extends _BaseEntity.default {
179
191
  set action(x) {
180
192
  this.that.action = x;
181
193
  }
194
+ get actionDetailSubjectType() {
195
+ return this.toEntity("actionDetailSubjectType", _SubjectType.default);
196
+ }
197
+ set actionDetailSubjectType(x) {
198
+ this.that.actionDetailSubjectType = this.fromObject(x);
199
+ }
200
+ get actionDetailProgram() {
201
+ return this.toEntity("actionDetailProgram", _Program.default);
202
+ }
203
+ set actionDetailProgram(x) {
204
+ this.that.actionDetailProgram = this.fromObject(x);
205
+ }
206
+ get actionDetailEncounterType() {
207
+ return this.toEntity("actionDetailEncounterType", _EncounterType.default);
208
+ }
209
+ set actionDetailEncounterType(x) {
210
+ this.that.actionDetailEncounterType = this.fromObject(x);
211
+ }
212
+ get actionDetailVisitType() {
213
+ return this.that.actionDetailVisitType;
214
+ }
215
+ set actionDetailVisitType(x) {
216
+ this.that.actionDetailVisitType = x;
217
+ }
218
+ isActionDoVisit() {
219
+ return this.action === ReportCard.actionTypes.DoVisit;
220
+ }
221
+ isScheduledVisitType() {
222
+ return this.actionDetailVisitType === ReportCard.visitTypes.Scheduled;
223
+ }
182
224
  }
183
225
  _defineProperty(ReportCard, "actionTypes", {
184
226
  ViewSubjectProfile: "ViewSubjectProfile",
185
227
  DoVisit: "DoVisit"
186
228
  });
229
+ _defineProperty(ReportCard, "visitTypes", {
230
+ Scheduled: "Scheduled",
231
+ Unplanned: "Unplanned"
232
+ });
187
233
  _defineProperty(ReportCard, "schema", {
188
234
  name: "ReportCard",
189
235
  primaryKey: "uuid",
@@ -238,6 +284,25 @@ _defineProperty(ReportCard, "schema", {
238
284
  action: {
239
285
  type: "string",
240
286
  optional: true
287
+ },
288
+ actionDetailSubjectType: {
289
+ type: "object",
290
+ objectType: "SubjectType",
291
+ optional: true
292
+ },
293
+ actionDetailProgram: {
294
+ type: "object",
295
+ objectType: "Program",
296
+ optional: true
297
+ },
298
+ actionDetailEncounterType: {
299
+ type: "object",
300
+ objectType: "EncounterType",
301
+ optional: true
302
+ },
303
+ actionDetailVisitType: {
304
+ type: "string",
305
+ optional: true
241
306
  }
242
307
  }
243
308
  });
package/dist/Schema.js CHANGED
@@ -776,6 +776,13 @@ function createRealmConfig() {
776
776
  }
777
777
  });
778
778
  }
779
+ if (oldDB.schemaVersion < 208) {
780
+ _lodash.default.forEach(newDB.objects(_EntitySyncStatus.default.schema.name), ess => {
781
+ if (ess.entityName === 'ReportCard') {
782
+ ess.loadedSince = _EntitySyncStatus.default.REALLY_OLD_DATE;
783
+ }
784
+ });
785
+ }
779
786
  if (oldDB.schemaVersion < 207) {
780
787
  const now = new Date();
781
788
  _lodash.default.forEach(newDB.objects("DraftEncounter"), draftEncounter => {
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.29",
4
+ "version": "1.33.31",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",