openchs-models 1.23.9 → 1.24.0
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 +27 -2
- package/dist/Program.js +9 -0
- package/dist/Schema.js +4 -2
- package/dist/SubjectType.js +8 -0
- package/dist/draft/DraftEncounter.js +115 -0
- package/dist/index.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,26 @@ release:
|
|
|
27
29
|
|
|
28
30
|
publish:
|
|
29
31
|
git push && git push origin --tags
|
|
32
|
+
|
|
33
|
+
copy-dist-to-avni-client:
|
|
34
|
+
cp -r * ../avni-client/packages/openchs-android/node_modules/openchs-models/
|
|
35
|
+
|
|
36
|
+
deploy:
|
|
37
|
+
$(if $(local),$(call _deploy,$(local)/packages/openchs-android/node_modules/openchs-models))
|
|
38
|
+
|
|
39
|
+
deploy-as-source:
|
|
40
|
+
$(if $(local),$(call _deploy_as_source,$(local)/packages/openchs-android/node_modules/openchs-models))
|
|
41
|
+
|
|
42
|
+
define _deploy_as_source
|
|
43
|
+
rm -rf $1/*
|
|
44
|
+
mkdir $1/dist
|
|
45
|
+
cp -r src/* $1/dist/
|
|
46
|
+
cp package.json $1/
|
|
47
|
+
endef
|
|
48
|
+
|
|
49
|
+
define _deploy
|
|
50
|
+
rm -rf $1/*
|
|
51
|
+
mkdir $1/dist
|
|
52
|
+
cp -r dist/* $1/dist/
|
|
53
|
+
cp ./* $1/
|
|
54
|
+
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
|
@@ -173,6 +173,8 @@ var _TaskStatus = _interopRequireDefault(require("./task/TaskStatus"));
|
|
|
173
173
|
|
|
174
174
|
var _TaskUnAssignment = _interopRequireDefault(require("./task/TaskUnAssignment"));
|
|
175
175
|
|
|
176
|
+
var _DraftEncounter = _interopRequireDefault(require("./draft/DraftEncounter"));
|
|
177
|
+
|
|
176
178
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
177
179
|
|
|
178
180
|
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; }
|
|
@@ -181,8 +183,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
181
183
|
|
|
182
184
|
var _default = {
|
|
183
185
|
//order is important, should be arranged according to the dependency
|
|
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:
|
|
186
|
+
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, _DraftEncounter.default],
|
|
187
|
+
schemaVersion: 161,
|
|
186
188
|
migration: function (oldDB, newDB) {
|
|
187
189
|
if (oldDB.schemaVersion < 10) {
|
|
188
190
|
var oldObjects = oldDB.objects("DecisionConfig");
|
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
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _ObservationsHolder = _interopRequireDefault(require("../ObservationsHolder"));
|
|
9
|
+
|
|
10
|
+
var _Encounter = _interopRequireDefault(require("../Encounter"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
class DraftEncounter {
|
|
17
|
+
static create(encounter) {
|
|
18
|
+
const draftEncounter = new DraftEncounter();
|
|
19
|
+
draftEncounter.uuid = encounter.uuid;
|
|
20
|
+
draftEncounter.encounterType = encounter.encounterType;
|
|
21
|
+
draftEncounter.encounterDateTime = encounter.encounterDateTime;
|
|
22
|
+
draftEncounter.individual = encounter.individual;
|
|
23
|
+
draftEncounter.observations = encounter.observations;
|
|
24
|
+
draftEncounter.encounterLocation = encounter.encounterLocation;
|
|
25
|
+
draftEncounter.name = encounter.name;
|
|
26
|
+
draftEncounter.earliestVisitDateTime = encounter.earliestVisitDateTime;
|
|
27
|
+
draftEncounter.maxVisitDateTime = encounter.maxVisitDateTime;
|
|
28
|
+
draftEncounter.cancelDateTime = encounter.cancelDateTime;
|
|
29
|
+
draftEncounter.cancelObservations = encounter.cancelObservations;
|
|
30
|
+
draftEncounter.cancelLocation = encounter.cancelLocation;
|
|
31
|
+
draftEncounter.voided = encounter.voided;
|
|
32
|
+
draftEncounter.latestEntityApprovalStatus = encounter.latestEntityApprovalStatus;
|
|
33
|
+
draftEncounter.registrationLocation = encounter.registrationLocation;
|
|
34
|
+
draftEncounter.updatedOn = new Date();
|
|
35
|
+
return draftEncounter;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
constructEncounter() {
|
|
39
|
+
const encounter = new _Encounter.default();
|
|
40
|
+
encounter.uuid = this.uuid;
|
|
41
|
+
encounter.encounterType = this.encounterType;
|
|
42
|
+
encounter.encounterDateTime = this.encounterDateTime;
|
|
43
|
+
encounter.individual = this.individual;
|
|
44
|
+
encounter.observations = _ObservationsHolder.default.clone(this.observations);
|
|
45
|
+
encounter.encounterLocation = this.encounterLocation;
|
|
46
|
+
encounter.name = this.name;
|
|
47
|
+
encounter.earliestVisitDateTime = this.earliestVisitDateTime;
|
|
48
|
+
encounter.maxVisitDateTime = this.maxVisitDateTime;
|
|
49
|
+
encounter.cancelDateTime = this.cancelDateTime;
|
|
50
|
+
encounter.cancelObservations = _ObservationsHolder.default.clone(this.cancelObservations);
|
|
51
|
+
encounter.cancelLocation = this.cancelLocation;
|
|
52
|
+
encounter.voided = this.voided;
|
|
53
|
+
encounter.latestEntityApprovalStatus = this.latestEntityApprovalStatus;
|
|
54
|
+
encounter.registrationLocation = this.registrationLocation;
|
|
55
|
+
return encounter;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
_defineProperty(DraftEncounter, "schema", {
|
|
61
|
+
name: "DraftEncounter",
|
|
62
|
+
primaryKey: "uuid",
|
|
63
|
+
properties: {
|
|
64
|
+
uuid: "string",
|
|
65
|
+
encounterType: "EncounterType",
|
|
66
|
+
encounterDateTime: {
|
|
67
|
+
type: "date",
|
|
68
|
+
optional: true
|
|
69
|
+
},
|
|
70
|
+
individual: "Individual",
|
|
71
|
+
observations: {
|
|
72
|
+
type: "list",
|
|
73
|
+
objectType: "Observation"
|
|
74
|
+
},
|
|
75
|
+
encounterLocation: {
|
|
76
|
+
type: "Point",
|
|
77
|
+
optional: true
|
|
78
|
+
},
|
|
79
|
+
name: {
|
|
80
|
+
type: "string",
|
|
81
|
+
optional: true
|
|
82
|
+
},
|
|
83
|
+
earliestVisitDateTime: {
|
|
84
|
+
type: "date",
|
|
85
|
+
optional: true
|
|
86
|
+
},
|
|
87
|
+
maxVisitDateTime: {
|
|
88
|
+
type: "date",
|
|
89
|
+
optional: true
|
|
90
|
+
},
|
|
91
|
+
cancelDateTime: {
|
|
92
|
+
type: "date",
|
|
93
|
+
optional: true
|
|
94
|
+
},
|
|
95
|
+
cancelObservations: {
|
|
96
|
+
type: "list",
|
|
97
|
+
objectType: "Observation"
|
|
98
|
+
},
|
|
99
|
+
cancelLocation: {
|
|
100
|
+
type: "Point",
|
|
101
|
+
optional: true
|
|
102
|
+
},
|
|
103
|
+
voided: {
|
|
104
|
+
type: "bool",
|
|
105
|
+
default: false
|
|
106
|
+
},
|
|
107
|
+
latestEntityApprovalStatus: {
|
|
108
|
+
type: "EntityApprovalStatus",
|
|
109
|
+
optional: true
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
var _default = DraftEncounter;
|
|
115
|
+
exports.default = _default;
|
package/dist/index.js
CHANGED
|
@@ -699,6 +699,12 @@ Object.defineProperty(exports, "TaskUnAssignment", {
|
|
|
699
699
|
return _TaskUnAssignment.default;
|
|
700
700
|
}
|
|
701
701
|
});
|
|
702
|
+
Object.defineProperty(exports, "DraftEncounter", {
|
|
703
|
+
enumerable: true,
|
|
704
|
+
get: function () {
|
|
705
|
+
return _DraftEncounter.default;
|
|
706
|
+
}
|
|
707
|
+
});
|
|
702
708
|
|
|
703
709
|
var _AbstractEncounter = _interopRequireDefault(require("./AbstractEncounter"));
|
|
704
710
|
|
|
@@ -930,6 +936,8 @@ var _TaskType = _interopRequireDefault(require("./task/TaskType"));
|
|
|
930
936
|
|
|
931
937
|
var _TaskUnAssignment = _interopRequireDefault(require("./task/TaskUnAssignment"));
|
|
932
938
|
|
|
939
|
+
var _DraftEncounter = _interopRequireDefault(require("./draft/DraftEncounter"));
|
|
940
|
+
|
|
933
941
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
934
942
|
|
|
935
943
|
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; }
|