@bahmni/widgets 0.0.1-dev.325 → 0.0.1-dev.328
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/dist/{DocumentsTable-BCApmM0e.js → DocumentsTable-C8RwQ0aH.js} +1 -1
- package/dist/{FormsTable-D4uH1t5n.js → FormsTable-OpTexxoW.js} +1 -1
- package/dist/{Observations-BuBMVV44.js → Observations-BX6W6aWO.js} +1 -1
- package/dist/{index-0AuXrwfX.js → index-B-ZJCY66.js} +9861 -9765
- package/dist/index.js +1 -1
- package/dist/tasks/TaskList.d.ts.map +1 -1
- package/dist/tasks/__tests__/__mocks__/taskActionsMocks.d.ts +23 -0
- package/dist/tasks/__tests__/__mocks__/taskActionsMocks.d.ts.map +1 -0
- package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts +32 -0
- package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts.map +1 -1
- package/dist/tasks/components/TaskActions.d.ts +10 -0
- package/dist/tasks/components/TaskActions.d.ts.map +1 -0
- package/dist/tasks/components/actionHandlers.d.ts +9 -0
- package/dist/tasks/components/actionHandlers.d.ts.map +1 -0
- package/dist/tasks/models.d.ts +13 -13
- package/dist/tasks/models.d.ts.map +1 -1
- package/dist/tasks/utils.d.ts +21 -0
- package/dist/tasks/utils.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a9 as s, a7 as t, n as o, a6 as r, p as n, a4 as g, N as c, af as l, r as d, C as P, w as v, D as m, a5 as T, z as C, I as u, L as b, an as I, ap as S, aq as W, M as p, Y as A, _ as f, O as L, m as R, H as h, K as D, y, x as E, S as N, E as O, a3 as _, V as x, ae as H, ab as U, aa as G, al as V, ak as k, ad as M, ah as q, ai as w, aj as z, ac as j, ag as B, am as F, a8 as K, W as Y, a0 as J, a2 as Q, ao as X, a as Z, u as $, a1 as aa } from "./index-
|
|
1
|
+
import { a9 as s, a7 as t, n as o, a6 as r, p as n, a4 as g, N as c, af as l, r as d, C as P, w as v, D as m, a5 as T, z as C, I as u, L as b, an as I, ap as S, aq as W, M as p, Y as A, _ as f, O as L, m as R, H as h, K as D, y, x as E, S as N, E as O, a3 as _, V as x, ae as H, ab as U, aa as G, al as V, ak as k, ad as M, ah as q, ai as w, aj as z, ac as j, ag as B, am as F, a8 as K, W as Y, a0 as J, a2 as Q, ao as X, a as Z, u as $, a1 as aa } from "./index-B-ZJCY66.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
s as ActivePractitionerContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskList.d.ts","sourceRoot":"","sources":["../../src/tasks/TaskList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TaskList.d.ts","sourceRoot":"","sources":["../../src/tasks/TaskList.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,UAAU,aAAc,SAAQ,WAAW;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAiFD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwIrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ObservationForm, UserPrivilege } from '@bahmni/services';
|
|
2
|
+
import { Task } from 'fhir/r4';
|
|
3
|
+
import { TaskAction, TaskActionConfig, TaskViewModel } from '../../models';
|
|
4
|
+
export declare const mockUserPrivileges: UserPrivilege[];
|
|
5
|
+
export declare const mockEmptyUserPrivileges: UserPrivilege[];
|
|
6
|
+
export declare const mockObservationForms: ObservationForm[];
|
|
7
|
+
export declare const mockLaunchFormAction: TaskAction;
|
|
8
|
+
export declare const mockLaunchFormActionNoPrivileges: TaskAction;
|
|
9
|
+
export declare const mockRestrictedAction: TaskAction;
|
|
10
|
+
export declare const mockTaskActionConfig: TaskActionConfig[];
|
|
11
|
+
export declare const mockFHIRTaskWithInput: Task;
|
|
12
|
+
export declare const mockFHIRTaskWithoutInput: Task;
|
|
13
|
+
export declare const mockFHIRTaskWithEmptyInput: Task;
|
|
14
|
+
export declare const mockFHIRTaskWithLabForm: Task;
|
|
15
|
+
export declare const mockFHIRTaskWithCaseInsensitiveForm: Task;
|
|
16
|
+
export declare const mockFHIRTaskWithNonexistentForm: Task;
|
|
17
|
+
export declare const mockTaskViewModelWithInput: TaskViewModel;
|
|
18
|
+
export declare const mockTaskViewModelWithoutInput: TaskViewModel;
|
|
19
|
+
export declare const mockTaskViewModelWithEmptyInput: TaskViewModel;
|
|
20
|
+
export declare const mockTaskViewModelWithLabForm: TaskViewModel;
|
|
21
|
+
export declare const mockTaskViewModelWithCaseInsensitiveForm: TaskViewModel;
|
|
22
|
+
export declare const mockTaskViewModelWithNonexistentForm: TaskViewModel;
|
|
23
|
+
//# sourceMappingURL=taskActionsMocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskActionsMocks.d.ts","sourceRoot":"","sources":["../../../../src/tasks/__tests__/__mocks__/taskActionsMocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQhF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAI7C,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,aAAa,EAAO,CAAC;AAG3D,eAAO,MAAM,oBAAoB,EAAE,eAAe,EAgEjD,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,UASlC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,UAS9C,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,UASlC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,EASlD,CAAC;AA+CF,eAAO,MAAM,qBAAqB,EAAE,IA0BnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,IAmBtC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,IAKxC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,IAMrC,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,IAO/C,CAAC;AAEJ,eAAO,MAAM,+BAA+B,EAAE,IAM7C,CAAC;AAaF,eAAO,MAAM,0BAA0B,EAAE,aAExC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,aAE3C,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,aACG,CAAC;AAElD,eAAO,MAAM,4BAA4B,EAAE,aAE1C,CAAC;AAEF,eAAO,MAAM,wCAAwC,EAAE,aACG,CAAC;AAE3D,eAAO,MAAM,oCAAoC,EAAE,aACG,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Bundle, Task } from 'fhir/r4';
|
|
2
2
|
import { TaskViewModel } from '../../models';
|
|
3
|
+
export declare const VITALS_TASK_CODE = "6501d0f9-98da-44be-afc9-e2319453f0d6";
|
|
4
|
+
export declare const LAB_TESTS_TASK_CODE = "7601d0f9-98da-44be-afc9-e2319453f0d7";
|
|
5
|
+
export declare const FORM_NAME_INPUT_CODE = "form-name-input-type";
|
|
3
6
|
export declare const mockFHIRTasks: Task[];
|
|
4
7
|
export declare const mockTasksBundle: Bundle<Task>;
|
|
5
8
|
export declare const emptyTasksBundle: Bundle<Task>;
|
|
@@ -12,5 +15,34 @@ export declare const mockTasksControlConfig: {
|
|
|
12
15
|
export declare const mockTasksControlConfigNoFitlers: {
|
|
13
16
|
showOnlyLeafTasks: boolean;
|
|
14
17
|
};
|
|
18
|
+
export declare const mockTaskActionConfig: {
|
|
19
|
+
taskCode: string;
|
|
20
|
+
actions: {
|
|
21
|
+
label: string;
|
|
22
|
+
type: string;
|
|
23
|
+
icon: string;
|
|
24
|
+
requiredPrivileges: string[];
|
|
25
|
+
handlerConfig: {
|
|
26
|
+
formInputCode: string;
|
|
27
|
+
encounterType: string;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
}[];
|
|
31
|
+
export declare const mockTasksControlConfigWithActions: {
|
|
32
|
+
showOnlyLeafTasks: boolean;
|
|
33
|
+
actionConfig: {
|
|
34
|
+
taskCode: string;
|
|
35
|
+
actions: {
|
|
36
|
+
label: string;
|
|
37
|
+
type: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
requiredPrivileges: string[];
|
|
40
|
+
handlerConfig: {
|
|
41
|
+
formInputCode: string;
|
|
42
|
+
encounterType: string;
|
|
43
|
+
};
|
|
44
|
+
}[];
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
15
47
|
export declare const mockError: Error;
|
|
16
48
|
//# sourceMappingURL=taskListMocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskListMocks.d.ts","sourceRoot":"","sources":["../../../../src/tasks/__tests__/__mocks__/taskListMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"taskListMocks.d.ts","sourceRoot":"","sources":["../../../../src/tasks/__tests__/__mocks__/taskListMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,eAAO,MAAM,gBAAgB,yCAAyC,CAAC;AACvE,eAAO,MAAM,mBAAmB,yCAAyC,CAAC;AAC1E,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,eAAO,MAAM,aAAa,EAAE,IAAI,EAuG/B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,IAAI,CAQxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAKzC,CAAC;AAgBF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAc7C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAAa,EAIxC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;CAGlC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;CAE3C,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;GAgBhC,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;CAG7C,CAAC;AAEF,eAAO,MAAM,SAAS,OAAqC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TaskViewModel, TaskActionConfig } from '../models';
|
|
3
|
+
interface TaskActionsProps {
|
|
4
|
+
task: TaskViewModel;
|
|
5
|
+
actionConfig: TaskActionConfig[];
|
|
6
|
+
episodeOfCareUuids?: string[];
|
|
7
|
+
}
|
|
8
|
+
declare const TaskActions: React.FC<TaskActionsProps>;
|
|
9
|
+
export default TaskActions;
|
|
10
|
+
//# sourceMappingURL=TaskActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskActions.d.ts","sourceRoot":"","sources":["../../../src/tasks/components/TaskActions.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAMjE,UAAU,gBAAgB;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuD3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObservationForm, UserPrivilege } from '@bahmni/services';
|
|
2
|
+
import { TaskAction, TaskViewModel } from '../models';
|
|
3
|
+
/**
|
|
4
|
+
* Check action-specific visibility requirements
|
|
5
|
+
* (Beyond privilege checks which are done in TaskActions.tsx)
|
|
6
|
+
*/
|
|
7
|
+
export declare const isActionVisible: (action: TaskAction, task: TaskViewModel, allForms: ObservationForm[], userPrivileges: UserPrivilege[] | null) => boolean;
|
|
8
|
+
export declare const handleTaskAction: (action: TaskAction, task: TaskViewModel) => void;
|
|
9
|
+
//# sourceMappingURL=actionHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionHandlers.d.ts","sourceRoot":"","sources":["../../../src/tasks/components/actionHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG3D;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,UAAU,EAClB,MAAM,aAAa,EACnB,UAAU,eAAe,EAAE,EAC3B,gBAAgB,aAAa,EAAE,GAAG,IAAI,KACrC,OAgBF,CAAC;AAwBF,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,UAAU,EAClB,MAAM,aAAa,KAClB,IAIF,CAAC"}
|
package/dist/tasks/models.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Task } from 'fhir/r4';
|
|
1
2
|
export interface TaskViewModel {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -5,24 +6,23 @@ export interface TaskViewModel {
|
|
|
5
6
|
status: string;
|
|
6
7
|
completedBy?: string;
|
|
7
8
|
completedOn?: string;
|
|
8
|
-
partOf
|
|
9
|
+
partOf: string[];
|
|
10
|
+
fhirResource: Task;
|
|
9
11
|
}
|
|
10
|
-
export interface
|
|
12
|
+
export interface TaskAction {
|
|
13
|
+
label: string;
|
|
14
|
+
type: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
requiredPrivileges: string[];
|
|
17
|
+
handlerConfig: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface TaskActionConfig {
|
|
11
20
|
taskCode: string;
|
|
12
|
-
|
|
13
|
-
handlerConfig?: {
|
|
14
|
-
actions?: Array<{
|
|
15
|
-
label: string;
|
|
16
|
-
type: string;
|
|
17
|
-
encounterType?: string;
|
|
18
|
-
requiredPrivileges?: string[];
|
|
19
|
-
icon?: string;
|
|
20
|
-
}>;
|
|
21
|
-
};
|
|
21
|
+
actions: TaskAction[];
|
|
22
22
|
}
|
|
23
23
|
export interface TaskListConfig {
|
|
24
24
|
showOnlyLeafTasks?: boolean;
|
|
25
25
|
taskTypes?: string[];
|
|
26
|
-
|
|
26
|
+
actionConfig?: TaskActionConfig[];
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/tasks/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/tasks/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ObservationForm, UserPrivilege } from '@bahmni/services';
|
|
2
|
+
import { TaskViewModel, TaskActionConfig } from './models';
|
|
3
|
+
/**
|
|
4
|
+
* Extract form name from task input based on inputType
|
|
5
|
+
* @param task - TaskViewModel containing the full FHIR Task resource
|
|
6
|
+
* @param inputType - The concept UUID to look for in task.input[].type.coding[].code
|
|
7
|
+
* @returns The form name from task.input[].valueString, or null if not found
|
|
8
|
+
*/
|
|
9
|
+
export declare const extractFormNameFromTask: (task: TaskViewModel, inputType: string) => string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Check if user can edit a form based on privileges
|
|
12
|
+
*/
|
|
13
|
+
export declare const canUserEditForm: (userPrivileges: UserPrivilege[] | null, form: ObservationForm | undefined) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Check if action config has any 'launchForm' type actions for the given task
|
|
16
|
+
* @param actionConfig - Array of task action configurations
|
|
17
|
+
* @param taskCode - The task code to check
|
|
18
|
+
* @returns true if there are launchForm actions, false otherwise
|
|
19
|
+
*/
|
|
20
|
+
export declare const hasLaunchFormActions: (actionConfig: TaskActionConfig[], taskCode: string) => boolean;
|
|
21
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tasks/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,aAAa,EACnB,WAAW,MAAM,KAChB,MAAM,GAAG,IAeX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,gBAAgB,aAAa,EAAE,GAAG,IAAI,EACtC,MAAM,eAAe,GAAG,SAAS,KAChC,OAuBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,cAAc,gBAAgB,EAAE,EAChC,UAAU,MAAM,KACf,OAQF,CAAC"}
|