@kenyaemr/esm-shr-app 5.4.4-pre.98 → 5.4.5-pre.16

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 (215) hide show
  1. package/package.json +2 -2
  2. package/src/config-schema.ts +6 -6
  3. package/src/hooks/usePatient.ts +23 -9
  4. package/src/hooks/useSHRSummary.ts +1 -3
  5. package/src/index.ts +1 -4
  6. package/src/referrals/dependents/dependents.component.tsx +8 -1
  7. package/src/referrals/referral-reasons/referral-reasons.component.tsx +2 -2
  8. package/src/referrals/referral-tabs/referrals-tabs.component.tsx +9 -2
  9. package/src/referrals/referrals-actions.component.tsx +66 -7
  10. package/src/referrals/referrals.component.tsx +2 -2
  11. package/src/routes.json +92 -78
  12. package/src/shr-summary/shr-summary.component.tsx +10 -5
  13. package/src/shr-summary/shr-summary.resource.ts +74 -74
  14. package/src/shr-summary/tables/shr-summary-table.component.tsx +50 -18
  15. package/src/utils/function.tsx +9 -4
  16. package/src/workspace/referral-workspace.resource.ts +1 -2
  17. package/src/workspace/referral.workspace.scss +4 -2
  18. package/src/workspace/referrals.workspace.component.tsx +189 -182
  19. package/translations/am.json +4 -1
  20. package/translations/en.json +4 -1
  21. package/translations/fr.json +4 -2
  22. package/translations/sw.json +4 -1
  23. package/.turbo/turbo-build.log +0 -6
  24. package/dist/1074.js +0 -1
  25. package/dist/1074.js.map +0 -1
  26. package/dist/12.js +0 -17
  27. package/dist/12.js.map +0 -1
  28. package/dist/1311.js +0 -1
  29. package/dist/1311.js.map +0 -1
  30. package/dist/1462.js +0 -1
  31. package/dist/1462.js.map +0 -1
  32. package/dist/1469.js +0 -1
  33. package/dist/1469.js.map +0 -1
  34. package/dist/1506.js +0 -13
  35. package/dist/1506.js.map +0 -1
  36. package/dist/1718.js +0 -1
  37. package/dist/1718.js.map +0 -1
  38. package/dist/1772.js +0 -1
  39. package/dist/1772.js.map +0 -1
  40. package/dist/1889.js +0 -1
  41. package/dist/1889.js.map +0 -1
  42. package/dist/1972.js +0 -1
  43. package/dist/1972.js.map +0 -1
  44. package/dist/1990.js +0 -1
  45. package/dist/1990.js.map +0 -1
  46. package/dist/2016.js +0 -1
  47. package/dist/2016.js.map +0 -1
  48. package/dist/2153.js +0 -1
  49. package/dist/2153.js.map +0 -1
  50. package/dist/216.js +0 -1
  51. package/dist/216.js.map +0 -1
  52. package/dist/2270.js +0 -1
  53. package/dist/2270.js.map +0 -1
  54. package/dist/2294.js +0 -1
  55. package/dist/2294.js.map +0 -1
  56. package/dist/2345.js +0 -1
  57. package/dist/2345.js.map +0 -1
  58. package/dist/2388.js +0 -1
  59. package/dist/2388.js.map +0 -1
  60. package/dist/2391.js +0 -1
  61. package/dist/2391.js.map +0 -1
  62. package/dist/2500.js +0 -1
  63. package/dist/2500.js.map +0 -1
  64. package/dist/251.js +0 -1
  65. package/dist/251.js.map +0 -1
  66. package/dist/257.js +0 -1
  67. package/dist/257.js.map +0 -1
  68. package/dist/2586.js +0 -1
  69. package/dist/2586.js.map +0 -1
  70. package/dist/2625.js +0 -1
  71. package/dist/2625.js.map +0 -1
  72. package/dist/2685.js +0 -1
  73. package/dist/2685.js.map +0 -1
  74. package/dist/2736.js +0 -1
  75. package/dist/2736.js.map +0 -1
  76. package/dist/2948.js +0 -1
  77. package/dist/2948.js.map +0 -1
  78. package/dist/3089.js +0 -1
  79. package/dist/3089.js.map +0 -1
  80. package/dist/3190.js +0 -1
  81. package/dist/3190.js.map +0 -1
  82. package/dist/3548.js +0 -1
  83. package/dist/3548.js.map +0 -1
  84. package/dist/379.js +0 -1
  85. package/dist/379.js.map +0 -1
  86. package/dist/3798.js +0 -1
  87. package/dist/3798.js.map +0 -1
  88. package/dist/3816.js +0 -1
  89. package/dist/3816.js.map +0 -1
  90. package/dist/3906.js +0 -1
  91. package/dist/3906.js.map +0 -1
  92. package/dist/3963.js +0 -1
  93. package/dist/3963.js.map +0 -1
  94. package/dist/405.js +0 -1
  95. package/dist/405.js.map +0 -1
  96. package/dist/4180.js +0 -1
  97. package/dist/4180.js.map +0 -1
  98. package/dist/4282.js +0 -1
  99. package/dist/4282.js.map +0 -1
  100. package/dist/4296.js +0 -1
  101. package/dist/4296.js.map +0 -1
  102. package/dist/4337.js +0 -1
  103. package/dist/4337.js.map +0 -1
  104. package/dist/4368.js +0 -1
  105. package/dist/4368.js.map +0 -1
  106. package/dist/452.js +0 -1
  107. package/dist/452.js.map +0 -1
  108. package/dist/4735.js +0 -1
  109. package/dist/4735.js.map +0 -1
  110. package/dist/4744.js +0 -1
  111. package/dist/4744.js.map +0 -1
  112. package/dist/4813.js +0 -2
  113. package/dist/4813.js.map +0 -1
  114. package/dist/4858.js +0 -1
  115. package/dist/4858.js.map +0 -1
  116. package/dist/487.js +0 -1
  117. package/dist/487.js.map +0 -1
  118. package/dist/5202.js +0 -1
  119. package/dist/5202.js.map +0 -1
  120. package/dist/5437.js +0 -1
  121. package/dist/5437.js.map +0 -1
  122. package/dist/5592.js +0 -1
  123. package/dist/5592.js.map +0 -1
  124. package/dist/5669.js +0 -1
  125. package/dist/5669.js.map +0 -1
  126. package/dist/6178.js +0 -1
  127. package/dist/6178.js.map +0 -1
  128. package/dist/6355.js +0 -1
  129. package/dist/6355.js.map +0 -1
  130. package/dist/6455.js +0 -1
  131. package/dist/6455.js.map +0 -1
  132. package/dist/6456.js +0 -1
  133. package/dist/6466.js +0 -3
  134. package/dist/6466.js.map +0 -1
  135. package/dist/6492.js +0 -1
  136. package/dist/6492.js.map +0 -1
  137. package/dist/6495.js +0 -1
  138. package/dist/6495.js.map +0 -1
  139. package/dist/6800.js +0 -1
  140. package/dist/6800.js.map +0 -1
  141. package/dist/6925.js +0 -1
  142. package/dist/6925.js.map +0 -1
  143. package/dist/7005.js +0 -1
  144. package/dist/7005.js.map +0 -1
  145. package/dist/7201.js +0 -1
  146. package/dist/7201.js.map +0 -1
  147. package/dist/7234.js +0 -1
  148. package/dist/7234.js.map +0 -1
  149. package/dist/7261.js +0 -1
  150. package/dist/7261.js.map +0 -1
  151. package/dist/7326.js +0 -1
  152. package/dist/7383.js +0 -1
  153. package/dist/7383.js.map +0 -1
  154. package/dist/7463.js +0 -1
  155. package/dist/7463.js.map +0 -1
  156. package/dist/7607.js +0 -1
  157. package/dist/7626.js +0 -1
  158. package/dist/7626.js.map +0 -1
  159. package/dist/7717.js +0 -1
  160. package/dist/7717.js.map +0 -1
  161. package/dist/7737.js +0 -1
  162. package/dist/7737.js.map +0 -1
  163. package/dist/7739.js +0 -1
  164. package/dist/7739.js.map +0 -1
  165. package/dist/7765.js +0 -1
  166. package/dist/7765.js.map +0 -1
  167. package/dist/7820.js +0 -1
  168. package/dist/7820.js.map +0 -1
  169. package/dist/7971.js +0 -1
  170. package/dist/7971.js.map +0 -1
  171. package/dist/8159.js +0 -7
  172. package/dist/8159.js.map +0 -1
  173. package/dist/8244.js +0 -1
  174. package/dist/8244.js.map +0 -1
  175. package/dist/8323.js +0 -1
  176. package/dist/8323.js.map +0 -1
  177. package/dist/845.js +0 -1
  178. package/dist/845.js.map +0 -1
  179. package/dist/8570.js +0 -1
  180. package/dist/8570.js.map +0 -1
  181. package/dist/87.js +0 -1
  182. package/dist/87.js.map +0 -1
  183. package/dist/8727.js +0 -1
  184. package/dist/9124.js +0 -1
  185. package/dist/9124.js.map +0 -1
  186. package/dist/9182.js +0 -1
  187. package/dist/921.js +0 -1
  188. package/dist/921.js.map +0 -1
  189. package/dist/9255.js +0 -1
  190. package/dist/9255.js.map +0 -1
  191. package/dist/9310.js +0 -1
  192. package/dist/9310.js.map +0 -1
  193. package/dist/9404.js +0 -1
  194. package/dist/9404.js.map +0 -1
  195. package/dist/9446.js +0 -1
  196. package/dist/9446.js.map +0 -1
  197. package/dist/9449.js +0 -1
  198. package/dist/9449.js.map +0 -1
  199. package/dist/9566.js +0 -5
  200. package/dist/9566.js.map +0 -1
  201. package/dist/9641.js +0 -1
  202. package/dist/9641.js.map +0 -1
  203. package/dist/9727.js +0 -1
  204. package/dist/9727.js.map +0 -1
  205. package/dist/9801.js +0 -1
  206. package/dist/9801.js.map +0 -1
  207. package/dist/9835.js +0 -11
  208. package/dist/9835.js.map +0 -1
  209. package/dist/kenyaemr-esm-shr-app.js +0 -5
  210. package/dist/kenyaemr-esm-shr-app.js.buildmanifest.json +0 -2634
  211. package/dist/kenyaemr-esm-shr-app.js.map +0 -1
  212. package/dist/main.js +0 -5
  213. package/dist/main.js.map +0 -1
  214. package/dist/routes.json +0 -1
  215. package/src/shr-summary/shr-authorization-form.workspace.tsx +0 -149
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-shr-app",
3
- "version": "5.4.4-pre.98",
3
+ "version": "5.4.5-pre.16",
4
4
  "description": "Patient care panels microfrontend for the OpenMRS SPA",
