-
Notifications
You must be signed in to change notification settings - Fork 69
(feat) O3-5020: Add a review & approval workflow for lab results configurable #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
d61410d
(feat): add configurable pending review workflow with conditional UI …
its-kios09 b07f98c
Merge branch 'main' into O3-5020
its-kios09 b8f05b4
(fix) Build issues
its-kios09 bc13edd
(fix) Fixed the Build issue
its-kios09 3e378dd
Merge branch 'main' into O3-5020
its-kios09 9b66255
(refactor) Updated the yarn.lock
its-kios09 1e6eff7
Merge branch 'main' into O3-5020
its-kios09 7ac9f90
(fix) Build issues
its-kios09 5c33940
fix: remove invalid tsconfigRootDir from ESLint config
its-kios09 17e9ba9
chore: upgrade TypeScript to v5.0 for const type parameter support
its-kios09 eb2cb67
fix: ensure Playwright browsers are always installed in CI
its-kios09 227fefe
(refactor) Updated the PR suggestions
its-kios09 9fcb1f3
Merge branch 'main' into O3-5020
its-kios09 e64d1a6
(refactor) Updated the PR suggestions
its-kios09 669f916
Merge branch 'O3-5020' of github.com:its-kios09/openmrs-esm-laborator…
its-kios09 ba7905e
Merge remote changes
its-kios09 a02377b
Merge branch 'main' into O3-5020
its-kios09 ba863a8
(refactor) fix the yarn.lock
its-kios09 db95f63
(refactor) fix the yarn.lock
its-kios09 a804286
(refactor) fix the yarn.lock
its-kios09 a8d465d
(refactor) fix the yarn.lock
its-kios09 4d04674
(refactor) fix the yarn.lock
its-kios09 0146797
(refactor) refactor the type
its-kios09 fbe9899
Merge branch 'main' into O3-5020
its-kios09 afdc98c
Merge branch 'main' into O3-5020
its-kios09 9bbf4df
(fix) Fix build issues
its-kios09 5bd470a
(fix) Fix build issues
its-kios09 c29e9eb
(fix) Fix build issues
its-kios09 96bfd0d
(fix) Fix build issues
its-kios09 8484f36
(fix) Fix build issues
its-kios09 df211d1
(fix) Fix build issues
its-kios09 e3dbda6
Merge branch 'main' into O3-5020
its-kios09 55c5b7d
chore: update yarn.lock
its-kios09 05a1f30
(refactor) Address PR suggestion
its-kios09 c1dea02
(refactor) Address PR suggestion
its-kios09 44ec442
Merge branch 'main' into O3-5020
its-kios09 08ccb36
(refactor) Address PR suggestion
its-kios09 ba2644e
Merge branch 'main' into O3-5020
its-kios09 d79cb97
(fix) fixed e2e yml playwright issues installation
its-kios09 bd3edb6
Merge branch 'main' into O3-5020
pirupius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,4 +65,4 @@ | |
| "react-hooks/exhaustive-deps": "warn", | ||
| "react-hooks/rules-of-hooks": "error" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/lab-tabs/actions/amend-lab-results-action.component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import React, { useCallback } from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import { Button } from '@carbon/react'; | ||
| import { showModal } from '@openmrs/esm-framework'; | ||
| import { type Order } from '@openmrs/esm-patient-common-lib'; | ||
| import styles from './actions.scss'; | ||
|
|
||
| interface AmendLabResultsActionMenuProps { | ||
| order: Order; | ||
| orders?: Order[]; | ||
| } | ||
|
|
||
| const AmendLabResultsAction: React.FC<AmendLabResultsActionMenuProps> = ({ order, orders }) => { | ||
| const { t } = useTranslation(); | ||
| const unsupportedStatuses = ['DECLINED', 'IN_PROGRESS', 'NEW']; | ||
|
|
||
| const handleLaunchModal = () => { | ||
| const editableOrders = orders | ||
| ? orders.filter((order) => ['COMPLETED', 'ON_HOLD'].includes(order.fulfillerStatus)) | ||
| : [order].filter((order) => ['COMPLETED', 'ON_HOLD'].includes(order.fulfillerStatus)); | ||
|
|
||
| const dispose = showModal('edit-lab-results-modal', { | ||
| closeModal: () => dispose(), | ||
| orders: editableOrders, | ||
| }); | ||
| }; | ||
|
|
||
| return ( | ||
| <Button | ||
| className={styles.actionButton} | ||
| disabled={unsupportedStatuses.includes(order.fulfillerStatus)} | ||
| size="sm" | ||
| kind="danger" | ||
| onClick={handleLaunchModal} | ||
| > | ||
| {t('amendLabResults', 'Amend lab results')} | ||
| </Button> | ||
| ); | ||
| }; | ||
|
|
||
| export default AmendLabResultsAction; |
37 changes: 37 additions & 0 deletions
37
src/lab-tabs/actions/approve-lab-results-action.component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import React, { useCallback } from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import { Button } from '@carbon/react'; | ||
| import { showModal } from '@openmrs/esm-framework'; | ||
| import { type Order } from '@openmrs/esm-patient-common-lib'; | ||
| import styles from './actions.scss'; | ||
|
|
||
| interface ApproveLabRequestActionMenuProps { | ||
| order: Order; | ||
| } | ||
|
|
||
| const ApproveLabRequestAction: React.FC<ApproveLabRequestActionMenuProps> = ({ order }) => { | ||
| const { t } = useTranslation(); | ||
| const unsupportedStatuses = ['COMPLETED', 'DECLINED', 'IN_PROGRESS']; | ||
|
|
||
| const launchModal = useCallback(() => { | ||
| const dispose = showModal('approval-lab-results-modal', { | ||
| closeModal: () => dispose(), | ||
| order, | ||
| }); | ||
| }, [order]); | ||
|
|
||
| return ( | ||
| <Button | ||
| className={styles.actionButton} | ||
| disabled={unsupportedStatuses.includes(order.fulfillerStatus)} | ||
| size="sm" | ||
| kind="primary" | ||
| key={order.uuid} | ||
| onClick={launchModal} | ||
| > | ||
| {t('approveLabResults', 'Approve lab results')} | ||
| </Button> | ||
| ); | ||
| }; | ||
|
|
||
| export default ApproveLabRequestAction; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/lab-tabs/data-table-extensions/pending-review-lab-request-table.extension.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import React from 'react'; | ||
| import OrdersDataTable from '../../components/orders-table/orders-data-table.component'; | ||
|
|
||
| const PendingReviewLabRequestsTable: React.FC = () => { | ||
| return ( | ||
| <OrdersDataTable | ||
| excludeColumns={[]} | ||
| fulfillerStatus="DRAFT" | ||
| useFilter={false} | ||
| excludeCanceledAndDiscontinuedOrders={false} | ||
| actions={[]} | ||
| /> | ||
| ); | ||
| }; | ||
|
|
||
| export default PendingReviewLabRequestsTable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.