openchs-models 1.27.18 → 1.27.19

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.
@@ -532,6 +532,11 @@ class ObservationsHolder {
532
532
  display += `${I18n.t(obs.concept.name)}: ${obs.getReadableValue()}\n`;
533
533
  });
534
534
  return display;
535
+ } // it uses only underlying realm model and not avni model
536
+
537
+
538
+ static hasAnyAnswer(obsHolder, conceptUuid, answerUuids) {
539
+ return _lodash.default.some(obsHolder.observations, obs => obs.concept.uuid === conceptUuid && obs.valueJSON && _lodash.default.some(answerUuids, ansUuid => obs.valueJSON.includes(ansUuid)));
535
540
  }
536
541
 
537
542
  }
@@ -45,6 +45,14 @@ class RealmResultsProxy {
45
45
  this.materialiseArray();
46
46
  return this.array.filter(predicate, thisArg);
47
47
  }
48
+ /*
49
+ Uses underlying collection. The objects would not have access to business methods on avni model
50
+ */
51
+
52
+
53
+ filterInternal(predicate, thisArg) {
54
+ return this.realmCollection.filter(predicate, thisArg);
55
+ }
48
56
 
49
57
  filtered(query, ...args) {
50
58
  return RealmResultsProxy.create(this.realmCollection.filtered(query, ...args), this.entityClass);
@@ -73,6 +81,16 @@ class RealmResultsProxy {
73
81
  return callback(this.createEntity(object), index, this);
74
82
  }, thisArg);
75
83
  }
84
+ /*
85
+ Uses underlying collection. The objects would not have access to business methods on avni model
86
+ */
87
+
88
+
89
+ mapInternal(callback, thisArg) {
90
+ return this.realmCollection.map((object, index) => {
91
+ return callback(object, index, this);
92
+ }, thisArg);
93
+ }
76
94
 
77
95
  max(property) {
78
96
  return this.realmCollection.max(property);
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.27.18",
4
+ "version": "1.27.19",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",