openchs-models 1.31.82 → 1.31.83
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,6 +15,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
|
|
16
16
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
17
|
|
|
18
|
+
const EmptyObjectHash = "99914b932bd37a50b983c5e7c90ae93b";
|
|
19
|
+
|
|
18
20
|
class CustomDashboardCache extends _BaseEntity.default {
|
|
19
21
|
constructor(that = null) {
|
|
20
22
|
super(that);
|
|
@@ -52,6 +54,14 @@ class CustomDashboardCache extends _BaseEntity.default {
|
|
|
52
54
|
this.that.dashboard = this.fromObject(x);
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
get dashboardFiltersHash() {
|
|
58
|
+
return this.that.dashboardFiltersHash;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
set dashboardFiltersHash(x) {
|
|
62
|
+
this.that.dashboardFiltersHash = x;
|
|
63
|
+
}
|
|
64
|
+
|
|
55
65
|
static create(uuid, updatedAt, selectedValuesJSON = '{}', filterApplied) {
|
|
56
66
|
const customDashboardCache = new CustomDashboardCache();
|
|
57
67
|
customDashboardCache.uuid = uuid;
|
|
@@ -72,6 +82,7 @@ class CustomDashboardCache extends _BaseEntity.default {
|
|
|
72
82
|
reset() {
|
|
73
83
|
this.filterApplied = false;
|
|
74
84
|
this.selectedValuesJSON = JSON.stringify({});
|
|
85
|
+
this.dashboardFiltersHash = EmptyObjectHash;
|
|
75
86
|
this.updatedAt = new Date();
|
|
76
87
|
}
|
|
77
88
|
|
|
@@ -86,6 +97,7 @@ class CustomDashboardCache extends _BaseEntity.default {
|
|
|
86
97
|
customDashboardCache.updatedAt = this.updatedAt;
|
|
87
98
|
customDashboardCache.selectedValuesJSON = this.selectedValuesJSON;
|
|
88
99
|
customDashboardCache.filterApplied = this.filterApplied;
|
|
100
|
+
customDashboardCache.dashboardFiltersHash = this.dashboardFiltersHash;
|
|
89
101
|
return customDashboardCache;
|
|
90
102
|
}
|
|
91
103
|
|
|
@@ -99,7 +111,8 @@ _defineProperty(CustomDashboardCache, "schema", {
|
|
|
99
111
|
dashboard: "Dashboard",
|
|
100
112
|
updatedAt: "date",
|
|
101
113
|
selectedValuesJSON: "string",
|
|
102
|
-
filterApplied: "bool"
|
|
114
|
+
filterApplied: "bool",
|
|
115
|
+
dashboardFiltersHash: "string"
|
|
103
116
|
}
|
|
104
117
|
});
|
|
105
118
|
|
package/dist/Schema.js
CHANGED
|
@@ -279,7 +279,7 @@ function createRealmConfig() {
|
|
|
279
279
|
return doCompact;
|
|
280
280
|
},
|
|
281
281
|
//order is important, should be arranged according to the dependency
|
|
282
|
-
schemaVersion:
|
|
282
|
+
schemaVersion: 192,
|
|
283
283
|
onMigration: function (oldDB, newDB) {
|
|
284
284
|
console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
|
|
285
285
|
if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
|
package/dist/index.js
CHANGED
|
@@ -795,6 +795,12 @@ Object.defineProperty(exports, "Locations", {
|
|
|
795
795
|
return _Locations.default;
|
|
796
796
|
}
|
|
797
797
|
});
|
|
798
|
+
Object.defineProperty(exports, "Range", {
|
|
799
|
+
enumerable: true,
|
|
800
|
+
get: function () {
|
|
801
|
+
return _Range.default;
|
|
802
|
+
}
|
|
803
|
+
});
|
|
798
804
|
|
|
799
805
|
var _AbstractEncounter = _interopRequireDefault(require("./AbstractEncounter"));
|
|
800
806
|
|
|
@@ -1050,6 +1056,8 @@ var _JsonStringify = require("./utility/JsonStringify");
|
|
|
1050
1056
|
|
|
1051
1057
|
var _Locations = _interopRequireDefault(require("./location/Locations"));
|
|
1052
1058
|
|
|
1059
|
+
var _Range = _interopRequireDefault(require("./reports/Range"));
|
|
1060
|
+
|
|
1053
1061
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
1054
1062
|
|
|
1055
1063
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -13,6 +13,8 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
13
13
|
|
|
14
14
|
var _DateTimeUtil = _interopRequireDefault(require("../utility/DateTimeUtil"));
|
|
15
15
|
|
|
16
|
+
var _Range = _interopRequireDefault(require("./Range"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -127,8 +129,10 @@ class DashboardFilterConfig {
|
|
|
127
129
|
return this.observationBasedFilter.concept.datatype;
|
|
128
130
|
} else if (this.isGroupSubjectTypeFilter()) {
|
|
129
131
|
return _Concept.default.dataType.Subject;
|
|
130
|
-
} else if (dateFilterTypes.includes(this.type)) {
|
|
132
|
+
} else if (dateFilterTypes.includes(this.type) && this.widget === _CustomFilter.default.widget.Default) {
|
|
131
133
|
return _Concept.default.dataType.Date;
|
|
134
|
+
} else if (dateFilterTypes.includes(this.type) && this.widget === _CustomFilter.default.widget.Range) {
|
|
135
|
+
return _Range.default.DateRange;
|
|
132
136
|
} else {
|
|
133
137
|
return this.type;
|
|
134
138
|
}
|
|
@@ -199,14 +203,10 @@ class DashboardFilterConfig {
|
|
|
199
203
|
validate(filterValue) {
|
|
200
204
|
const inputDataType = this.getInputDataType();
|
|
201
205
|
|
|
202
|
-
if (
|
|
206
|
+
if (_Range.default.DateRange === inputDataType) {
|
|
203
207
|
return _DateTimeUtil.default.validateDateRange(filterValue.minValue, filterValue.maxValue);
|
|
204
208
|
}
|
|
205
209
|
|
|
206
|
-
if (_Concept.default.dataType.Time === inputDataType && this.widget === _CustomFilter.default.widget.Range) {
|
|
207
|
-
return _DateTimeUtil.default.validateTimeRange(filterValue.minValue, filterValue.maxValue);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
210
|
return [true];
|
|
211
211
|
}
|
|
212
212
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
|
|
14
|
+
class Range {
|
|
15
|
+
constructor(minValue, maxValue) {
|
|
16
|
+
_defineProperty(this, "minValue", void 0);
|
|
17
|
+
|
|
18
|
+
_defineProperty(this, "maxValue", void 0);
|
|
19
|
+
|
|
20
|
+
this.minValue = minValue;
|
|
21
|
+
this.maxValue = maxValue;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static empty() {
|
|
25
|
+
return new Range(null, null);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
isEmpty() {
|
|
29
|
+
return _lodash.default.isNil(this.minValue) || _lodash.default.isNil(this.maxValue);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_defineProperty(Range, "DateRange", "DateRange");
|
|
35
|
+
|
|
36
|
+
var _default = Range;
|
|
37
|
+
exports.default = _default;
|