openchs-models 1.23.8 → 1.23.11
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/.nvmrc +1 -1
- package/Makefile +24 -2
- package/dist/Program.js +9 -0
- package/dist/Schema.js +1 -1
- package/dist/StandardReportCardType.js +23 -8
- package/dist/SubjectType.js +8 -0
- package/package.json +1 -1
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v10.15
|
|
1
|
+
v10.15
|
package/Makefile
CHANGED
|
@@ -12,10 +12,12 @@ deps: check-node-v
|
|
|
12
12
|
@rm -rf package-lock.json
|
|
13
13
|
yarn install
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
tests:
|
|
16
16
|
yarn test
|
|
17
17
|
|
|
18
|
-
build: check-node-v
|
|
18
|
+
build: check-node-v build-only
|
|
19
|
+
|
|
20
|
+
build-only:
|
|
19
21
|
yarn run build
|
|
20
22
|
|
|
21
23
|
release:
|
|
@@ -27,3 +29,23 @@ release:
|
|
|
27
29
|
|
|
28
30
|
publish:
|
|
29
31
|
git push && git push origin --tags
|
|
32
|
+
|
|
33
|
+
deploy:
|
|
34
|
+
$(if $(local),$(call _deploy,$(local)/packages/openchs-android/node_modules/openchs-models))
|
|
35
|
+
|
|
36
|
+
deploy-as-source:
|
|
37
|
+
$(if $(local),$(call _deploy_as_source,$(local)/packages/openchs-android/node_modules/openchs-models))
|
|
38
|
+
|
|
39
|
+
define _deploy_as_source
|
|
40
|
+
rm -rf $1/*
|
|
41
|
+
mkdir $1/dist
|
|
42
|
+
cp -r src/* $1/dist/
|
|
43
|
+
cp package.json $1/
|
|
44
|
+
endef
|
|
45
|
+
|
|
46
|
+
define _deploy
|
|
47
|
+
rm -rf $1/*
|
|
48
|
+
mkdir $1/dist
|
|
49
|
+
cp -r dist/* $1/dist/
|
|
50
|
+
cp ./* $1/
|
|
51
|
+
endef
|
package/dist/Program.js
CHANGED
|
@@ -38,6 +38,10 @@ class Program extends _ReferenceEntity.default {
|
|
|
38
38
|
_defineProperty(this, "active", void 0);
|
|
39
39
|
|
|
40
40
|
_defineProperty(this, "voided", void 0);
|
|
41
|
+
|
|
42
|
+
_defineProperty(this, "manualEligibilityCheckRequired", void 0);
|
|
43
|
+
|
|
44
|
+
_defineProperty(this, "manualEnrolmentEligibilityCheckRule", void 0);
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
static fromResource(operationalProgram) {
|
|
@@ -90,6 +94,11 @@ _defineProperty(Program, "schema", {
|
|
|
90
94
|
type: 'string',
|
|
91
95
|
optional: true
|
|
92
96
|
},
|
|
97
|
+
manualEligibilityCheckRequired: 'bool',
|
|
98
|
+
manualEnrolmentEligibilityCheckRule: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
optional: true
|
|
101
|
+
},
|
|
93
102
|
voided: {
|
|
94
103
|
type: 'bool',
|
|
95
104
|
default: false
|
package/dist/Schema.js
CHANGED
|
@@ -182,7 +182,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
182
182
|
var _default = {
|
|
183
183
|
//order is important, should be arranged according to the dependency
|
|
184
184
|
schema: [_LocaleMapping.default, _Settings.default, _Concept.ConceptAnswer, _Concept.default, _EncounterType.default, _Gender.default, _UserDefinedIndividualProperty.default, _AddressLevel.LocationMapping, _AddressLevel.default, _KeyValue.default, _Form.default, _FormMapping.default, _FormElementGroup.default, _FormElement.default, _SubjectType.default, _Individual.default, _ProgramOutcome.default, _Program.default, _ProgramEnrolment.default, _Observation.default, _ProgramEncounter.default, _Encounter.default, _EntitySyncStatus.default, _EntityQueue.default, _ConfigFile.default, _Checklist.default, _ChecklistItem.default, _Format.default, _UserInfo.default, _StringKeyNumericValue.default, _VisitScheduleInterval.default, _VisitScheduleConfig.default, _ProgramConfig.default, _Family.default, _IndividualRelation.default, _IndividualRelationGenderMapping.default, _IndividualRelationshipType.default, _IndividualRelationship.default, _RuleDependency.default, _Rule.default, _ChecklistItemStatus.default, _ChecklistDetail.default, _ChecklistItemDetail.default, _VideoTelemetric.default, _Video.default, _MediaQueue.default, _Point.default, _SyncTelemetry.default, _IdentifierSource.default, _IdentifierAssignment.default, _RuleFailureTelemetry.default, _BeneficiaryModePin.default, _OrganisationConfig.default, _PlatformTranslation.default, _Translation.default, _Groups.default, _MyGroups.default, _GroupPrivileges.default, _Privilege.default, _GroupRole.default, _GroupSubject.default, _DashboardCache.default, _LocationHierarchy.default, _ReportCard.default, _Dashboard.default, _DashboardSectionCardMapping.default, _DraftSubject.default, _StandardReportCardType.default, _ApprovalStatus.default, _EntityApprovalStatus.default, _GroupDashboard.default, _DashboardSection.default, _News.default, _Comment.default, _CommentThread.default, _Extension.default, _SubjectMigration.default, _ResetSync.default, _Documentation.default, _DocumentationItem.default, _TaskType.default, _TaskStatus.default, _Task.default, _TaskUnAssignment.default],
|
|
185
|
-
schemaVersion:
|
|
185
|
+
schemaVersion: 161,
|
|
186
186
|
migration: function (oldDB, newDB) {
|
|
187
187
|
if (oldDB.schemaVersion < 10) {
|
|
188
188
|
var oldObjects = oldDB.objects("DecisionConfig");
|
|
@@ -9,6 +9,8 @@ var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
|
|
|
9
9
|
|
|
10
10
|
var _General = _interopRequireDefault(require("./utility/General"));
|
|
11
11
|
|
|
12
|
+
var _TaskType = _interopRequireDefault(require("./task/TaskType"));
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
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; }
|
|
@@ -20,7 +22,8 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
20
22
|
[StandardReportCardType.type.Rejected]: 'cancel',
|
|
21
23
|
[StandardReportCardType.type.PendingApproval]: 'av-timer',
|
|
22
24
|
[StandardReportCardType.type.Comments]: 'message',
|
|
23
|
-
[StandardReportCardType.type.
|
|
25
|
+
[StandardReportCardType.type.CallTasks]: 'call',
|
|
26
|
+
[StandardReportCardType.type.OpenSubjectTasks]: 'sticky-note-2'
|
|
24
27
|
};
|
|
25
28
|
return typeIcon[this.name];
|
|
26
29
|
}
|
|
@@ -31,7 +34,8 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
31
34
|
[StandardReportCardType.type.Rejected]: '#bf360c',
|
|
32
35
|
[StandardReportCardType.type.PendingApproval]: '#6a1b9a',
|
|
33
36
|
[StandardReportCardType.type.Comments]: '#3949ab',
|
|
34
|
-
[StandardReportCardType.type.
|
|
37
|
+
[StandardReportCardType.type.CallTasks]: '#69a672',
|
|
38
|
+
[StandardReportCardType.type.OpenSubjectTasks]: '#717cac'
|
|
35
39
|
};
|
|
36
40
|
return typeCardColor[this.name];
|
|
37
41
|
}
|
|
@@ -40,14 +44,14 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
40
44
|
return this.isStandardCard() ? '#ffffff' : 'rgba(0, 0, 0, 0.87)';
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
isStandardCard() {
|
|
44
|
-
return _.includes([...this.approvalTypes(), StandardReportCardType.type.Comments, StandardReportCardType.type.Tasks], this.name);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
47
|
static fromResource(resource) {
|
|
48
48
|
return _General.default.assignFields(resource, new StandardReportCardType(), ["uuid", "name", "description", "voided"]);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
isStandardCard() {
|
|
52
|
+
return _.includes([...this.approvalTypes(), StandardReportCardType.type.Comments, StandardReportCardType.type.CallTasks, StandardReportCardType.type.OpenSubjectTasks], this.name);
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
approvalTypes() {
|
|
52
56
|
return [StandardReportCardType.type.PendingApproval, StandardReportCardType.type.Approved, StandardReportCardType.type.Rejected];
|
|
53
57
|
}
|
|
@@ -65,7 +69,17 @@ class StandardReportCardType extends _BaseEntity.default {
|
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
isTaskType() {
|
|
68
|
-
return
|
|
72
|
+
return _.includes([StandardReportCardType.type.CallTasks, StandardReportCardType.type.OpenSubjectTasks], this.name);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
getTaskTypeType() {
|
|
76
|
+
switch (this.name) {
|
|
77
|
+
case StandardReportCardType.type.CallTasks:
|
|
78
|
+
return _TaskType.default.TaskTypeName.Call;
|
|
79
|
+
|
|
80
|
+
case StandardReportCardType.type.OpenSubjectTasks:
|
|
81
|
+
return _TaskType.default.TaskTypeName.OpenSubject;
|
|
82
|
+
}
|
|
69
83
|
}
|
|
70
84
|
|
|
71
85
|
isDefaultType() {
|
|
@@ -102,7 +116,8 @@ _defineProperty(StandardReportCardType, "type", {
|
|
|
102
116
|
LatestVisits: "Last 24 hours visits",
|
|
103
117
|
Total: "Total",
|
|
104
118
|
Comments: "Comments",
|
|
105
|
-
|
|
119
|
+
CallTasks: "Call tasks",
|
|
120
|
+
OpenSubjectTasks: "Open subject tasks"
|
|
106
121
|
});
|
|
107
122
|
|
|
108
123
|
var _default = StandardReportCardType;
|
package/dist/SubjectType.js
CHANGED
|
@@ -40,6 +40,8 @@ class SubjectType extends _ReferenceEntity.default {
|
|
|
40
40
|
_defineProperty(this, "validMiddleNameFormat", void 0);
|
|
41
41
|
|
|
42
42
|
_defineProperty(this, "validLastNameFormat", void 0);
|
|
43
|
+
|
|
44
|
+
_defineProperty(this, "programEligibilitySummaryRule", void 0);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
static create(name, group = false, household = false, type) {
|
|
@@ -63,6 +65,7 @@ class SubjectType extends _ReferenceEntity.default {
|
|
|
63
65
|
subjectType.active = operationalSubjectType.active;
|
|
64
66
|
subjectType.type = operationalSubjectType.type;
|
|
65
67
|
subjectType.subjectSummaryRule = operationalSubjectType.subjectSummaryRule;
|
|
68
|
+
subjectType.programEligibilitySummaryRule = operationalSubjectType.programEligibilitySummaryRule;
|
|
66
69
|
subjectType.uniqueName = operationalSubjectType.uniqueName;
|
|
67
70
|
subjectType.allowMiddleName = operationalSubjectType.allowMiddleName;
|
|
68
71
|
subjectType.allowProfilePicture = operationalSubjectType.allowProfilePicture;
|
|
@@ -86,6 +89,7 @@ class SubjectType extends _ReferenceEntity.default {
|
|
|
86
89
|
cloned.active = this.active;
|
|
87
90
|
cloned.type = this.type;
|
|
88
91
|
cloned.subjectSummaryRule = this.subjectSummaryRule;
|
|
92
|
+
cloned.programEligibilitySummaryRule = this.programEligibilitySummaryRule;
|
|
89
93
|
cloned.allowEmptyLocation = this.allowEmptyLocation;
|
|
90
94
|
cloned.allowMiddleName = this.allowMiddleName;
|
|
91
95
|
cloned.allowProfilePicture = this.allowProfilePicture;
|
|
@@ -153,6 +157,10 @@ _defineProperty(SubjectType, "schema", {
|
|
|
153
157
|
type: 'string',
|
|
154
158
|
optional: true
|
|
155
159
|
},
|
|
160
|
+
programEligibilitySummaryRule: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
optional: true
|
|
163
|
+
},
|
|
156
164
|
uniqueName: {
|
|
157
165
|
type: 'bool',
|
|
158
166
|
default: false
|