@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,57 @@
|
|
|
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
|
+
const I18N = '@health-core:datasources.injury-mechanism-options';
|
|
10
|
+
/** Same rows as the former `injury-mechanism-options` registry data source. */
|
|
11
|
+
const INJURY_MECHANISM_OPTIONS = [
|
|
12
|
+
{ id: 'slip_trip_fall', title: `${I18N}.samples.slip-trip-fall` },
|
|
13
|
+
{ id: 'struck_by', title: `${I18N}.samples.struck-by` },
|
|
14
|
+
{ id: 'struck_against', title: `${I18N}.samples.struck-against` },
|
|
15
|
+
{ id: 'caught_in', title: `${I18N}.samples.caught-in` },
|
|
16
|
+
{ id: 'overexertion', title: `${I18N}.samples.overexertion` },
|
|
17
|
+
{ id: 'exposure', title: `${I18N}.samples.exposure` },
|
|
18
|
+
{ id: 'vehicle', title: `${I18N}.samples.vehicle` },
|
|
19
|
+
{ id: 'cut_puncture', title: `${I18N}.samples.cut-puncture` },
|
|
20
|
+
{ id: 'other', title: `${I18N}.samples.other` },
|
|
21
|
+
];
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ---- Query ----
|
|
24
|
+
/**
|
|
25
|
+
* Static injury mechanism catalog — replaces the `injury-mechanism-options` DI data source.
|
|
26
|
+
*/
|
|
27
|
+
class AXMListInjuryMechanismOptionsQuery {
|
|
28
|
+
//#region ---- Query Execution ----
|
|
29
|
+
async fetch(input) {
|
|
30
|
+
try {
|
|
31
|
+
let items = [...INJURY_MECHANISM_OPTIONS];
|
|
32
|
+
if (input?.filter) {
|
|
33
|
+
items = applyFilterArray(items, [input.filter]);
|
|
34
|
+
}
|
|
35
|
+
const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
|
|
36
|
+
const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'id', dir: 'asc' }];
|
|
37
|
+
items = applySortArray(items, sortOpt);
|
|
38
|
+
const skip = resolveCollectionSkip(input?.skip);
|
|
39
|
+
const take = resolveCollectionTake(input?.take);
|
|
40
|
+
const total = items.length;
|
|
41
|
+
const page = items.slice(skip, skip + take);
|
|
42
|
+
return runtimeQuerySuccessCollection({ items: page, total });
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListInjuryMechanismOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
49
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListInjuryMechanismOptionsQuery, providedIn: 'root' }); }
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListInjuryMechanismOptionsQuery, decorators: [{
|
|
52
|
+
type: Injectable,
|
|
53
|
+
args: [{ providedIn: 'root' }]
|
|
54
|
+
}] });
|
|
55
|
+
|
|
56
|
+
export { AXMListInjuryMechanismOptionsQuery };
|
|
57
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-injury-mechanism-options.query-D7Tjl7eC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-injury-mechanism-options.query-D7Tjl7eC.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-injury-mechanism-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 AXMListInjuryMechanismOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListInjuryMechanismOptionsQueryItem {\n /** Stored choice code. */\n id: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst I18N = '@health-core:datasources.injury-mechanism-options';\n\n/** Same rows as the former `injury-mechanism-options` registry data source. */\nconst INJURY_MECHANISM_OPTIONS: AXMListInjuryMechanismOptionsQueryItem[] = [\n { id: 'slip_trip_fall', title: `${I18N}.samples.slip-trip-fall` },\n { id: 'struck_by', title: `${I18N}.samples.struck-by` },\n { id: 'struck_against', title: `${I18N}.samples.struck-against` },\n { id: 'caught_in', title: `${I18N}.samples.caught-in` },\n { id: 'overexertion', title: `${I18N}.samples.overexertion` },\n { id: 'exposure', title: `${I18N}.samples.exposure` },\n { id: 'vehicle', title: `${I18N}.samples.vehicle` },\n { id: 'cut_puncture', title: `${I18N}.samples.cut-puncture` },\n { id: 'other', title: `${I18N}.samples.other` },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static injury mechanism catalog — replaces the `injury-mechanism-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListInjuryMechanismOptionsQuery\n implements\n AXPCollectionQuery<AXMListInjuryMechanismOptionsQueryInput, AXMListInjuryMechanismOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListInjuryMechanismOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListInjuryMechanismOptionsQueryItem> {\n try {\n let items = [...INJURY_MECHANISM_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: 'id' 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,MAAM,IAAI,GAAG,mDAAmD;AAEhE;AACA,MAAM,wBAAwB,GAA6C;IACzE,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,uBAAA,CAAyB,EAAE;IACjE,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,kBAAA,CAAoB,EAAE;IACvD,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,uBAAA,CAAyB,EAAE;IACjE,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,C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I,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;8GA/BW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,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,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
package/fesm2022/acorex-platform-module-health-core-client-list-pain-rate-options.query-C9sGCRmk.mjs
ADDED
|
@@ -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
|
+
const I18N = '@health-core:datasources.pain-rate-options';
|
|
10
|
+
/** Same rows as the former `pain-rate-options` registry data source. */
|
|
11
|
+
const PAIN_RATE_OPTIONS = [
|
|
12
|
+
{ id: '1', title: `${I18N}.samples.1` },
|
|
13
|
+
{ id: '2', title: `${I18N}.samples.2` },
|
|
14
|
+
{ id: '3', title: `${I18N}.samples.3` },
|
|
15
|
+
{ id: '4', title: `${I18N}.samples.4` },
|
|
16
|
+
{ id: '5', title: `${I18N}.samples.5` },
|
|
17
|
+
];
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ---- Query ----
|
|
20
|
+
/**
|
|
21
|
+
* Static pain rate catalog — replaces the `pain-rate-options` DI data source.
|
|
22
|
+
*/
|
|
23
|
+
class AXMListPainRateOptionsQuery {
|
|
24
|
+
//#region ---- Query Execution ----
|
|
25
|
+
async fetch(input) {
|
|
26
|
+
try {
|
|
27
|
+
let items = [...PAIN_RATE_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: 'id', 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: AXMListPainRateOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
45
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListPainRateOptionsQuery, providedIn: 'root' }); }
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListPainRateOptionsQuery, decorators: [{
|
|
48
|
+
type: Injectable,
|
|
49
|
+
args: [{ providedIn: 'root' }]
|
|
50
|
+
}] });
|
|
51
|
+
|
|
52
|
+
export { AXMListPainRateOptionsQuery };
|
|
53
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-pain-rate-options.query-C9sGCRmk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-pain-rate-options.query-C9sGCRmk.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-pain-rate-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 AXMListPainRateOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListPainRateOptionsQueryItem {\n /** Stored choice code. */\n id: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst I18N = '@health-core:datasources.pain-rate-options';\n\n/** Same rows as the former `pain-rate-options` registry data source. */\nconst PAIN_RATE_OPTIONS: AXMListPainRateOptionsQueryItem[] = [\n { id: '1', title: `${I18N}.samples.1` },\n { id: '2', title: `${I18N}.samples.2` },\n { id: '3', title: `${I18N}.samples.3` },\n { id: '4', title: `${I18N}.samples.4` },\n { id: '5', title: `${I18N}.samples.5` },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static pain rate catalog — replaces the `pain-rate-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListPainRateOptionsQuery\n implements AXPCollectionQuery<AXMListPainRateOptionsQueryInput, AXMListPainRateOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListPainRateOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListPainRateOptionsQueryItem> {\n try {\n let items = [...PAIN_RATE_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: 'id' 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,MAAM,IAAI,GAAG,4CAA4C;AAEzD;AACA,MAAM,iBAAiB,GAAsC;IAC3D,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,UAAA,CAAY,EAAE;IACvC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,UAAA,CAAY,EAAE;IACvC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,UAAA,CAAY,EAAE;IACvC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA,EAAG,IAA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,GAAG,wBAAwB,CAClE;QACH;IACF;8GA9BW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,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,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,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 `smoking-status-options` registry data source. */
|
|
10
|
+
const SMOKING_STATUS_OPTIONS = [
|
|
11
|
+
{ value: 'never', title: '@health-core:datasources.smoking-status-options.samples.never' },
|
|
12
|
+
{ value: 'former', title: '@health-core:datasources.smoking-status-options.samples.former' },
|
|
13
|
+
{ value: 'current', title: '@health-core:datasources.smoking-status-options.samples.current' },
|
|
14
|
+
{
|
|
15
|
+
value: 'prefer-not-to-say',
|
|
16
|
+
title: '@health-core:datasources.smoking-status-options.samples.prefer-not-to-say',
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ---- Query ----
|
|
21
|
+
/**
|
|
22
|
+
* Static smoking status catalog — replaces the `smoking-status-options` DI data source.
|
|
23
|
+
*/
|
|
24
|
+
class AXMListSmokingStatusOptionsQuery {
|
|
25
|
+
//#region ---- Query Execution ----
|
|
26
|
+
async fetch(input) {
|
|
27
|
+
try {
|
|
28
|
+
let items = [...SMOKING_STATUS_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: AXMListSmokingStatusOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
46
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListSmokingStatusOptionsQuery, providedIn: 'root' }); }
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListSmokingStatusOptionsQuery, decorators: [{
|
|
49
|
+
type: Injectable,
|
|
50
|
+
args: [{ providedIn: 'root' }]
|
|
51
|
+
}] });
|
|
52
|
+
|
|
53
|
+
export { AXMListSmokingStatusOptionsQuery };
|
|
54
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-smoking-status-options.query-EUVhlNLW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-smoking-status-options.query-EUVhlNLW.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-smoking-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 AXMListSmokingStatusOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListSmokingStatusOptionsQueryItem {\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 `smoking-status-options` registry data source. */\nconst SMOKING_STATUS_OPTIONS: AXMListSmokingStatusOptionsQueryItem[] = [\n { value: 'never', title: '@health-core:datasources.smoking-status-options.samples.never' },\n { value: 'former', title: '@health-core:datasources.smoking-status-options.samples.former' },\n { value: 'current', title: '@health-core:datasources.smoking-status-options.samples.current' },\n {\n value: 'prefer-not-to-say',\n title: '@health-core:datasources.smoking-status-options.samples.prefer-not-to-say',\n },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static smoking status catalog — replaces the `smoking-status-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListSmokingStatusOptionsQuery\n implements\n AXPCollectionQuery<AXMListSmokingStatusOptionsQueryInput, AXMListSmokingStatusOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListSmokingStatusOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListSmokingStatusOptionsQueryItem> {\n try {\n let items = [...SMOKING_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,sBAAsB,GAA2C;AACrE,IAAA,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,+DAA+D,EAAE;AAC1F,IAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,gEAAgE,EAAE;AAC5F,IAAA,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,iEAAiE,EAAE;AAC9F,IAAA;AACE,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,2EAA2E;AACnF,KAAA;CACF;AAED;AAEA;AAEA;;AAEG;MAEU,gCAAgC,CAAA;;IAM3C,MAAM,KAAK,CACT,KAAoD,EAAA;AAEpD,QAAA,IAAI;AACF,YAAA,IAAI,KAAK,GAAG,CAAC,GAAG,sBAAsB,CAAC;AAEvC,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,EAA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|
|
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
|
+
const I18N = '@health-core:datasources.work-capacity-options';
|
|
10
|
+
/** Same rows as the former `work-capacity-options` registry data source. */
|
|
11
|
+
const WORK_CAPACITY_OPTIONS = [
|
|
12
|
+
{ id: 'continue', title: `${I18N}.samples.continue` },
|
|
13
|
+
{ id: 'modified', title: `${I18N}.samples.modified` },
|
|
14
|
+
{ id: 'unable', title: `${I18N}.samples.unable` },
|
|
15
|
+
{ id: 'hospitalised', title: `${I18N}.samples.hospitalised` },
|
|
16
|
+
];
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region ---- Query ----
|
|
19
|
+
/**
|
|
20
|
+
* Static work capacity catalog — replaces the `work-capacity-options` DI data source.
|
|
21
|
+
*/
|
|
22
|
+
class AXMListWorkCapacityOptionsQuery {
|
|
23
|
+
//#region ---- Query Execution ----
|
|
24
|
+
async fetch(input) {
|
|
25
|
+
try {
|
|
26
|
+
let items = [...WORK_CAPACITY_OPTIONS];
|
|
27
|
+
if (input?.filter) {
|
|
28
|
+
items = applyFilterArray(items, [input.filter]);
|
|
29
|
+
}
|
|
30
|
+
const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
|
|
31
|
+
const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'id', dir: 'asc' }];
|
|
32
|
+
items = applySortArray(items, sortOpt);
|
|
33
|
+
const skip = resolveCollectionSkip(input?.skip);
|
|
34
|
+
const take = resolveCollectionTake(input?.take);
|
|
35
|
+
const total = items.length;
|
|
36
|
+
const page = items.slice(skip, skip + take);
|
|
37
|
+
return runtimeQuerySuccessCollection({ items: page, total });
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListWorkCapacityOptionsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
44
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListWorkCapacityOptionsQuery, providedIn: 'root' }); }
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListWorkCapacityOptionsQuery, decorators: [{
|
|
47
|
+
type: Injectable,
|
|
48
|
+
args: [{ providedIn: 'root' }]
|
|
49
|
+
}] });
|
|
50
|
+
|
|
51
|
+
export { AXMListWorkCapacityOptionsQuery };
|
|
52
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-list-work-capacity-options.query-YQ6BW3kG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-list-work-capacity-options.query-YQ6BW3kG.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/queries/list-work-capacity-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 AXMListWorkCapacityOptionsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListWorkCapacityOptionsQueryItem {\n /** Stored choice code. */\n id: string;\n /** Display title (i18n key). */\n title: string;\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst I18N = '@health-core:datasources.work-capacity-options';\n\n/** Same rows as the former `work-capacity-options` registry data source. */\nconst WORK_CAPACITY_OPTIONS: AXMListWorkCapacityOptionsQueryItem[] = [\n { id: 'continue', title: `${I18N}.samples.continue` },\n { id: 'modified', title: `${I18N}.samples.modified` },\n { id: 'unable', title: `${I18N}.samples.unable` },\n { id: 'hospitalised', title: `${I18N}.samples.hospitalised` },\n];\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Static work capacity catalog — replaces the `work-capacity-options` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListWorkCapacityOptionsQuery\n implements AXPCollectionQuery<AXMListWorkCapacityOptionsQueryInput, AXMListWorkCapacityOptionsQueryItem>\n{\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListWorkCapacityOptionsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListWorkCapacityOptionsQueryItem> {\n try {\n let items = [...WORK_CAPACITY_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: 'id' 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,MAAM,IAAI,GAAG,gDAAgD;AAE7D;AACA,MAAM,qBAAqB,GAA0C;IACnE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA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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;8GA9BW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA/B,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,+BAA+B,cADlB,MAAM,EAAA,CAAA,CAAA;;2FACnB,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { AXPSystemStatusType, runtimeQueryCollectionData } from '@acorex-platform/framework-shared/core';
|
|
2
|
+
import { getRecordWorkflowInstanceId } from '@acorex-platform/framework-shared/entity';
|
|
3
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
|
4
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
5
|
+
import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';
|
|
6
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
7
|
+
import { AXPQueryService, AXPCommandService } from '@acorex-platform/framework-client/runtime';
|
|
8
|
+
import { ENTITY_QUERY_DEFAULT, ENTITY_UPDATE_DEFAULT } from '@acorex-platform/framework-shared/runtime';
|
|
9
|
+
import { AXPWorkflowManager, AXP_WORKFLOW_ENGINE } from '@acorex-platform/framework-client/workflow';
|
|
10
|
+
import * as i0 from '@angular/core';
|
|
11
|
+
import { inject, Injectable } from '@angular/core';
|
|
12
|
+
import { RootConfig } from '@acorex-platform/module-health-core-client/contracts';
|
|
13
|
+
|
|
14
|
+
//#region ---- Health event open statuses ----
|
|
15
|
+
/** Statuses that block starting another run for the same subject and event type. */
|
|
16
|
+
const AXMHealthCoreHealthEventOpenStatusIds = [
|
|
17
|
+
AXPSystemStatusType.InProgress,
|
|
18
|
+
AXPSystemStatusType.WaitingSignOff,
|
|
19
|
+
];
|
|
20
|
+
//#endregion
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
/**
|
|
24
|
+
* Starts a guided health event workflow after ensuring at most one in-progress event per subject and record type.
|
|
25
|
+
*/
|
|
26
|
+
class StartHealthEventFlowCommand {
|
|
27
|
+
constructor() {
|
|
28
|
+
//#region ---- Services & Dependencies ----
|
|
29
|
+
this.dialogService = inject(AXDialogService);
|
|
30
|
+
this.translationService = inject(AXTranslationService);
|
|
31
|
+
this.toastService = inject(AXToastService);
|
|
32
|
+
this.entityService = inject(AXPEntityService);
|
|
33
|
+
this.queryService = inject(AXPQueryService);
|
|
34
|
+
this.commandService = inject(AXPCommandService);
|
|
35
|
+
this.workflowManager = inject(AXPWorkflowManager);
|
|
36
|
+
this.workflowEngine = inject(AXP_WORKFLOW_ENGINE, { optional: true });
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region ---- Command Implementation ----
|
|
40
|
+
async execute(input) {
|
|
41
|
+
const options = (input?.options ?? input);
|
|
42
|
+
const flowInput = options.input;
|
|
43
|
+
const workflowId = options.workflowId?.trim();
|
|
44
|
+
const subjectType = flowInput?.subjectType?.trim();
|
|
45
|
+
const subjectId = this.resolveFlowText(flowInput?.subjectId);
|
|
46
|
+
const recordTypeId = flowInput?.recordTypeId?.trim();
|
|
47
|
+
const subjectTitle = this.resolveFlowText(flowInput?.subjectTitle);
|
|
48
|
+
const recordTypeTitleForWorkflow = this.coerceRecordTypeTitleForWorkflow(flowInput?.recordTypeTitle);
|
|
49
|
+
const recordTypeTitleDisplay = this.resolveFlowText(flowInput?.recordTypeTitle);
|
|
50
|
+
const assessmentCaseTitle = this.resolveFlowText(flowInput?.assessmentCaseTitle) ||
|
|
51
|
+
this.buildAssessmentCaseTitle(recordTypeTitleDisplay, subjectTitle);
|
|
52
|
+
if (!workflowId || !subjectType || !subjectId || !recordTypeId) {
|
|
53
|
+
return { success: false, message: { text: 'Missing workflow or subject context.' } };
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const openEvents = await this.findOpenHealthEvents(subjectType, subjectId, recordTypeId);
|
|
57
|
+
const orphanInstanceIds = await this.findOrphanRunningWorkflowInstanceIds(subjectType, subjectId, recordTypeId, workflowId, openEvents);
|
|
58
|
+
if (openEvents.length > 0 || orphanInstanceIds.length > 0) {
|
|
59
|
+
const confirmed = await this.confirmReplace(recordTypeTitleDisplay);
|
|
60
|
+
if (!confirmed) {
|
|
61
|
+
return { success: false };
|
|
62
|
+
}
|
|
63
|
+
await this.closeOpenRuns(openEvents, orphanInstanceIds);
|
|
64
|
+
}
|
|
65
|
+
const startResult = await this.workflowManager.start(workflowId, {
|
|
66
|
+
subjectType,
|
|
67
|
+
subjectId,
|
|
68
|
+
subjectTitle,
|
|
69
|
+
recordTypeId: flowInput.recordTypeId,
|
|
70
|
+
...(recordTypeTitleForWorkflow != null ? { recordTypeTitle: recordTypeTitleForWorkflow } : {}),
|
|
71
|
+
assessmentCaseTitle,
|
|
72
|
+
questionnaireId: flowInput.questionnaireId,
|
|
73
|
+
requireEmployeeSignature: flowInput.requireEmployeeSignature,
|
|
74
|
+
requireManagerSignature: flowInput.requireManagerSignature,
|
|
75
|
+
refId: subjectId,
|
|
76
|
+
refType: subjectType,
|
|
77
|
+
correlationId: this.buildCorrelationId(subjectType, subjectId, recordTypeId, workflowId),
|
|
78
|
+
});
|
|
79
|
+
if (!startResult.success) {
|
|
80
|
+
this.toastService.show({
|
|
81
|
+
color: 'danger',
|
|
82
|
+
title: 'Workflow Execution Failed',
|
|
83
|
+
content: startResult.error ?? 'Unknown error',
|
|
84
|
+
closeButton: true,
|
|
85
|
+
timeOut: 5000,
|
|
86
|
+
});
|
|
87
|
+
return { success: false, message: { text: startResult.error ?? 'Unknown error' } };
|
|
88
|
+
}
|
|
89
|
+
return { success: true, kind: 'object', data: undefined };
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
93
|
+
console.error('[StartHealthEventFlowCommand]', error);
|
|
94
|
+
this.toastService.show({
|
|
95
|
+
color: 'danger',
|
|
96
|
+
title: 'Workflow Execution Error',
|
|
97
|
+
content: message,
|
|
98
|
+
closeButton: true,
|
|
99
|
+
timeOut: 5000,
|
|
100
|
+
});
|
|
101
|
+
return { success: false, message: { text: message } };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region ---- Open-run detection ----
|
|
106
|
+
async findOpenHealthEvents(subjectType, subjectId, recordTypeId) {
|
|
107
|
+
const page = await this.entityService
|
|
108
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.healthEvent.name)
|
|
109
|
+
.data()
|
|
110
|
+
.query({
|
|
111
|
+
skip: 0,
|
|
112
|
+
take: 10,
|
|
113
|
+
filter: {
|
|
114
|
+
logic: 'and',
|
|
115
|
+
filters: [
|
|
116
|
+
{ field: 'subject.type', operator: { type: 'equal' }, value: subjectType },
|
|
117
|
+
{ field: 'subject.id', operator: { type: 'equal' }, value: subjectId },
|
|
118
|
+
{ field: 'recordTypeId', operator: { type: 'equal' }, value: recordTypeId },
|
|
119
|
+
{
|
|
120
|
+
field: 'statusId',
|
|
121
|
+
operator: { type: 'in' },
|
|
122
|
+
value: [...AXMHealthCoreHealthEventOpenStatusIds],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
return (page.items ?? []);
|
|
128
|
+
}
|
|
129
|
+
async findOrphanRunningWorkflowInstanceIds(subjectType, subjectId, recordTypeId, workflowId, openEvents) {
|
|
130
|
+
const linkedInstanceIds = new Set(openEvents
|
|
131
|
+
.map((row) => getRecordWorkflowInstanceId(row))
|
|
132
|
+
.filter((id) => !!id));
|
|
133
|
+
try {
|
|
134
|
+
const result = await this.queryService.fetch(ENTITY_QUERY_DEFAULT, {
|
|
135
|
+
entity: 'WorkflowManagement.WorkflowInstance',
|
|
136
|
+
skip: 0,
|
|
137
|
+
take: 50,
|
|
138
|
+
filter: {
|
|
139
|
+
logic: 'and',
|
|
140
|
+
filters: [
|
|
141
|
+
{
|
|
142
|
+
field: 'definitionId',
|
|
143
|
+
operator: { type: 'equal' },
|
|
144
|
+
value: workflowId,
|
|
145
|
+
},
|
|
146
|
+
{ field: 'status', operator: { type: 'equal' }, value: 'Running' },
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
const items = (runtimeQueryCollectionData(result)?.items ?? []);
|
|
151
|
+
return items
|
|
152
|
+
.filter((row) => {
|
|
153
|
+
const id = row.id?.trim();
|
|
154
|
+
if (!id || linkedInstanceIds.has(id)) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
const runInput = row.workflowInstance?.workflowState?.input ?? {};
|
|
158
|
+
return (runInput['subjectType'] === subjectType &&
|
|
159
|
+
runInput['subjectId'] === subjectId &&
|
|
160
|
+
runInput['recordTypeId'] === recordTypeId);
|
|
161
|
+
})
|
|
162
|
+
.map((row) => row.id);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return [];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region ---- Close and replace ----
|
|
170
|
+
async confirmReplace(recordTypeTitle) {
|
|
171
|
+
const title = await this.translationService.translateAsync('@health-core:health-events.messages.replace-open.confirm.title');
|
|
172
|
+
const message = await this.translationService.translateAsync('@health-core:health-events.messages.replace-open.confirm.message', {
|
|
173
|
+
params: {
|
|
174
|
+
recordTypeTitle: String(recordTypeTitle ?? '').trim() || '—',
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
const result = await this.dialogService.confirm(title, message, 'warning', 'horizontal', false, 'cancel');
|
|
178
|
+
return result.result === true;
|
|
179
|
+
}
|
|
180
|
+
async closeOpenRuns(openEvents, orphanInstanceIds) {
|
|
181
|
+
const data = this.entityService
|
|
182
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.healthEvent.name)
|
|
183
|
+
.data();
|
|
184
|
+
const supersedeNote = 'Closed to start a new health event run.';
|
|
185
|
+
for (const event of openEvents) {
|
|
186
|
+
await data.update(event.id, {
|
|
187
|
+
statusId: AXPSystemStatusType.Cancelled,
|
|
188
|
+
notes: supersedeNote,
|
|
189
|
+
});
|
|
190
|
+
const instanceId = getRecordWorkflowInstanceId(event);
|
|
191
|
+
if (instanceId) {
|
|
192
|
+
await this.cancelWorkflowInstance(instanceId);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
for (const instanceId of orphanInstanceIds) {
|
|
196
|
+
await this.cancelWorkflowInstance(instanceId);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async cancelWorkflowInstance(instanceId) {
|
|
200
|
+
const engine = this.workflowEngine;
|
|
201
|
+
if (engine?.cancelInstance) {
|
|
202
|
+
await engine.cancelInstance(instanceId, 'superseded');
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const now = new Date().toISOString();
|
|
206
|
+
try {
|
|
207
|
+
await this.commandService.execute(ENTITY_UPDATE_DEFAULT, {
|
|
208
|
+
entity: 'WorkflowManagement.WorkflowInstance',
|
|
209
|
+
id: instanceId,
|
|
210
|
+
status: 'Finished',
|
|
211
|
+
subStatus: 'Cancelled',
|
|
212
|
+
finishedAt: now,
|
|
213
|
+
updatedAt: now,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
console.warn('[StartHealthEventFlowCommand] Failed to cancel workflow instance:', instanceId, error);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region ---- Helpers ----
|
|
222
|
+
resolveFlowText(value) {
|
|
223
|
+
if (value == null || value === false) {
|
|
224
|
+
return '';
|
|
225
|
+
}
|
|
226
|
+
if (typeof value === 'string') {
|
|
227
|
+
return value.trim();
|
|
228
|
+
}
|
|
229
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
230
|
+
return String(value).trim();
|
|
231
|
+
}
|
|
232
|
+
return resolveMultiLanguageString(value, this.translationService.getActiveLang()).trim();
|
|
233
|
+
}
|
|
234
|
+
/** Preserves multi-language record type titles on the workflow instance for locale-aware task labels. */
|
|
235
|
+
coerceRecordTypeTitleForWorkflow(value) {
|
|
236
|
+
if (value == null) {
|
|
237
|
+
return undefined;
|
|
238
|
+
}
|
|
239
|
+
if (typeof value === 'object') {
|
|
240
|
+
return value;
|
|
241
|
+
}
|
|
242
|
+
const trimmed = value.trim();
|
|
243
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
244
|
+
}
|
|
245
|
+
buildAssessmentCaseTitle(recordTypeTitle, subjectTitle) {
|
|
246
|
+
if (recordTypeTitle && subjectTitle) {
|
|
247
|
+
return `${recordTypeTitle} — ${subjectTitle}`;
|
|
248
|
+
}
|
|
249
|
+
return recordTypeTitle || subjectTitle;
|
|
250
|
+
}
|
|
251
|
+
buildCorrelationId(subjectType, subjectId, recordTypeId, workflowId) {
|
|
252
|
+
return `${subjectType}:${subjectId}:${recordTypeId}:${workflowId}`;
|
|
253
|
+
}
|
|
254
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: StartHealthEventFlowCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
255
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: StartHealthEventFlowCommand, providedIn: 'root' }); }
|
|
256
|
+
}
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: StartHealthEventFlowCommand, decorators: [{
|
|
258
|
+
type: Injectable,
|
|
259
|
+
args: [{ providedIn: 'root' }]
|
|
260
|
+
}] });
|
|
261
|
+
|
|
262
|
+
export { StartHealthEventFlowCommand };
|
|
263
|
+
//# sourceMappingURL=acorex-platform-module-health-core-client-start-health-record-flow.command-BsB-MPmu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-health-core-client-start-health-record-flow.command-BsB-MPmu.mjs","sources":["../../../../libs/modules/health-core/client/src/lib/features/health-event/health-event-status.constants.ts","../../../../libs/modules/health-core/client/src/lib/features/health-event/commands/start-health-record-flow.command.ts"],"sourcesContent":["import { AXPSystemStatusType } from '@acorex-platform/framework-shared/core';\n\n//#region ---- Health event open statuses ----\n\n/** Statuses that block starting another run for the same subject and event type. */\nexport const AXMHealthCoreHealthEventOpenStatusIds = [\n AXPSystemStatusType.InProgress,\n AXPSystemStatusType.WaitingSignOff,\n] as const;\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPRuntimeCommandResult,\n AXPSystemStatusType,\n runtimeQueryCollectionData,\n} from '@acorex-platform/framework-shared/core';\nimport { getRecordWorkflowInstanceId } from '@acorex-platform/framework-shared/entity';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService, resolveMultiLanguageString, type AXMultiLanguageString } from '@acorex/core/translation';\n\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService, AXPQueryService } from '@acorex-platform/framework-client/runtime';\nimport { ENTITY_QUERY_DEFAULT, ENTITY_UPDATE_DEFAULT } from '@acorex-platform/framework-shared/runtime';\n\nimport {\n AXP_WORKFLOW_ENGINE,\n AXPWorkflowEngine,\n AXPWorkflowManager,\n} from '@acorex-platform/framework-client/workflow';\nimport { inject, Injectable } from '@angular/core';\n\nimport { RootConfig } from '@acorex-platform/module-health-core-client/contracts';\nimport { AXMHealthCoreHealthEventOpenStatusIds } from '../health-event-status.constants';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface StartHealthEventFlowInput {\n workflowId?: string;\n subjectType?: string;\n subjectId?: string;\n subjectTitle?: string;\n recordTypeId?: string;\n recordTypeTitle?: AXMultiLanguageString | string;\n questionnaireId?: string;\n requireEmployeeSignature?: boolean;\n requireManagerSignature?: boolean;\n options?: StartHealthEventFlowOptions;\n}\n\nexport interface StartHealthEventFlowOptions {\n workflowId: string;\n input: {\n subjectType: string;\n subjectId: string;\n subjectTitle: string;\n recordTypeId: string;\n recordTypeTitle?: AXMultiLanguageString | string;\n questionnaireId?: string;\n requireEmployeeSignature?: boolean;\n requireManagerSignature?: boolean;\n assessmentCaseTitle?: string;\n };\n}\n\ninterface OpenHealthEventRow {\n id: string;\n workflowInfo?: { instanceId?: string | null; correlationId?: string | null };\n recordType?: { title?: unknown };\n}\n\n//#endregion\n\n/**\n * Starts a guided health event workflow after ensuring at most one in-progress event per subject and record type.\n */\n@Injectable({ providedIn: 'root' })\nexport class StartHealthEventFlowCommand implements AXPCommand<StartHealthEventFlowInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly dialogService = inject(AXDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly entityService = inject(AXPEntityService);\n private readonly queryService = inject(AXPQueryService);\n private readonly commandService = inject(AXPCommandService);\n private readonly workflowManager = inject(AXPWorkflowManager);\n private readonly workflowEngine = inject(AXP_WORKFLOW_ENGINE, { optional: true });\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: StartHealthEventFlowInput): AXPCommandExecuteResultPromise<void> {\n const options = (input?.options ?? input) as StartHealthEventFlowOptions;\n const flowInput = options.input;\n const workflowId = options.workflowId?.trim();\n const subjectType = flowInput?.subjectType?.trim();\n const subjectId = this.resolveFlowText(flowInput?.subjectId);\n const recordTypeId = flowInput?.recordTypeId?.trim();\n const subjectTitle = this.resolveFlowText(flowInput?.subjectTitle);\n const recordTypeTitleForWorkflow = this.coerceRecordTypeTitleForWorkflow(flowInput?.recordTypeTitle);\n const recordTypeTitleDisplay = this.resolveFlowText(flowInput?.recordTypeTitle);\n const assessmentCaseTitle =\n this.resolveFlowText(flowInput?.assessmentCaseTitle) ||\n this.buildAssessmentCaseTitle(recordTypeTitleDisplay, subjectTitle);\n\n if (!workflowId || !subjectType || !subjectId || !recordTypeId) {\n return { success: false, message: { text: 'Missing workflow or subject context.' } };\n }\n\n try {\n const openEvents = await this.findOpenHealthEvents(subjectType, subjectId, recordTypeId);\n const orphanInstanceIds = await this.findOrphanRunningWorkflowInstanceIds(\n subjectType,\n subjectId,\n recordTypeId,\n workflowId,\n openEvents,\n );\n\n if (openEvents.length > 0 || orphanInstanceIds.length > 0) {\n const confirmed = await this.confirmReplace(recordTypeTitleDisplay);\n if (!confirmed) {\n return { success: false };\n }\n await this.closeOpenRuns(openEvents, orphanInstanceIds);\n }\n\n const startResult = await this.workflowManager.start(workflowId, {\n subjectType,\n subjectId,\n subjectTitle,\n recordTypeId: flowInput.recordTypeId,\n ...(recordTypeTitleForWorkflow != null ? { recordTypeTitle: recordTypeTitleForWorkflow } : {}),\n assessmentCaseTitle,\n questionnaireId: flowInput.questionnaireId,\n requireEmployeeSignature: flowInput.requireEmployeeSignature,\n requireManagerSignature: flowInput.requireManagerSignature,\n refId: subjectId,\n refType: subjectType,\n correlationId: this.buildCorrelationId(subjectType, subjectId, recordTypeId, workflowId),\n });\n\n if (!startResult.success) {\n this.toastService.show({\n color: 'danger',\n title: 'Workflow Execution Failed',\n content: startResult.error ?? 'Unknown error',\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: startResult.error ?? 'Unknown error' } };\n }\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n console.error('[StartHealthEventFlowCommand]', error);\n this.toastService.show({\n color: 'danger',\n title: 'Workflow Execution Error',\n content: message,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: message } };\n }\n }\n\n //#endregion\n\n //#region ---- Open-run detection ----\n\n private async findOpenHealthEvents(\n subjectType: string,\n subjectId: string,\n recordTypeId: string,\n ): Promise<OpenHealthEventRow[]> {\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.healthEvent.name)\n .data()\n .query({\n skip: 0,\n take: 10,\n filter: {\n logic: 'and',\n filters: [\n { field: 'subject.type', operator: { type: 'equal' }, value: subjectType },\n { field: 'subject.id', operator: { type: 'equal' }, value: subjectId },\n { field: 'recordTypeId', operator: { type: 'equal' }, value: recordTypeId },\n {\n field: 'statusId',\n operator: { type: 'in' },\n value: [...AXMHealthCoreHealthEventOpenStatusIds],\n },\n ],\n },\n });\n\n return (page.items ?? []) as OpenHealthEventRow[];\n }\n\n private async findOrphanRunningWorkflowInstanceIds(\n subjectType: string,\n subjectId: string,\n recordTypeId: string,\n workflowId: string,\n openEvents: OpenHealthEventRow[],\n ): Promise<string[]> {\n const linkedInstanceIds = new Set(\n openEvents\n .map((row) => getRecordWorkflowInstanceId(row))\n .filter((id): id is string => !!id),\n );\n\n try {\n const result = await this.queryService.fetch(ENTITY_QUERY_DEFAULT, {\n entity: 'WorkflowManagement.WorkflowInstance',\n skip: 0,\n take: 50,\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'definitionId',\n operator: { type: 'equal' },\n value: workflowId,\n },\n { field: 'status', operator: { type: 'equal' }, value: 'Running' },\n ],\n },\n });\n\n const items = (runtimeQueryCollectionData(result)?.items ?? []) as Array<{\n id?: string;\n workflowInstance?: { workflowState?: { input?: Record<string, unknown> } };\n }>;\n\n return items\n .filter((row) => {\n const id = row.id?.trim();\n if (!id || linkedInstanceIds.has(id)) {\n return false;\n }\n const runInput = row.workflowInstance?.workflowState?.input ?? {};\n return (\n runInput['subjectType'] === subjectType &&\n runInput['subjectId'] === subjectId &&\n runInput['recordTypeId'] === recordTypeId\n );\n })\n .map((row) => row.id as string);\n } catch {\n return [];\n }\n }\n\n //#endregion\n\n //#region ---- Close and replace ----\n\n private async confirmReplace(recordTypeTitle: string | undefined): Promise<boolean> {\n const title = await this.translationService.translateAsync(\n '@health-core:health-events.messages.replace-open.confirm.title',\n );\n const message = await this.translationService.translateAsync(\n '@health-core:health-events.messages.replace-open.confirm.message',\n {\n params: {\n recordTypeTitle: String(recordTypeTitle ?? '').trim() || '—',\n },\n },\n );\n const result = await this.dialogService.confirm(title, message, 'warning', 'horizontal', false, 'cancel');\n return result.result === true;\n }\n\n private async closeOpenRuns(\n openEvents: OpenHealthEventRow[],\n orphanInstanceIds: string[],\n ): Promise<void> {\n const data = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.healthEvent.name)\n .data();\n\n const supersedeNote = 'Closed to start a new health event run.';\n\n for (const event of openEvents) {\n await data.update(event.id, {\n statusId: AXPSystemStatusType.Cancelled,\n notes: supersedeNote,\n } as never);\n\n const instanceId = getRecordWorkflowInstanceId(event);\n if (instanceId) {\n await this.cancelWorkflowInstance(instanceId);\n }\n }\n\n for (const instanceId of orphanInstanceIds) {\n await this.cancelWorkflowInstance(instanceId);\n }\n }\n\n private async cancelWorkflowInstance(instanceId: string): Promise<void> {\n const engine = this.workflowEngine as AXPWorkflowEngine | null;\n if (engine?.cancelInstance) {\n await engine.cancelInstance(instanceId, 'superseded');\n return;\n }\n\n const now = new Date().toISOString();\n try {\n await this.commandService.execute(ENTITY_UPDATE_DEFAULT, {\n entity: 'WorkflowManagement.WorkflowInstance',\n id: instanceId,\n status: 'Finished',\n subStatus: 'Cancelled',\n finishedAt: now,\n updatedAt: now,\n });\n } catch (error: unknown) {\n console.warn('[StartHealthEventFlowCommand] Failed to cancel workflow instance:', instanceId, error);\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveFlowText(value: unknown): string {\n if (value == null || value === false) {\n return '';\n }\n if (typeof value === 'string') {\n return value.trim();\n }\n if (typeof value === 'number' || typeof value === 'boolean') {\n return String(value).trim();\n }\n return resolveMultiLanguageString(value as never, this.translationService.getActiveLang()).trim();\n }\n\n /** Preserves multi-language record type titles on the workflow instance for locale-aware task labels. */\n private coerceRecordTypeTitleForWorkflow(\n value: AXMultiLanguageString | string | undefined,\n ): AXMultiLanguageString | string | undefined {\n if (value == null) {\n return undefined;\n }\n if (typeof value === 'object') {\n return value;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n }\n\n private buildAssessmentCaseTitle(recordTypeTitle: string, subjectTitle: string): string {\n if (recordTypeTitle && subjectTitle) {\n return `${recordTypeTitle} — ${subjectTitle}`;\n }\n return recordTypeTitle || subjectTitle;\n }\n\n private buildCorrelationId(\n subjectType: string,\n subjectId: string,\n recordTypeId: string,\n workflowId: string,\n ): string {\n return `${subjectType}:${subjectId}:${recordTypeId}:${workflowId}`;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAEA;AAEA;AACO,MAAM,qCAAqC,GAAG;AACnD,IAAA,mBAAmB,CAAC,UAAU;AAC9B,IAAA,mBAAmB,CAAC,cAAc;CAC1B;AAEV;;ACuDA;AAEA;;AAEG;MAEU,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC;AACtC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,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