@digihmis/esm-service-queue-app 1.0.0
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/README.md +4 -0
- package/dist/117.js +1 -0
- package/dist/117.js.map +1 -0
- package/dist/132.js +1 -0
- package/dist/132.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/157.js +1 -0
- package/dist/157.js.map +1 -0
- package/dist/209.js +1 -0
- package/dist/209.js.map +1 -0
- package/dist/217.js +1 -0
- package/dist/217.js.map +1 -0
- package/dist/317.js +1 -0
- package/dist/317.js.map +1 -0
- package/dist/349.js +1 -0
- package/dist/349.js.map +1 -0
- package/dist/371.js +1 -0
- package/dist/371.js.map +1 -0
- package/dist/378.js +1 -0
- package/dist/378.js.map +1 -0
- package/dist/390.js +1 -0
- package/dist/390.js.map +1 -0
- package/dist/393.js +12 -0
- package/dist/393.js.map +1 -0
- package/dist/442.js +1 -0
- package/dist/442.js.map +1 -0
- package/dist/45.js +1 -0
- package/dist/45.js.map +1 -0
- package/dist/466.js +1 -0
- package/dist/466.js.map +1 -0
- package/dist/50.js +1 -0
- package/dist/50.js.map +1 -0
- package/dist/508.js +1 -0
- package/dist/508.js.map +1 -0
- package/dist/61.js +1 -0
- package/dist/61.js.map +1 -0
- package/dist/689.js +1 -0
- package/dist/689.js.map +1 -0
- package/dist/712.js +1 -0
- package/dist/712.js.map +1 -0
- package/dist/716.js +1 -0
- package/dist/716.js.map +1 -0
- package/dist/720.js +1 -0
- package/dist/720.js.map +1 -0
- package/dist/731.js +15 -0
- package/dist/731.js.map +1 -0
- package/dist/742.js +1 -0
- package/dist/742.js.map +1 -0
- package/dist/771.js +1 -0
- package/dist/771.js.map +1 -0
- package/dist/806.js +1 -0
- package/dist/806.js.map +1 -0
- package/dist/912.js +1 -0
- package/dist/912.js.map +1 -0
- package/dist/913.js +1 -0
- package/dist/913.js.map +1 -0
- package/dist/940.js +1 -0
- package/dist/940.js.map +1 -0
- package/dist/989.js +1 -0
- package/dist/989.js.map +1 -0
- package/dist/digihmis-esm-service-queue-app.js +6 -0
- package/dist/digihmis-esm-service-queue-app.js.buildmanifest.json +873 -0
- package/dist/digihmis-esm-service-queue-app.js.map +1 -0
- package/dist/main.js +6 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +26 -0
- package/package.json +51 -0
- package/rspack.config.js +1 -0
- package/src/config-schema.ts +181 -0
- package/src/dashboard.meta.ts +5 -0
- package/src/declarations.d.ts +6 -0
- package/src/index.ts +22 -0
- package/src/move-patient-new-room/component/queue-priority.component.tsx +44 -0
- package/src/move-patient-new-room/component/queue-priority.scss +16 -0
- package/src/move-patient-new-room/move-patient-new-room.extension.tsx +375 -0
- package/src/move-patient-new-room/move-patient-new-room.resource.ts +164 -0
- package/src/move-patient-new-room/move-patient-new-room.scss +50 -0
- package/src/move-patient-new-room/type/index.ts +156 -0
- package/src/routes.json +22 -0
- package/src/service-queue-checkin-form/queue-fields.component.tsx +316 -0
- package/src/service-queue-checkin-form/service-queue-checkin-form.extension.tsx +27 -0
- package/src/service-queue-checkin-form/service-queue-checkin-form.resource.ts +99 -0
- package/src/service-queue-checkin-form/service-queue-checkin-form.scss +18 -0
- package/src/setup-tests.ts +1 -0
- package/src/type/index.ts +10 -0
- package/translations/am.json +14 -0
- package/translations/ar.json +14 -0
- package/translations/en.json +14 -0
- package/translations/es.json +14 -0
- package/translations/fr.json +14 -0
- package/translations/he.json +14 -0
- package/translations/km.json +14 -0
- package/translations/pt.json +14 -0
- package/translations/sw.json +14 -0
- package/translations/vi.json +14 -0
- package/translations/zh.json +14 -0
- package/tsconfig.json +5 -0
package/dist/routes.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"service-queue-check-in-form","slot":"visit-form-bottom-slot","component":"serviceQueueCheckIn","order":1}],"modals":[{"name":"move-patient-to-new-room-modal","component":"moveToNextRoomModal"}],"version":"1.0.0"}
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @type {import('jest').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
clearMocks: true,
|
|
4
|
+
transform: {
|
|
5
|
+
'^.+\\.[jt]sx?$': ['@swc/jest'],
|
|
6
|
+
},
|
|
7
|
+
transformIgnorePatterns: ['/node_modules/(?!@openmrs|.+\\.pnp\\.[^\\/]+$)'],
|
|
8
|
+
moduleNameMapper: {
|
|
9
|
+
'\\.(s?css)$': 'identity-obj-proxy',
|
|
10
|
+
'@openmrs/esm-framework': '@openmrs/esm-framework/mock',
|
|
11
|
+
'lodash-es': 'lodash',
|
|
12
|
+
'^dexie$': require.resolve('dexie'),
|
|
13
|
+
},
|
|
14
|
+
collectCoverageFrom: [
|
|
15
|
+
'**/src/**/*.tsx',
|
|
16
|
+
'!**/node_modules/**',
|
|
17
|
+
'!**/vendor/**',
|
|
18
|
+
'!**/src/**/*.test.*',
|
|
19
|
+
'!**/src/declarations.d.ts',
|
|
20
|
+
],
|
|
21
|
+
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
|
|
22
|
+
testEnvironment: 'jsdom',
|
|
23
|
+
testEnvironmentOptions: {
|
|
24
|
+
url: 'http://localhost/',
|
|
25
|
+
},
|
|
26
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@digihmis/esm-service-queue-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Service queue microfrontend for the OpenMRS SPA",
|
|
5
|
+
"browser": "dist/digihmis-esm-service-queue-app.js",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"source": true,
|
|
8
|
+
"license": "MPL-2.0",
|
|
9
|
+
"homepage": "https://github.com/its-kios09/DigiHMIS-apps#readme",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"analyze": "rspack --mode=production --env analyze=true",
|
|
12
|
+
"build": "rspack --mode=production",
|
|
13
|
+
"coverage": "yarn test --coverage",
|
|
14
|
+
"debug": "npm run serve",
|
|
15
|
+
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js",
|
|
16
|
+
"lint": "eslint src --ext ts,tsx",
|
|
17
|
+
"serve": "rspack serve --mode=development",
|
|
18
|
+
"start": "openmrs develop",
|
|
19
|
+
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests",
|
|
20
|
+
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js",
|
|
21
|
+
"typescript": "tsc"
|
|
22
|
+
},
|
|
23
|
+
"browserslist": [
|
|
24
|
+
"extends browserslist-config-openmrs"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"openmrs"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/its-kios09/DigiHMIS-apps.git#readme"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/its-kios09/DigiHMIS-apps/issues"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"lodash-es": "^4.17.15",
|
|
41
|
+
"react-to-print": "2.14.13"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@carbon/react": "1.x",
|
|
45
|
+
"@openmrs/esm-framework": "8.x",
|
|
46
|
+
"react": "^18.1.0",
|
|
47
|
+
"react-i18next": "16.x",
|
|
48
|
+
"react-router-dom": "6.x",
|
|
49
|
+
"swr": "2.x"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/rspack.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../tools/rs-pack-code-spliting');
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { ConfigSchema, Type, validator, validators } from '@openmrs/esm-framework';
|
|
2
|
+
|
|
3
|
+
export interface ServiceQueueConfig {
|
|
4
|
+
showServiceQueueFields: boolean;
|
|
5
|
+
OpenmrsIdentifierTypeUuid: string;
|
|
6
|
+
visitQueueNumberAttributeUuid?: string;
|
|
7
|
+
concepts: {
|
|
8
|
+
defaultStatusConceptUuid: string;
|
|
9
|
+
defaultPriorityConceptUuid: string;
|
|
10
|
+
emergencyPriorityConceptUuid: string;
|
|
11
|
+
};
|
|
12
|
+
defualtQueueRoom: {
|
|
13
|
+
triageQueueUuid: string;
|
|
14
|
+
outPatienttriageUuid: string;
|
|
15
|
+
};
|
|
16
|
+
priorityConfigs: Array<PriorityConfig>;
|
|
17
|
+
queueExclusions: {
|
|
18
|
+
triage: Array<string>;
|
|
19
|
+
consultation: Array<string>;
|
|
20
|
+
default: Array<string>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const defaultNotUrgentPriorityUuid = '80cd8f8c-5d82-4cdc-b96e-a6addeb94b7f';
|
|
24
|
+
const defaultEmergencyPriorityUuid = '80cd8f8c-5d82-4cdc-b96e-a6addeb94b7f';
|
|
25
|
+
const defaultUrgentPriorityUuid = '037446f4-adfc-40b3-928c-a39a4826b1bf';
|
|
26
|
+
|
|
27
|
+
export const defaultPriorityConfig: Array<PriorityConfig> = [
|
|
28
|
+
{
|
|
29
|
+
conceptUuid: defaultEmergencyPriorityUuid,
|
|
30
|
+
style: null,
|
|
31
|
+
color: 'red',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
conceptUuid: defaultNotUrgentPriorityUuid,
|
|
35
|
+
style: null,
|
|
36
|
+
color: 'green',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
conceptUuid: defaultUrgentPriorityUuid,
|
|
40
|
+
style: null,
|
|
41
|
+
color: 'orange',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
export interface PriorityConfig {
|
|
46
|
+
conceptUuid: string;
|
|
47
|
+
color: PriorityTagColor;
|
|
48
|
+
style: TagStyle | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type PriorityTagColor = (typeof priorityTagColors)[number];
|
|
52
|
+
|
|
53
|
+
const tagStyles = ['bold'] as const;
|
|
54
|
+
type TagStyle = (typeof tagStyles)[number];
|
|
55
|
+
|
|
56
|
+
const priorityTagColors = [
|
|
57
|
+
'red',
|
|
58
|
+
'magenta',
|
|
59
|
+
'purple',
|
|
60
|
+
'blue',
|
|
61
|
+
'teal',
|
|
62
|
+
'cyan',
|
|
63
|
+
'gray',
|
|
64
|
+
'orange',
|
|
65
|
+
'green',
|
|
66
|
+
'warm-gray',
|
|
67
|
+
'cool-gray',
|
|
68
|
+
'high-contrast',
|
|
69
|
+
'outline',
|
|
70
|
+
] as const;
|
|
71
|
+
export const configSchema: ConfigSchema = {
|
|
72
|
+
priorityConfigs: {
|
|
73
|
+
_type: Type.Array,
|
|
74
|
+
_default: defaultPriorityConfig,
|
|
75
|
+
_description: 'Add entries to configure the styling for specific priority tags.',
|
|
76
|
+
_elements: {
|
|
77
|
+
conceptUuid: {
|
|
78
|
+
_type: Type.UUID,
|
|
79
|
+
_description: 'The UUID of the priority concept to configure',
|
|
80
|
+
},
|
|
81
|
+
color: {
|
|
82
|
+
_type: Type.String,
|
|
83
|
+
_description:
|
|
84
|
+
'The color of the tag. This is based on the "type" field of the Carbon Design System "Tag" component.',
|
|
85
|
+
_validators: [validators.oneOf(priorityTagColors)],
|
|
86
|
+
_default: 'gray',
|
|
87
|
+
},
|
|
88
|
+
style: {
|
|
89
|
+
_type: Type.String,
|
|
90
|
+
_description: 'Style to apply to the tag',
|
|
91
|
+
_validators: [validators.oneOf(tagStyles)],
|
|
92
|
+
_default: null,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
showServiceQueueFields: {
|
|
97
|
+
_type: Type.Boolean,
|
|
98
|
+
_description: 'Whether start visit form should display service queue fields`',
|
|
99
|
+
_default: true,
|
|
100
|
+
},
|
|
101
|
+
visitQueueNumberAttributeUuid: {
|
|
102
|
+
_type: Type.String,
|
|
103
|
+
_default: null,
|
|
104
|
+
_description: 'The UUID of the visit attribute that contains the visit queue number.',
|
|
105
|
+
},
|
|
106
|
+
concepts: {
|
|
107
|
+
defaultPriorityConceptUuid: {
|
|
108
|
+
_type: Type.ConceptUuid,
|
|
109
|
+
_description: 'The UUID of the default priority for the queues eg Not urgent.',
|
|
110
|
+
_default: '80cd8f8c-5d82-4cdc-b96e-a6addeb94b7f',
|
|
111
|
+
},
|
|
112
|
+
defaultStatusConceptUuid: {
|
|
113
|
+
_type: Type.ConceptUuid,
|
|
114
|
+
_description: 'The UUID of the default status for the queues eg Waiting.',
|
|
115
|
+
_default: '167407AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
116
|
+
},
|
|
117
|
+
emergencyPriorityConceptUuid: {
|
|
118
|
+
_type: Type.ConceptUuid,
|
|
119
|
+
_description: 'The UUID of the priority with the highest sort weight for the queues eg Emergency.',
|
|
120
|
+
_default: '037446f4-adfc-40b3-928c-a39a4826b1bf',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
defualtQueueRoom: {
|
|
124
|
+
triageQueueUuid: {
|
|
125
|
+
_type: Type.String,
|
|
126
|
+
_description: 'The UUID of the queue room to be used for triage.',
|
|
127
|
+
_default: 'd692a223-e140-11ee-bad2-0242ac120002',
|
|
128
|
+
},
|
|
129
|
+
outPatienttriageUuid: {
|
|
130
|
+
_type: Type.String,
|
|
131
|
+
_description: 'The UUID of the queue room to be used for outpatient triage.',
|
|
132
|
+
_default: 'aab6b51c-be83-41d8-a5b7-4911325eb1af',
|
|
133
|
+
},
|
|
134
|
+
outPatientQueueUuid: {
|
|
135
|
+
_type: Type.String,
|
|
136
|
+
_description: 'The UUID of the queue room to be used for outpatient queue.',
|
|
137
|
+
_default: '13b5ce7a-cc47-434f-94d7-c7533f1d4b58',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
queueExclusions: {
|
|
141
|
+
_type: Type.Object,
|
|
142
|
+
_description: 'Context-specific queue exclusions for different workflows',
|
|
143
|
+
_default: {
|
|
144
|
+
triage: [
|
|
145
|
+
'a09188e9-4bca-431f-b8d7-876e2bbee54d', // Pharmacy Room
|
|
146
|
+
'f86579a3-2c7c-4bef-9e44-fcc326230e33', // Laboratory Room
|
|
147
|
+
'5e2f4c8b-3b1d-4f4a-9f7a-2d3e5c6b7a8c', // Imaging Room
|
|
148
|
+
'7c9e1d2f-8b6a-4c3e-9f1b-0d2e3f4a5b6c', // Procedures Room
|
|
149
|
+
],
|
|
150
|
+
consultation: ['d692a223-e140-11ee-bad2-0242ac120002'],
|
|
151
|
+
default: [],
|
|
152
|
+
},
|
|
153
|
+
triage: {
|
|
154
|
+
_type: Type.Array,
|
|
155
|
+
_description:
|
|
156
|
+
'Queue UUIDs to exclude in triage workflow. Excludes Pharmacy, Laboratory, Imaging, and Procedures rooms as these require doctor assessment/orders.',
|
|
157
|
+
_elements: {
|
|
158
|
+
_type: Type.String,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
consultation: {
|
|
162
|
+
_type: Type.Array,
|
|
163
|
+
_description: 'Queue UUIDs to exclude in consultation workflow. Excludes Triage room to prevent backwards flow.',
|
|
164
|
+
_elements: {
|
|
165
|
+
_type: Type.String,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
default: {
|
|
169
|
+
_type: Type.Array,
|
|
170
|
+
_description: 'Default queue UUIDs to exclude across all workflows',
|
|
171
|
+
_elements: {
|
|
172
|
+
_type: Type.String,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
OpenmrsIdentifierTypeUuid: {
|
|
177
|
+
_type: Type.UUID,
|
|
178
|
+
_default: 'dfacd928-0370-4315-99d7-6ec1c9f7ae76',
|
|
179
|
+
_description: 'UUID for OpenMRS Identifier Type',
|
|
180
|
+
},
|
|
181
|
+
};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework';
|
|
2
|
+
import { configSchema } from './config-schema';
|
|
3
|
+
import ServiceQueueCheckIn from './service-queue-checkin-form/service-queue-checkin-form.extension';
|
|
4
|
+
import MovePatientToNewRoom from './move-patient-new-room/move-patient-new-room.extension';
|
|
5
|
+
const moduleName = '@digihmis/esm-service-queue-app';
|
|
6
|
+
const pageName = 'service-queue';
|
|
7
|
+
|
|
8
|
+
const options = {
|
|
9
|
+
featureName: pageName,
|
|
10
|
+
moduleName,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Core Components
|
|
14
|
+
export const serviceQueueCheckIn = getSyncLifecycle(ServiceQueueCheckIn, options);
|
|
15
|
+
|
|
16
|
+
export const moveToNextRoomModal = getSyncLifecycle(MovePatientToNewRoom, options);
|
|
17
|
+
|
|
18
|
+
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
19
|
+
|
|
20
|
+
export function startupApp() {
|
|
21
|
+
defineConfigSchema(moduleName, configSchema);
|
|
22
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { DefinitionTooltip, Tag } from '@carbon/react';
|
|
4
|
+
import { type PriorityConfig } from '../../config-schema';
|
|
5
|
+
import styles from './queue-priority.scss';
|
|
6
|
+
import { type Concept } from '../type';
|
|
7
|
+
|
|
8
|
+
interface QueuePriorityProps {
|
|
9
|
+
priority: Concept;
|
|
10
|
+
priorityComment?: string;
|
|
11
|
+
priorityConfigs: PriorityConfig[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const QueuePriority: React.FC<QueuePriorityProps> = ({ priority, priorityComment, priorityConfigs }) => {
|
|
15
|
+
const priorityConfig = priorityConfigs.find((c) => c.conceptUuid === priority.uuid);
|
|
16
|
+
|
|
17
|
+
const tag = (
|
|
18
|
+
<Tag
|
|
19
|
+
role={priorityComment ? 'tooltip' : null}
|
|
20
|
+
className={classNames(
|
|
21
|
+
styles.tag,
|
|
22
|
+
priorityConfig?.style === 'bold' && styles.bold,
|
|
23
|
+
priorityConfig?.color === 'orange' && styles.orange,
|
|
24
|
+
priorityConfig?.color === 'red' && styles.red,
|
|
25
|
+
)}
|
|
26
|
+
type={priorityConfig?.color !== 'orange' ? priorityConfig?.color : null}>
|
|
27
|
+
{priority.display}
|
|
28
|
+
</Tag>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
{priorityComment ? (
|
|
34
|
+
<DefinitionTooltip className={styles.tooltip} align="bottom-left" definition={priorityComment}>
|
|
35
|
+
{tag}
|
|
36
|
+
</DefinitionTooltip>
|
|
37
|
+
) : (
|
|
38
|
+
tag
|
|
39
|
+
)}
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default QueuePriority;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
|
+
|
|
5
|
+
.tag {
|
|
6
|
+
margin: 0 layout.$spacing-02;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.bold {
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.orange {
|
|
15
|
+
background-color: colors.$orange-20;
|
|
16
|
+
}
|