@kenyaemr/esm-morgue-app 5.4.2-pre.2330 → 5.4.2-pre.2333

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 (62) hide show
  1. package/.turbo/turbo-build.log +20 -20
  2. package/dist/197.js +1 -1
  3. package/dist/221.js +1 -0
  4. package/dist/221.js.map +1 -0
  5. package/dist/294.js +1 -1
  6. package/dist/300.js +1 -1
  7. package/dist/347.js +1 -1
  8. package/dist/347.js.map +1 -1
  9. package/dist/429.js +2 -0
  10. package/dist/429.js.map +1 -0
  11. package/dist/529.js +1 -0
  12. package/dist/529.js.map +1 -0
  13. package/dist/619.js +1 -0
  14. package/dist/619.js.map +1 -0
  15. package/dist/633.js +1 -1
  16. package/dist/633.js.map +1 -1
  17. package/dist/653.js +1 -0
  18. package/dist/653.js.map +1 -0
  19. package/dist/712.js +1 -0
  20. package/dist/712.js.map +1 -0
  21. package/dist/723.js +1 -0
  22. package/dist/723.js.map +1 -0
  23. package/dist/805.js +1 -0
  24. package/dist/805.js.map +1 -0
  25. package/dist/989.js +1 -1
  26. package/dist/989.js.map +1 -1
  27. package/dist/kenyaemr-esm-morgue-app.js +1 -1
  28. package/dist/kenyaemr-esm-morgue-app.js.buildmanifest.json +182 -80
  29. package/dist/kenyaemr-esm-morgue-app.js.map +1 -1
  30. package/dist/main.js +1 -1
  31. package/dist/main.js.map +1 -1
  32. package/dist/routes.json +1 -1
  33. package/package.json +1 -1
  34. package/src/bed/bed.component.tsx +10 -11
  35. package/src/bed-layout/discharged/discharged-bed-layout.component.tsx +24 -7
  36. package/src/bed-linelist-view/discharged/discharged-bed-line-view.component.tsx +35 -20
  37. package/src/config-schema.ts +1 -1
  38. package/src/extension/overflow-menu-item-postmortem/print-postmorterm-report.component.tsx +39 -0
  39. package/src/index.ts +11 -0
  40. package/src/modals/autopsy-report/autopsy-print-preview-confirmation.modal.tsx +569 -0
  41. package/src/modals/autopsy-report/autopsy-print-preview-confirmation.scss +715 -0
  42. package/src/modals/mortuary-gate-pass/print-preview-confirmation.modal.tsx +257 -0
  43. package/src/modals/mortuary-gate-pass/print-preview-confirmation.resource.ts +0 -0
  44. package/src/modals/mortuary-gate-pass/print-preview-confirmation.scss +333 -0
  45. package/src/routes.json +15 -0
  46. package/src/utils/utils.ts +6 -0
  47. package/src/view-details/panels/attachement.component.tsx +17 -3
  48. package/src/view-details/panels/autopsy.component.tsx +89 -75
  49. package/src/view-details/panels/billing-history.component.tsx +8 -1
  50. package/src/view-details/view-details.component.tsx +6 -2
  51. package/translations/am.json +8 -3
  52. package/translations/en.json +8 -3
  53. package/translations/sw.json +8 -3
  54. package/dist/201.js +0 -1
  55. package/dist/201.js.map +0 -1
  56. package/dist/389.js +0 -1
  57. package/dist/389.js.map +0 -1
  58. package/dist/420.js +0 -2
  59. package/dist/420.js.map +0 -1
  60. package/dist/798.js +0 -1
  61. package/dist/798.js.map +0 -1
  62. /package/dist/{420.js.LICENSE.txt → 429.js.LICENSE.txt} +0 -0
@@ -9,13 +9,7 @@ import {
9
9
  useLayoutType,
10
10
  usePagination,
11
11
  } from '@openmrs/esm-framework';
