-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat)O3-4175 add ability to view and edit completed lab results (#2100)
* Cleaned state management, launching form in edit mode * Fixed obs update for none grouped obs * Fixed form mutation, added lab results component for complete lab orders * update lab result test * updated translations * optimized imports * Diplay results in accordion in a tabular form same as in orders --------- Co-authored-by: makombe <[email protected]>
- Loading branch information
Showing
17 changed files
with
277 additions
and
84 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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
46 changes: 46 additions & 0 deletions
46
packages/esm-patient-orders-app/src/lab-results/lab-result.component.tsx
This file contains 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,46 @@ | ||
import { Tile, InlineLoading , InlineNotification } from '@carbon/react'; | ||
import { type Order } from '@openmrs/esm-patient-common-lib'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { useCompletedLabResults, useOrderConceptByUuid } from './lab-results.resource'; | ||
import styles from './lab-result.scss'; | ||
import TestOrder from '../components/test-order.component'; | ||
|
||
type LabResultsProps = { | ||
order: Order; | ||
}; | ||
const LabResults: React.FC<LabResultsProps> = ({ order }) => { | ||
const { t } = useTranslation(); | ||
const { concept, isLoading: isLoadingConcepts, error: conceptError } = useOrderConceptByUuid(order.concept.uuid); | ||
const { isLoading, error, completeLabResult, mutate } = useCompletedLabResults(order); | ||
|
||
if (isLoading || isLoadingConcepts) | ||
return ( | ||
<InlineLoading | ||
status="active" | ||
iconDescription="Loading" | ||
description={t('loadinglabresults', 'Loading lab results') + '...'} | ||
/> | ||
); | ||
|
||
if (error || conceptError) | ||
return ( | ||
<InlineNotification | ||
kind="error" | ||
title={t('labResultError', 'Error loading lab results')} | ||
subtitle={error?.message ?? conceptError?.message} | ||
/> | ||
); | ||
|
||
return ( | ||
<Tile className={styles.resultsCiontainer}> | ||
<OrderDetail order={order} /> | ||
</Tile> | ||
); | ||
}; | ||
|
||
export default LabResults; | ||
|
||
const OrderDetail = ({ order }: { order: Order }) => { | ||
return <TestOrder testOrder={order} />; | ||
}; |
18 changes: 18 additions & 0 deletions
18
packages/esm-patient-orders-app/src/lab-results/lab-result.scss
This file contains 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,18 @@ | ||
@use '@carbon/layout'; | ||
@use '@carbon/type'; | ||
|
||
.resultsCiontainer { | ||
margin-top: layout.$spacing-05; | ||
} | ||
|
||
.detailsContainer { | ||
display: flex; | ||
flex-direction: column; | ||
gap: layout.$spacing-03; | ||
} | ||
|
||
.resultDetail { | ||
display: flex; | ||
flex-direction: row; | ||
gap: layout.$spacing-05; | ||
} |
This file contains 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.