openchs-models 1.22.3 → 1.22.4

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.
@@ -292,7 +292,12 @@ class Individual extends _BaseEntity.default {
292
292
  }
293
293
 
294
294
  get nameString() {
295
- return this.isPerson() ? `${this.firstName} ${this.middleName ? this.middleName : ''} ${this.lastName}` : this.firstName;
295
+ return this.isPerson() ? Individual.getFullName(this) : this.firstName;
296
+ }
297
+
298
+ static getFullName(obj) {
299
+ let name = `${obj.firstName} ${obj.middleName ? obj.middleName : ''}`.trim();
300
+ return `${name} ${obj.lastName ? obj.lastName : ''}`.trim();
296
301
  } //TODO: this will be fixed later where we specify the option to create a template to display another unique field along with the name
297
302
 
298
303
 
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.3",
4
+ "version": "1.22.4",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",