openchs-models 1.27.7 → 1.27.9

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.
Files changed (115) hide show
  1. package/Makefile +8 -12
  2. package/dist/AbstractEncounter.js +89 -8
  3. package/dist/AddressLevel.js +89 -5
  4. package/dist/ApprovalStatus.js +12 -0
  5. package/dist/BaseEntity.js +32 -3
  6. package/dist/BeneficiaryModePin.js +20 -2
  7. package/dist/Checklist.js +39 -1
  8. package/dist/ChecklistDetail.js +22 -6
  9. package/dist/ChecklistItem.js +52 -2
  10. package/dist/ChecklistItemDetail.js +78 -4
  11. package/dist/ChecklistItemStatus.js +66 -4
  12. package/dist/Comment.js +63 -1
  13. package/dist/CommentThread.js +28 -0
  14. package/dist/Concept.js +92 -52
  15. package/dist/ConceptAnswer.js +95 -0
  16. package/dist/ConfigFile.js +25 -1
  17. package/dist/Dashboard.js +20 -0
  18. package/dist/DashboardCache.js +31 -1
  19. package/dist/DashboardSection.js +44 -0
  20. package/dist/DashboardSectionCardMapping.js +28 -0
  21. package/dist/Decision.js +33 -1
  22. package/dist/Documentation.js +14 -6
  23. package/dist/DocumentationItem.js +28 -8
  24. package/dist/Encounter.js +27 -9
  25. package/dist/EncounterType.js +44 -0
  26. package/dist/EntityApprovalStatus.js +55 -29
  27. package/dist/EntityMetaData.js +7 -5
  28. package/dist/EntityQueue.js +29 -1
  29. package/dist/EntitySyncStatus.js +43 -1
  30. package/dist/Extension.js +26 -2
  31. package/dist/Family.js +62 -0
  32. package/dist/Gender.js +8 -4
  33. package/dist/GroupDashboard.js +28 -0
  34. package/dist/GroupPrivileges.js +78 -4
  35. package/dist/GroupRole.js +53 -1
  36. package/dist/GroupSubject.js +41 -3
  37. package/dist/Groups.js +25 -1
  38. package/dist/Identifier.js +40 -6
  39. package/dist/IdentifierAssignment.js +44 -2
  40. package/dist/IdentifierSource.js +16 -4
  41. package/dist/Individual.js +152 -30
  42. package/dist/LocaleMapping.js +26 -1
  43. package/dist/LocationHierarchy.js +52 -0
  44. package/dist/MediaQueue.js +55 -1
  45. package/dist/MyGroups.js +25 -1
  46. package/dist/News.js +73 -13
  47. package/dist/Observation.js +21 -4
  48. package/dist/ObservationsHolder.js +9 -7
  49. package/dist/OrganisationConfig.js +23 -1
  50. package/dist/PersistedObject.js +72 -0
  51. package/dist/PlatformTranslation.js +24 -2
  52. package/dist/Privilege.js +35 -13
  53. package/dist/Program.js +70 -14
  54. package/dist/ProgramConfig.js +28 -0
  55. package/dist/ProgramEncounter.js +29 -3
  56. package/dist/ProgramEnrolment.js +103 -5
  57. package/dist/ProgramOutcome.js +14 -1
  58. package/dist/ReferenceEntity.js +4 -0
  59. package/dist/ReportCard.js +48 -0
  60. package/dist/ResetSync.js +14 -6
  61. package/dist/Rule.js +52 -0
  62. package/dist/RuleDependency.js +12 -0
  63. package/dist/RuleFailureTelemetry.js +55 -1
  64. package/dist/Schema.js +403 -362
  65. package/dist/SchemaNames.js +85 -0
  66. package/dist/Settings.js +81 -1
  67. package/dist/StandardReportCardType.js +20 -0
  68. package/dist/SubjectMigration.js +64 -12
  69. package/dist/SubjectType.js +134 -14
  70. package/dist/SyncTelemetry.js +77 -6
  71. package/dist/Translation.js +24 -2
  72. package/dist/UserDefinedIndividualProperty.js +34 -1
  73. package/dist/UserInfo.js +47 -1
  74. package/dist/VisitScheduleConfig.js +28 -0
  75. package/dist/VisitScheduleInterval.js +28 -6
  76. package/dist/application/Filter.js +68 -0
  77. package/dist/application/Form.js +76 -6
  78. package/dist/application/FormElement.js +102 -4
  79. package/dist/application/FormElementGroup.js +96 -2
  80. package/dist/application/FormMapping.js +68 -22
  81. package/dist/application/Format.js +26 -2
  82. package/dist/application/KeyValue.js +28 -2
  83. package/dist/application/MenuItem.js +41 -11
  84. package/dist/application/MultiSelectFilter.js +39 -0
  85. package/dist/application/SingleSelectFilter.js +42 -0
  86. package/dist/application/StringKeyNumericValue.js +28 -2
  87. package/dist/assignment/UserSubjectAssignment.js +11 -5
  88. package/dist/draft/DraftEncounter.js +113 -1
  89. package/dist/draft/DraftSubject.js +124 -2
  90. package/dist/framework/ArrayHelper.js +49 -0
  91. package/dist/framework/RealmCollectionHelper.js +35 -0
  92. package/dist/framework/RealmListProxy.js +51 -0
  93. package/dist/framework/RealmObjectSchema.js +39 -0
  94. package/dist/framework/RealmProxy.js +94 -0
  95. package/dist/framework/RealmResultsProxy.js +131 -0
  96. package/dist/framework/RealmResultsProxyHandler.js +28 -0
  97. package/dist/geo/Point.js +25 -1
  98. package/dist/index.js +57 -5
  99. package/dist/observation/MultipleCodedValues.js +3 -1
  100. package/dist/observation/PrimitiveValue.js +3 -1
  101. package/dist/observation/QuestionGroup.js +6 -6
  102. package/dist/program/SubjectProgramEligibility.js +40 -10
  103. package/dist/relationship/IndividualRelation.js +15 -1
  104. package/dist/relationship/IndividualRelationGenderMapping.js +26 -2
  105. package/dist/relationship/IndividualRelationship.js +57 -1
  106. package/dist/relationship/IndividualRelationshipType.js +31 -1
  107. package/dist/task/Task.js +61 -13
  108. package/dist/task/TaskStatus.js +24 -8
  109. package/dist/task/TaskType.js +24 -8
  110. package/dist/task/TaskUnAssignment.js +18 -6
  111. package/dist/utility/General.js +2 -2
  112. package/dist/videos/Video.js +39 -1
  113. package/dist/videos/VideoTelemetric.js +49 -1
  114. package/package.json +2 -1
  115. package/yarn.lock +11 -1
