@openmrs/esm-laboratory-app 1.0.3-pre.511 → 1.1.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 (52) hide show
  1. package/dist/2636.js +1 -1
  2. package/dist/2636.js.map +1 -1
  3. package/dist/3264.js +1 -1
  4. package/dist/3264.js.map +1 -1
  5. package/dist/3956.js +1 -1
  6. package/dist/5144.js +1 -1
  7. package/dist/5144.js.LICENSE.txt +2 -2
  8. package/dist/5144.js.map +1 -1
  9. package/dist/6048.js +1 -1
  10. package/dist/6048.js.map +1 -1
  11. package/dist/6172.js +1 -0
  12. package/dist/6172.js.map +1 -0
  13. package/dist/6676.js +1 -1
  14. package/dist/7295.js +1 -1
  15. package/dist/7540.js +1 -1
  16. package/dist/7540.js.map +1 -1
  17. package/dist/7936.js +2 -0
  18. package/dist/7936.js.map +1 -0
  19. package/dist/8320.js +1 -1
  20. package/dist/8320.js.map +1 -1
  21. package/dist/8552.js +1 -0
  22. package/dist/8552.js.map +1 -0
  23. package/dist/8728.js +1 -1
  24. package/dist/8728.js.map +1 -1
  25. package/dist/9832.js +1 -1
  26. package/dist/main.js +1 -1
  27. package/dist/main.js.map +1 -1
  28. package/dist/openmrs-esm-laboratory-app.js +1 -1
  29. package/dist/openmrs-esm-laboratory-app.js.buildmanifest.json +108 -111
  30. package/dist/openmrs-esm-laboratory-app.js.map +1 -1
  31. package/dist/routes.json +1 -1
  32. package/package.json +3 -5
  33. package/src/components/orders-table/list-order-details.component.tsx +21 -37
  34. package/src/components/orders-table/list-order-details.scss +4 -12
  35. package/src/components/orders-table/orders-data-table.component.tsx +6 -4
  36. package/src/index.ts +0 -5
  37. package/src/lab-tabs/actions/actions.scss +6 -0
  38. package/src/lab-tabs/actions/add-lab-request-results-action.component.tsx +9 -2
  39. package/src/routes.json +4 -4
  40. package/tools/update-openmrs-deps.mjs +43 -0
  41. package/translations/en.json +0 -1
  42. package/.turbo/cache/812297a17ed163a0-meta.json +0 -1
  43. package/.turbo/cache/812297a17ed163a0.tar.zst +0 -0
  44. package/.turbo/turbo-build.log +0 -44
  45. package/dist/1800.js +0 -1
  46. package/dist/1800.js.map +0 -1
  47. package/dist/2260.js +0 -2
  48. package/dist/2260.js.map +0 -1
  49. package/dist/764.js +0 -1
  50. package/dist/764.js.map +0 -1
  51. package/src/lab-tabs/actions/edit-lab-request-results-action.component.tsx +0 -26
  52. /package/dist/{2260.js.LICENSE.txt → 7936.js.LICENSE.txt} +0 -0
@@ -77,14 +77,6 @@ const ListOrderDetails: React.FC<ListOrdersDetailsProps> = (props) => {
77
77
  name="completed-lab-order-results-slot"
78
78
  />
79
79
  </div>
80
-
81
- {row.fulfillerStatus === 'COMPLETED' && (
82
- <ExtensionSlot
83
- className={styles.menuLink}
84
- state={{ order: row }}
85
- name="completed-ordered-actions-slot"
86
- />
87
- )}
88
80
  </AccordionItem>
89
81
  </Accordion>
90
82
  )}
