openchs-models 1.31.76 → 1.31.77
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.
- package/dist/CustomFilter.js +2 -1
- package/dist/Individual.js +0 -4
- package/dist/Observation.js +2 -4
- package/dist/ObservationsHolder.js +1 -1
- package/dist/ReportCard.js +52 -6
- package/dist/Schema.js +2 -10
- package/dist/StandardReportCardType.js +4 -0
- package/dist/reports/DashboardFilterConfig.js +14 -0
- package/package.json +1 -1
package/dist/CustomFilter.js
CHANGED
|
@@ -41,7 +41,8 @@ _defineProperty(CustomFilter, "type", {
|
|
|
41
41
|
EncounterDate: "EncounterDate",
|
|
42
42
|
Address: "Address",
|
|
43
43
|
Concept: "Concept",
|
|
44
|
-
GroupSubject: "GroupSubject"
|
|
44
|
+
GroupSubject: "GroupSubject",
|
|
45
|
+
SubjectType: "SubjectType"
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
_defineProperty(CustomFilter, "scope", {
|
package/dist/Individual.js
CHANGED
|
@@ -1087,10 +1087,6 @@ class Individual extends _BaseEntity.default {
|
|
|
1087
1087
|
(0, _AuditUtil.updateAuditFields)(this, userInfo, isNew);
|
|
1088
1088
|
}
|
|
1089
1089
|
|
|
1090
|
-
static getAddressLevelDummyUUID() {
|
|
1091
|
-
return ADDRESS_LEVEL_DUMMY_UUID;
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
1090
|
}
|
|
1095
1091
|
|
|
1096
1092
|
_defineProperty(Individual, "schema", {
|
package/dist/Observation.js
CHANGED
|
@@ -84,10 +84,8 @@ class Observation extends _PersistedObject.default {
|
|
|
84
84
|
return new _Displayable.default(valueWrapper.asDisplayTime(), null);
|
|
85
85
|
} else if (valueWrapper.isSingleCoded) {
|
|
86
86
|
if (observation.concept.datatype === _Concept.default.dataType.Subject) {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
const displayName = subject && subject.nameStringWithUniqueAttribute || uuid;
|
|
90
|
-
return [new _Displayable.default(displayName, subject)];
|
|
87
|
+
const subject = subjectService.findByUUID(valueWrapper.getValue());
|
|
88
|
+
return [new _Displayable.default(subject.nameStringWithUniqueAttribute, subject)];
|
|
91
89
|
} else if (observation.concept.datatype === _Concept.default.dataType.Encounter) {
|
|
92
90
|
const encounter = encounterService.findByUUID(valueWrapper.getValue());
|
|
93
91
|
const identifier = observation.concept.recordValueByKey(_Concept.default.keys.encounterIdentifier);
|
|
@@ -59,7 +59,7 @@ class ObservationsHolder {
|
|
|
59
59
|
const groupObservations = observations && observations.getValueWrapper();
|
|
60
60
|
|
|
61
61
|
if (parentFormElement.repeatable) {
|
|
62
|
-
return groupObservations && groupObservations.
|
|
62
|
+
return groupObservations && groupObservations.getGroupObservationAtIndex(questionGroupIndex).getObservation(concept);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return groupObservations && groupObservations.getObservation(concept);
|
package/dist/ReportCard.js
CHANGED
|
@@ -15,14 +15,16 @@ var _StandardReportCardType = _interopRequireDefault(require("./StandardReportCa
|
|
|
15
15
|
|
|
16
16
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
17
17
|
|
|
18
|
+
var _SubjectType = _interopRequireDefault(require("./SubjectType"));
|
|
19
|
+
|
|
20
|
+
var _Program = _interopRequireDefault(require("./Program"));
|
|
21
|
+
|
|
22
|
+
var _EncounterType = _interopRequireDefault(require("./EncounterType"));
|
|
23
|
+
|
|
18
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
25
|
|
|
20
26
|
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; }
|
|
21
27
|
|
|
22
|
-
function throwInvalidIndexError(index, reportCardsLength) {
|
|
23
|
-
throw new Error(`Invalid index ${index} specified for reportCard with length ${reportCardsLength}`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
28
|
class ReportCard extends _BaseEntity.default {
|
|
27
29
|
constructor(that = null) {
|
|
28
30
|
super(that);
|
|
@@ -96,6 +98,30 @@ class ReportCard extends _BaseEntity.default {
|
|
|
96
98
|
get textColor() {
|
|
97
99
|
return _lodash.default.isNil(this.standardReportCardType) ? '#ffffff' : this.standardReportCardType.textColor;
|
|
98
100
|
}
|
|
101
|
+
|
|
102
|
+
get standardReportCardInputSubjectTypes() {
|
|
103
|
+
return this.toEntityList("standardReportCardInputSubjectTypes", _SubjectType.default);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
set standardReportCardInputSubjectTypes(x) {
|
|
107
|
+
this.that.standardReportCardInputSubjectTypes = this.fromEntityList(x);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get standardReportCardInputPrograms() {
|
|
111
|
+
return this.toEntityList("standardReportCardInputPrograms", _Program.default);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
set standardReportCardInputPrograms(x) {
|
|
115
|
+
this.that.standardReportCardInputPrograms = this.fromEntityList(x);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
get standardReportCardInputEncounterTypes() {
|
|
119
|
+
return this.toEntityList("standardReportCardInputEncounterTypes", _EncounterType.default);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
set standardReportCardInputEncounterTypes(x) {
|
|
123
|
+
this.that.standardReportCardInputEncounterTypes = this.fromEntityList(x);
|
|
124
|
+
}
|
|
99
125
|
/**
|
|
100
126
|
* Helper method used to generate unique key value for Nested Report Cards using UUID and Index of the Report Card.
|
|
101
127
|
* The Nested Report Card's query responses would be mapped to the corresponding Dashboard Report cards using the UUID and Index.
|
|
@@ -132,6 +158,14 @@ class ReportCard extends _BaseEntity.default {
|
|
|
132
158
|
return _lodash.default.isNil(this.standardReportCardType) ? false : this.standardReportCardType.isTaskType();
|
|
133
159
|
}
|
|
134
160
|
|
|
161
|
+
isStandardReportType() {
|
|
162
|
+
return !_lodash.default.isNil(this.standardReportCardType);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
isSubjectTypeFilterSupported() {
|
|
166
|
+
return this.isStandardReportType() && this.standardReportCardType.isSubjectTypeFilterSupported();
|
|
167
|
+
}
|
|
168
|
+
|
|
135
169
|
}
|
|
136
170
|
|
|
137
171
|
_defineProperty(ReportCard, "schema", {
|
|
@@ -166,8 +200,20 @@ _defineProperty(ReportCard, "schema", {
|
|
|
166
200
|
type: "int",
|
|
167
201
|
default: 1,
|
|
168
202
|
optional: true
|
|
169
|
-
}
|
|
170
|
-
|
|
203
|
+
},
|
|
204
|
+
//Used only by nested ReportCards
|
|
205
|
+
standardReportCardInputSubjectTypes: {
|
|
206
|
+
type: "list",
|
|
207
|
+
objectType: "SubjectType"
|
|
208
|
+
},
|
|
209
|
+
standardReportCardInputPrograms: {
|
|
210
|
+
type: "list",
|
|
211
|
+
objectType: "Program"
|
|
212
|
+
},
|
|
213
|
+
standardReportCardInputEncounterTypes: {
|
|
214
|
+
type: "list",
|
|
215
|
+
objectType: "EncounterType"
|
|
216
|
+
}
|
|
171
217
|
}
|
|
172
218
|
});
|
|
173
219
|
|
package/dist/Schema.js
CHANGED
|
@@ -902,16 +902,8 @@ function createRealmConfig() {
|
|
|
902
902
|
// newDB.deleteModel("ProgramOutcome");
|
|
903
903
|
}
|
|
904
904
|
|
|
905
|
-
if (oldDB.schemaVersion < 189) {
|
|
906
|
-
|
|
907
|
-
if (!subjectType.settings) {
|
|
908
|
-
subjectType.settings = '{}';
|
|
909
|
-
}
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
if (oldDB.schemaVersion < 190) {// PlaceHolder for SubjectType.User changes, so that people with previous version of client
|
|
914
|
-
// are not able to use fastSync of version 190 and above
|
|
905
|
+
if (oldDB.schemaVersion < 189) {// PlaceHolder for SubjectType.User changes, so that people with previous version of client
|
|
906
|
+
// are not able to use fastSync of version 189 and above
|
|
915
907
|
}
|
|
916
908
|
}
|
|
917
909
|
};
|
|
@@ -118,6 +118,10 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
118
118
|
return typeToStatusMap[this.name];
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
isSubjectTypeFilterSupported() {
|
|
122
|
+
return [StandardReportCardType.type.ScheduledVisits, StandardReportCardType.type.OverdueVisits].includes(this.name);
|
|
123
|
+
}
|
|
124
|
+
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
_defineProperty(StandardReportCardType, "schema", {
|
|
@@ -111,6 +111,8 @@ const dateFilterTypes = [_CustomFilter.default.type.RegistrationDate, _CustomFil
|
|
|
111
111
|
|
|
112
112
|
class DashboardFilterConfig {
|
|
113
113
|
constructor() {
|
|
114
|
+
_defineProperty(this, "subjectType", void 0);
|
|
115
|
+
|
|
114
116
|
_defineProperty(this, "type", void 0);
|
|
115
117
|
|
|
116
118
|
_defineProperty(this, "widget", void 0);
|
|
@@ -140,6 +142,10 @@ class DashboardFilterConfig {
|
|
|
140
142
|
return this.type === _CustomFilter.default.type.GroupSubject;
|
|
141
143
|
}
|
|
142
144
|
|
|
145
|
+
isSubjectTypeFilter() {
|
|
146
|
+
return this.type === _CustomFilter.default.type.SubjectType;
|
|
147
|
+
}
|
|
148
|
+
|
|
143
149
|
isValid() {
|
|
144
150
|
const valid = !_lodash.default.isNil(this.type);
|
|
145
151
|
if (!valid) return valid;
|
|
@@ -149,6 +155,7 @@ class DashboardFilterConfig {
|
|
|
149
155
|
toServerRequest() {
|
|
150
156
|
const request = {
|
|
151
157
|
type: this.type,
|
|
158
|
+
subjectTypeUUID: this.subjectType && this.subjectType.uuid,
|
|
152
159
|
widget: this.widget
|
|
153
160
|
};
|
|
154
161
|
if (this.isConceptTypeFilter()) request.observationBasedFilter = this.observationBasedFilter.toServerRequest();else if (this.isGroupSubjectTypeFilter()) request.groupSubjectTypeFilter = this.groupSubjectTypeFilter.toServerRequest();
|
|
@@ -175,6 +182,12 @@ class DashboardFilterConfig {
|
|
|
175
182
|
return [RegistrationDate, EnrolmentDate, ProgramEncounterDate, EncounterDate].includes(this.type) || this.isConceptTypeFilter() && this.observationBasedFilter.isWidgetRequired();
|
|
176
183
|
}
|
|
177
184
|
|
|
185
|
+
setSubjectType(subjectType) {
|
|
186
|
+
if (_lodash.default.get(subjectType, "uuid") !== _lodash.default.get(this.subjectType, "uuid")) {
|
|
187
|
+
this.subjectType = subjectType;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
178
191
|
willObservationBeInScopeOfProgramEnrolment() {
|
|
179
192
|
return this.isConceptTypeFilter() && this.observationBasedFilter.willObservationBeInScopeOfProgramEnrolment();
|
|
180
193
|
}
|
|
@@ -200,6 +213,7 @@ class DashboardFilterConfig {
|
|
|
200
213
|
clone() {
|
|
201
214
|
const clone = new DashboardFilterConfig();
|
|
202
215
|
clone.type = this.type;
|
|
216
|
+
clone.subjectType = this.subjectType;
|
|
203
217
|
clone.widget = this.widget;
|
|
204
218
|
clone.groupSubjectTypeFilter = this.groupSubjectTypeFilter;
|
|
205
219
|
clone.observationBasedFilter = this.observationBasedFilter;
|