package/Makefile CHANGED
@@ -1,24 +1,20 @@
1
- check-node-v:
2
- ifneq ($(shell node -v),$(shell cat .nvmrc))
3
- @echo '\nPlease run `nvm use` in your terminal to change node version\n'
4
- @exit 1
5
- endif
6
- @node -v
1
+ set_node_version:
2
+ . ${NVM_DIR}/nvm.sh && nvm use
7
3
 
8
4
  clean:
9
5
  rm -rf node_modules
10
6
 
11
- deps:
12
- @rm -rf package-lock.json
7
+ deps: set_node_version
8
+ @rm -f package-lock.json
13
9
  yarn install
14
10
 
15
- tests:
11
+ tests: set_node_version
16
12
  yarn test
17
13
 
18
- build:
14
+ build: set_node_version
19
15
  yarn run build
20
16
 
21
- release:
17
+ release: set_node_version
22
18
  git pull --tags
23
19
  git pull --rebase
24
20
  @echo "Ensure version changes follow semantic versioning - https://classic.yarnpkg.com/en/docs/dependency-versions#toc-semantic-versioning"
@@ -36,7 +32,7 @@ deploy-to-avni-client-only:
36
32
 
37
33
  deploy-to-avni-client: build deploy-to-avni-client-only
38
34
 
39
- deploy-to-avni-web:
35
+ deploy-to-avni-project: build
40
36
  $(if $(local),$(call _deploy,$(local)/node_modules/openchs-models))
41
37
 
42
38
  deploy-as-source-to-avni-client:
@@ -27,11 +27,97 @@ var _moment = _interopRequireDefault(require("moment"));
27
27
 
28
28
  var _Observation = _interopRequireDefault(require("./Observation"));
29
29
 
30
+ var _EntityApprovalStatus = _interopRequireDefault(require("./EntityApprovalStatus"));
31
+
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
33
 
32
34
  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; }
33
35
 
