openchs-models 1.31.77 → 1.31.78

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.
@@ -1087,6 +1087,10 @@ class Individual extends _BaseEntity.default {
1087
1087
  (0, _AuditUtil.updateAuditFields)(this, userInfo, isNew);
1088
1088
  }
1089
1089
 
1090
+ static getAddressLevelDummyUUID() {
1091
+ return ADDRESS_LEVEL_DUMMY_UUID;
1092
+ }
1093
+
1090
1094
  }
1091
1095
 
1092
1096
  _defineProperty(Individual, "schema", {
@@ -84,8 +84,10 @@ class Observation extends _PersistedObject.default {
84
84
  return new _Displayable.default(valueWrapper.asDisplayTime(), null);
85
85
  } else if (valueWrapper.isSingleCoded) {
86
86
  if (observation.concept.datatype === _Concept.default.dataType.Subject) {
87
- const subject = subjectService.findByUUID(valueWrapper.getValue());
88
- return [new _Displayable.default(subject.nameStringWithUniqueAttribute, subject)];
87
+ const uuid = valueWrapper.getValue();
88
+ const subject = subjectService.findByUUID(uuid);
89
+ const displayName = subject && subject.nameStringWithUniqueAttribute || uuid;
90
+ return [new _Displayable.default(displayName, subject)];
89
91
  } else if (observation.concept.datatype === _Concept.default.dataType.Encounter) {
90
92
  const encounter = encounterService.findByUUID(valueWrapper.getValue());
91
93
  const identifier = observation.concept.recordValueByKey(_Concept.default.keys.encounterIdentifier);
@@ -59,7 +59,7 @@ class ObservationsHolder {
59
59
  const groupObservations = observations && observations.getValueWrapper();
60
60
 
61
61
  if (parentFormElement.repeatable) {
62
- return groupObservations && groupObservations.getGroupObservationAtIndex(questionGroupIndex).getObservation(concept);
62
+ return groupObservations && groupObservations.size() > questionGroupIndex && groupObservations.getGroupObservationAtIndex(questionGroupIndex).getObservation(concept);
63
63
  }
64
64
 
65
65
  return groupObservations && groupObservations.getObservation(concept);
package/dist/Schema.js CHANGED
@@ -902,8 +902,16 @@ function createRealmConfig() {
902
902
  // newDB.deleteModel("ProgramOutcome");
903
903
  }
904
904
 
905
- if (oldDB.schemaVersion < 189) {// PlaceHolder for SubjectType.User changes, so that people with previous version of client
906
- // are not able to use fastSync of version 189 and above
905
+ if (oldDB.schemaVersion < 189) {
906
+ _lodash.default.forEach(newDB.objects("SubjectType"), subjectType => {
907
+ if (!subjectType.settings) {
908
+ subjectType.settings = '{}';
909
+ }
910
+ });
911
+ }
912
+
913
+ if (oldDB.schemaVersion < 190) {// PlaceHolder for SubjectType.User changes, so that people with previous version of client
914
+ // are not able to use fastSync of version 190 and above
907
915
  }
908
916
  }
909
917
  };
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.31.77",
4
+ "version": "1.31.78",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",