openchs-models 1.22.5 → 1.22.6

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.
@@ -401,7 +401,7 @@ class Individual extends _BaseEntity.default {
401
401
  }
402
402
 
403
403
  validateMiddleName() {
404
- if (this.subjectType.allowMiddleName) return this.validateName(this.middleName, Individual.validationKeys.MIDDLE_NAME, this.subjectType.validMiddleNameFormat, false);
404
+ return this.validateName(this.middleName, Individual.validationKeys.MIDDLE_NAME, this.subjectType.validMiddleNameFormat, false);
405
405
  }
406
406
 
407
407
  validateLastName() {
@@ -424,7 +424,7 @@ class Individual extends _BaseEntity.default {
424
424
  validationResults.push(this.validateFirstName());
425
425
 
426
426
  if (this.subjectType.isPerson()) {
427
- validationResults.push(this.validateMiddleName());
427
+ if (this.subjectType.allowMiddleName) validationResults.push(this.validateMiddleName());
428
428
  validationResults.push(this.validateLastName());
429
429
  validationResults.push(this.validateDateOfBirth());
430
430
  validationResults.push(this.validateGender());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openchs-models",
3
3
  "description": "OpenCHS data model to be used by front end clients",
4
- "version": "1.22.5",
4
+ "version": "1.22.6",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",