@digihmis/esm-administration-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.
Files changed (206) hide show
  1. package/README.md +4 -0
  2. package/dist/101.js +1 -0
  3. package/dist/101.js.map +1 -0
  4. package/dist/117.js +1 -0
  5. package/dist/117.js.map +1 -0
  6. package/dist/132.js +1 -0
  7. package/dist/132.js.map +1 -0
  8. package/dist/15.js +1 -0
  9. package/dist/15.js.map +1 -0
  10. package/dist/152.js +1 -0
  11. package/dist/152.js.map +1 -0
  12. package/dist/153.js +1 -0
  13. package/dist/153.js.map +1 -0
  14. package/dist/190.js +1 -0
  15. package/dist/190.js.map +1 -0
  16. package/dist/209.js +1 -0
  17. package/dist/209.js.map +1 -0
  18. package/dist/266.js +1 -0
  19. package/dist/266.js.map +1 -0
  20. package/dist/317.js +1 -0
  21. package/dist/317.js.map +1 -0
  22. package/dist/349.js +1 -0
  23. package/dist/349.js.map +1 -0
  24. package/dist/371.js +1 -0
  25. package/dist/371.js.map +1 -0
  26. package/dist/378.js +1 -0
  27. package/dist/378.js.map +1 -0
  28. package/dist/394.js +1 -0
  29. package/dist/394.js.map +1 -0
  30. package/dist/442.js +1 -0
  31. package/dist/442.js.map +1 -0
  32. package/dist/45.js +1 -0
  33. package/dist/45.js.map +1 -0
  34. package/dist/454.js +1 -0
  35. package/dist/454.js.map +1 -0
  36. package/dist/466.js +1 -0
  37. package/dist/466.js.map +1 -0
  38. package/dist/482.js +1 -0
  39. package/dist/482.js.map +1 -0
  40. package/dist/501.js +1 -0
  41. package/dist/501.js.map +1 -0
  42. package/dist/508.js +1 -0
  43. package/dist/508.js.map +1 -0
  44. package/dist/578.js +1 -0
  45. package/dist/578.js.map +1 -0
  46. package/dist/598.js +1 -0
  47. package/dist/598.js.map +1 -0
  48. package/dist/606.js +1 -0
  49. package/dist/606.js.map +1 -0
  50. package/dist/61.js +1 -0
  51. package/dist/61.js.map +1 -0
  52. package/dist/640.js +1 -0
  53. package/dist/640.js.map +1 -0
  54. package/dist/685.js +1 -0
  55. package/dist/685.js.map +1 -0
  56. package/dist/689.js +1 -0
  57. package/dist/689.js.map +1 -0
  58. package/dist/709.js +1 -0
  59. package/dist/709.js.map +1 -0
  60. package/dist/712.js +1 -0
  61. package/dist/712.js.map +1 -0
  62. package/dist/720.js +1 -0
  63. package/dist/720.js.map +1 -0
  64. package/dist/737.js +12 -0
  65. package/dist/737.js.map +1 -0
  66. package/dist/742.js +1 -0
  67. package/dist/742.js.map +1 -0
  68. package/dist/747.js +1 -0
  69. package/dist/747.js.map +1 -0
  70. package/dist/771.js +1 -0
  71. package/dist/771.js.map +1 -0
  72. package/dist/806.js +1 -0
  73. package/dist/806.js.map +1 -0
  74. package/dist/912.js +1 -0
  75. package/dist/912.js.map +1 -0
  76. package/dist/913.js +1 -0
  77. package/dist/913.js.map +1 -0
  78. package/dist/916.js +15 -0
  79. package/dist/916.js.map +1 -0
  80. package/dist/940.js +1 -0
  81. package/dist/940.js.map +1 -0
  82. package/dist/digihmis-esm-administration-app.js +6 -0
  83. package/dist/digihmis-esm-administration-app.js.buildmanifest.json +1100 -0
  84. package/dist/digihmis-esm-administration-app.js.map +1 -0
  85. package/dist/main.js +17 -0
  86. package/dist/main.js.map +1 -0
  87. package/dist/routes.json +1 -0
  88. package/increment-version.js +17 -0
  89. package/jest.config.js +26 -0
  90. package/package.json +51 -0
  91. package/release-version.js +16 -0
  92. package/rspack.config.js +1 -0
  93. package/src/bed-management/bed-management.component.tsx +19 -0
  94. package/src/bed-management/bed-management.scss +0 -0
  95. package/src/billing-management/billing-charge-items/billing-charge-items-modal/billing-charge-items.modal.tsx +79 -0
  96. package/src/billing-management/billing-charge-items/billing-charge-items-modal/billing-charge-items.resource.ts +11 -0
  97. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/billing-charge-item.workspace.tsx +212 -0
  98. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/billing-charge-items.resource.ts +51 -0
  99. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/billing-charge-service.workspace.tsx +296 -0
  100. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/components/concept-search.component.tsx +67 -0
  101. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/components/price.component.tsx +81 -0
  102. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/components/stock-search.component.tsx +107 -0
  103. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/global/billing-charge-commodity.scss +61 -0
  104. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/global/billing-charge-items.scss +59 -0
  105. package/src/billing-management/billing-charge-items/billing-charge-items-workspace/schemas/form-schemas.ts +33 -0
  106. package/src/billing-management/billing-charge-items/billing-charge-items.component.tsx +222 -0
  107. package/src/billing-management/billing-charge-items/billing-charge-items.resource.ts +20 -0
  108. package/src/billing-management/billing-charge-items/billing-charge-items.scss +84 -0
  109. package/src/billing-management/billing-charge-items/type/index.ts +88 -0
  110. package/src/billing-management/billing-charge-items/utils/index.ts +96 -0
  111. package/src/billing-management/billing-management.component.tsx +21 -0
  112. package/src/billing-management/billing-management.scss +0 -0
  113. package/src/billing-management/billing-payment-modes/billing-payment-modes-modal/billing-delete-payment-modes.modal.scss +28 -0
  114. package/src/billing-management/billing-payment-modes/billing-payment-modes-modal/billing-delete-payment-modes.modal.tsx +67 -0
  115. package/src/billing-management/billing-payment-modes/billing-payment-modes-modal/delete-payment-mode.test.tsx +56 -0
  116. package/src/billing-management/billing-payment-modes/billing-payment-modes-workspace/billing-payment-modes-form-schema.ts +52 -0
  117. package/src/billing-management/billing-payment-modes/billing-payment-modes-workspace/billing-payment-modes.resource.ts +35 -0
  118. package/src/billing-management/billing-payment-modes/billing-payment-modes-workspace/billing-payment-modes.workspace.scss +33 -0
  119. package/src/billing-management/billing-payment-modes/billing-payment-modes-workspace/billing-payment-modes.workspace.test.tsx +239 -0
  120. package/src/billing-management/billing-payment-modes/billing-payment-modes-workspace/billing-payment-modes.workspace.tsx +218 -0
  121. package/src/billing-management/billing-payment-modes/billing-payment-modes-workspace/payment-attributes/payment-mode-attributes.component.tsx +156 -0
  122. package/src/billing-management/billing-payment-modes/billing-payment-modes-workspace/payment-attributes/payment-mode-attributes.scss +10 -0
  123. package/src/billing-management/billing-payment-modes/billing-payment-modes.component.tsx +243 -0
  124. package/src/billing-management/billing-payment-modes/billing-payment-modes.resource.ts +23 -0
  125. package/src/billing-management/billing-payment-modes/billing-payment-modes.scss +140 -0
  126. package/src/billing-management/billing-payment-modes/type/index.ts +42 -0
  127. package/src/billing-management/billing-payment-points/billing-payment-point-modal/billing-delete-payment-modes.modal.scss +28 -0
  128. package/src/billing-management/billing-payment-points/billing-payment-point-modal/billing-delete-payment-point.modal.tsx +72 -0
  129. package/src/billing-management/billing-payment-points/billing-payment-point-modal/delete-payment-point.test.tsx +56 -0
  130. package/src/billing-management/billing-payment-points/billing-payment-point.component.tsx +202 -0
  131. package/src/billing-management/billing-payment-points/billing-payment-point.resource.ts +16 -0
  132. package/src/billing-management/billing-payment-points/billing-payment-point.scss +0 -0
  133. package/src/billing-management/billing-payment-points/billing-payment-points-workspace/billing-payment-point.resource.ts +39 -0
  134. package/src/billing-management/billing-payment-points/billing-payment-points-workspace/billing-payment-point.workspace.scss +33 -0
  135. package/src/billing-management/billing-payment-points/billing-payment-points-workspace/billing-payment-points.workspace.tsx +194 -0
  136. package/src/billing-management/billing-payment-points/type/index.ts +35 -0
  137. package/src/billing-management/billing-tabs/billing-tabs.component.scss +15 -0
  138. package/src/billing-management/billing-tabs/billing-tabs.component.tsx +36 -0
  139. package/src/components/custom-icon-wrapper/custom-icon-wrapper.component.tsx +17 -0
  140. package/src/components/custom-page-header/custom-page-header.component.tsx +38 -0
  141. package/src/components/custom-page-header/custom-page-header.scss +76 -0
  142. package/src/config-schema.ts +142 -0
  143. package/src/constant/index.ts +1 -0
  144. package/src/dashboard.meta.ts +47 -0
  145. package/src/declarations.d.ts +6 -0
  146. package/src/form-builder/form-builder.component.tsx +19 -0
  147. package/src/form-builder/form-builder.scss +0 -0
  148. package/src/hooks/useConcept.ts +13 -0
  149. package/src/hooks/useQueues.ts +22 -0
  150. package/src/hooks/useSystemSetting.ts +18 -0
  151. package/src/index.ts +133 -0
  152. package/src/left-panel/left-panel.component.tsx +49 -0
  153. package/src/left-panel/left-panel.scss +13 -0
  154. package/src/location-management/components/auto-suggest/autosuggest.component.tsx +149 -0
  155. package/src/location-management/components/auto-suggest/autosuggest.scss +61 -0
  156. package/src/location-management/components/auto-suggest/location-autosuggest.component.tsx +97 -0
  157. package/src/location-management/components/auto-suggest/location-autosuggest.scss +48 -0
  158. package/src/location-management/components/custom-results-tile/results-tile.component.tsx +43 -0
  159. package/src/location-management/components/custom-results-tile/results-tile.scss +86 -0
  160. package/src/location-management/forms/add-location/add-location.workspace.scss +71 -0
  161. package/src/location-management/forms/add-location/add-location.workspace.tsx +199 -0
  162. package/src/location-management/forms/search-location/search-location.workspace.scss +71 -0
  163. package/src/location-management/forms/search-location/search-location.workspace.tsx +214 -0
  164. package/src/location-management/helpers/index.ts +33 -0
  165. package/src/location-management/hooks/UseFacilityLocations.ts +12 -0
  166. package/src/location-management/hooks/useLocation.ts +18 -0
  167. package/src/location-management/hooks/useLocationTags.ts +15 -0
  168. package/src/location-management/location-management-dashboard.component.tsx +21 -0
  169. package/src/location-management/location-management-dashboard.scss +3 -0
  170. package/src/location-management/tables/locations-table.component.tsx +242 -0
  171. package/src/location-management/tables/locations-table.resource.ts +26 -0
  172. package/src/location-management/tables/locations-table.scss +114 -0
  173. package/src/location-management/types/index.ts +120 -0
  174. package/src/queue-management/queue-management-dashboard.component.tsx +23 -0
  175. package/src/queue-management/queue-management-dashboard.scss +8 -0
  176. package/src/queue-management/queue-management-table/queue-management-table.component.tsx +296 -0
  177. package/src/queue-management/queue-management-table/queue-management-table.scss +78 -0
  178. package/src/queue-management/queue-management-table/queue-management.resource.ts +39 -0
  179. package/src/queue-management/queue-management-workspace/queue-room/queue-room-form.scss +56 -0
  180. package/src/queue-management/queue-management-workspace/queue-room/queue-room-form.test.tsx +82 -0
  181. package/src/queue-management/queue-management-workspace/queue-room/queue-room-form.workspace.tsx +169 -0
  182. package/src/queue-management/queue-management-workspace/queue-room/queue-room.resource.ts +20 -0
  183. package/src/queue-management/queue-management-workspace/queue-service/queue-service-form.scss +61 -0
  184. package/src/queue-management/queue-management-workspace/queue-service/queue-service-form.test.tsx +127 -0
  185. package/src/queue-management/queue-management-workspace/queue-service/queue-service-form.workspace.tsx +178 -0
  186. package/src/queue-management/queue-management-workspace/queue-service/queue-service.resource.ts +55 -0
  187. package/src/queue-management/queue-types/index.ts +33 -0
  188. package/src/routes.json +157 -0
  189. package/src/setup-tests.ts +1 -0
  190. package/src/system-info/system-info.component.tsx +338 -0
  191. package/src/system-info/system-info.resource.ts +40 -0
  192. package/src/system-info/system-info.scss +622 -0
  193. package/src/type/index.ts +6 -0
  194. package/translations/am.json +111 -0
  195. package/translations/ar.json +115 -0
  196. package/translations/en.json +111 -0
  197. package/translations/es.json +112 -0
  198. package/translations/fr.json +112 -0
  199. package/translations/he.json +112 -0
  200. package/translations/km.json +110 -0
  201. package/translations/pt.json +112 -0
  202. package/translations/sw.json +111 -0
  203. package/translations/vi.json +110 -0
  204. package/translations/zh.json +110 -0
  205. package/tsconfig.json +5 -0
  206. package/version.js +27 -0
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';
3
+ import { LocationSave, Money, FinancialAssets } from '@carbon/react/icons';
4
+ import { useTranslation } from 'react-i18next';
5
+ import styles from './billing-tabs.component.scss';
6
+ import PaymentModeTable from '../billing-payment-modes/billing-payment-modes.component';
7
+ import PaymentPointTable from '../billing-payment-points/billing-payment-point.component';
8
+ import ChargeItemsTable from '../billing-charge-items/billing-charge-items.component';
9
+
10
+ const BillManagement = () => {
11
+ const { t } = useTranslation();
12
+ return (
13
+ <div className={styles.adminPage}>
14
+ <Tabs>
15
+ <TabList contained>
16
+ <Tab renderIcon={FinancialAssets}>{t('billableServices', 'Billable services')}</Tab>
17
+ <Tab renderIcon={Money}>{t('paymentsMode', 'Payment modes')}</Tab>
18
+ <Tab renderIcon={LocationSave}>{t('paymentPoints', 'Payment points')}</Tab>
19
+ </TabList>
20
+ <TabPanels>
21
+ <TabPanel>
22
+ <ChargeItemsTable />
23
+ </TabPanel>
24
+ <TabPanel>
25
+ <PaymentModeTable />
26
+ </TabPanel>
27
+ <TabPanel>
28
+ <PaymentPointTable />
29
+ </TabPanel>
30
+ </TabPanels>
31
+ </Tabs>
32
+ </div>
33
+ );
34
+ };
35
+
36
+ export default BillManagement;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ interface IconWrapperProps {
4
+ src: string;
5
+ alt?: string;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ }
9
+
10
+ export const IconWrapper: React.FC<IconWrapperProps> = ({
11
+ src,
12
+ alt = 'Icon',
13
+ className,
14
+ style = { width: '100px', height: '148px' },
15
+ }) => {
16
+ return <img src={src} alt={alt} className={className} style={style} />;
17
+ };
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { Calendar } from '@carbon/react/icons';
4
+ import { useSession, formatDate, ExtensionSlot, useConfig } from '@openmrs/esm-framework';
5
+ import styles from './custom-page-header.scss';
6
+ import { IconWrapper } from '../custom-icon-wrapper/custom-icon-wrapper.component';
7
+
8
+ interface CustomPageHeaderProps {
9
+ subTitle?: string;
10
+ iconSrc?: string;
11
+ iconAlt?: string;
12
+ }
13
+
14
+ export const CustomPageHeader: React.FC<CustomPageHeaderProps> = ({ subTitle, iconSrc, iconAlt }) => {
15
+ const userSession = useSession();
16
+ const userLocation = userSession?.sessionLocation?.display;
17
+
18
+ return (
19
+ <div className={styles.header}>
20
+ <div className={styles['left-justified-items']}>
21
+ <IconWrapper src={iconSrc} alt={iconAlt} />
22
+ <div className={styles['page-labels']}>
23
+ <p className={styles['page-name']}>{userLocation}</p>
24
+ <p className={styles['page-subtitle']}>{subTitle}</p>
25
+ </div>
26
+ </div>
27
+ <div className={styles['right-justified-items']}>
28
+ <div className={styles.extensionSlot}>
29
+ <ExtensionSlot name={'provider-banner-slot'} />
30
+ <div className={styles['date-and-location']}>
31
+ <Calendar size={16} />
32
+ <span className={styles.value}>{formatDate(new Date(), { mode: 'wide', noToday: true })}</span>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ );
38
+ };
@@ -0,0 +1,76 @@
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@carbon/colors';
4
+
5
+ .header {
6
+ @include type.type-style('body-compact-02');
7
+ height: layout.$spacing-12;
8
+ border: 1px solid colors.$gray-20;
9
+ border-left: 0px;
10
+ display: flex;
11
+ background: var(--cds-field);
12
+ justify-content: space-between;
13
+ margin-top: 1.5rem;
14
+ }
15
+
16
+ .left-justified-items {
17
+ display: flex;
18
+ flex-direction: row;
19
+ align-items: center;
20
+ }
21
+
22
+ .right-justified-items {
23
+ @include type.type-style('body-01');
24
+ color: colors.$gray-80;
25
+ padding-top: layout.$spacing-05;
26
+ padding-bottom: layout.$spacing-07;
27
+ }
28
+
29
+ .page-subtitle {
30
+ @include type.type-style('caption-01');
31
+ color: colors.$gray-70;
32
+ font-size: layout.$spacing-06;
33
+ }
34
+ .page-name {
35
+ @include type.type-style('caption-01');
36
+ color: colors.$gray-80;
37
+ font-size: layout.$spacing-05;
38
+ }
39
+
40
+ .page-labels {
41
+ p:first-of-type {
42
+ margin-bottom: layout.$spacing-02;
43
+ }
44
+ }
45
+
46
+ .date-and-location {
47
+ margin-top: layout.$spacing-03;
48
+ display: flex;
49
+ justify-content: flex-end;
50
+ align-items: center;
51
+ margin-right: layout.$spacing-05;
52
+ @include type.type-style('caption-01');
53
+ font-size: 0.83rem;
54
+ }
55
+
56
+ .value {
57
+ margin-left: layout.$spacing-02;
58
+ }
59
+
60
+ .middot {
61
+ margin: 0 layout.$spacing-03;
62
+ }
63
+
64
+ .view {
65
+ @include type.type-style('caption-01');
66
+ }
67
+
68
+ svg.iconOverrides {
69
+ width: 72 !important;
70
+ height: 72 !important;
71
+ }
72
+
73
+ .svgContainer svg {
74
+ width: 72px;
75
+ height: 72px;
76
+ }
@@ -0,0 +1,142 @@
1
+ import { ConfigSchema, Type, validators } from '@openmrs/esm-framework';
2
+
3
+ export const configSchema: ConfigSchema = {
4
+ queueManagementIcon: {
5
+ src: {
6
+ _type: Type.String,
7
+ _default: '/openmrs/spa/queue_management.svg',
8
+ _description:
9
+ 'The path or URL to the logo image. If set to an empty string, the default OpenMRS SVG sprite will be used.',
10
+ _validators: [validators.isUrl],
11
+ },
12
+ },
13
+ formBuilderIcon: {
14
+ src: {
15
+ _type: Type.String,
16
+ _default: '/openmrs/spa/form_builder.svg',
17
+ _description:
18
+ 'The path or URL to the logo image. If set to an empty string, the default OpenMRS SVG sprite will be used.',
19
+ _validators: [validators.isUrl],
20
+ },
21
+ alt: {
22
+ _type: Type.String,
23
+ _default: 'Logo',
24
+ _description: 'The alternative text for the logo image, displayed when the image cannot be loaded or on hover.',
25
+ },
26
+ },
27
+ billingIcon: {
28
+ src: {
29
+ _type: Type.String,
30
+ _default: '/openmrs/spa/billing.svg',
31
+ _description:
32
+ 'The path or URL to the logo image. If set to an empty string, the default OpenMRS SVG sprite will be used.',
33
+ _validators: [validators.isUrl],
34
+ },
35
+ alt: {
36
+ _type: Type.String,
37
+ _default: 'Logo',
38
+ _description: 'The alternative text for the logo image, displayed when the image cannot be loaded or on hover.',
39
+ },
40
+ },
41
+ inpatientIcon: {
42
+ src: {
43
+ _type: Type.String,
44
+ _default: '/openmrs/spa/Inpatient.svg',
45
+ _description:
46
+ 'The path or URL to the logo image. If set to an empty string, the default OpenMRS SVG sprite will be used.',
47
+ _validators: [validators.isUrl],
48
+ },
49
+ alt: {
50
+ _type: Type.String,
51
+ _default: 'Logo',
52
+ _description: 'The alternative text for the logo image, displayed when the image cannot be loaded or on hover.',
53
+ },
54
+ },
55
+ locationIcon: {
56
+ src: {
57
+ _type: Type.String,
58
+ _default: '/openmrs/spa/location.svg',
59
+ _description:
60
+ 'The path or URL to the logo image. If set to an empty string, the default OpenMRS SVG sprite will be used.',
61
+ _validators: [validators.isUrl],
62
+ },
63
+ alt: {
64
+ _type: Type.String,
65
+ _default: 'Logo',
66
+ _description: 'The alternative text for the logo image, displayed when the image cannot be loaded or on hover.',
67
+ },
68
+ },
69
+ digiHMISIcon: {
70
+ src: {
71
+ _type: Type.String,
72
+ _default: '/openmrs/spa/digihmis-login-logo.svg',
73
+ _description:
74
+ 'The path or URL to the DigiHMIS logo image. If set to an empty string, the default OpenMRS SVG sprite will be used.',
75
+ _validators: [validators.isUrl],
76
+ },
77
+ alt: {
78
+ _type: Type.String,
79
+ _default: 'DigiHMIS Logo',
80
+ _description: 'The alternative text for the DigiHMIS logo image, displayed when the image cannot be loaded.',
81
+ },
82
+ },
83
+ flagIcon: {
84
+ src: {
85
+ _type: Type.String,
86
+ _default: '/openmrs/spa/kenya-flag.svg',
87
+ _description:
88
+ 'The path or URL to the flag image. If set to an empty string, the default OpenMRS SVG sprite will be used.',
89
+ _validators: [validators.isUrl],
90
+ },
91
+ alt: {
92
+ _type: Type.String,
93
+ _default: 'Kenya Flag',
94
+ _description: 'The alternative text for the flag image, displayed when the image cannot be loaded.',
95
+ },
96
+ },
97
+ excludedPaymentMode: {
98
+ _type: Type.Array,
99
+ _elements: {
100
+ uuid: {
101
+ _type: Type.UUID,
102
+ _description: 'The value of the payment mode to be excluded',
103
+ },
104
+ label: {
105
+ _type: Type.String,
106
+ _default: null,
107
+ _description: 'The label of the payment mode to be excluded',
108
+ },
109
+ },
110
+ _default: [
111
+ {
112
+ uuid: 'eb6173cb-9678-4614-bbe1-0ccf7ed9d1d4',
113
+ label: 'Waiver',
114
+ },
115
+ ],
116
+ },
117
+ };
118
+
119
+ export type ConfigObject = {
120
+ queueManagementIcon: {
121
+ src: string;
122
+ };
123
+ formBuilderIcon: {
124
+ src: string;
125
+ };
126
+ billingIcon: {
127
+ src: string;
128
+ };
129
+ inpatientIcon: {
130
+ src: string;
131
+ };
132
+ locationIcon: {
133
+ src: string;
134
+ };
135
+ digiHMISIcon: {
136
+ src: string;
137
+ };
138
+ flagIcon: {
139
+ src: string;
140
+ };
141
+ excludedPaymentMode: Array<{ uuid: string; label: string }>;
142
+ };
@@ -0,0 +1 @@
1
+ export const PAYMENT_MODE_ATTRIBUTE_FORMATS = ['java.lang.String', 'java.lang.Integer', 'java.lang.Double'];
@@ -0,0 +1,47 @@
1
+ import {
2
+ DataCenter,
3
+ DocumentSketch,
4
+ HospitalBed,
5
+ MessageQueue,
6
+ PiggyBank,
7
+ WebServicesTaskDefinitionVersion,
8
+ } from '@carbon/react/icons';
9
+ export const systemInfoDashboardMeta = {
10
+ name: 'system-info-management',
11
+ slot: 'administration-dashboard-slot',
12
+ title: 'System Info',
13
+ icon: WebServicesTaskDefinitionVersion,
14
+ };
15
+ export const queueManagementDashboardMeta = {
16
+ name: 'queue-management',
17
+ slot: 'administration-dashboard-slot',
18
+ title: 'Queue Management',
19
+ icon: MessageQueue,
20
+ };
21
+
22
+ export const locationManagementDashboardMeta = {
23
+ name: 'location-management',
24
+ slot: 'administration-dashboard-slot',
25
+ title: 'Location Management',
26
+ icon: DataCenter,
27
+ };
28
+
29
+ export const bedManagementDashboardMeta = {
30
+ name: 'bed-management',
31
+ slot: 'administration-dashboard-slot',
32
+ title: 'Bed Management',
33
+ icon: HospitalBed,
34
+ };
35
+
36
+ export const formBuilderDashboardMeta = {
37
+ name: 'form-builder',
38
+ slot: 'administration-dashboard-slot',
39
+ title: 'Form Builder',
40
+ icon: DocumentSketch,
41
+ };
42
+ export const billingManagementDashboardMeta = {
43
+ name: 'billing-management',
44
+ slot: 'administration-dashboard-slot',
45
+ title: 'Billing Management',
46
+ icon: PiggyBank,
47
+ };
@@ -0,0 +1,6 @@
1
+ declare module '@carbon/react';
2
+ declare module '*.css';
3
+ declare module '*.scss';
4
+ declare module '*.png';
5
+
6
+ declare type SideNavProps = object;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { ExtensionSlot, useConfig } from '@openmrs/esm-framework';
3
+ import styles from './form-builder.scss';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { ConfigObject } from '../config-schema';
6
+ import { CustomPageHeader } from '../components/custom-page-header/custom-page-header.component';
7
+
8
+ const FormBuilderDashboard: React.FC = () => {
9
+ const { t } = useTranslation();
10
+ const { formBuilderIcon } = useConfig<ConfigObject>();
11
+
12
+ return (
13
+ <div className={styles.dashboardContainer}>
14
+ <CustomPageHeader subTitle={t('configureForms', 'Manage clinical forms')} iconSrc={formBuilderIcon.src} />
15
+ </div>
16
+ );
17
+ };
18
+
19
+ export default FormBuilderDashboard;
File without changes
@@ -0,0 +1,13 @@
1
+ import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import useSWRImmutable from 'swr/immutable';
3
+ import { type Concept } from '../queue-management/queue-types';
4
+
5
+ export function useConcept(uuid: string) {
6
+ const apiUrl = uuid ? `${restBaseUrl}/concept/${uuid}` : undefined;
7
+ const { data, error, isLoading } = useSWRImmutable<{ data: Concept }, Error>(apiUrl, openmrsFetch);
8
+ return {
9
+ concept: data?.data,
10
+ error,
11
+ isLoading,
12
+ };
13
+ }
@@ -0,0 +1,22 @@
1
+ import { getLocale, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import useSWRImmutable from 'swr/immutable';
3
+ import { useMemo } from 'react';
4
+ import { Queue } from '../queue-management/queue-types';
5
+
6
+ export function useQueues(locationUuid?: string) {
7
+ const customRepresentation =
8
+ 'custom:(uuid,display,name,description,service:(uuid,display),allowedPriorities:(uuid,display),allowedStatuses:(uuid,display),location:(uuid,display))';
9
+ const apiUrl = `${restBaseUrl}/queue?v=${customRepresentation}` + (locationUuid ? `&location=${locationUuid}` : '');
10
+
11
+ const { data, ...rest } = useSWRImmutable<{ data: { results: Array<Queue> } }, Error>(apiUrl, openmrsFetch);
12
+
13
+ const queues = useMemo(
14
+ () => data?.data?.results.sort((a, b) => a.display.localeCompare(b.display, getLocale())) ?? [],
15
+ [data?.data?.results],
16
+ );
17
+
18
+ return {
19
+ queues,
20
+ ...rest,
21
+ };
22
+ }
@@ -0,0 +1,18 @@
1
+ import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import useSWRImmutable from 'swr/immutable';
3
+
4
+ export interface SystemSetting {
5
+ uuid: string;
6
+ property: string;
7
+ value: string;
8
+ }
9
+
10
+ export function useSystemSetting(setting: string) {
11
+ const apiUrl = `${restBaseUrl}/systemsetting/${setting}?v=custom:(value)`;
12
+ const { data, error, isLoading } = useSWRImmutable<{ data: SystemSetting }, Error>(apiUrl, openmrsFetch);
13
+ return {
14
+ systemSetting: data?.data,
15
+ error,
16
+ isLoading,
17
+ };
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,133 @@
1
+ import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework';
2
+ import { configSchema } from './config-schema';
3
+ import { createDashboardLink } from './left-panel/left-panel.component';
4
+ import {
5
+ bedManagementDashboardMeta,
6
+ billingManagementDashboardMeta,
7
+ formBuilderDashboardMeta,
8
+ locationManagementDashboardMeta,
9
+ queueManagementDashboardMeta,
10
+ systemInfoDashboardMeta,
11
+ } from './dashboard.meta';
12
+ import QueueManagementDashboard from './queue-management/queue-management-dashboard.component';
13
+ import LocationManagementDashboard from './location-management/location-management-dashboard.component';
14
+ import BedManagementDashboard from './bed-management/bed-management.component';
15
+ import FormBuilderDashboard from './form-builder/form-builder.component';
16
+ import BillingManagementDashboard from './billing-management/billing-management.component';
17
+ import SystemInfoDashboard from './system-info/system-info.component';
18
+ import DeletePaymentModeModal from './billing-management/billing-payment-modes/billing-payment-modes-modal/billing-delete-payment-modes.modal';
19
+ import DeletePaymentPointModal from './billing-management/billing-payment-points/billing-payment-point-modal/billing-delete-payment-point.modal';
20
+ import DeleteBillableServiceModal from './billing-management/billing-charge-items/billing-charge-items-modal/billing-charge-items.modal';
21
+
22
+ const moduleName = '@digihmis/esm-administration-app';
23
+ const pageName = 'administration';
24
+
25
+ const options = {
26
+ featureName: pageName,
27
+ moduleName,
28
+ };
29
+
30
+ export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
31
+
32
+ export const queueLeftPanelLink = getSyncLifecycle(createDashboardLink(queueManagementDashboardMeta), options);
33
+ export const locationLeftPanelLink = getSyncLifecycle(createDashboardLink(locationManagementDashboardMeta), options);
34
+ export const bedLeftPanelLink = getSyncLifecycle(createDashboardLink(bedManagementDashboardMeta), options);
35
+ export const formBuilderLeftPanelLink = getSyncLifecycle(createDashboardLink(formBuilderDashboardMeta), options);
36
+ export const billingLeftPanelLink = getSyncLifecycle(createDashboardLink(billingManagementDashboardMeta), options);
37
+ export const systemInfoLeftPanelLink = getSyncLifecycle(createDashboardLink(systemInfoDashboardMeta), options);
38
+
39
+ export const queueManagementDashboard = getSyncLifecycle(QueueManagementDashboard, options);
40
+ export const locationManagementDashboard = getSyncLifecycle(LocationManagementDashboard, options);
41
+ export const bedManagementDashboard = getSyncLifecycle(BedManagementDashboard, options);
42
+ export const formBuilderDashboard = getSyncLifecycle(FormBuilderDashboard, options);
43
+ export const billingManagementDashboard = getSyncLifecycle(BillingManagementDashboard, options);
44
+ export const systemInfoDashboard = getSyncLifecycle(SystemInfoDashboard, options);
45
+
46
+ // t('addNewQueueService', 'Add New Queue Service')
47
+ export const addNewQueueServiceWorkspace = getAsyncLifecycle(
48
+ () => import('./queue-management/queue-management-workspace/queue-service/queue-service-form.workspace'),
49
+ {
50
+ featureName: 'service-queues-service-form',
51
+ moduleName,
52
+ },
53
+ );
54
+
55
+ // t('addNewQueueServiceRoom', 'Add new queue service room')
56
+ export const addNewQueueServiceRoomWorkspace = getAsyncLifecycle(
57
+ () => import('./queue-management/queue-management-workspace/queue-room/queue-room-form.workspace'),
58
+ {
59
+ featureName: 'service-queues-queue-room-form',
60
+ moduleName,
61
+ },
62
+ );
63
+
64
+ // t('addNewLocationWorkspace', 'Add new location')
65
+ export const addNewLocationWorkspace = getAsyncLifecycle(
66
+ () => import('./location-management/forms/add-location/add-location.workspace'),
67
+ {
68
+ featureName: 'add-location-workspace',
69
+ moduleName,
70
+ },
71
+ );
72
+
73
+ // t('searchLocationWorkspace', 'Search Location')
74
+ export const searchLocationWorkspace = getAsyncLifecycle(
75
+ () => import('./location-management/forms/search-location/search-location.workspace'),
76
+ {
77
+ featureName: 'search-location-workspace',
78
+ moduleName,
79
+ },
80
+ );
81
+
82
+ // t('paymentModeWorkspace', 'Payment Mode')
83
+ export const paymentModeWorkspace = getAsyncLifecycle(
84
+ () =>
85
+ import(
86
+ './billing-management/billing-payment-modes/billing-payment-modes-workspace/billing-payment-modes.workspace'
87
+ ),
88
+ {
89
+ featureName: 'payment-mode-workspace',
90
+ moduleName,
91
+ },
92
+ );
93
+
94
+ // t('paymentPointWorkspace', 'Payment Point')
95
+ export const paymentPointWorkspace = getAsyncLifecycle(
96
+ () =>
97
+ import(
98
+ './billing-management/billing-payment-points/billing-payment-points-workspace/billing-payment-points.workspace'
99
+ ),
100
+ {
101
+ featureName: 'payment-point-workspace',
102
+ moduleName,
103
+ },
104
+ );
105
+
106
+ // t('addCommodityItem', 'Add Commodity Item')
107
+ export const commodityForm = getAsyncLifecycle(
108
+ () =>
109
+ import('./billing-management/billing-charge-items/billing-charge-items-workspace/billing-charge-item.workspace'),
110
+ {
111
+ featureName: 'billing-charge-item-workspace',
112
+ moduleName,
113
+ },
114
+ );
115
+
116
+ // t('addServiceItem', 'Add Charge Service')
117
+ export const billableServiceForm = getAsyncLifecycle(
118
+ () =>
119
+ import('./billing-management/billing-charge-items/billing-charge-items-workspace/billing-charge-service.workspace'),
120
+ {
121
+ featureName: 'billing-charge-service-workspace',
122
+ moduleName,
123
+ },
124
+ );
125
+
126
+ // modals
127
+ export const deletePaymentModeModal = getSyncLifecycle(DeletePaymentModeModal, options);
128
+ export const deletePaymentPointModal = getSyncLifecycle(DeletePaymentPointModal, options);
129
+ export const deleteBillableService = getSyncLifecycle(DeleteBillableServiceModal, options);
130
+
131
+ export function startupApp() {
132
+ defineConfigSchema(moduleName, configSchema);
133
+ }
@@ -0,0 +1,49 @@
1
+ import React, { useMemo } from 'react';
2
+ import { ConfigurableLink, MaybeIcon } from '@openmrs/esm-framework';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { BrowserRouter, useLocation } from 'react-router-dom';
5
+ import { type CarbonIconType } from '@carbon/react/icons';
6
+ import last from 'lodash-es/last';
7
+ import styles from './left-panel.scss';
8
+
9
+ export interface DashboardLinkConfig {
10
+ name: string;
11
+ title: string;
12
+ icon?: string | CarbonIconType;
13
+ }
14
+
15
+ const DashboardLink = ({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) => {
16
+ const { t } = useTranslation();
17
+ const { name, title, icon } = dashboardLinkConfig;
18
+ const nameSegment = name.split('/').at(-1);
19
+ const location = useLocation();
20
+ const spaBasePath = window.getOpenmrsSpaBase() + 'home/administration';
21
+
22
+ let urlSegment = useMemo(() => decodeURIComponent(last(location.pathname.split('/'))), [location.pathname]);
23
+
24
+ const IconComp = typeof icon !== 'string' ? (icon as CarbonIconType) : null;
25
+ const isActive = nameSegment === urlSegment;
26
+
27
+ return (
28
+ <ConfigurableLink
29
+ to={`${spaBasePath}/${name}`}
30
+ className={`cds--side-nav__link ${isActive && 'active-left-nav-link'}`}>
31
+ {typeof icon === 'string' ? (
32
+ <MaybeIcon icon={icon} className={styles.icon} size={16} />
33
+ ) : (
34
+ IconComp && <IconComp className={styles.icon} />
35
+ )}
36
+ {t(title)}
37
+ </ConfigurableLink>
38
+ );
39
+ };
40
+
41
+ export const createDashboardLink = (dashboardLinkConfig: DashboardLinkConfig) => () => {
42
+ return (
43
+ <BrowserRouter>
44
+ <DashboardLink dashboardLinkConfig={dashboardLinkConfig} />
45
+ </BrowserRouter>
46
+ );
47
+ };
48
+
49
+ export default DashboardLink;
@@ -0,0 +1,13 @@
1
+ @use '@carbon/colors';
2
+ @use '@carbon/layout';
3
+
4
+ .menu {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ }
9
+
10
+ .icon {
11
+ margin-right: layout.$spacing-05;
12
+ fill: colors.$gray-70;
13
+ }