@@ -103,35 +95,27 @@ const ListOrderDetails: React.FC<ListOrdersDetailsProps> = (props) => {
103
95
  </StructuredListRow>
104
96
 
105
97
  <div className={styles.buttonSection}>
106
- <div className={styles.actionButtons}>
107
- {/* @ts-ignore */}
108
- {row.fulfillerStatus === 'New' ||
109
- row.fulfillerStatus === 'RECEIVED' ||
110
- row.fulfillerStatus == null ? (
111
- <>
112
- <div className={styles.actionButtons}>
113
- <div className={styles.rejectButton}>
114
- <ExtensionSlot state={{ order: row }} name="rejected-ordered-actions-slot" />
115
- </div>
116
- <div className={styles.testsOrderedActions}>
117
- <ExtensionSlot state={{ order: row }} name="tests-ordered-actions-slot" />
118
- </div>
119
- </div>
120
- </>
121
- ) : row.fulfillerStatus === 'IN_PROGRESS' ? (
122
- <>
123
- <div className={styles.testsOrderedActions}>
124
- <ExtensionSlot
125
- className={styles.menuLink}
126
- state={{ order: row }}
127
- name="inprogress-tests-actions-slot"
128
- />
129
- </div>
130
- </>
131
- ) : (
132
- <div></div>
133
- )}
134
- </div>
98
+ {/* @ts-ignore */}
99
+ {row.fulfillerStatus === 'New' || row.fulfillerStatus === 'RECEIVED' || row.fulfillerStatus == null ? (
100
+ <>
101
+ <div className={styles.testsOrderedActions}>
102
+ <ExtensionSlot state={{ order: row }} name="rejected-ordered-actions-slot" />
103
+ <ExtensionSlot state={{ order: row }} name="tests-ordered-actions-slot" />
104
+ </div>
105
+ </>
106
+ ) : row.fulfillerStatus === 'IN_PROGRESS' ? (
107
+ <>
108
+ <div className={styles.testsOrderedActions}>
109
+ <ExtensionSlot
110
+ className={styles.menuLink}
111
+ state={{ order: row }}
112
+ name="inprogress-tests-actions-slot"
113
+ />
114
+ </div>
115
+ </>
116
+ ) : (
117
+ <div></div>
118
+ )}
135
119
  </div>
136
120
  </div>
137
121
  </div>
@@ -5,11 +5,11 @@
5
5
 
6
6
  .buttonSection {
7
7
  display: flex;
8
- justify-content: space-between;
9
- align-items: center;
8
+ flex-direction: column;
9
+ align-items: flex-start;
10
10
  padding-top: layout.$spacing-03;
11
11
  width: 100%;
12
- gap: 10rem;
12
+ margin-left: layout.$spacing-05;
13
13
  }
14
14
 
15
15
  .nameOrderRow {
@@ -26,18 +26,10 @@
26
26
  font-weight: bold;
27
27
  }
28
28
 
29
- .actionButtons {
30
- gap: layout.$spacing-03;
31
- }
32
-
33
29
  .testsOrderedActions {
34
30
  margin-left: auto;
35
31
  display: flex;
36
- }
37
-
38
- .rejectButton {
39
- margin-right: auto;
40
- display: flex;
32
+ padding-right: 1rem;
41
33
  }
42
34
 
43
35
  .menuLink {
@@ -1,4 +1,3 @@
1
- import React, { useMemo, useState } from 'react';
2
1
  import {
3
2
  DataTable,
4
3
  DataTableSkeleton,
@@ -22,8 +21,10 @@ import {
22
21
  TableToolbarSearch,
23
22
  Tile,
24
23
  } from '@carbon/react';
25
- import { formatDate, parseDate, showModal, usePagination } from '@openmrs/esm-framework';
24
+ import { ExtensionSlot, formatDate, parseDate, showModal, usePagination, useVisit } from '@openmrs/esm-framework';
26
25
  import { type Order } from '@openmrs/esm-patient-common-lib';
26
+ import { upperCase } from 'lodash-es';
27
+ import React, { useCallback, useMemo, useState } from 'react';
27
28
  import { useTranslation } from 'react-i18next';
28
29
  import { useLabOrders, useSearchGroupedResults } from '../../laboratory-resource';
29
30
  import type { FulfillerStatus, OrdersDataTableProps } from '../../types';
@@ -47,7 +48,7 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
47
48
  return {
48
49
  ...order,
49
50
  dateActivated: formatDate(parseDate(order.dateActivated)),
50
- patientName: order.patient?.display.split('-')[1],
51
+ patientName: order.patient?.person.display,
51
52
  patientUuid: order.patient?.uuid,
52
53
  patientAge: order.patient?.person?.age,
53
54
  status: order.fulfillerStatus ?? '--',
@@ -121,7 +122,7 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
121
122
  const tableRows = useMemo(() => {
122
123
  return paginatedLabOrders.map((order) => ({
123
124
  id: order.patientId,
124
- patientName: order.orders[0]?.patient?.display?.split('-')[1]?.trim() || '',
125
+ patientName: order.orders[0]?.patient.person.display,
125
126
  orders: order.orders,
126
127
  totalOrders: order.orders?.length,
127
128
  patientAge: order.orders[0]?.patient?.person?.age,
@@ -129,6 +130,7 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
129
130
  action: order.orders.some((o) => o.fulfillerStatus === 'COMPLETED') ? (
130
131
  <div className={styles.actionCell}>
131
132
  <OverflowMenu aria-label="Actions" iconDescription="Actions" flipped>
133
+ <ExtensionSlot name="transition-overflow-menu-item-slot" state={{ patientUuid: order?.patientId }} />
132
134
  <OverflowMenuItem
133
135
  itemText={t('printTestResults', 'Print test results')}
134
136
  onClick={() => handlePrintModal(order?.orders)}
package/src/index.ts CHANGED
@@ -92,11 +92,6 @@ export const rejectLabRequestAction = getAsyncLifecycle(
92
92
  options,
93
93
  );
94
94
 
95
- export const editLabRequestAction = getAsyncLifecycle(
96
- () => import('./lab-tabs/actions/edit-lab-request-results-action.component'),
97
- options,
98
- );
99
-
100
95
  export function startupApp() {
101
96
  defineConfigSchema(moduleName, configSchema);
102
97
  }
@@ -8,6 +8,11 @@
8
8
  text-align: center;
9
9
  padding: 0 layout.$spacing-04;
10
10
  font-size: type.type-scale(2);
11
+ .actionButtonIcon {
12
+ margin-right: layout.$spacing-02;
13
+ color: white;
14
+ fill: white;
15
+ }
11
16
  }
12
17
 
13
18
  .actionRejectButton {
@@ -17,4 +22,5 @@
17
22
  text-align: center;
18
23
  padding: 0 layout.$spacing-04;
19
24
  font-size: type.type-scale(2);
25
+ border: none;
20
26
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Button } from '@carbon/react';
3
3
  import { mutate } from 'swr';
4
4
  import { useTranslation } from 'react-i18next';
5
- import { launchWorkspace, restBaseUrl, useConfig } from '@openmrs/esm-framework';
5
+ import { AddIcon, launchWorkspace, restBaseUrl, useConfig } from '@openmrs/esm-framework';
6
6
  import { type Order } from '@openmrs/esm-patient-common-lib';
7
7
  import { type Config } from '../../config-schema';
8
8
  import styles from './actions.scss';
@@ -29,7 +29,14 @@ const AddLabRequestResultsAction: React.FC<AddLabRequestResultsActionProps> = ({
29
29
  };
30
30
 
31
31
  return (
32
- <Button className={styles.actionButton} kind="primary" onClick={launchTestResultsWorkspace} size="sm">
32
+ <Button
33
+ className={styles.actionButton}
34
+ kind="primary"
35
+ renderIcon={() => <AddIcon className={styles.actionButtonIcon} />}
36
+ iconDescription="Add lab results"
37
+ onClick={launchTestResultsWorkspace}
38
+ size="sm"
39
+ >
33
40
  {t('addLabResult', 'Add lab results')}
34
41
  </Button>
35
42
  );
package/src/routes.json CHANGED
@@ -112,13 +112,13 @@
112
112
  "slot": "completed-ordered-actions-slot"
113
113
  },
114
114
  {
115
- "name": "add-lab-request-results-action",
116
- "component": "addLabRequestResultsAction",
115
+ "name": "reject-lab-request-worklist-action",
116
+ "component": "rejectLabRequestAction",
117
117
  "slot": "inprogress-tests-actions-slot"
118
118
  },
119
119
  {
120
- "name": "reject-lab-request-worklist-action",
121
- "component": "rejectLabRequestAction",
120
+ "name": "add-lab-request-results-action",
121
+ "component": "addLabRequestResultsAction",
122
122
  "slot": "inprogress-tests-actions-slot"
123
123
  }
124
124
  ]
@@ -0,0 +1,43 @@
1
+ import { execSync } from 'node:child_process';
2
+
3
+ try {
4
+ // NB for other places use '@openmrs/*@next'; here we want to ignore patient-common-lib
5
+ execSync(`yarn up --fixed '@openmrs/esm-framework@next' '@openmrs/esm-patient-common-lib@next' 'openmrs@next'`, {
6
+ stdio: ['ignore', 'inherit', 'inherit'],
7
+ windowsHide: true,
8
+ });
9
+ } catch (error) {
10
+ console.error(`Error while updating dependencies: ${error.message ?? error}`);
11
+ process.exit(1);
12
+ }
13
+
14
+ try {
15
+ execSync(`yarn dedupe`, {
16
+ stdio: ['ignore', 'inherit', 'inherit'],
17
+ windowsHide: true,
18
+ });
19
+ } catch (error) {
20
+ console.error(`Error while deduplicating dependencies: ${error.message ?? error}`);
21
+ process.exit(1);
22
+ }
23
+
24
+ try {
25
+ execSync(`git diff-index --quiet HEAD --`, {
26
+ stdio: 'ignore',
27
+ windowsHide: true,
28
+ });
29
+ process.exit(0);
30
+ } catch (error) {
31
+ // git diff-index --quite HEAD --
32
+ // exits with status 1 if there are changes; we only need to run yarn verify if there are changes
33
+ }
34
+
35
+ try {
36
+ execSync(`yarn verify`, {
37
+ stdio: ['ignore', 'inherit', 'inherit'],
38
+ windowsHide: true,
39
+ });
40
+ } catch (error) {
41
+ console.error(`Error while running yarn verify: ${error.message ?? error}. Updates require manual intervention.`);
42
+ process.exit(1);
43
+ }
@@ -11,7 +11,6 @@
11
11
  "dateRange": "Date range",
12
12
  "declinedStatus": "DECLINED",
13
13
  "discard": "Discard",
14
- "editResults": "Edit results",
15
14
  "errorPickingOrder', 'Error picking order": "",
16
15
  "errorRejectingRequest": "Error rejecting lab request",
17
16
  "exceptionStatus": "EXCEPTION",
@@ -1 +0,0 @@
1
- {"hash":"812297a17ed163a0","duration":45946}
@@ -1,44 +0,0 @@
1
- Browserslist: caniuse-lite is outdated. Please run:
2
- npx update-browserslist-db@latest
3
- Why you should do it regularly: https://github.com/browserslist/update-db#readme
4
- assets by path *.js 3.24 MiB
5
- assets by chunk 2.28 MiB (id hint: vendors)
6
- assets by status 2.02 MiB [big]
7
- asset 8728.js 1.55 MiB [emitted] [minimized] [big] (id hint: vendors) 2 related assets
8
- asset 2260.js 486 KiB [emitted] [minimized] [big] (id hint: vendors) 2 related assets
9
- asset 9064.js 130 KiB [emitted] [minimized] (id hint: vendors) 2 related assets
10
- asset 436.js 94.5 KiB [emitted] [minimized] (id hint: vendors) 2 related assets
11
- asset 764.js 20.1 KiB [emitted] [minimized] (id hint: vendors) 1 related asset
12
- asset 5144.js 18 KiB [emitted] [minimized] (id hint: vendors) 2 related assets
13
- + 52 assets
14
- assets by path *.json 29.1 KiB
15
- asset openmrs-esm-laboratory-app.js.buildmanifest.json 26.8 KiB [emitted]
16
- asset routes.json 2.25 KiB [emitted] [from: src/routes.json] [copied]
17
- orphan modules 6.75 MiB [orphan] 1076 modules
18
- runtime modules 41.4 KiB 30 modules
19
- built modules 9.33 MiB (javascript) 252 bytes (consume-shared) 210 bytes (share-init) [built]
20
- javascript modules 9.27 MiB 94 modules
21
- optional modules 69 KiB [optional]
22
- ./translations/am.json 2.13 KiB [optional] [built] [code generated]
23
- + 31 modules
24
- consume-shared-module modules 252 bytes
25
- modules by path consume shared module (default) @openmrs/ 84 bytes 2 modules
26
- + 4 modules
27
- provide-module modules 210 bytes
28
- provide shared module (default) @openmrs/esm-framework@6.2.1-pre.2836 = ./node_m...(truncated) 42 bytes [built] [code generated]
29
- provide shared module (default) dayjs@1.11.11 = ./node_modules/dayj...(truncated) 42 bytes [built] [code generated]
30
- + 3 modules
31
-
32
- WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
33
- This can impact web performance.
34
- Assets:
35
- main.js (679 KiB)
36
- 8728.js (1.55 MiB)
37
- 2260.js (486 KiB)
38
-
39
- WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
40
- Entrypoints:
41
- main (679 KiB)
42
- main.js
43
-
44
- webpack 5.90.1 compiled with 2 warnings in 43554 ms
package/dist/1800.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_openmrs_esm_laboratory_app=globalThis.webpackChunk_openmrs_esm_laboratory_app||[]).push([[1800],{6104:(n,t,e)=>{e.d(t,{c:()=>i});var s=e(8276),a=e.n(s),o=e(8600),c=e.n(o)()(a());c.push([n.id,".-esm-laboratory__actions__actionButton___Fnx-R{display:flex;align-items:center;justify-content:center;text-align:center;padding:0 .75rem;font-size:.875rem}.-esm-laboratory__actions__actionRejectButton___5ynYL{display:flex;align-items:center;justify-content:center;text-align:center;padding:0 .75rem;font-size:.875rem}","",{version:3,sources:["webpack://./src/lab-tabs/actions/actions.scss"],names:[],mappings:"AAGA,gDACE,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,iBAAA,CACA,gBAAA,CACA,iBAAA,CAGF,sDACE,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,iBAAA,CACA,gBAAA,CACA,iBAAA",sourcesContent:["@use '@carbon/type';\n@use '@carbon/layout';\n\n.actionButton {\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 0 layout.$spacing-04;\n font-size: type.type-scale(2);\n}\n\n.actionRejectButton {\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 0 layout.$spacing-04;\n font-size: type.type-scale(2);\n}\n"],sourceRoot:""}]),c.locals={actionButton:"-esm-laboratory__actions__actionButton___Fnx-R",actionRejectButton:"-esm-laboratory__actions__actionRejectButton___5ynYL"};const i=c},1632:(n,t,e)=>{e.d(t,{c:()=>m});var s=e(3604),a=e.n(s),o=e(7200),c=e.n(o),i=e(8272),r=e.n(i),A=e(712),l=e.n(A),u=e(6768),_=e.n(u),p=e(2116),y=e.n(p),C=e(6104),d={};d.styleTagTransform=y(),d.setAttributes=l(),d.insert=r().bind(null,"head"),d.domAPI=c(),d.insertStyleElement=_(),a()(C.c,d);const m=C.c&&C.c.locals?C.c.locals:void 0},1800:(n,t,e)=>{e.r(t),e.d(t,{default:()=>A});var s=e(7244),a=e.n(s),o=e(1552),c=e(4652),i=e(8704),r=e(1632);const A=function(n){var t=n.order,e=(0,c.useTranslation)().t;return a().createElement(o.qaq,{kind:"tertiary",className:r.c.actionButton,size:"sm",onClick:function(){return(0,i.launchWorkspace)("test-results-form-workspace",{order:t})}},e("editResults","Edit results"))}}}]);
package/dist/1800.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"1800.js","mappings":"wMAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,iUAAkU,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iDAAiD,MAAQ,GAAG,SAAW,gJAAgJ,eAAiB,CAAC,saAAsa,WAAa,MAEliCH,EAAwBI,OAAS,CAChC,aAAgB,iDAChB,mBAAsB,wDAEvB,S,iKCAIC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,EAAAC,EAASN,GAKnB,QAAe,EAAAM,GAAW,EAAAA,EAAQP,OAAS,EAAAO,EAAQP,YAASQ,C,8GCDnE,QAd8C,Y,IAAGC,EAAAA,EAAAA,MACzC,GAAQC,EAAAA,EAAAA,kBAANC,EACR,OACE,kBAACC,EAAAA,IAAMA,CACLC,KAAK,WACLC,UAAWC,EAAAA,EAAOC,aAClBC,KAAK,KACLC,QAAS,W,OAAMC,EAAAA,EAAAA,iBAAgB,8BAA+B,CAAEV,MAAAA,G,GAE/DE,EAAE,cAAe,gBAGxB,C","sources":["webpack://@openmrs/esm-laboratory-app/./src/lab-tabs/actions/actions.scss","webpack://@openmrs/esm-laboratory-app/./src/lab-tabs/actions/actions.scss?f61e","webpack://@openmrs/esm-laboratory-app/./src/lab-tabs/actions/edit-lab-request-results-action.component.tsx"],"names":["___CSS_LOADER_EXPORT___","push","module","id","locals","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","c","undefined","order","useTranslation","t","Button","kind","className","styles","actionButton","size","onClick","launchWorkspace"],"sourceRoot":""}