34
36
  class AbstractEncounter extends _BaseEntity.default {
37
+ constructor(that = null) {
38
+ super(that);
39
+ }
40
+
41
+ get latestEntityApprovalStatus() {
42
+ return this.toEntity("latestEntityApprovalStatus", _EntityApprovalStatus.default);
43
+ }
44
+
45
+ set latestEntityApprovalStatus(x) {
46
+ this.that.latestEntityApprovalStatus = this.fromObject(x);
47
+ }
48
+
49
+ get name() {
50
+ return this.that.name;
51
+ }
52
+
53
+ set name(x) {
54
+ this.that.name = x;
55
+ }
56
+
57
+ get earliestVisitDateTime() {
58
+ return this.that.earliestVisitDateTime;
59
+ }
60
+
61
+ set earliestVisitDateTime(x) {
62
+ this.that.earliestVisitDateTime = x;
63
+ }
64
+
65
+ get maxVisitDateTime() {
66
+ return this.that.maxVisitDateTime;
67
+ }
68
+
69
+ set maxVisitDateTime(x) {
70
+ this.that.maxVisitDateTime = x;
71
+ }
72
+
73
+ get encounterType() {
74
+ return this.toEntity("encounterType", _EncounterType.default);
75
+ }
76
+
77
+ set encounterType(x) {
78
+ this.that.encounterType = this.fromObject(x);
79
+ }
80
+
81
+ get encounterDateTime() {
82
+ return this.that.encounterDateTime;
83
+ }
84
+
85
+ set encounterDateTime(x) {
86
+ this.that.encounterDateTime = x;
87
+ }
88
+
89
+ get observations() {
90
+ return this.toEntityList("observations", _Observation.default);
91
+ }
92
+
93
+ set observations(x) {
94
+ this.that.observations = this.fromEntityList(x);
95
+ }
96
+
97
+ get cancelLocation() {
98
+ return this.toEntity("cancelLocation", _Point.default);
99
+ }
100
+
101
+ set cancelLocation(x) {
102
+ this.that.cancelLocation = this.fromObject(x);
103
+ }
104
+
105
+ get cancelObservations() {
106
+ return this.toEntityList("cancelObservations", _Observation.default);
107
+ }
108
+
109
+ set cancelObservations(x) {
110
+ this.that.cancelObservations = this.fromEntityList(x);
111
+ }
112
+
113
+ get cancelDateTime() {
114
+ return this.that.cancelDateTime;
115
+ }
116
+
117
+ set cancelDateTime(x) {
118
+ this.that.cancelDateTime = x;
119
+ }
120
+
35
121
  validate() {
36
122
  return _lodash.default.isNil(this.encounterDateTime) ? [new _ValidationResult.default(false, AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME, "emptyValidationMessage")] : [_ValidationResult.default.successful(AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME)];
37
123
  }
@@ -59,8 +145,7 @@ class AbstractEncounter extends _BaseEntity.default {
59
145
  return resource;
60
146
  }
61
147
 
62
- static createEmptyInstance() {
63
- const encounter = new this();
148
+ static createEmptyInstance(encounter) {
64
149
  encounter.voided = false;
65
150
  encounter.uuid = _General.default.randomUUID();
66
151
  encounter.observations = [];
@@ -92,9 +177,7 @@ class AbstractEncounter extends _BaseEntity.default {
92
177
  return encounter;
93
178
  }
94
179
 
95
- static fromResource(resource, entityService) {
96
- const encounter = new this();
97
-
180
+ static fromResource(resource, entityService, encounter) {
98
181
  _General.default.assignFields(resource, encounter, ["uuid", "voided"], ["encounterDateTime"], ["observations", "cancelObservations"], entityService);
99
182
 
100
183
  encounter.encounterType = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(resource, "encounterTypeUUID"), _EncounterType.default.schema.name);
@@ -109,9 +192,7 @@ class AbstractEncounter extends _BaseEntity.default {
109
192
 
110
193
  getEncounterDateValues() {
111
194
  return {
112
- [AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME]: this.encounterDateTime,
113
- [ProgramEncounter.fieldKeys.SCHEDULED_DATE_TIME]: this.earliestVisitDateTime,
114
- [ProgramEncounter.fieldKeys.MAX_DATE_TIME]: this.maxVisitDateTime
195
+ [AbstractEncounter.fieldKeys.ENCOUNTER_DATE_TIME]: this.encounterDateTime
115
196
  };
116
197
  }
117
198
 
@@ -13,6 +13,10 @@ var _General = _interopRequireDefault(require("./utility/General"));
13
13
 
14
14
  var _lodash = _interopRequireDefault(require("lodash"));
15
15
 
16
+ var _Observation = _interopRequireDefault(require("./Observation"));
17
+
18
+ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
19
+
16
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
21
 
18
22
  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; }
@@ -21,6 +25,26 @@ const PARENT_LOCATION_UUID = "parentLocationUUID";
21
25
  const CHILD_LOCATION_UUID = "locationUUID";
22
26
 
23
27
  class LocationMapping extends _BaseEntity.default {
28
+ constructor(that = null) {
29
+ super(that);
30
+ }
31
+
32
+ get parent() {
33
+ return this.toEntity("parent", AddressLevel);
34
+ }
35
+
36
+ set parent(x) {
37
+ this.that.parent = this.fromObject(x);
38
+ }
39
+
40
+ get child() {
41
+ return this.toEntity("child", AddressLevel);
42
+ }
43
+
44
+ set child(x) {
45
+ this.that.child = this.fromObject(x);
46
+ }
47
+
24
48
  static create({
25
49
  uuid,
26
50
  parent,
@@ -49,7 +73,7 @@ class LocationMapping extends _BaseEntity.default {
49
73
  exports.LocationMapping = LocationMapping;
50
74
 
51
75
  _defineProperty(LocationMapping, "schema", {
52
- name: "LocationMapping",
76
+ name: _SchemaNames.default.LocationMapping,
53
77
  primaryKey: "uuid",
54
78
  properties: {
55
79
  uuid: "string",
@@ -65,12 +89,72 @@ _defineProperty(LocationMapping, "schema", {
65
89
  _defineProperty(LocationMapping, "parentAssociations", () => new Map([[AddressLevel, PARENT_LOCATION_UUID]]));
66
90
 
67
91
  class AddressLevel extends _BaseEntity.default {
68
- constructor(...args) {
69
- super(...args);
92
+ constructor(that = null) {
93
+ super(that);
94
+ }
95
+
96
+ get name() {
97
+ return this.that.name;
98
+ }
99
+
100
+ set name(x) {
101
+ this.that.name = x;
102
+ }
103
+
104
+ get level() {
105
+ return this.that.level;
106
+ }
107
+
108
+ set level(x) {
109
+ this.that.level = x;
110
+ }
70
111
 
71
- _defineProperty(this, "uuid", void 0);
112
+ get type() {
113
+ return this.that.type;
114
+ }
115
+
116
+ set type(x) {
117
+ this.that.type = x;
118
+ }
119
+
120
+ get locationMappings() {
121
+ return this.toEntityList("locationMappings", LocationMapping);
122
+ }
123
+
124
+ set locationMappings(x) {
125
+ this.that.locationMappings = this.fromEntityList(x);
126
+ }
127
+
128
+ get locationProperties() {
129
+ return this.toEntityList("locationProperties", _Observation.default);
130
+ }
131
+
132
+ set locationProperties(x) {
133
+ this.that.locationProperties = this.fromEntityList(x);
134
+ }
135
+
136
+ get titleLineage() {
137
+ return this.that.titleLineage;
138
+ }
139
+
140
+ set titleLineage(x) {
141
+ this.that.titleLineage = x;
142
+ }
143
+
144
+ get parentUuid() {
145
+ return this.that.parentUuid;
146
+ }
147
+
148
+ set parentUuid(x) {
149
+ this.that.parentUuid = x;
150
+ }
151
+
152
+ get typeUuid() {
153
+ return this.that.typeUuid;
154
+ }
72
155
 
73
- _defineProperty(this, "name", void 0);
156
+ set typeUuid(x) {
157
+ this.that.typeUuid = x;
74
158
  }
75
159
 
76
160
  static create({
@@ -14,6 +14,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
14
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
15
 
16
16
  class ApprovalStatus extends _BaseEntity.default {
17
+ constructor(that = null) {
18
+ super(that);
19
+ }
20
+
21
+ get status() {
22
+ return this.that.status;
23
+ }
24
+
25
+ set status(x) {
26
+ this.that.status = x;
27
+ }
28
+
17
29
  get isPending() {
18
30
  return this.status === ApprovalStatus.statuses.Pending;
19
31
  }
@@ -15,11 +15,35 @@ var _SyncError = _interopRequireDefault(require("./error/SyncError"));
15
15
 
16
16
  var _ErrorCodes = require("./error/ErrorCodes");
17
17
 
18
+ var _PersistedObject = _interopRequireDefault(require("./PersistedObject"));
19
+
20
+ var _ArrayHelper = _interopRequireDefault(require("./framework/ArrayHelper"));
21
+
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
23
 
20
24
  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; }
21
25
 
22
- class BaseEntity {
26
+ class BaseEntity extends _PersistedObject.default {
27
+ constructor(that) {
28
+ super(that);
29
+ }
30
+
31
+ get voided() {
32
+ return this.that.voided;
33
+ }
34
+
35
+ set voided(x) {
36
+ this.that.voided = x;
37
+ }
38
+
39
+ set uuid(x) {
40
+ this.that.uuid = x;
41
+ }
42
+
43
+ get uuid() {
44
+ return this.that.uuid;
45
+ }
46
+
23
47
  static mergeOn(key) {
24
48
  return entities => {
25
49
  return entities.reduce((acc, entity) => {
@@ -30,10 +54,15 @@ class BaseEntity {
30
54
  });
31
55
  };
32
56
  }
57
+ /*
58
+ to be used only during sync where entities are handled generically and not via model classes
59
+ */
60
+
33
61
 
34
62
  static addNewChild(newChild, existingChildren) {
35
63
  if (!BaseEntity.collectionHasEntity(existingChildren, newChild)) {
36
- existingChildren.push(newChild);
64
+ const child = _lodash.default.isNil(newChild.that) ? newChild : newChild.that;
65
+ existingChildren.push(child);
37
66
  }
38
67
  }
39
68
 
@@ -42,7 +71,7 @@ class BaseEntity {
42
71
  }
43
72
 
44
73
  static removeFromCollection(collection, entity) {
45
- _lodash.default.remove(collection, item => item.uuid === entity.uuid);
74
+ _ArrayHelper.default.remove(collection, item => item.uuid === entity.uuid);
46
75
  }
47
76
 
48
77
  equals(other) {
@@ -5,9 +5,27 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
+ var _PersistedObject = _interopRequireDefault(require("./PersistedObject"));
9
+
10
+ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
8
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; }
9
15
 
10
- class BeneficiaryModePin {
16
+ class BeneficiaryModePin extends _PersistedObject.default {
17
+ constructor(that = null) {
18
+ super(that);
19
+ }
20
+
21
+ get pin() {
22
+ return this.that.pin;
23
+ }
24
+
25
+ set pin(x) {
26
+ this.that.pin = x;
27
+ }
28
+
11
29
  pinMatches(enteredPin) {
12
30
  return enteredPin === this.pin;
13
31
  }
@@ -15,7 +33,7 @@ class BeneficiaryModePin {
15
33
  }
16
34
 
17
35
  _defineProperty(BeneficiaryModePin, "schema", {
18
- name: "BeneficiaryModePin",
36
+ name: _SchemaNames.default.BeneficiaryModePin,
19
37
  properties: {
20
38
  pin: "int"
21
39
  }
package/dist/Checklist.js CHANGED
@@ -19,11 +19,49 @@ var _ChecklistItem = _interopRequireDefault(require("./ChecklistItem"));
19
19
 
20
20
  var _ChecklistDetail = _interopRequireDefault(require("./ChecklistDetail"));
21
21
 
22
+ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
23
+
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
24
26
  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; }
25
27
 
26
28
  class Checklist extends _BaseEntity.default {
29
+ constructor(that = null) {
30
+ super(that);
31
+ }
32
+
33
+ get detail() {
34
+ return this.toEntity("detail", _ChecklistDetail.default);
35
+ }
36
+
37
+ set detail(x) {
38
+ this.that.detail = this.fromObject(x);
39
+ }
40
+
41
+ get baseDate() {
42
+ return this.that.baseDate;
43
+ }
44
+
45
+ set baseDate(x) {
46
+ this.that.baseDate = x;
47
+ }
48
+
49
+ get items() {
50
+ return this.toEntityList("items", _ChecklistItem.default);
51
+ }
52
+
53
+ set items(x) {
54
+ this.that.items = this.fromEntityList(x);
55
+ }
56
+
57
+ get programEnrolment() {
58
+ return this.toEntity("programEnrolment", _ProgramEnrolment.default);
59
+ }
60
+
61
+ set programEnrolment(x) {
62
+ this.that.programEnrolment = this.fromObject(x);
63
+ }
64
+
27
65
  static create() {
28
66
  const checklist = new Checklist();
29
67
  checklist.uuid = _General.default.randomUUID();
@@ -91,7 +129,7 @@ class Checklist extends _BaseEntity.default {
91
129
  }
92
130
 
93
131
  _defineProperty(Checklist, "schema", {
94
- name: "Checklist",
132
+ name: _SchemaNames.default.Checklist,
95
133
  primaryKey: "uuid",
96
134
  properties: {
97
135
  uuid: "string",
@@ -5,23 +5,39 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _ResourceUtil = _interopRequireDefault(require("./utility/ResourceUtil"));
9
-
10
8
  var _General = _interopRequireDefault(require("./utility/General"));
11
9
 
12
10
  var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
13
11
 
14
12
  var _ChecklistItemDetail = _interopRequireDefault(require("./ChecklistItemDetail"));
15
13
 
16
- var _ProgramEncounter = _interopRequireDefault(require("./ProgramEncounter"));
17
-
18
- var _Checklist = _interopRequireDefault(require("./Checklist"));
14
+ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
19
15
 
20
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
17
 
22
18
  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; }
23
19
 
24
20
  class ChecklistDetail extends _BaseEntity.default {
21
+ constructor(that = null) {
22
+ super(that);
23
+ }
24
+
25
+ get name() {
26
+ return this.that.name;
27
+ }
28
+
29
+ set name(x) {
30
+ this.that.name = x;
31
+ }
32
+
33
+ get items() {
34
+ return this.toEntityList("items", _ChecklistItemDetail.default);
35
+ }
36
+
37
+ set items(x) {
38
+ this.that.items = this.fromEntityList(x);
39
+ }
40
+
25
41
  static fromResource(checklistResource, entityService) {
26
42
  const checklistDetail = _General.default.assignFields(checklistResource, new ChecklistDetail(), ["uuid", "name", "voided"]);
27
43
 
@@ -47,7 +63,7 @@ class ChecklistDetail extends _BaseEntity.default {
47
63
  }
48
64
 
49
65
  _defineProperty(ChecklistDetail, "schema", {
50
- name: "ChecklistDetail",
66
+ name: _SchemaNames.default.ChecklistDetail,
51
67
  primaryKey: "uuid",
52
68
  properties: {
53
69
  uuid: "string",
@@ -23,11 +23,61 @@ var _moment = _interopRequireDefault(require("moment"));
23
23
 
24
24
  var _EntityApprovalStatus = _interopRequireDefault(require("./EntityApprovalStatus"));
25
25
 
26
+ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
27
+
28
+ var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
29
+
30
+ var _Observation = _interopRequireDefault(require("./Observation"));
31
+
26
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
33
 
28
34
  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; }
29
35
 
30
- class ChecklistItem {
36
+ class ChecklistItem extends _BaseEntity.default {
37
+ constructor(that = null) {
38
+ super(that);
39
+ }
40
+
41
+ get detail() {
42
+ return this.toEntity("detail", _ChecklistItemDetail.default);
43
+ }
44
+
45
+ set detail(x) {
46
+ this.that.detail = this.fromObject(x);
47
+ }
48
+
49
+ get completionDate() {
50
+ return this.that.completionDate;
51
+ }
52
+
53
+ set completionDate(x) {
54
+ this.that.completionDate = x;
55
+ }
56
+
57
+ get observations() {
58
+ return this.toEntityList("observations", _Observation.default);
59
+ }
60
+
61
+ set observations(x) {
62
+ this.that.observations = this.fromEntityList(x);
63
+ }
64
+
65
+ get checklist() {
66
+ return this.toEntity("checklist", _Checklist.default);
67
+ }
68
+
69
+ set checklist(x) {
70
+ this.that.checklist = this.fromObject(x);
71
+ }
72
+
73
+ get latestEntityApprovalStatus() {
74
+ return this.toEntity("latestEntityApprovalStatus", _EntityApprovalStatus.default);
75
+ }
76
+
77
+ set latestEntityApprovalStatus(x) {
78
+ this.that.latestEntityApprovalStatus = this.fromObject(x);
79
+ }
80
+
31
81
  static create({
32
82
  uuid = _General.default.randomUUID(),
33
83
  observations = [],
@@ -233,7 +283,7 @@ class ChecklistItem {
233
283
  }
234
284
 
235
285
  _defineProperty(ChecklistItem, "schema", {
236
- name: "ChecklistItem",
286
+ name: _SchemaNames.default.ChecklistItem,
237
287
  primaryKey: "uuid",
238
288
  properties: {
239
289
  uuid: "string",
@@ -21,15 +21,89 @@ var _Concept = _interopRequireDefault(require("./Concept"));
21
21
 
22
22
  var _ChecklistItemStatus = _interopRequireDefault(require("./ChecklistItemStatus"));
23
23
 
24
- var _ProgramEncounter = _interopRequireDefault(require("./ProgramEncounter"));
25
-
26
- var _Checklist = _interopRequireDefault(require("./Checklist"));
24
+ var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
27
25
 
28
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
27
 
30
28
  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; }
31
29
 
32
30
  class ChecklistItemDetail extends _BaseEntity.default {
31
+ constructor(that = null) {
32
+ super(that);
33
+ }
34
+
35
+ get concept() {
36
+ return this.toEntity("concept", _Concept.default);
37
+ }
38
+
39
+ set concept(x) {
40
+ this.that.concept = this.fromObject(x);
41
+ }
42
+
43
+ get stateConfig() {
44
+ return this.toEntityList("stateConfig", _ChecklistItemStatus.default);
45
+ }
46
+
47
+ set stateConfig(x) {
48
+ this.that.stateConfig = this.fromEntityList(x);
49
+ }
50
+
51
+ get form() {
52
+ return this.toEntity("form", _Form.default);
53
+ }
54
+
55
+ set form(x) {
56
+ this.that.form = this.fromObject(x);
57
+ }
58
+
59
+ get checklistDetail() {
60
+ return this.toEntity("checklistDetail", _ChecklistDetail.default);
61
+ }
62
+
63
+ set checklistDetail(x) {
64
+ this.that.checklistDetail = this.fromObject(x);
65
+ }
66
+
67
+ get dependentOn() {
68
+ return this.toEntity("dependentOn", ChecklistItemDetail);
69
+ }
70
+
71
+ set dependentOn(x) {
72
+ this.that.dependentOn = this.fromObject(x);
73
+ }
74
+
75
+ get scheduleOnExpiryOfDependency() {
76
+ return this.that.scheduleOnExpiryOfDependency;
77
+ }
78
+
79
+ set scheduleOnExpiryOfDependency(x) {
80
+ this.that.scheduleOnExpiryOfDependency = x;
81
+ }
82
+
83
+ get minDaysFromStartDate() {
84
+ return this.that.minDaysFromStartDate;
85
+ }
86
+
87
+ set minDaysFromStartDate(x) {
88
+ this.that.minDaysFromStartDate = x;
89
+ }
90
+
91
+ get minDaysFromDependent() {
92
+ return this.that.minDaysFromDependent;
93
+ }
94
+
95
+ set minDaysFromDependent(x) {
96
+ this.that.minDaysFromDependent = x;
97
+ }
98
+
99
+ get expiresAfter() {
100
+ return this.that.expiresAfter;
101
+ }
102
+
103
+ set expiresAfter(x) {
104
+ this.that.expiresAfter = x;
105
+ }
106
+
33
107
  static fromResource(checklistItemResource, entityService, resourcesInCurrentPage) {
34
108
  const checklistDetail = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(checklistItemResource, "checklistDetailUUID"), _ChecklistDetail.default.schema.name);
35
109
  const form = entityService.findByKey("uuid", _ResourceUtil.default.getUUIDFor(checklistItemResource, "formUUID"), _Form.default.schema.name);
@@ -65,7 +139,7 @@ class ChecklistItemDetail extends _BaseEntity.default {
65
139
  }
66
140
 
67
141
  _defineProperty(ChecklistItemDetail, "schema", {
68
- name: "ChecklistItemDetail",
142
+ name: _SchemaNames.default.ChecklistItemDetail,
69
143
  primaryKey: "uuid",
70
144
  properties: {
71
145
  uuid: "string",