5
5
  "keywords": [
6
6
  "openmrs"
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "stableVersion": "5.4.3"
50
+ "stableVersion": "5.4.4"
51
51
  }
@@ -6,6 +6,11 @@ export const configSchema = {
6
6
  _description: 'The national patient unique identifier',
7
7
  _default: 'f85081e2-b4be-4e48-b3a4-7994b69bb101',
8
8
  },
9
+ nationalIdIdentifierType: {
10
+ _type: Type.UUID,
11
+ _description: 'The national patient unique identifier',
12
+ _default: '49af6cdc-7968-4abb-bf46-de10d7f4859f',
13
+ },
9
14
  phoneNumberAttributeType: {
10
15
  _type: Type.UUID,
11
16
  _description: 'The patient phone number attribute type uuid',
@@ -16,16 +21,11 @@ export const configSchema = {
16
21
  _description: 'Social Health Authority Unique Identification Number',
17
22
  _default: '24aedd37-b5be-4e08-8311-3721b8d5100d',
18
23
  },
19
- artDirectoryUrl: {
20
- _type: Type.String,
21
- _description: 'URL for the ART Directory',
22
- _default: 'https://art.kenyahmis.org/api/patients',
23
- },
24
24
  };
25
25
 
26
26
  export type ReferralConfigObject = {
27
27
  nationalPatientUniqueIdentifier: string;
28
+ nationalIdIdentifierType: string;
28
29
  phoneNumberAttributeType: string;
29
30
  socialHealthAuthorityIdentifierType: string;
30
- artDirectoryUrl: string;
31
31
  };