12
- import {
13
- CardHeader,
14
- EmptyState,
15
- ErrorState,
16
- getPatientUuidFromStore,
17
- usePaginationInfo,
18
- } from '@openmrs/esm-patient-common-lib';
12
+ import { CardHeader, EmptyState, ErrorState, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
19
13
  import {
20
14
  Button,
21
15
  DataTable,
@@ -40,15 +34,24 @@ import { ConfigObject } from '../../config-schema';
40
34
  import EncounterObservations from './observations/observation.component';
41
35
  import { Observation } from '../../types';
42
36
  import { useAutospyEncounter } from '../view-details.resource';
37
+ import { useParams } from 'react-router-dom';
38
+
39
+ interface RouteParams {
40
+ patientUuid: string;
41
+ [key: string]: string | undefined;
42
+ }
43
43
 
44
44
  const AutopsyView: React.FC = () => {
45
45
  const { t } = useTranslation();
46
- const patientUuid = getPatientUuidFromStore();
46
+ const { patientUuid } = useParams<RouteParams>();
47
+
47
48
  const { autopsyFormUuid, autopsyEncounterFormUuid } = useConfig<ConfigObject>();
49
+
48
50
  const { encounters, isLoading, error, mutate, isValidating } = useAutospyEncounter(
49
51
  patientUuid,
50
52
  autopsyEncounterFormUuid,
51
53
  );
54
+
52
55
  const headerTitle = t('autopsyReport', 'Autopsy report');
53
56
  const layout = useLayoutType();
54
57
  const [pageSize, setPageSize] = React.useState(10);
@@ -57,16 +60,20 @@ const AutopsyView: React.FC = () => {
57
60
  const { pageSizes } = usePaginationInfo(pageSize, encounters?.length, currentPage, results?.length);
58
61
 
59
62
  const handleLaunchAutopsyForm = (encounterUUID = '') => {
63
+ const workspaceTitle = encounterUUID
64
+ ? t('editAutopsyReport', 'Edit Autopsy Report')
65
+ : t('addAutopsyReport', 'Add Autopsy Report');
66
+
60
67
  launchWorkspace('mortuary-form-entry', {
61
- workspaceTitle: t('autopsyReport', 'Autopsy report'),
62
- mutateForm: () => mutate(),
63
- formInfo: {
64
- encounterUuid: encounterUUID,
65
- formUuid: autopsyFormUuid,
66
- patientUuid,
67
- visitTypeUuid: '',
68
- visitUuid: '',
68
+ workspaceTitle,
69
+ mutateForm: () => {
70
+ mutate();
69
71
  },
72
+ formUuid: autopsyFormUuid,
73
+ encounterUuid: encounterUUID,
74
+ patientUuid,
75
+ visitTypeUuid: '',
76
+ visitUuid: '',
70
77
  });
71
78
  };
72
79
 
@@ -109,20 +116,23 @@ const AutopsyView: React.FC = () => {
109
116
  return <EmptyState displayText={headerTitle} headerTitle={headerTitle} launchForm={handleLaunchAutopsyForm} />;
110
117
  }
111
118
 
112
- const tableRows = encounters.map((encounter) => ({
113
- id: `${encounter.uuid}`,
114
- date: formatDate(parseDate(encounter?.encounterDatetime)),
115
- visitType: encounter?.visit?.visitType?.display,
116
- encounterType: encounter?.encounterType?.display,
117
- formName: encounter?.form?.name,
118
- mortician: encounter?.encounterProviders[0]?.provider?.name,
119
- action: (
120
- <OverflowMenu aria-label="overflow-menu" flipped={false}>
121
- <OverflowMenuItem onClick={() => handleLaunchAutopsyForm(encounter.uuid)} itemText={t('edit', 'Edit')} />
122
- </OverflowMenu>
123
- ),
124
- obs: encounter?.obs,
125
- }));
119
+ const tableRows = encounters.map((encounter) => {
120
+ const row = {
121
+ id: `${encounter.uuid}`,
122
+ date: formatDate(parseDate(encounter?.encounterDatetime)),
123
+ visitType: encounter?.visit?.visitType?.display ?? '--',
124
+ encounterType: encounter?.encounterType?.display ?? '--',
125
+ formName: encounter?.form?.name ?? '--',
126
+ mortician: encounter?.encounterProviders?.[0]?.provider?.name ?? '--',
127
+ action: (
128
+ <OverflowMenu aria-label="autopsy-actions" flipped={false}>
129
+ <OverflowMenuItem onClick={() => handleLaunchAutopsyForm(encounter.uuid)} itemText={t('edit', 'Edit')} />
130
+ </OverflowMenu>
131
+ ),
132
+ obs: encounter?.obs,
133
+ };
134
+ return row;
135
+ });
126
136
 
127
137
  return (
128
138
  <div className={styles.widgetCard}>
@@ -132,10 +142,11 @@ const AutopsyView: React.FC = () => {
132
142
  kind="ghost"
133
143
  onClick={() => handleLaunchAutopsyForm()}
134
144
  renderIcon={(props) => <Add size={24} {...props} />}
135
- iconDescription={t('add', 'Add')}>
145
+ iconDescription={t('addAutopsyReport', 'Add Autopsy Report')}>
136
146
  {t('add', 'Add')}
137
147
  </Button>
138
148
  </CardHeader>
149
+
139
150
  <DataTable isSortable rows={tableRows} headers={tableHeader} size={responsiveSize} useZebraStyles>
140
151
  {({
141
152
  rows,
@@ -145,51 +156,54 @@ const AutopsyView: React.FC = () => {
145
156
  getTableContainerProps,
146
157
  getHeaderProps,
147
158
  getRowProps,
148
- }) => (
149
- <TableContainer {...getTableContainerProps}>
150
- <Table className={styles.table} {...getTableProps()} aria-label="Bill list">
151
- <TableHead>
152
- <TableRow>
153
- <TableExpandHeader enableToggle {...getExpandHeaderProps()} />
154
- {headers.map((header, i) => (
155
- <TableHeader
156
- key={i}
157
- {...getHeaderProps({
158
- header,
159
- })}>
160
- {header.header}
161
- </TableHeader>
162
- ))}
163
- </TableRow>
164
- </TableHead>
165
- <TableBody>
166
- {rows.map((row, i) => {
167
- const encounter = encounters.find((enc) => enc.uuid === row.id);
168
-
169
- return (
170
- <React.Fragment key={row.id}>
171
- <TableExpandRow {...getRowProps({ row })}>
172
- {row.cells.map((cell, index) => (
173
- <TableCell key={cell.id}>{cell.value}</TableCell>
174
- ))}
175
- </TableExpandRow>
176
- {row.isExpanded && encounter ? (
177
- <TableExpandedRow className={styles.expandedRow} colSpan={headers.length + 1}>
178
- <div className={styles.container} key={i}>
179
- <EncounterObservations observations={encounter.obs as Observation[]} />
180
- </div>
181
- </TableExpandedRow>
182
- ) : (
183
- <TableExpandedRow className={styles.hiddenRow} colSpan={headers.length + 2} />
184
- )}
185
- </React.Fragment>
186
- );
187
- })}
188
- </TableBody>
189
- </Table>
190
- </TableContainer>
191
- )}
159
+ }) => {
160
+ return (
161
+ <TableContainer {...getTableContainerProps}>
162
+ <Table className={styles.table} {...getTableProps()} aria-label="Autopsy reports list">
163
+ <TableHead>
164
+ <TableRow>
165
+ <TableExpandHeader enableToggle {...getExpandHeaderProps()} />
166
+ {headers.map((header, i) => (
167
+ <TableHeader
168
+ key={i}
169
+ {...getHeaderProps({
170
+ header,
171
+ })}>
172
+ {header.header}
173
+ </TableHeader>
174
+ ))}
175
+ </TableRow>
176
+ </TableHead>
177
+ <TableBody>
178
+ {rows.map((row, i) => {
179
+ const encounter = encounters.find((enc) => enc.uuid === row.id);
180
+
181
+ return (
182
+ <React.Fragment key={row.id}>
183
+ <TableExpandRow {...getRowProps({ row })}>
184
+ {row.cells.map((cell) => (
185
+ <TableCell key={cell.id}>{cell.value}</TableCell>
186
+ ))}
187
+ </TableExpandRow>
188
+ {row.isExpanded && encounter ? (
189
+ <TableExpandedRow className={styles.expandedRow} colSpan={headers.length + 1}>
190
+ <div className={styles.container} key={i}>
191
+ <EncounterObservations observations={encounter.obs as Observation[]} />
192
+ </div>
193
+ </TableExpandedRow>
194
+ ) : (
195
+ <TableExpandedRow className={styles.hiddenRow} colSpan={headers.length + 2} />
196
+ )}
197
+ </React.Fragment>
198
+ );
199
+ })}
200
+ </TableBody>
201
+ </Table>
202
+ </TableContainer>
203
+ );
204
+ }}
192
205
  </DataTable>
206
+
193
207
  {paginated && (
194
208
  <Pagination
195
209
  forwardText={t('nextPage', 'Next page')}
@@ -3,10 +3,17 @@ import { ExtensionSlot, navigate, usePatient } from '@openmrs/esm-framework';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { EmptyState, getPatientUuidFromStore } from '@openmrs/esm-patient-common-lib';
5
5
  import styles from './panels.scss';
6
+ import { useParams } from 'react-router-dom';
7
+
8
+ interface RouteParams {
9
+ patientUuid: string;
10
+ [key: string]: string | undefined;
11
+ }
6
12
 
7
13
  const BillingHistoryView: React.FC = () => {
8
14
  const { t } = useTranslation();
9
- const patientUuid = getPatientUuidFromStore();
15
+ const { patientUuid } = useParams<RouteParams>();
16
+
10
17
  return <ExtensionSlot name="patient-chart-billing-dashboard-slot" state={{ patientUuid }} />;
11
18
  };
12
19
 
@@ -12,14 +12,18 @@ import AutopsyView from './panels/autopsy.component';
12
12
  import AttachmentView from './panels/attachement.component';
13
13
  import { useActiveMorgueVisit } from './view-details.resource';
14
14
  import BannerInfo from '../extension/deceasedInfoBanner.component';
15
+ import { useParams } from 'react-router-dom';
15
16
 
16
17
  interface MortuarySummaryProps {
17
18
  bedNumber?: string;
18
19
  }
19
-
20
+ interface RouteParams {
21
+ patientUuid: string;
22
+ [key: string]: string | undefined;
23
+ }
20
24
  const MortuarySummary: React.FC<MortuarySummaryProps> = ({ bedNumber }) => {
21
25
  const { t } = useTranslation();
22
- const patientUuid = getPatientUuidFromStore();
26
+ const { patientUuid } = useParams<RouteParams>();
23
27
  const { isLoading } = usePerson(patientUuid);
24
28
  const { activeVisit, isLoading: isActiveLoading } = useActiveMorgueVisit(patientUuid);
25
29
 
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "action": "ድርጊት",
3
3
  "add": "ጨምር",
4
+ "addAutopsyReport": "Add Autopsy Report",
4
5
  "admissionDate": "የመግቢያ ቀን",
5
6
  "admissionForm": "የመግቢያ ቅጽ",
6
7
  "admit": "አስገባ",
@@ -10,6 +11,8 @@
10
11
  "age": "ዕድሜ",
11
12
  "allocation": "የምደባ እይታ",
12
13
  "attachements": "አባሪዎች",
14
+ "attachments": "Attachments",
15
+ "autopsyDeleted": "Autopsy report deleted",
13
16
  "autopsyReport": "የአስከሬን ምርመራ ሪፖርት",
14
17
  "available": "ይገኛል",
15
18
  "awaiting": "በመጠባበቅ ላይ",
@@ -35,6 +38,7 @@
35
38
  "daysSinceDeath": "ከሞቱ በኋላ ያለፉ ቀናት",
36
39
  "discharge": "መልቀቅ",
37
40
  "discharged": "ተለቋል",
41
+ "dischargeDate": "Discharge Date",
38
42
  "dischargedHeader": "ተለቋል",
39
43
  "dischargeForm": "መልቀቅ",
40
44
  "dispose": "አስወግድ",
@@ -42,9 +46,11 @@
42
46
  "dividerText": "የተጋራ",
43
47
  "durationOnWard": "በወረፋ የቆዩ ቀናት",
44
48
  "edit": "አስተካክል",
49
+ "editAutopsyReport": "Edit Autopsy Report",
45
50
  "empty": "ባዶ",
46
51
  "emptyCompartment": "ባዶ ክፍል",
47
52
  "encounterType": "የግኝት አይነት",
53
+ "error": "Error",
48
54
  "errorLoadingPatients": "የተለቀቁ ታካሚዎችን በመጫን ላይ ስህተት",
49
55
  "errorMessage": "ስህተት",
50
56
  "formName": "የቅጽ ስም",
@@ -67,14 +73,13 @@
67
73
  "noDischargedPatients": "ምንም የተለቀቁ ታካሚዎች አልተገኙም",
68
74
  "noDischargedPatientsDescription": "በአሁኑ ጊዜ ምንም የተለቀቁ ታካሚዎች የሉም።",
69
75
  "noObservationsFound": "ምንም ምልከታዎች አልተገኙም",
76
+ "noPatientSelected": "No patient selected",
70
77
  "occupied": "ተይዟል",
71
78
  "patientName": "የታካሚ ስም",
72
- "postmortem": "የአስከሬን ምርመራ",
73
79
  "postmortemForm": "የአስከሬን ምርመራ",
74
80
  "previousPage": "የቀደመ ገጽ",
75
81
  "printGatePass": "የበር ማለፊያ",
76
- "printPostmortem": "የአስከሬን ምርመራ",
77
- "printPostmortemReport": "የአስከሬን ምርመራ ሪፖርት",
82
+ "printPostMortemReport": "Postmortem Report",
78
83
  "searchPatients": "ታካሚዎችን ፈልግ",
79
84
  "sharedCompartment_one": "{{count}} የሚጋራ",
80
85
  "sharedCompartment_other": "{{count}} የሚጋሩ",
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "action": "Action",
3
3
  "add": "Add",
4
+ "addAutopsyReport": "Add Autopsy Report",
4
5
  "admissionDate": "Admission Date",
5
6
  "admissionForm": "Admission form",
6
7
  "admit": "Admit",
@@ -10,6 +11,8 @@
10
11
  "age": "Age",
11
12
  "allocation": "Allocation",
12
13
  "attachements": "Attachements",
14
+ "attachments": "Attachments",
15
+ "autopsyDeleted": "Autopsy report deleted",
13
16
  "autopsyReport": "Autopsy report",
14
17
  "available": "Available",
15
18
  "awaiting": "Awaiting",
@@ -35,6 +38,7 @@
35
38
  "daysSinceDeath": "Days Since Death",
36
39
  "discharge": "Discharge body",
37
40
  "discharged": "Discharged",
41
+ "dischargeDate": "Discharge Date",
38
42
  "dischargedHeader": "Discharged",
39
43
  "dischargeForm": "Discharge form",
40
44
  "dispose": "Dispose",
@@ -42,9 +46,11 @@
42
46
  "dividerText": "Shared",
43
47
  "durationOnWard": "Days In Queue",
44
48
  "edit": "Edit",
49
+ "editAutopsyReport": "Edit Autopsy Report",
45
50
  "empty": "Empty",
46
51
  "emptyCompartment": "Empty compartment",
47
52
  "encounterType": "Encounter type",
53
+ "error": "Error",
48
54
  "errorLoadingPatients": "Error loading discharged patients",
49
55
  "errorMessage": "Error",
50
56
  "formName": "Form name",
@@ -67,14 +73,13 @@
67
73
  "noDischargedPatients": "No discharged patients found",
68
74
  "noDischargedPatientsDescription": "There are currently no discharged patients to display.",
69
75
  "noObservationsFound": "No observations found",
76
+ "noPatientSelected": "No patient selected",
70
77
  "occupied": "Occupied",
71
78
  "patientName": "Patient Name",
72
- "postmortem": "Postmortem",
73
79
  "postmortemForm": "Postmortem",
74
80
  "previousPage": "Previous page",
75
81
  "printGatePass": "Gate Pass",
76
- "printPostmortem": "Postmortem",
77
- "printPostmortemReport": "Postmortem Report",
82
+ "printPostMortemReport": "Postmortem Report",
78
83
  "searchPatients": "Search Patients",
79
84
  "sharedCompartment_one": "{{count}} sharing",
80
85
  "sharedCompartment_other": "{{count}} sharing",
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "action": "Action",
3
3
  "add": "Add",
4
+ "addAutopsyReport": "Add Autopsy Report",
4
5
  "admissionDate": "Admission Date",
5
6
  "admissionForm": "Admission form",
6
7
  "admit": "Admit",
@@ -10,6 +11,8 @@
10
11
  "age": "Age",
11
12
  "allocation": "Allocation View",
12
13
  "attachements": "Attachements",
14
+ "attachments": "Attachments",
15
+ "autopsyDeleted": "Autopsy report deleted",
13
16
  "autopsyReport": "Autopsy report",
14
17
  "available": "Available",
15
18
  "awaiting": "Awaiting",
@@ -35,6 +38,7 @@
35
38
  "daysSinceDeath": "Days Since Death",
36
39
  "discharge": "Discharge",
37
40
  "discharged": "Discharged",
41
+ "dischargeDate": "Discharge Date",
38
42
  "dischargedHeader": "Discharged",
39
43
  "dischargeForm": "Discharge",
40
44
  "dispose": "Dispose",
@@ -42,9 +46,11 @@
42
46
  "dividerText": "Shared",
43
47
  "durationOnWard": "Days In Queue",
44
48
  "edit": "Edit",
49
+ "editAutopsyReport": "Edit Autopsy Report",
45
50
  "empty": "Empty",
46
51
  "emptyCompartment": "Empty compartment",
47
52
  "encounterType": "Encounter type",
53
+ "error": "Error",
48
54
  "errorLoadingPatients": "Error loading discharged patients",
49
55
  "errorMessage": "Error",
50
56
  "formName": "Form name",
@@ -67,14 +73,13 @@
67
73
  "noDischargedPatients": "No discharged patients found",
68
74
  "noDischargedPatientsDescription": "There are currently no discharged patients to display.",
69
75
  "noObservationsFound": "No observations found",
76
+ "noPatientSelected": "No patient selected",
70
77
  "occupied": "Occupied",
71
78
  "patientName": "Patient Name",
72
- "postmortem": "Postmortem",
73
79
  "postmortemForm": "Postmortem",
74
80
  "previousPage": "Previous page",
75
81
  "printGatePass": "Gate Pass",
76
- "printPostmortem": "Postmortem",
77
- "printPostmortemReport": "Postmortem Report",
82
+ "printPostMortemReport": "Postmortem Report",
78
83
  "searchPatients": "Search Patients",
79
84
  "sharedCompartment_one": "{{count}} sharing",
80
85
  "sharedCompartment_other": "{{count}} sharing",