@acorex-platform/module-health-core-client 0.0.21
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/fesm2022/acorex-platform-module-health-core-client-contracts.mjs +285 -0
- package/fesm2022/acorex-platform-module-health-core-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-alcohol-consumption-options.query-CFQk6mlY.mjs +61 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-alcohol-consumption-options.query-CFQk6mlY.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-allergy-severity-options.query-BmdEP1TK.mjs +53 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-allergy-severity-options.query-BmdEP1TK.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-chronic-condition-status-options.query-QgsQCqLm.mjs +59 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-chronic-condition-status-options.query-QgsQCqLm.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-health-risk-level-options.query-BtJdBZVT.mjs +54 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-health-risk-level-options.query-BtJdBZVT.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-injury-mechanism-options.query-D7Tjl7eC.mjs +57 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-injury-mechanism-options.query-D7Tjl7eC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-pain-rate-options.query-C9sGCRmk.mjs +53 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-pain-rate-options.query-C9sGCRmk.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-smoking-status-options.query-EUVhlNLW.mjs +54 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-smoking-status-options.query-EUVhlNLW.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-work-capacity-options.query-YQ6BW3kG.mjs +52 -0
- package/fesm2022/acorex-platform-module-health-core-client-list-work-capacity-options.query-YQ6BW3kG.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client-start-health-record-flow.command-BsB-MPmu.mjs +263 -0
- package/fesm2022/acorex-platform-module-health-core-client-start-health-record-flow.command-BsB-MPmu.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-health-core-client.mjs +522 -0
- package/fesm2022/acorex-platform-module-health-core-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-health-core-client-contracts.d.ts +342 -0
- package/types/acorex-platform-module-health-core-client.d.ts +32 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';
|
|
2
|
+
|
|
3
|
+
/** Health catalog scope for questionnaires, question bank items, and workflow definitions. */
|
|
4
|
+
const HEALTH_CATALOG_SCOPE = 'health-core.health';
|
|
5
|
+
|
|
6
|
+
const AXMHealthCoreCommandKeys = {
|
|
7
|
+
HealthEvent: {
|
|
8
|
+
StartFlow: 'HealthCore.HealthEvent:StartFlow',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const AXMHealthCoreMenuKeys = {
|
|
13
|
+
Root: 'health-core',
|
|
14
|
+
BloodTypes: 'health-core.blood-types',
|
|
15
|
+
BodyParts: 'health-core.body-parts',
|
|
16
|
+
DisabilityStatuses: 'health-core.disability-statuses',
|
|
17
|
+
InjuryTypes: 'health-core.injury-types',
|
|
18
|
+
VaccinationTypes: 'health-core.vaccination-types',
|
|
19
|
+
HealthConditionTypes: 'health-core.health-condition-types',
|
|
20
|
+
HealthRestrictions: 'health-core.health-restrictions',
|
|
21
|
+
HealthRecordTypes: 'health-core.health-record-types',
|
|
22
|
+
HealthEvents: 'health-core.health-events',
|
|
23
|
+
HealthProfiles: 'health-core.health-profiles',
|
|
24
|
+
HealthConditions: 'health-core.health-conditions',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Safety & Risk capabilities used by this module.
|
|
29
|
+
* Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
|
|
30
|
+
*/
|
|
31
|
+
const AXPSafetyRiskPermissionKeys = {
|
|
32
|
+
Access: 'SafetyRisk:Permission:Access',
|
|
33
|
+
MaintainSafety: 'SafetyRisk:Permission:MaintainSafety',
|
|
34
|
+
MaintainRisk: 'SafetyRisk:Permission:MaintainRisk',
|
|
35
|
+
MaintainHealth: 'SafetyRisk:Permission:MaintainHealth',
|
|
36
|
+
MaintainAssessments: 'SafetyRisk:Permission:MaintainAssessments',
|
|
37
|
+
Setup: 'SafetyRisk:Permission:Setup',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Prefer {@link AXPSafetyRiskPermissionKeys}.
|
|
41
|
+
* Legacy nested shape kept so existing imports compile during migration.
|
|
42
|
+
*/
|
|
43
|
+
const AXMHealthCorePermissionKeys = {
|
|
44
|
+
HealthCore: {
|
|
45
|
+
BloodType: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
46
|
+
BodyPart: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
47
|
+
DisabilityStatus: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
48
|
+
InjuryType: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
49
|
+
VaccinationType: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
50
|
+
HealthConditionType: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
51
|
+
HealthRestriction: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
52
|
+
HealthRecordType: { Management: AXPSafetyRiskPermissionKeys.Setup },
|
|
53
|
+
HealthProfile: {
|
|
54
|
+
ViewOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
55
|
+
EditOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
56
|
+
View: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
57
|
+
Manage: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
58
|
+
},
|
|
59
|
+
HealthCondition: {
|
|
60
|
+
ViewOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
61
|
+
EditOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
62
|
+
View: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
63
|
+
Manage: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
64
|
+
},
|
|
65
|
+
HealthEvent: {
|
|
66
|
+
ViewOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
67
|
+
EditOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
68
|
+
View: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
69
|
+
Manage: AXPSafetyRiskPermissionKeys.MaintainHealth,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
//#region ---- Subject form layout helpers ----
|
|
75
|
+
/** Subject lookup field omitted from create/update when injected from parent context. */
|
|
76
|
+
const HEALTH_SUBJECT_PROPERTY_NAMES = ['subject.id'];
|
|
77
|
+
/** Omits subject lookup from master create/update layouts (subject is injected from context). */
|
|
78
|
+
function omitHealthSubjectFromEditLayouts(layouts) {
|
|
79
|
+
return layouts.filter((layout) => !HEALTH_SUBJECT_PROPERTY_NAMES.includes(layout.name));
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
|
|
83
|
+
//#region ---- Imports ----
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region ---- Subject filter helpers ----
|
|
86
|
+
/** Person subject type for health records shared between My Profile and employee detail. */
|
|
87
|
+
const HEALTH_PERSON_SUBJECT_TYPE = 'PersonCore.Person';
|
|
88
|
+
/** Filters child health records by polymorphic subject on a parent entity detail context. */
|
|
89
|
+
function healthSubjectReferenceConditions(subjectType) {
|
|
90
|
+
return [
|
|
91
|
+
{
|
|
92
|
+
name: 'subject.type',
|
|
93
|
+
operator: { type: 'equal' },
|
|
94
|
+
value: subjectType,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'subject.id',
|
|
98
|
+
operator: { type: 'equal' },
|
|
99
|
+
value: '{{context.eval("id")}}',
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Filters health records for an employee's linked person (`personId` on employee context).
|
|
105
|
+
* Use for all person-scoped health records on employee detail so data matches My Profile.
|
|
106
|
+
*/
|
|
107
|
+
function healthPersonSubjectReferenceConditions(personIdExpression = '{{context.eval("personId")}}') {
|
|
108
|
+
return [
|
|
109
|
+
{
|
|
110
|
+
name: 'subject.type',
|
|
111
|
+
operator: { type: 'equal' },
|
|
112
|
+
value: HEALTH_PERSON_SUBJECT_TYPE,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'subject.id',
|
|
116
|
+
operator: { type: 'equal' },
|
|
117
|
+
value: personIdExpression,
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region ---- Subject lookup property ----
|
|
123
|
+
/** Single polymorphic subject lookup (assessment-case `subjectRef.id` pattern). */
|
|
124
|
+
function createHealthSubjectLookupProperty(groupId, options = {}) {
|
|
125
|
+
const readonly = options.readonly ?? false;
|
|
126
|
+
return {
|
|
127
|
+
name: 'subject.id',
|
|
128
|
+
title: '@health-core:terms.subject.title',
|
|
129
|
+
groupId,
|
|
130
|
+
options: readonly
|
|
131
|
+
? { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } }
|
|
132
|
+
: undefined,
|
|
133
|
+
schema: {
|
|
134
|
+
dataType: 'string',
|
|
135
|
+
readonly,
|
|
136
|
+
interface: {
|
|
137
|
+
type: AXPWidgetsList.Editors.LookupBox,
|
|
138
|
+
options: {
|
|
139
|
+
readonly,
|
|
140
|
+
entity: "{{ context.eval('subject.type') }}",
|
|
141
|
+
valueField: 'id',
|
|
142
|
+
expose: [
|
|
143
|
+
{ source: 'id', target: 'subject.id' },
|
|
144
|
+
{ source: 'title', target: 'subject.title' },
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
validations: [{ rule: 'required' }],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
|
|
154
|
+
const config = {
|
|
155
|
+
i18n: 'health-core',
|
|
156
|
+
module: 'HealthCore',
|
|
157
|
+
};
|
|
158
|
+
const RootConfig = {
|
|
159
|
+
config,
|
|
160
|
+
module: {
|
|
161
|
+
name: config.module,
|
|
162
|
+
title: `@${config.i18n}:module.title`,
|
|
163
|
+
icon: 'fa-light fa-heart-pulse',
|
|
164
|
+
},
|
|
165
|
+
entities: {
|
|
166
|
+
bloodType: {
|
|
167
|
+
name: 'BloodType',
|
|
168
|
+
title: `@${config.i18n}:blood-types.entities.blood-type.title`,
|
|
169
|
+
titlePlural: `@${config.i18n}:blood-types.entities.blood-type.plural`,
|
|
170
|
+
icon: 'fa-light fa-droplet',
|
|
171
|
+
},
|
|
172
|
+
bodyPart: {
|
|
173
|
+
name: 'BodyPart',
|
|
174
|
+
title: `@${config.i18n}:body-parts.entities.body-part.title`,
|
|
175
|
+
titlePlural: `@${config.i18n}:body-parts.entities.body-part.plural`,
|
|
176
|
+
icon: 'fa-light fa-person',
|
|
177
|
+
},
|
|
178
|
+
disabilityStatus: {
|
|
179
|
+
name: 'DisabilityStatus',
|
|
180
|
+
title: `@${config.i18n}:disability-statuses.entities.disability-status.title`,
|
|
181
|
+
titlePlural: `@${config.i18n}:disability-statuses.entities.disability-status.plural`,
|
|
182
|
+
icon: 'fa-light fa-wheelchair',
|
|
183
|
+
},
|
|
184
|
+
injuryType: {
|
|
185
|
+
name: 'InjuryType',
|
|
186
|
+
title: `@${config.i18n}:injury-types.entities.injury-type.title`,
|
|
187
|
+
titlePlural: `@${config.i18n}:injury-types.entities.injury-type.plural`,
|
|
188
|
+
icon: 'fa-light fa-bandage',
|
|
189
|
+
},
|
|
190
|
+
vaccinationType: {
|
|
191
|
+
name: 'VaccinationType',
|
|
192
|
+
title: `@${config.i18n}:vaccination-types.entities.vaccination-type.title`,
|
|
193
|
+
titlePlural: `@${config.i18n}:vaccination-types.entities.vaccination-type.plural`,
|
|
194
|
+
icon: 'fa-light fa-syringe',
|
|
195
|
+
},
|
|
196
|
+
healthConditionType: {
|
|
197
|
+
name: 'HealthConditionType',
|
|
198
|
+
title: `@${config.i18n}:health-condition-types.entities.health-condition-type.title`,
|
|
199
|
+
titlePlural: `@${config.i18n}:health-condition-types.entities.health-condition-type.plural`,
|
|
200
|
+
icon: 'fa-light fa-file-medical',
|
|
201
|
+
},
|
|
202
|
+
healthRestriction: {
|
|
203
|
+
name: 'HealthRestriction',
|
|
204
|
+
title: `@${config.i18n}:health-restrictions.entities.health-restriction.title`,
|
|
205
|
+
titlePlural: `@${config.i18n}:health-restrictions.entities.health-restriction.plural`,
|
|
206
|
+
icon: 'fa-light fa-ban',
|
|
207
|
+
},
|
|
208
|
+
healthRecordType: {
|
|
209
|
+
name: 'HealthRecordType',
|
|
210
|
+
title: `@${config.i18n}:health-record-types.entities.health-record-type.title`,
|
|
211
|
+
titlePlural: `@${config.i18n}:health-record-types.entities.health-record-type.plural`,
|
|
212
|
+
icon: 'fa-light fa-notes-medical',
|
|
213
|
+
},
|
|
214
|
+
healthEvent: {
|
|
215
|
+
name: 'HealthEvent',
|
|
216
|
+
title: `@${config.i18n}:health-events.entities.health-event.title`,
|
|
217
|
+
titlePlural: `@${config.i18n}:health-events.entities.health-event.plural`,
|
|
218
|
+
icon: 'fa-light fa-file-medical',
|
|
219
|
+
},
|
|
220
|
+
healthProfile: {
|
|
221
|
+
name: 'HealthProfile',
|
|
222
|
+
title: `@${config.i18n}:health-profiles.entities.health-profile.title`,
|
|
223
|
+
titlePlural: `@${config.i18n}:health-profiles.entities.health-profile.plural`,
|
|
224
|
+
icon: 'fa-light fa-heart-pulse',
|
|
225
|
+
},
|
|
226
|
+
healthCondition: {
|
|
227
|
+
name: 'HealthCondition',
|
|
228
|
+
title: `@${config.i18n}:health-conditions.entities.health-condition.title`,
|
|
229
|
+
titlePlural: `@${config.i18n}:health-conditions.entities.health-condition.plural`,
|
|
230
|
+
icon: 'fa-light fa-file-medical',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
queries: {
|
|
234
|
+
reports: {
|
|
235
|
+
getHealthEventsByType: `${config.module}:Reports:GetHealthEventsByType`,
|
|
236
|
+
getWorkplaceInjuries: `${config.module}:Reports:GetWorkplaceInjuries`,
|
|
237
|
+
getActiveWorkRestrictions: `${config.module}:Reports:GetActiveWorkRestrictions`,
|
|
238
|
+
getFitnessForWorkStatus: `${config.module}:Reports:GetFitnessForWorkStatus`,
|
|
239
|
+
getVaccinationCoverage: `${config.module}:Reports:GetVaccinationCoverage`,
|
|
240
|
+
getHealthRiskDistribution: `${config.module}:Reports:GetHealthRiskDistribution`,
|
|
241
|
+
getIncompleteHealthProfiles: `${config.module}:Reports:GetIncompleteHealthProfiles`,
|
|
242
|
+
getIncompleteHealthProfileEmployees: `${config.module}:Reports:GetIncompleteHealthProfileEmployees`,
|
|
243
|
+
},
|
|
244
|
+
dashboard: {
|
|
245
|
+
healthEventsTrendLine: `${config.module}:Dashboard:HealthEventsTrendLine`,
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
//#endregion
|
|
251
|
+
|
|
252
|
+
//#endregion
|
|
253
|
+
|
|
254
|
+
//#endregion
|
|
255
|
+
|
|
256
|
+
//#region ---- Imports ----
|
|
257
|
+
//#endregion
|
|
258
|
+
|
|
259
|
+
//#region ---- Imports ----
|
|
260
|
+
//#endregion
|
|
261
|
+
|
|
262
|
+
//#region ---- Imports ----
|
|
263
|
+
//#endregion
|
|
264
|
+
|
|
265
|
+
//#region ---- Imports ----
|
|
266
|
+
//#endregion
|
|
267
|
+
|
|
268
|
+
//#region ---- Imports ----
|
|
269
|
+
//#endregion
|
|
270
|
+
|
|
271
|
+
//#region ---- Imports ----
|
|
272
|
+
//#endregion
|
|
273
|
+
|
|
274
|
+
//#endregion
|
|
275
|
+
|
|
276
|
+
//#endregion
|
|
277
|
+
|
|
278
|
+
//#region ---- Contracts barrel ----
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Generated bundle index. Do not edit.
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
export { AXMHealthCoreCommandKeys, AXMHealthCoreMenuKeys, AXMHealthCorePermissionKeys, AXPSafetyRiskPermissionKeys, HEALTH_CATALOG_SCOPE, HEALTH_PERSON_SUBJECT_TYPE, HEALTH_SUBJECT_PROPERTY_NAMES, RootConfig, createHealthSubjectLookupProperty, healthPersonSubjectReferenceConditions, healthSubjectReferenceConditions, omitHealthSubjectFromEditLayouts };
|
|
285
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-contracts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-contracts.mjs","sources":["../../../../libs/modules/health-core/contracts/src/catalog-scope.keys.ts","../../../../libs/modules/health-core/contracts/src/commands.keys.ts","../../../../libs/modules/health-core/contracts/src/menu.keys.ts","../../../../libs/modules/health-core/contracts/src/permission.keys.ts","../../../../libs/modules/health-core/contracts/src/health-subject-form-layout.utils.ts","../../../../libs/modules/health-core/contracts/src/health-subject.utils.ts","../../../../libs/modules/health-core/contracts/src/root-config.ts","../../../../libs/modules/health-core/contracts/src/entities/blood-type/blood-type.types.ts","../../../../libs/modules/health-core/contracts/src/entities/body-part/body-part.types.ts","../../../../libs/modules/health-core/contracts/src/entities/disability-status/disability-status.types.ts","../../../../libs/modules/health-core/contracts/src/entities/health-condition/health-condition.types.ts","../../../../libs/modules/health-core/contracts/src/entities/health-condition-type/health-condition-type.types.ts","../../../../libs/modules/health-core/contracts/src/entities/health-event/health-event.types.ts","../../../../libs/modules/health-core/contracts/src/entities/health-profile/health-profile.types.ts","../../../../libs/modules/health-core/contracts/src/entities/health-record-type/health-record-type.types.ts","../../../../libs/modules/health-core/contracts/src/entities/health-restriction/health-restriction.types.ts","../../../../libs/modules/health-core/contracts/src/entities/injury-type/injury-type.types.ts","../../../../libs/modules/health-core/contracts/src/entities/vaccination-type/vaccination-type.types.ts","../../../../libs/modules/health-core/contracts/src/index.ts","../../../../libs/modules/health-core/contracts/src/acorex-platform-module-health-core-client-contracts.ts"],"sourcesContent":["/** Health catalog scope for questionnaires, question bank items, and workflow definitions. */\nexport const HEALTH_CATALOG_SCOPE = 'health-core.health';\n","export const AXMHealthCoreCommandKeys = {\n HealthEvent: {\n StartFlow: 'HealthCore.HealthEvent:StartFlow',\n },\n} as const;\n","export const AXMHealthCoreMenuKeys = {\n Root: 'health-core',\n BloodTypes: 'health-core.blood-types',\n BodyParts: 'health-core.body-parts',\n DisabilityStatuses: 'health-core.disability-statuses',\n InjuryTypes: 'health-core.injury-types',\n VaccinationTypes: 'health-core.vaccination-types',\n HealthConditionTypes: 'health-core.health-condition-types',\n HealthRestrictions: 'health-core.health-restrictions',\n HealthRecordTypes: 'health-core.health-record-types',\n HealthEvents: 'health-core.health-events',\n HealthProfiles: 'health-core.health-profiles',\n HealthConditions: 'health-core.health-conditions',\n} as const;\n","/**\n * Safety & Risk capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPSafetyRiskPermissionKeys = {\n Access: 'SafetyRisk:Permission:Access',\n MaintainSafety: 'SafetyRisk:Permission:MaintainSafety',\n MaintainRisk: 'SafetyRisk:Permission:MaintainRisk',\n MaintainHealth: 'SafetyRisk:Permission:MaintainHealth',\n MaintainAssessments: 'SafetyRisk:Permission:MaintainAssessments',\n Setup: 'SafetyRisk:Permission:Setup',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPSafetyRiskPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMHealthCorePermissionKeys = {\n HealthCore: {\n BloodType: { Management: AXPSafetyRiskPermissionKeys.Setup },\n BodyPart: { Management: AXPSafetyRiskPermissionKeys.Setup },\n DisabilityStatus: { Management: AXPSafetyRiskPermissionKeys.Setup },\n InjuryType: { Management: AXPSafetyRiskPermissionKeys.Setup },\n VaccinationType: { Management: AXPSafetyRiskPermissionKeys.Setup },\n HealthConditionType: { Management: AXPSafetyRiskPermissionKeys.Setup },\n HealthRestriction: { Management: AXPSafetyRiskPermissionKeys.Setup },\n HealthRecordType: { Management: AXPSafetyRiskPermissionKeys.Setup },\n HealthProfile: {\n ViewOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,\n EditOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,\n View: AXPSafetyRiskPermissionKeys.MaintainHealth,\n Manage: AXPSafetyRiskPermissionKeys.MaintainHealth,\n },\n HealthCondition: {\n ViewOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,\n EditOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,\n View: AXPSafetyRiskPermissionKeys.MaintainHealth,\n Manage: AXPSafetyRiskPermissionKeys.MaintainHealth,\n },\n HealthEvent: {\n ViewOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,\n EditOwn: AXPSafetyRiskPermissionKeys.MaintainHealth,\n View: AXPSafetyRiskPermissionKeys.MaintainHealth,\n Manage: AXPSafetyRiskPermissionKeys.MaintainHealth,\n },\n },\n} as const;\n","//#region ---- Subject form layout helpers ----\n\n/** Subject lookup field omitted from create/update when injected from parent context. */\nexport const HEALTH_SUBJECT_PROPERTY_NAMES = ['subject.id'] as const;\n\ntype PropertyLayoutRef = { name: string; layout?: Record<string, unknown> };\n\n/** Omits subject lookup from master create/update layouts (subject is injected from context). */\nexport function omitHealthSubjectFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[] {\n return layouts.filter(\n (layout) => !HEALTH_SUBJECT_PROPERTY_NAMES.includes(layout.name as (typeof HEALTH_SUBJECT_PROPERTY_NAMES)[number]),\n );\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntityProperty, AXPQueryFilter } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Subject filter helpers ----\n\n/** Person subject type for health records shared between My Profile and employee detail. */\nexport const HEALTH_PERSON_SUBJECT_TYPE = 'PersonCore.Person';\n\n/** Filters child health records by polymorphic subject on a parent entity detail context. */\nexport function healthSubjectReferenceConditions(subjectType: string): AXPQueryFilter[] {\n return [\n {\n name: 'subject.type',\n operator: { type: 'equal' },\n value: subjectType,\n },\n {\n name: 'subject.id',\n operator: { type: 'equal' },\n value: '{{context.eval(\"id\")}}',\n },\n ];\n}\n\n/**\n * Filters health records for an employee's linked person (`personId` on employee context).\n * Use for all person-scoped health records on employee detail so data matches My Profile.\n */\nexport function healthPersonSubjectReferenceConditions(\n personIdExpression = '{{context.eval(\"personId\")}}',\n): AXPQueryFilter[] {\n return [\n {\n name: 'subject.type',\n operator: { type: 'equal' },\n value: HEALTH_PERSON_SUBJECT_TYPE,\n },\n {\n name: 'subject.id',\n operator: { type: 'equal' },\n value: personIdExpression,\n },\n ];\n}\n\n//#endregion\n\n//#region ---- Subject lookup property ----\n\n/** Single polymorphic subject lookup (assessment-case `subjectRef.id` pattern). */\nexport function createHealthSubjectLookupProperty(\n groupId: string,\n options: { readonly?: boolean } = {},\n): AXPEntityProperty {\n const readonly = options.readonly ?? false;\n\n return {\n name: 'subject.id',\n title: '@health-core:terms.subject.title',\n groupId,\n options: readonly\n ? { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } }\n : undefined,\n schema: {\n dataType: 'string',\n readonly,\n interface: {\n type: AXPWidgetsList.Editors.LookupBox,\n options: {\n readonly,\n entity: \"{{ context.eval('subject.type') }}\",\n valueField: 'id',\n expose: [\n { source: 'id', target: 'subject.id' },\n { source: 'title', target: 'subject.title' },\n ],\n },\n },\n },\n validations: [{ rule: 'required' }],\n };\n}\n\n//#endregion\n","const config = {\n i18n: 'health-core',\n module: 'HealthCore',\n};\n\nexport const RootConfig = {\n config,\n module: {\n name: config.module,\n title: `@${config.i18n}:module.title`,\n icon: 'fa-light fa-heart-pulse',\n },\n entities: {\n bloodType: {\n name: 'BloodType',\n title: `@${config.i18n}:blood-types.entities.blood-type.title`,\n titlePlural: `@${config.i18n}:blood-types.entities.blood-type.plural`,\n icon: 'fa-light fa-droplet',\n },\n bodyPart: {\n name: 'BodyPart',\n title: `@${config.i18n}:body-parts.entities.body-part.title`,\n titlePlural: `@${config.i18n}:body-parts.entities.body-part.plural`,\n icon: 'fa-light fa-person',\n },\n disabilityStatus: {\n name: 'DisabilityStatus',\n title: `@${config.i18n}:disability-statuses.entities.disability-status.title`,\n titlePlural: `@${config.i18n}:disability-statuses.entities.disability-status.plural`,\n icon: 'fa-light fa-wheelchair',\n },\n injuryType: {\n name: 'InjuryType',\n title: `@${config.i18n}:injury-types.entities.injury-type.title`,\n titlePlural: `@${config.i18n}:injury-types.entities.injury-type.plural`,\n icon: 'fa-light fa-bandage',\n },\n vaccinationType: {\n name: 'VaccinationType',\n title: `@${config.i18n}:vaccination-types.entities.vaccination-type.title`,\n titlePlural: `@${config.i18n}:vaccination-types.entities.vaccination-type.plural`,\n icon: 'fa-light fa-syringe',\n },\n healthConditionType: {\n name: 'HealthConditionType',\n title: `@${config.i18n}:health-condition-types.entities.health-condition-type.title`,\n titlePlural: `@${config.i18n}:health-condition-types.entities.health-condition-type.plural`,\n icon: 'fa-light fa-file-medical',\n },\n healthRestriction: {\n name: 'HealthRestriction',\n title: `@${config.i18n}:health-restrictions.entities.health-restriction.title`,\n titlePlural: `@${config.i18n}:health-restrictions.entities.health-restriction.plural`,\n icon: 'fa-light fa-ban',\n },\n healthRecordType: {\n name: 'HealthRecordType',\n title: `@${config.i18n}:health-record-types.entities.health-record-type.title`,\n titlePlural: `@${config.i18n}:health-record-types.entities.health-record-type.plural`,\n icon: 'fa-light fa-notes-medical',\n },\n healthEvent: {\n name: 'HealthEvent',\n title: `@${config.i18n}:health-events.entities.health-event.title`,\n titlePlural: `@${config.i18n}:health-events.entities.health-event.plural`,\n icon: 'fa-light fa-file-medical',\n },\n healthProfile: {\n name: 'HealthProfile',\n title: `@${config.i18n}:health-profiles.entities.health-profile.title`,\n titlePlural: `@${config.i18n}:health-profiles.entities.health-profile.plural`,\n icon: 'fa-light fa-heart-pulse',\n },\n healthCondition: {\n name: 'HealthCondition',\n title: `@${config.i18n}:health-conditions.entities.health-condition.title`,\n titlePlural: `@${config.i18n}:health-conditions.entities.health-condition.plural`,\n icon: 'fa-light fa-file-medical',\n },\n },\n queries: {\n reports: {\n getHealthEventsByType: `${config.module}:Reports:GetHealthEventsByType`,\n getWorkplaceInjuries: `${config.module}:Reports:GetWorkplaceInjuries`,\n getActiveWorkRestrictions: `${config.module}:Reports:GetActiveWorkRestrictions`,\n getFitnessForWorkStatus: `${config.module}:Reports:GetFitnessForWorkStatus`,\n getVaccinationCoverage: `${config.module}:Reports:GetVaccinationCoverage`,\n getHealthRiskDistribution: `${config.module}:Reports:GetHealthRiskDistribution`,\n getIncompleteHealthProfiles: `${config.module}:Reports:GetIncompleteHealthProfiles`,\n getIncompleteHealthProfileEmployees: `${config.module}:Reports:GetIncompleteHealthProfileEmployees`,\n },\n dashboard: {\n healthEventsTrendLine: `${config.module}:Dashboard:HealthEventsTrendLine`,\n },\n },\n} as const;\n","import { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n//#region ---- Blood Type Model ----\n\nexport interface AXMHealthCoreBloodTypeEntityModel extends AXPEntityModel<string> {\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString | null;\n}\n\n//#endregion\n","import { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n//#region ---- Body Part Model ----\n\nexport interface AXMHealthCoreBodyPartEntityModel extends AXPEntityModel<string> {\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString | null;\n}\n\n//#endregion\n","import { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n//#region ---- Disability Status Model ----\n\nexport interface AXMHealthCoreDisabilityStatusEntityModel extends AXPEntityModel<string> {\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString | null;\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport type { AXPEntityReference } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Restriction assignment ----\n\nexport interface AXMHealthCoreHealthConditionRestrictionItem {\n restrictionId: string;\n restriction?: { id: string; title?: unknown };\n startDate?: Date | string;\n endDate?: Date | string;\n}\n\n//#endregion\n\n//#region ---- Health condition ----\n\nexport interface AXMHealthCoreHealthConditionEntityModel extends AXPEntityModel<string> {\n subject: AXPEntityReference;\n conditionTypeId: string;\n conditionType?: { id: string; title?: unknown; kind?: string };\n diagnosedDate?: Date | string;\n restrictions?: AXMHealthCoreHealthConditionRestrictionItem[];\n notes?: string;\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport type { AXMMetaDataBuilderValue } from '@acorex-platform/module-data-management-contracts';\nimport type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Health condition type ----\n\nexport type AXMHealthCoreHealthConditionKind = 'allergy' | 'chronic';\n\nexport interface AXMHealthCoreHealthConditionTypeEntityModel extends AXPEntityModel<string> {\n title: unknown;\n kind: AXMHealthCoreHealthConditionKind;\n description?: unknown;\n suggestedRestrictionIds?: string[];\n suggestedRestrictions?: Array<{ id: string; title: AXPMultiLanguageString }>;\n metaDataList?: AXMMetaDataBuilderValue;\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { type AXPEntityReference, type AXPMultiLanguageString, AXPSystemStatusType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Health event ----\n\nexport type AXMHealthCoreHealthEventStatus =\n | AXPSystemStatusType.InProgress\n | AXPSystemStatusType.WaitingSignOff\n | AXPSystemStatusType.Completed\n | AXPSystemStatusType.Cancelled;\n\nexport interface AXMHealthCoreHealthEventEntityModel extends AXPEntityModel<string> {\n subject: AXPEntityReference;\n recordTypeId: string;\n recordType?: {\n id: string;\n title?: AXPMultiLanguageString;\n };\n occurredDate?: Date | string;\n endDate?: Date | string | null;\n provider?: string;\n facility?: string;\n notes?: string;\n employeeSignature?: string;\n employeeSignedAt?: Date | string;\n managerSignature?: string;\n managerSignedAt?: Date | string;\n statusId?: AXMHealthCoreHealthEventStatus;\n status?: { id: AXMHealthCoreHealthEventStatus; title?: string };\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport type { AXPEntityReference } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Health profile ----\n\nexport interface AXMHealthCoreHealthProfileEntityModel extends AXPEntityModel<string> {\n subject: AXPEntityReference;\n bloodTypeId?: string;\n bloodType?: { id: string; title?: unknown };\n disabilityStatusId?: string;\n disabilityStatus?: { id: string; title?: unknown };\n smokingStatus?: string;\n alcoholConsumption?: string;\n healthRiskLevel?: string;\n doctorName?: string;\n doctorNumber?: string;\n emergencyContactName?: string;\n emergencyContactPhone?: string;\n emergencyContactEmail?: string;\n notes?: string;\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport type { AXMMetaDataBuilderValue } from '@acorex-platform/module-data-management-contracts';\nimport type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Health record type ----\n\n/** Workflow template binding and admin-configured default inputs for health record types. */\nexport interface AXMHealthCoreHealthRecordTypeWorkflowConfig {\n workflowDefinitionId: string;\n workflowName: string;\n defaultInput?: Record<string, unknown>;\n}\n\n/**\n * Defines workflow defaults, questionnaire, and metadata schema for health timeline records.\n */\nexport interface AXMHealthCoreHealthRecordTypeEntityModel extends AXPEntityModel<string> {\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n workflowConfig?: AXMHealthCoreHealthRecordTypeWorkflowConfig | null;\n icon?: string;\n metaDataList?: AXMMetaDataBuilderValue;\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport type { AXPCategoryListItem, AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Health restriction ----\n\nexport interface AXMHealthCoreHealthRestrictionEntityModel extends AXPEntityModel<string> {\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n categoryIds?: string[];\n categories?: AXPCategoryListItem[];\n}\n\n//#endregion\n","import { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n//#region ---- Injury Type Model ----\n\nexport interface AXMHealthCoreInjuryTypeEntityModel extends AXPEntityModel<string> {\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString | null;\n}\n\n//#endregion\n","import { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n//#region ---- Vaccination Type Model ----\n\nexport interface AXMHealthCoreVaccinationTypeEntityModel extends AXPEntityModel<string> {\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString | null;\n}\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './catalog-scope.keys';\nexport * from './commands.keys';\nexport * from './menu.keys';\nexport * from './permission.keys';\n\nexport * from './health-subject-form-layout.utils';\nexport * from './health-subject.utils';\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './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,MAAM,CAAC,MAAM,CAAA,6BAAA,CAA+B;AACrE,YAAA,yBAAyB,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,kCAAA,CAAoC;AAC/E,YAAA,uBAAuB,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,gCAAA,CAAkC;AAC3E,YAAA,sBAAsB,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,+BAAA,CAAiC;AACzE,YAAA,yBAAyB,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,kCAAA,CAAoC;AAC/E,YAAA,2BAA2B,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,oCAAA,CAAsC;AACnF,YAAA,mCAAmC,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,4CAAA,CAA8C;AACpG,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,qBAAqB,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,gCAAA,CAAkC;AAC1E,SAAA;AACF,KAAA;;;ACrFH;;ACAA;;ACAA;;ACTA;AA6BA;;AC7BA;AAqBA;;ACrBA;AAmCA;;ACnCA;AA0BA;;AC1BA;AA4BA;;AC5BA;AAgBA;;ACPA;;ACAA;;ACTA;;ACAA;;AAEG;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ---- Constants ----
|
|
9
|
+
/** Same rows as the former `alcohol-consumption-options` registry data source. */
|
|
10
|
+
const ALCOHOL_CONSUMPTION_OPTIONS = [
|
|
11
|
+
{ value: 'never', title: '@health-core:datasources.alcohol-consumption-options.samples.never' },
|
|
12
|
+
{
|
|
13
|
+
value: 'occasional',
|
|
14
|
+
title: '@health-core:datasources.alcohol-consumption-options.samples.occasional',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: 'regular',
|
|
18
|
+
title: '@health-core:datasources.alcohol-consumption-options.samples.regular',
|
|
19
|
+
},
|
|
20
|
+
{ value: 'heavy', title: '@health-core:datasources.alcohol-consumption-options.samples.heavy' },
|
|
21
|
+
{
|
|
22
|
+
value: 'prefer-not-to-say',
|
|
23
|
+
title: '@health-core:datasources.alcohol-consumption-options.samples.prefer-not-to-say',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region ---- Query ----
|
|
28
|
+
/**
|
|
29
|
+
* Static alcohol consumption catalog — replaces the `alcohol-consumption-options` DI data source.
|
|
30
|
+
*/
|
|
31
|
+
class AXMListAlcoholConsumptionOptionsQuery {
|
|
32
|
+
//#region ---- Query Execution ----
|
|
33
|
+
async fetch(input) {
|
|
34
|
+
try {
|
|
35
|
+
let items = [...ALCOHOL_CONSUMPTION_OPTIONS];
|
|
36
|
+
if (input?.filter) {
|
|
37
|
+
items = applyFilterArray(items, [input.filter]);
|
|
38
|
+
}
|
|
39
|
+
const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
|
|
40
|
+
const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
|
|
41
|
+
items = applySortArray(items, sortOpt);
|
|
42
|
+
const skip = resolveCollectionSkip(input?.skip);
|
|
43
|
+
const take = resolveCollectionTake(input?.take);
|
|
44
|
+
const total = items.length;
|
|
45
|
+
const page = items.slice(skip, skip + take);
|
|
46
|
+
return runtimeQuerySuccessCollection({ items: page, total });
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAlcoholConsumptionOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
53
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAlcoholConsumptionOptionsQuery, providedIn: 'root' }); }
|
|
54
|
+
}
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAlcoholConsumptionOptionsQuery, decorators: [{
|
|
56
|
+
type: Injectable,
|
|
57
|
+
args: [{ providedIn: 'root' }]
|
|
58
|
+
}] });
|
|
59
|
+
|
|
60
|
+
export { AXMListAlcoholConsumptionOptionsQuery };
|
|
61
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-alcohol-consumption-options.query-CFQk6mlY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-alcohol-consumption-options.query-CFQk6mlY.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-alcohol-consumption-options.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\n\nimport { Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListAlcoholConsumptionOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListAlcoholConsumptionOptionsQueryItem {\n /** Stored choice code. */\n value: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Same rows as the former `alcohol-consumption-options` registry data source. */\nconst ALCOHOL_CONSUMPTION_OPTIONS: AXMListAlcoholConsumptionOptionsQueryItem[] = [\n { value: 'never', title: '@health-core:datasources.alcohol-consumption-options.samples.never' },\n {\n value: 'occasional',\n title: '@health-core:datasources.alcohol-consumption-options.samples.occasional',\n },\n {\n value: 'regular',\n title: '@health-core:datasources.alcohol-consumption-options.samples.regular',\n },\n { value: 'heavy', title: '@health-core:datasources.alcohol-consumption-options.samples.heavy' },\n {\n value: 'prefer-not-to-say',\n title: '@health-core:datasources.alcohol-consumption-options.samples.prefer-not-to-say',\n },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static alcohol consumption catalog — replaces the `alcohol-consumption-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListAlcoholConsumptionOptionsQuery\n implements\n AXPCollectionQuery<\n AXMListAlcoholConsumptionOptionsQueryInput,\n AXMListAlcoholConsumptionOptionsQueryItem\n >\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListAlcoholConsumptionOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListAlcoholConsumptionOptionsQueryItem> {\n try {\n let items = [...ALCOHOL_CONSUMPTION_OPTIONS];\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AA0BA;AAEA;AAEA;AACA,MAA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AAK,GAAG,KAAK,CAAC,MAAM;AAC1B,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;YAE3C,OAAO,6BAA6B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAC9D;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;8GAlCW,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qCAAqC,cADxB,MAAM,EAAA,CAAA,CAAA;;2FACnB,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBADjD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ---- Constants ----
|
|
9
|
+
/** Same rows as the former `allergy-severity-options` registry data source. */
|
|
10
|
+
const ALLERGY_SEVERITY_OPTIONS = [
|
|
11
|
+
{ value: 'mild', title: '@health-core:datasources.allergy-severity-options.samples.mild' },
|
|
12
|
+
{
|
|
13
|
+
value: 'moderate',
|
|
14
|
+
title: '@health-core:datasources.allergy-severity-options.samples.moderate',
|
|
15
|
+
},
|
|
16
|
+
{ value: 'severe', title: '@health-core:datasources.allergy-severity-options.samples.severe' },
|
|
17
|
+
];
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ---- Query ----
|
|
20
|
+
/**
|
|
21
|
+
* Static allergy severity catalog — replaces the `allergy-severity-options` DI data source.
|
|
22
|
+
*/
|
|
23
|
+
class AXMListAllergySeverityOptionsQuery {
|
|
24
|
+
//#region ---- Query Execution ----
|
|
25
|
+
async fetch(input) {
|
|
26
|
+
try {
|
|
27
|
+
let items = [...ALLERGY_SEVERITY_OPTIONS];
|
|
28
|
+
if (input?.filter) {
|
|
29
|
+
items = applyFilterArray(items, [input.filter]);
|
|
30
|
+
}
|
|
31
|
+
const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
|
|
32
|
+
const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
|
|
33
|
+
items = applySortArray(items, sortOpt);
|
|
34
|
+
const skip = resolveCollectionSkip(input?.skip);
|
|
35
|
+
const take = resolveCollectionTake(input?.take);
|
|
36
|
+
const total = items.length;
|
|
37
|
+
const page = items.slice(skip, skip + take);
|
|
38
|
+
return runtimeQuerySuccessCollection({ items: page, total });
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAllergySeverityOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
45
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAllergySeverityOptionsQuery, providedIn: 'root' }); }
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListAllergySeverityOptionsQuery, decorators: [{
|
|
48
|
+
type: Injectable,
|
|
49
|
+
args: [{ providedIn: 'root' }]
|
|
50
|
+
}] });
|
|
51
|
+
|
|
52
|
+
export { AXMListAllergySeverityOptionsQuery };
|
|
53
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-allergy-severity-options.query-BmdEP1TK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-allergy-severity-options.query-BmdEP1TK.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-allergy-severity-options.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\n\nimport { Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListAllergySeverityOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListAllergySeverityOptionsQueryItem {\n /** Stored choice code. */\n value: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Same rows as the former `allergy-severity-options` registry data source. */\nconst ALLERGY_SEVERITY_OPTIONS: AXMListAllergySeverityOptionsQueryItem[] = [\n { value: 'mild', title: '@health-core:datasources.allergy-severity-options.samples.mild' },\n {\n value: 'moderate',\n title: '@health-core:datasources.allergy-severity-options.samples.moderate',\n },\n { value: 'severe', title: '@health-core:datasources.allergy-severity-options.samples.severe' },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static allergy severity catalog — replaces the `allergy-severity-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListAllergySeverityOptionsQuery\n implements\n AXPCollectionQuery<AXMListAllergySeverityOptionsQueryInput, AXMListAllergySeverityOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListAllergySeverityOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListAllergySeverityOptionsQueryItem> {\n try {\n let items = [...ALLERGY_SEVERITY_OPTIONS];\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AA0BA;AAEA;AAEA;AACA,MAAM,wBAAwB,GAA6C;AACzE,IAAA,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gEAAgE,EAAE;AAC1F,IAAA;AACE,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,KAAK,EAAE,oEAAoE;AAC5E,KAAA;AACD,IAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,kEAAkE,EAAE;CAC/F;AAED;AAEA;AAEA;;AAEG;MAEU,kCAAkC,CAAA;;IAM7C,MAAM,KAAK,CACT,KAAsD,EAAA;AAEtD,QAAA,IAAI;AACF,YAAA,IAAI,KAAK,GAAG,CAAC,GAAG,wBAAwB,CAAC;AAEzC,YAAA,IAAI,KAAK,EAAE,MAAM,EAAE;gBACjB,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC,KAAK,CAA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,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ---- Constants ----
|
|
9
|
+
/** Same rows as the former `chronic-condition-status-options` registry data source. */
|
|
10
|
+
const CHRONIC_CONDITION_STATUS_OPTIONS = [
|
|
11
|
+
{
|
|
12
|
+
value: 'active',
|
|
13
|
+
title: '@health-core:datasources.chronic-condition-status-options.samples.active',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
value: 'managed',
|
|
17
|
+
title: '@health-core:datasources.chronic-condition-status-options.samples.managed',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: 'resolved',
|
|
21
|
+
title: '@health-core:datasources.chronic-condition-status-options.samples.resolved',
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ---- Query ----
|
|
26
|
+
/**
|
|
27
|
+
* Static chronic condition status catalog — replaces the `chronic-condition-status-options` DI data source.
|
|
28
|
+
*/
|
|
29
|
+
class AXMListChronicConditionStatusOptionsQuery {
|
|
30
|
+
//#region ---- Query Execution ----
|
|
31
|
+
async fetch(input) {
|
|
32
|
+
try {
|
|
33
|
+
let items = [...CHRONIC_CONDITION_STATUS_OPTIONS];
|
|
34
|
+
if (input?.filter) {
|
|
35
|
+
items = applyFilterArray(items, [input.filter]);
|
|
36
|
+
}
|
|
37
|
+
const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
|
|
38
|
+
const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
|
|
39
|
+
items = applySortArray(items, sortOpt);
|
|
40
|
+
const skip = resolveCollectionSkip(input?.skip);
|
|
41
|
+
const take = resolveCollectionTake(input?.take);
|
|
42
|
+
const total = items.length;
|
|
43
|
+
const page = items.slice(skip, skip + take);
|
|
44
|
+
return runtimeQuerySuccessCollection({ items: page, total });
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListChronicConditionStatusOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListChronicConditionStatusOptionsQuery, providedIn: 'root' }); }
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListChronicConditionStatusOptionsQuery, decorators: [{
|
|
54
|
+
type: Injectable,
|
|
55
|
+
args: [{ providedIn: 'root' }]
|
|
56
|
+
}] });
|
|
57
|
+
|
|
58
|
+
export { AXMListChronicConditionStatusOptionsQuery };
|
|
59
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-chronic-condition-status-options.query-QgsQCqLm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-chronic-condition-status-options.query-QgsQCqLm.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-chronic-condition-status-options.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\n\nimport { Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListChronicConditionStatusOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListChronicConditionStatusOptionsQueryItem {\n /** Stored choice code. */\n value: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Same rows as the former `chronic-condition-status-options` registry data source. */\nconst CHRONIC_CONDITION_STATUS_OPTIONS: AXMListChronicConditionStatusOptionsQueryItem[] = [\n {\n value: 'active',\n title: '@health-core:datasources.chronic-condition-status-options.samples.active',\n },\n {\n value: 'managed',\n title: '@health-core:datasources.chronic-condition-status-options.samples.managed',\n },\n {\n value: 'resolved',\n title: '@health-core:datasources.chronic-condition-status-options.samples.resolved',\n },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static chronic condition status catalog — replaces the `chronic-condition-status-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListChronicConditionStatusOptionsQuery\n implements\n AXPCollectionQuery<\n AXMListChronicConditionStatusOptionsQueryInput,\n AXMListChronicConditionStatusOptionsQueryItem\n >\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListChronicConditionStatusOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListChronicConditionStatusOptionsQueryItem> {\n try {\n let items = [...CHRONIC_CONDITION_STATUS_OPTIONS];\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AA0BA;AAEA;AAEA;AACA,MAAM,gCAAgC,GAAoD;AACxF,IAAA;AACE,QAAA,KAAK,EAAE,QAAQ;AACf,QAAA,KAAK,EAAE,0EAA0E;AAClF,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,KAAK,EAAE,2EAA2E;AACnF,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,KAAK,EAAE,4EAA4E;AACpF,KAAA;CACF;AAED;AAEA;AAEA;;AAEG;MAEU,yCAAyC,CAAA;;IASpD,MAAM,KAAK,CACT,KAA6D,EAAA;AAE7D,QAAA,IAAI;AACF,YAAA,IAAI,KAAK,GAAG,CAAC,GAAG,gCAAgC,CAAC;AAEjD,YAAA,IAAI,KAAK,EAAE,MAAM,EAAE;gBACjB,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACjD;AAEA,YAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACzF,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,OAAgB,EAAE,GAAG,EAAE,KAAc,EAAE,CAAC;AACjG,YAAA,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC;YAEtC,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC;YAC/C,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/C,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM;AAC1B,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;YAE3C,OAAO,6BAA6B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAC9D;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;8GAlCW,yCAAyC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yCAAyC,cAD5B,MAAM,EAAA,CAAA,CAAA;;2FACnB,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBADrD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ---- Constants ----
|
|
9
|
+
/** Same rows as the former `health-risk-level-options` registry data source. */
|
|
10
|
+
const HEALTH_RISK_LEVEL_OPTIONS = [
|
|
11
|
+
{ value: 'low', title: '@health-core:datasources.health-risk-level-options.samples.low' },
|
|
12
|
+
{ value: 'medium', title: '@health-core:datasources.health-risk-level-options.samples.medium' },
|
|
13
|
+
{ value: 'high', title: '@health-core:datasources.health-risk-level-options.samples.high' },
|
|
14
|
+
{
|
|
15
|
+
value: 'critical',
|
|
16
|
+
title: '@health-core:datasources.health-risk-level-options.samples.critical',
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ---- Query ----
|
|
21
|
+
/**
|
|
22
|
+
* Static health risk level catalog — replaces the `health-risk-level-options` DI data source.
|
|
23
|
+
*/
|
|
24
|
+
class AXMListHealthRiskLevelOptionsQuery {
|
|
25
|
+
//#region ---- Query Execution ----
|
|
26
|
+
async fetch(input) {
|
|
27
|
+
try {
|
|
28
|
+
let items = [...HEALTH_RISK_LEVEL_OPTIONS];
|
|
29
|
+
if (input?.filter) {
|
|
30
|
+
items = applyFilterArray(items, [input.filter]);
|
|
31
|
+
}
|
|
32
|
+
const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
|
|
33
|
+
const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value', dir: 'asc' }];
|
|
34
|
+
items = applySortArray(items, sortOpt);
|
|
35
|
+
const skip = resolveCollectionSkip(input?.skip);
|
|
36
|
+
const take = resolveCollectionTake(input?.take);
|
|
37
|
+
const total = items.length;
|
|
38
|
+
const page = items.slice(skip, skip + take);
|
|
39
|
+
return runtimeQuerySuccessCollection({ items: page, total });
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListHealthRiskLevelOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
46
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListHealthRiskLevelOptionsQuery, providedIn: 'root' }); }
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListHealthRiskLevelOptionsQuery, decorators: [{
|
|
49
|
+
type: Injectable,
|
|
50
|
+
args: [{ providedIn: 'root' }]
|
|
51
|
+
}] });
|
|
52
|
+
|
|
53
|
+
export { AXMListHealthRiskLevelOptionsQuery };
|
|
54
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-health-risk-level-options.query-BtJdBZVT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-health-risk-level-options.query-BtJdBZVT.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-health-risk-level-options.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\n\nimport { Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListHealthRiskLevelOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListHealthRiskLevelOptionsQueryItem {\n /** Stored choice code. */\n value: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Same rows as the former `health-risk-level-options` registry data source. */\nconst HEALTH_RISK_LEVEL_OPTIONS: AXMListHealthRiskLevelOptionsQueryItem[] = [\n { value: 'low', title: '@health-core:datasources.health-risk-level-options.samples.low' },\n { value: 'medium', title: '@health-core:datasources.health-risk-level-options.samples.medium' },\n { value: 'high', title: '@health-core:datasources.health-risk-level-options.samples.high' },\n {\n value: 'critical',\n title: '@health-core:datasources.health-risk-level-options.samples.critical',\n },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static health risk level catalog — replaces the `health-risk-level-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListHealthRiskLevelOptionsQuery\n implements\n AXPCollectionQuery<AXMListHealthRiskLevelOptionsQueryInput, AXMListHealthRiskLevelOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListHealthRiskLevelOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListHealthRiskLevelOptionsQueryItem> {\n try {\n let items = [...HEALTH_RISK_LEVEL_OPTIONS];\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'value' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AA0BA;AAEA;AAEA;AACA,MAAM,yBAAyB,GAA6C;AAC1E,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,gEAAgE,EAAE;AACzF,IAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,mEAAmE,EAAE;AAC/F,IAAA,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,iEAAiE,EAAE;AAC3F,IAAA;AACE,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,KAAK,EAAE,qEAAqE;AAC7E,KA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