@@ -1,6 +1,7 @@
1
1
  import { type FetchResponse, openmrsFetch, type Patient, restBaseUrl, useConfig } from '@openmrs/esm-framework';
2
2
  import useSWR from 'swr';
3
3
  import { ReferralConfigObject } from '../config-schema';
4
+ import { useMemo } from 'react';
4
5
 
5
6
  function extractValue(display: string) {
6
7
  const pattern = /=\s*(.*)$/;
@@ -15,20 +16,33 @@ const usePatient = (uuid: string) => {
15
16
  const customPresentation =
16
17
  'custom:(uuid,display,identifiers,person:(uuid,display,attributes:(uuid,display,attributeType:(uuid,display))))';
17
18
  const url = `${restBaseUrl}/patient/${uuid}?v=${customPresentation}`;
18
- const { phoneNumberAttributeType } = useConfig<ReferralConfigObject>();
19
+ const { phoneNumberAttributeType, nationalIdIdentifierType } = useConfig<ReferralConfigObject>();
19
20
  const { data, error, isLoading } = useSWR<FetchResponse<Patient>>(url, openmrsFetch);
21
+ const nationalId = useMemo(
22
+ () =>
23
+ data?.data?.identifiers
24
+ ?.find((id) => id.identifierType?.uuid === nationalIdIdentifierType)
25
+ ?.display?.split('=')?.[1]
26
+ ?.trim(),
27
+ [data, nationalIdIdentifierType],
28
+ );
29
+ const patientPhoneNumber = useMemo(() => {
30
+ const phone = data?.data?.person?.attributes?.find(
31
+ (attr) => attr.attributeType?.uuid === phoneNumberAttributeType,
32
+ )?.display;
33
+ if (phone) {
34
+ return extractValue(phone);
35
+ }
36
+ return undefined;
37
+ }, [data?.data?.person?.attributes, phoneNumberAttributeType]);
38
+
20
39
  return {
21
40
  isLoading,
22
41
  error,
23
42
  patient: data?.data,
24
- patientName: data?.data?.person.display,
25
- patientPhoneNumber: data?.data?.person?.attributes?.find(
26
- (attr) => attr.attributeType.uuid === phoneNumberAttributeType,
27
- )?.display
28
- ? extractValue(
29
- data?.data?.person?.attributes?.find((attr) => attr.attributeType.uuid === phoneNumberAttributeType)?.display,
30
- )
31
- : undefined,
43
+ patientName: data?.data?.person?.display,
44
+ patientPhoneNumber,
45
+ nationalId,
32
46
  };
33
47
  };
34
48
 
@@ -1,11 +1,9 @@
1
1
  import { openmrsFetch } from '@openmrs/esm-framework';
2
2
  import useSWR from 'swr';
3
3
  import { SHRSummary } from '../types/index';
4
- import { useState } from 'react';
5
- import { deepMerge } from '../utils/function';
6
4
 
7
5
  export const useSHRSummary = (patientUuid: string) => {
8
- const shrSummaryUrl = `/ws/rest/v1/kenyaemril/shrPatientSummary?patientUuid=${patientUuid}`;
6
+ const shrSummaryUrl = `/ws/rest/v1/kenyaemril/hie-patient-history?patientUuid=${patientUuid}`;
9
7
  const { data, mutate, error, isLoading } = useSWR<{ data: SHRSummary }>(shrSummaryUrl, openmrsFetch);
10
8
 
11
9
  return {
package/src/index.ts CHANGED
@@ -82,8 +82,5 @@ export const facilityRefferalForm = getAsyncLifecycle(
82
82
 
83
83
  // SHR Summary
84
84
  export const patientSHRSummary = getAsyncLifecycle(() => import('./shr-summary/shr-summary.component'), options);
85
- export const shrAuthorizationForm = getAsyncLifecycle(
86
- () => import('./shr-summary/shr-authorization-form.workspace'),
87
- options,
88
- );
85
+
89
86
  export const referralWrap = getAsyncLifecycle(() => import('./referrals-wrap'), options);
@@ -13,6 +13,8 @@ import {
13
13
  } from '@carbon/react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import capitalize from 'lodash/capitalize';
16
+ import { FHIRResource } from '@openmrs/esm-framework';
17
+ import { EmptyState } from '@openmrs/esm-patient-common-lib';
16
18
 
17
19
  type DependentProps = {
18
20
  patientUuid: string;
@@ -76,7 +78,12 @@ const DependentsComponent: React.FC<DependentProps> = ({ patient, patientUuid })
76
78
  }
77
79
 
78
80
  if (dependents.length === 0) {
79
- return <div>{t('noDependentsFoundFromHIE', 'No dependents found from HIE')}</div>;
81
+ return (
82
+ <EmptyState
83
+ headerTitle={t('hieDependants', 'HIE Dependants')}
84
+ displayText={t('hieDependants', 'HIE Dependants')}
85
+ />
86
+ );
80
87
  }
81
88
 
82
89
  return (
@@ -21,10 +21,10 @@ const ReferralReasonsDialogPopup: React.FC<ReferralReasonsDialogPopupProps> = ({
21
21
  }) => {
22
22
  const { t } = useTranslation();
23
23
 
24
- const handleServeClient = async () => {
24
+ const handleServeClient = () => {
25
25
  try {
26
- await handleProcessReferral();
27
26
  closeModal();
27
+ handleProcessReferral();
28
28
  } catch (error) {
29
29
  showNotification({
30
30
  title: t('referralError', 'Error processing referral'),
@@ -3,7 +3,14 @@ import { mutate } from 'swr';
3
3
  import useSWRMutation from 'swr/mutation';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Tab, TabList, Tabs, Button, TabPanel, TabPanels, InlineLoading } from '@carbon/react';
6
- import { isDesktop, launchWorkspace, useLayoutType, showSnackbar, restBaseUrl } from '@openmrs/esm-framework';
6
+ import {
7
+ isDesktop,
8
+ launchWorkspace,
9
+ useLayoutType,
10
+ showSnackbar,
11
+ restBaseUrl,
12
+ launchWorkspace2,
13
+ } from '@openmrs/esm-framework';
7
14
  import { AirlineManageGates, UpdateNow } from '@carbon/react/icons';
8
15
 
9
16
  import ReferralTable from '../referrals.component';
@@ -46,7 +53,7 @@ const ReferralTabs: React.FC = () => {
46
53
  );
47
54
 
48
55
  const handleReferral = () => {
49
- launchWorkspace('facility-referral-form', {
56
+ launchWorkspace2('facility-referral-form', {
50
57
  workspaceTitle: t('referralForm', 'Referral Form'),
51
58
  });
52
59
  };
@@ -1,18 +1,26 @@
1
- import React, { useCallback } from 'react';
2
- import { Button } from '@carbon/react';
1
+ import React, { useCallback, useRef, useState } from 'react';
2
+ import { Button, InlineLoading } from '@carbon/react';
3
3
 
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { navigate, showModal, showSnackbar } from '@openmrs/esm-framework';
6
6
  import { ReferralReasonsProps } from '../types';
7
7
  import { processCommunityReferral } from './refferals.resource';
8
+ import usePatient from '../hooks/usePatient';
9
+ import { sendSHAOtp, verifyOtp } from '../shr-summary/shr-summary.resource';
8
10
 
9
11
  interface ReferralReasonData {
10
12
  referralData: ReferralReasonsProps;
11
13
  status: string;
14
+ patientUuid: string;
12
15
  }
13
16
 
14
- const CommunityReferralActions: React.FC<ReferralReasonData> = ({ status, referralData }) => {
17
+ const CommunityReferralActions: React.FC<ReferralReasonData> = ({ status, referralData, patientUuid }) => {
15
18
  const { t } = useTranslation();
19
+ const idRef = useRef<string>();
20
+ const [accessGranted, setAccessGranted] = useState(true);
21
+ const [isAuthorizing, setIsAuthorizing] = useState(false);
22
+
23
+ const { error, isLoading, patientPhoneNumber, patientName, nationalId } = usePatient(patientUuid);
16
24
 
17
25
  const handleProcessReferral = useCallback(() => {
18
26
  processCommunityReferral(referralData.messageId)
@@ -39,22 +47,73 @@ const CommunityReferralActions: React.FC<ReferralReasonData> = ({ status, referr
39
47
  });
40
48
  }, [referralData, t]);
41
49
 
50
+ const handleInitiateAuthorization = useCallback(() => {
51
+ const dispose = showModal('otp-verification-modal', {
52
+ onClose: () => {
53
+ if (!accessGranted) {
54
+ setIsAuthorizing(false);
55
+ }
56
+ dispose();
57
+ },
58
+ phoneNumber: patientPhoneNumber || '',
59
+ otpLength: 5,
60
+ expiryMinutes: 5,
61
+ centerBoxes: true,
62
+ onRequestOtp: async (_phone: string) => {
63
+ const { status, id } = await sendSHAOtp(_phone, nationalId as string);
64
+ idRef.current = id;
65
+ if (status !== 'success') {
66
+ throw new Error(t('otpFailed', 'Failed to send OTP'));
67
+ }
68
+ },
69
+
70
+ onVerify: async (enteredOtp: string) => {
71
+ const { status, data, error } = await verifyOtp(enteredOtp, idRef.current as string);
72
+ if (status !== 'success') {
73
+ throw new Error(t('authorizeFailed', 'Authorization failed'));
74
+ }
75
+ },
76
+
77
+ onVerificationSuccess: () => {
78
+ dispose();
79
+ setIsAuthorizing(false);
80
+ setAccessGranted(true);
81
+ handleProcessReferral();
82
+ showSnackbar({
83
+ title: t('success', 'Success'),
84
+ subtitle: t('otpVerificationSuccessMessage', 'OTP Vefification succesfull'),
85
+ kind: 'success',
86
+ });
87
+ },
88
+
89
+ onCleanup: () => {
90
+ if (!accessGranted) {
91
+ setIsAuthorizing(false);
92
+ }
93
+ },
94
+ });
95
+ }, [accessGranted, handleProcessReferral, nationalId, patientPhoneNumber, t]);
96
+
42
97
  const refearralReasonsHandleClick = useCallback(() => {
43
98
  const dispose = showModal('referral-reasons-dialog', {
44
99
  closeModal: () => dispose(),
45
100
  referralReasons: referralData,
46
101
  status: status,
47
- handleProcessReferral,
102
+ handleProcessReferral: handleInitiateAuthorization,
48
103
  });
49
- }, [referralData, handleProcessReferral, status]);
104
+ }, [referralData, handleInitiateAuthorization, status]);
105
+
106
+ if (isLoading || isAuthorizing) {
107
+ return <InlineLoading description={t('loading', 'Loading...')} />;
108
+ }
50
109
 
51
110
  return (
52
111
  <>
53
- <Button kind="primary" size="md" onClick={() => refearralReasonsHandleClick()}>
112
+ <Button kind="primary" size="md" onClick={refearralReasonsHandleClick}>
54
113
  {t('viewReasons', 'View reasons')}
55
114
  </Button>
56
115
  {status === 'completed' ? null : (
57
- <Button kind="primary" size="md" onClick={() => handleProcessReferral()}>
116
+ <Button kind="primary" size="md" onClick={handleInitiateAuthorization}>
58
117
  {t('serveClient', 'Serve client')}
59
118
  </Button>
60
119
  )}
@@ -23,7 +23,7 @@ import { useTranslation } from 'react-i18next';
23
23
  import { useCommunityReferrals } from './refferals.resource';
24
24
  import CommunityReferralActions from './referrals-actions.component';
25
25
  import { ReferralReasonsProps } from '../types';
26
- import { usePaginationInfo } from '@openmrs/esm-patient-common-lib/src';
26
+ import { usePaginationInfo } from '@openmrs/esm-patient-common-lib';
27
27
 
28
28
  type ReferralProps = {
29
29
  status: string;
@@ -124,7 +124,7 @@ const ReferralTable: React.FC<ReferralProps> = ({ status }) => {
124
124
  dateReferred: record.dateReferred,
125
125
  referredFrom: record.referredFrom,
126
126
  referralService: record.referralReasons?.category,
127
- actions: <CommunityReferralActions status={status} referralData={referralReasonsx} />,
127
+ actions: <CommunityReferralActions status={status} referralData={referralReasonsx} patientUuid={record.uuid} />,
128
128
  };
129
129
  rowData.push(s);
130
130
  });
package/src/routes.json CHANGED
@@ -1,80 +1,94 @@
1
1
  {
2
- "$schema": "https://json.openmrs.org/routes.schema.json",
3
- "backendDependencies": {
4
- "kenyaemr": "^19.0.0"
2
+ "$schema": "https://json.openmrs.org/routes.schema.json",
3
+ "backendDependencies": {
4
+ "kenyaemr": "^19.0.0"
5
+ },
6
+ "pages": [
7
+ {
8
+ "component": "shrHome",
9
+ "route": "referrals"
10
+ }
11
+ ],
12
+ "extensions": [
13
+ {
14
+ "name": "patient-chart-shr-summary-dashboard-link",
15
+ "component": "shrSummaryDashboardLink",
16
+ "meta": {
17
+ "columns": 1,
18
+ "columnSpan": 1,
19
+ "slot": "patient-chart-shr-summary-dashboard-slot",
20
+ "path": "SHR Portal"
21
+ },
22
+ "featureFlag": "healthInformationExchange"
5
23
  },
6
- "pages": [
7
- {
8
- "component": "shrHome",
9
- "route": "referrals"
10
- }
11
- ],
12
- "extensions": [
13
- {
14
- "component": "shrAuthorizationForm",
15
- "name": "shr-authorization-form"
16
- },
17
- {
18
- "name": "patient-chart-shr-summary-dashboard-link",
19
- "component": "shrSummaryDashboardLink",
20
- "meta": {
21
- "columns": 1,
22
- "columnSpan": 1,
23
- "slot": "patient-chart-shr-summary-dashboard-slot",
24
- "path": "SHR Portal"
25
- },
26
- "featureFlag": "healthInformationExchange"
27
- },
28
- {
29
- "name": "SHR Portal",
30
- "slot": "patient-chart-shr-summary-dashboard-slot",
31
- "component": "patientSHRSummary",
32
- "meta": {
33
- "columnSpan": 4
34
- }
35
- },
36
- {
37
- "name": "referrals",
38
- "slot": "referrals-slot",
39
- "component": "referralWrap"
40
- },
41
- {
42
- "name": "referrals-link",
43
- "slot": "homepage-dashboard-slot",
44
- "component": "ReferralsDashboardLink",
45
- "meta": {
46
- "name": "referrals",
47
- "title": "referrals",
48
- "slot": "referrals-slot"
49
- }
50
- },
51
- {
52
- "name": "referral-reasons-dialog",
53
- "component": "referralReasonsDialogPopup"
54
- },
55
- {
56
- "name": "facility-referral-form",
57
- "component": "facilityRefferalForm"
58
- },
59
- {
60
- "name": "referral-view-link",
61
- "component": "referralLink",
62
- "order": 13,
63
- "meta": {
64
- "columns": 1,
65
- "columnSpan": 1,
66
- "slot": "patient-chart-referral-slot",
67
- "path": "referral",
68
- "layoutMode": "anchored"
69
- }
70
- },
71
- {
72
- "name": "referral-view",
73
- "slot": "patient-chart-referral-slot",
74
- "component": "referralWidget",
75
- "order": 0,
76
- "online": true,
77
- "offline": false
78
- }
79
- ]
80
- }
24
+ {
25
+ "name": "SHR Portal",
26
+ "slot": "patient-chart-shr-summary-dashboard-slot",
27
+ "component": "patientSHRSummary",
28
+ "meta": {
29
+ "columnSpan": 4
30
+ }
31
+ },
32
+ {
33
+ "name": "referrals",
34
+ "slot": "referrals-slot",
35
+ "component": "referralWrap"
36
+ },
37
+ {
38
+ "name": "referrals-link",
39
+ "slot": "homepage-dashboard-slot",
40
+ "component": "ReferralsDashboardLink",
41
+ "meta": {
42
+ "name": "referrals",
43
+ "title": "referrals",
44
+ "slot": "referrals-slot"
45
+ }
46
+ },
47
+ {
48
+ "name": "referral-reasons-dialog",
49
+ "component": "referralReasonsDialogPopup"
50
+ },
51
+ {
52
+ "name": "referral-view-link",
53
+ "component": "referralLink",
54
+ "order": 13,
55
+ "meta": {
56
+ "columns": 1,
57
+ "columnSpan": 1,
58
+ "slot": "patient-chart-referral-slot",
59
+ "path": "referral",
60
+ "layoutMode": "anchored"
61
+ }
62
+ },
63
+ {
64
+ "name": "referral-view",
65
+ "slot": "patient-chart-referral-slot",
66
+ "component": "referralWidget",
67
+ "order": 0,
68
+ "online": true,
69
+ "offline": false
70
+ }
71
+ ],
72
+ "workspaces2": [
73
+ {
74
+ "name": "facility-referral-form",
75
+ "component": "facilityRefferalForm",
76
+ "window": "referral-workspace-window"
77
+ }
78
+ ],
79
+ "workspaceWindows2": [
80
+ {
81
+ "name": "referral-workspace-window",
82
+ "group": "referral-workspace-group",
83
+ "canMaximize": false,
84
+ "width": "wider"
85
+ }
86
+ ],
87
+ "workspaceGroups2": [
88
+ {
89
+ "name": "referral-workspace-group",
90
+ "persistence": "closeable",
91
+ "closeable": true
92
+ }
93
+ ]
94
+ }
@@ -1,12 +1,17 @@
1
- import { DataTableSkeleton, Tabs, TabList, Tab, TabPanel, TabPanels } from '@carbon/react';
1
+ import { DataTableSkeleton, Tab, TabList, TabPanel, TabPanels, Tabs } from '@carbon/react';
2
2
  import { ErrorState } from '@openmrs/esm-patient-common-lib';
3
- import React from 'react';
3
+ import React, { FC } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import usePatientIdentifiers from '../hooks/usePatientIdentifiers';
6
- import PatientSHRSummaryTable from './tables/shr-summary-table.component';
7
6
  import DependentsComponent from '../referrals/dependents/dependents.component';
7
+ import PatientSHRSummaryTable from './tables/shr-summary-table.component';
8
+
9
+ type SHRSummaryPanelProps = {
10
+ patientUuid: string;
11
+ patient: fhir.Patient;
12
+ };
8
13
 
9
- const SHRSummaryPanel = ({ patient, patientUuid }) => {
14
+ const SHRSummaryPanel: FC<SHRSummaryPanelProps> = ({ patient, patientUuid }) => {
10
15
  const { t } = useTranslation();
11
16
  const { error, isLoading } = usePatientIdentifiers(patientUuid);
12
17
 
@@ -30,7 +35,7 @@ const SHRSummaryPanel = ({ patient, patientUuid }) => {
30
35
  <DependentsComponent patientUuid={patientUuid} patient={patient} />
31
36
  </TabPanel>
32
37
  <TabPanel>
33
- <PatientSHRSummaryTable />
38
+ <PatientSHRSummaryTable patient={patient} patientUuid={patientUuid} />
34
39
  </TabPanel>
35
40
  </TabPanels>
36
41
  </Tabs>