openchs-models 1.22.0 → 1.22.1
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/Individual.js +16 -2
- package/dist/Schema.js +1 -1
- package/dist/SubjectType.js +16 -0
- package/package.json +1 -1
package/dist/Individual.js
CHANGED
|
@@ -83,6 +83,8 @@ class Individual extends _BaseEntity.default {
|
|
|
83
83
|
|
|
84
84
|
_defineProperty(this, "firstName", void 0);
|
|
85
85
|
|
|
86
|
+
_defineProperty(this, "middleName", void 0);
|
|
87
|
+
|
|
86
88
|
_defineProperty(this, "lastName", void 0);
|
|
87
89
|
|
|
88
90
|
_defineProperty(this, "profilePicture", void 0);
|
|
@@ -129,7 +131,7 @@ class Individual extends _BaseEntity.default {
|
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
get toResource() {
|
|
132
|
-
const resource = _lodash.default.pick(this, ["uuid", "firstName", "lastName", "profilePicture", "dateOfBirthVerified", "voided"]);
|
|
134
|
+
const resource = _lodash.default.pick(this, ["uuid", "firstName", "middleName", "lastName", "profilePicture", "dateOfBirthVerified", "voided"]);
|
|
133
135
|
|
|
134
136
|
resource.dateOfBirth = this.dateOfBirth ? (0, _moment.default)(this.dateOfBirth).format("YYYY-MM-DD") : null;
|
|
135
137
|
resource.registrationDate = (0, _moment.default)(this.registrationDate).format("YYYY-MM-DD");
|
|
@@ -176,7 +178,7 @@ class Individual extends _BaseEntity.default {
|
|
|
176
178
|
const gender = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(individualResource, "genderUUID"), _Gender.default.schema.name);
|
|
177
179
|
const subjectType = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(individualResource, "subjectTypeUUID"), _SubjectType.default.schema.name);
|
|
178
180
|
|
|
179
|
-
const individual = _General.default.assignFields(individualResource, new Individual(), ["uuid", "firstName", "lastName", "profilePicture", "dateOfBirthVerified", "voided"], ["dateOfBirth", "registrationDate"], ["observations"], entityService);
|
|
181
|
+
const individual = _General.default.assignFields(individualResource, new Individual(), ["uuid", "firstName", "middleName", "lastName", "profilePicture", "dateOfBirthVerified", "voided"], ["dateOfBirth", "registrationDate"], ["observations"], entityService);
|
|
180
182
|
|
|
181
183
|
individual.gender = gender;
|
|
182
184
|
individual.lowestAddressLevel = addressLevel;
|
|
@@ -386,6 +388,10 @@ class Individual extends _BaseEntity.default {
|
|
|
386
388
|
return this.validateName(this.firstName, Individual.validationKeys.FIRST_NAME, this.subjectType.validFirstNameFormat);
|
|
387
389
|
}
|
|
388
390
|
|
|
391
|
+
validateMiddleName() {
|
|
392
|
+
return this.validateName(this.middleName, Individual.validationKeys.MIDDLE_NAME, this.subjectType.validMiddleNameFormat);
|
|
393
|
+
}
|
|
394
|
+
|
|
389
395
|
validateLastName() {
|
|
390
396
|
return this.validateName(this.lastName, Individual.validationKeys.LAST_NAME, this.subjectType.validLastNameFormat);
|
|
391
397
|
}
|
|
@@ -462,6 +468,7 @@ class Individual extends _BaseEntity.default {
|
|
|
462
468
|
individual.subjectType = this.subjectType.clone();
|
|
463
469
|
individual.name = this.name;
|
|
464
470
|
individual.firstName = this.firstName;
|
|
471
|
+
individual.middleName = this.middleName;
|
|
465
472
|
individual.lastName = this.lastName;
|
|
466
473
|
individual.profilePicture = this.profilePicture;
|
|
467
474
|
individual.dateOfBirth = this.dateOfBirth;
|
|
@@ -488,6 +495,7 @@ class Individual extends _BaseEntity.default {
|
|
|
488
495
|
individual.uuid = this.uuid;
|
|
489
496
|
individual.name = this.name;
|
|
490
497
|
individual.firstName = this.firstName;
|
|
498
|
+
individual.middleName = this.middleName;
|
|
491
499
|
individual.lastName = this.lastName;
|
|
492
500
|
individual.profilePicture = this.profilePicture;
|
|
493
501
|
individual.dateOfBirth = this.dateOfBirth;
|
|
@@ -800,6 +808,7 @@ class Individual extends _BaseEntity.default {
|
|
|
800
808
|
return {
|
|
801
809
|
uuid: this.uuid,
|
|
802
810
|
firstName: this.firstName,
|
|
811
|
+
middleName: this.middleName,
|
|
803
812
|
lastName: this.lastName,
|
|
804
813
|
profilePicture: this.profilePicture,
|
|
805
814
|
enrolments: this.enrolments,
|
|
@@ -830,6 +839,10 @@ _defineProperty(Individual, "schema", {
|
|
|
830
839
|
subjectType: "SubjectType",
|
|
831
840
|
name: "string",
|
|
832
841
|
firstName: "string",
|
|
842
|
+
middleName: {
|
|
843
|
+
type: "string",
|
|
844
|
+
optional: true
|
|
845
|
+
},
|
|
833
846
|
lastName: {
|
|
834
847
|
type: "string",
|
|
835
848
|
optional: true
|
|
@@ -899,6 +912,7 @@ _defineProperty(Individual, "validationKeys", {
|
|
|
899
912
|
DOB: "DOB",
|
|
900
913
|
GENDER: "GENDER",
|
|
901
914
|
FIRST_NAME: "FIRST_NAME",
|
|
915
|
+
MIDDLE_NAME: "MIDDLE_NAME",
|
|
902
916
|
LAST_NAME: "LAST_NAME",
|
|
903
917
|
PROFILE_PICTURE: "PROFILE_PICTURE",
|
|
904
918
|
REGISTRATION_DATE: "REGISTRATION_DATE",
|
package/dist/Schema.js
CHANGED
|
@@ -174,7 +174,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
174
174
|
var _default = {
|
|
175
175
|
//order is important, should be arranged according to the dependency
|
|
176
176
|
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],
|
|
177
|
-
schemaVersion:
|
|
177
|
+
schemaVersion: 159,
|
|
178
178
|
migration: function (oldDB, newDB) {
|
|
179
179
|
if (oldDB.schemaVersion < 10) {
|
|
180
180
|
var oldObjects = oldDB.objects("DecisionConfig");
|
package/dist/SubjectType.js
CHANGED
|
@@ -33,8 +33,12 @@ class SubjectType extends _ReferenceEntity.default {
|
|
|
33
33
|
|
|
34
34
|
_defineProperty(this, "uniqueName", void 0);
|
|
35
35
|
|
|
36
|
+
_defineProperty(this, "allowMiddleName", void 0);
|
|
37
|
+
|
|
36
38
|
_defineProperty(this, "validFirstNameFormat", void 0);
|
|
37
39
|
|
|
40
|
+
_defineProperty(this, "validMiddleNameFormat", void 0);
|
|
41
|
+
|
|
38
42
|
_defineProperty(this, "validLastNameFormat", void 0);
|
|
39
43
|
}
|
|
40
44
|
|
|
@@ -60,8 +64,10 @@ class SubjectType extends _ReferenceEntity.default {
|
|
|
60
64
|
subjectType.type = operationalSubjectType.type;
|
|
61
65
|
subjectType.subjectSummaryRule = operationalSubjectType.subjectSummaryRule;
|
|
62
66
|
subjectType.uniqueName = operationalSubjectType.uniqueName;
|
|
67
|
+
subjectType.allowMiddleName = operationalSubjectType.allowMiddleName;
|
|
63
68
|
subjectType.allowProfilePicture = operationalSubjectType.allowProfilePicture;
|
|
64
69
|
subjectType.validFirstNameFormat = _Format.default.fromResource(operationalSubjectType["validFirstNameFormat"]);
|
|
70
|
+
subjectType.validMiddleNameFormat = _Format.default.fromResource(operationalSubjectType["validMiddleNameFormat"]);
|
|
65
71
|
subjectType.validLastNameFormat = _Format.default.fromResource(operationalSubjectType["validLastNameFormat"]);
|
|
66
72
|
subjectType.iconFileS3Key = operationalSubjectType.iconFileS3Key;
|
|
67
73
|
subjectType.syncRegistrationConcept1 = _ResourceUtil.default.getUUIDFor(operationalSubjectType, 'syncRegistrationConcept1');
|
|
@@ -81,9 +87,11 @@ class SubjectType extends _ReferenceEntity.default {
|
|
|
81
87
|
cloned.type = this.type;
|
|
82
88
|
cloned.subjectSummaryRule = this.subjectSummaryRule;
|
|
83
89
|
cloned.allowEmptyLocation = this.allowEmptyLocation;
|
|
90
|
+
cloned.allowMiddleName = this.allowMiddleName;
|
|
84
91
|
cloned.allowProfilePicture = this.allowProfilePicture;
|
|
85
92
|
cloned.uniqueName = this.uniqueName;
|
|
86
93
|
cloned.validFirstNameFormat = this.validFirstNameFormat;
|
|
94
|
+
cloned.validMiddleNameFormat = this.validMiddleNameFormat;
|
|
87
95
|
cloned.validLastNameFormat = this.validLastNameFormat;
|
|
88
96
|
cloned.iconFileS3Key = this.iconFileS3Key;
|
|
89
97
|
cloned.syncRegistrationConcept1 = this.syncRegistrationConcept1;
|
|
@@ -153,6 +161,10 @@ _defineProperty(SubjectType, "schema", {
|
|
|
153
161
|
type: "Format",
|
|
154
162
|
optional: true
|
|
155
163
|
},
|
|
164
|
+
validMiddleNameFormat: {
|
|
165
|
+
type: "Format",
|
|
166
|
+
optional: true
|
|
167
|
+
},
|
|
156
168
|
validLastNameFormat: {
|
|
157
169
|
type: "Format",
|
|
158
170
|
optional: true
|
|
@@ -173,6 +185,10 @@ _defineProperty(SubjectType, "schema", {
|
|
|
173
185
|
type: 'bool',
|
|
174
186
|
default: false
|
|
175
187
|
},
|
|
188
|
+
allowMiddleName: {
|
|
189
|
+
type: 'bool',
|
|
190
|
+
default: false
|
|
191
|
+
},
|
|
176
192
|
nameHelpText: {
|
|
177
193
|
type: "string",
|
|
178
194
|
optional: true
|