openchs-models 1.33.26 → 1.33.28

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.
@@ -139,6 +139,7 @@ class ReportCard extends _BaseEntity.default {
139
139
  reportCard.standardReportCardInputEncounterTypes.push(entityService.findByUUID(uuid, _EncounterType.default.schema.name));
140
140
  });
141
141
  reportCard.setStandardReportCardInputRecentDurationJSON(resource.standardReportCardInputRecentDuration);
142
+ reportCard.action = resource.action || null;
142
143
  return reportCard;
143
144
  }
144
145
  isStandardTaskType() {
@@ -172,7 +173,17 @@ class ReportCard extends _BaseEntity.default {
172
173
  return _NestedReportCardResult.default.create(primaryValue, secondaryValue, false, true, itemKey);
173
174
  });
174
175
  }
176
+ get action() {
177
+ return this.that.action;
178
+ }
179
+ set action(x) {
180
+ this.that.action = x;
181
+ }
175
182
  }
183
+ _defineProperty(ReportCard, "actionTypes", {
184
+ ViewSubjectProfile: "ViewSubjectProfile",
185
+ DoVisit: "DoVisit"
186
+ });
176
187
  _defineProperty(ReportCard, "schema", {
177
188
  name: "ReportCard",
178
189
  primaryKey: "uuid",
@@ -223,6 +234,10 @@ _defineProperty(ReportCard, "schema", {
223
234
  standardReportCardInputRecentDurationJSON: {
224
235
  type: "string",
225
236
  optional: true
237
+ },
238
+ action: {
239
+ type: "string",
240
+ optional: true
226
241
  }
227
242
  }
228
243
  });
package/dist/Schema.js CHANGED
@@ -180,7 +180,7 @@ function createRealmConfig() {
180
180
  return doCompact;
181
181
  },
182
182
  //order is important, should be arranged according to the dependency
183
- schemaVersion: 207,
183
+ schemaVersion: 208,
184
184
  onMigration: function (oldDB, newDB) {
185
185
  console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
186
186
  if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
@@ -257,6 +257,10 @@ class FormElement extends _BaseEntity.default {
257
257
  const unique = this.recordByKey("unique");
258
258
  return _lodash.default.isNil(unique) ? false : unique.getValue();
259
259
  }
260
+ get restrictGalleryUpload() {
261
+ const restrictGalleryUpload = this.recordByKey("restrictGalleryUpload");
262
+ return _lodash.default.isNil(restrictGalleryUpload) ? false : restrictGalleryUpload.getValue();
263
+ }
260
264
  get styles() {
261
265
  const style = {};
262
266
  const backgroundColour = this.recordValueByKey("backgroundColour");
@@ -43,6 +43,24 @@ class ReportCardResult extends _BaseEntity.default {
43
43
  set reportCard(x) {
44
44
  this.that.reportCard = x;
45
45
  }
46
+ get cardName() {
47
+ return this.that.cardName;
48
+ }
49
+ set cardName(x) {
50
+ this.that.cardName = x;
51
+ }
52
+ get cardColor() {
53
+ return this.that.cardColor;
54
+ }
55
+ set cardColor(x) {
56
+ this.that.cardColor = x;
57
+ }
58
+ get textColor() {
59
+ return this.that.textColor;
60
+ }
61
+ set textColor(x) {
62
+ this.that.textColor = x;
63
+ }
46
64
  static create(primaryValue, secondaryValue, clickable, hasErrorMsg = false) {
47
65
  const reportCardResult = new ReportCardResult();
48
66
  reportCardResult.uuid = _General.default.randomUUID();
@@ -52,8 +70,14 @@ class ReportCardResult extends _BaseEntity.default {
52
70
  reportCardResult.hasErrorMsg = hasErrorMsg;
53
71
  return reportCardResult;
54
72
  }
55
- static fromQueryResult(result) {
56
- return ReportCardResult.create(result.primaryValue, result.secondaryValue, _lodash.default.isFunction(result.lineListFunction), result.hasErrorMsg);
73
+ static fromQueryResult(result, reportCard) {
74
+ const reportCardResult = ReportCardResult.create(result.primaryValue, result.secondaryValue, _lodash.default.isFunction(result.lineListFunction), result.hasErrorMsg);
75
+ if (!result.hasErrorMsg) {
76
+ reportCardResult.cardName = result.cardName;
77
+ reportCardResult.cardColor = _lodash.default.isNil(result.cardColor) ? reportCard ? reportCard.colour : undefined : result.cardColor;
78
+ reportCardResult.textColor = result.textColor;
79
+ }
80
+ return reportCardResult;
57
81
  }
58
82
  get lineListFunction() {
59
83
  return _lodash.default.noop;
@@ -67,7 +91,19 @@ _defineProperty(ReportCardResult, "schema", {
67
91
  dashboard: "string",
68
92
  reportCard: "string",
69
93
  primaryValue: "string",
70
- secondaryValue: "string"
94
+ secondaryValue: "string",
95
+ cardName: {
96
+ type: "string",
97
+ optional: true
98
+ },
99
+ cardColor: {
100
+ type: "string",
101
+ optional: true
102
+ },
103
+ textColor: {
104
+ type: "string",
105
+ optional: true
106
+ }
71
107
  }
72
108
  });
73
109
  var _default = ReportCardResult;
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.26",
4
+ "version": "1.33.28",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",