Skip to content

Commit

Permalink
More review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
makombe committed Feb 14, 2024
1 parent 8540c08 commit 7cc625c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ export function LabOrderForm({ initialOrder, closeWorkspace }: LabOrderFormProps
},
});
const config = useConfig<ConfigObject>();
const selectedLabTest =
config && config.labTestsWithOrderReasons
? config.labTestsWithOrderReasons.find((p) => p.labTestUuid === defaultValues?.testType?.conceptUuid)
: null;
const orderReasons =
(config.labTestsWithOrderReasons?.find((c) => c.labTestUuid === defaultValues?.testType?.conceptUuid) || {})
.orderReasons || [];

const handleFormSubmission = useCallback(
(data: LabOrderBasketItem) => {
Expand Down Expand Up @@ -194,7 +193,7 @@ export function LabOrderForm({ initialOrder, closeWorkspace }: LabOrderFormProps
</InputWrapper>
</Column>
</Grid>
{selectedLabTest && (
{orderReasons.length > 0 && (
<Grid className={styles.gridRow}>
<Column lg={16} md={8} sm={4}>
<InputWrapper>
Expand All @@ -208,7 +207,7 @@ export function LabOrderForm({ initialOrder, closeWorkspace }: LabOrderFormProps
titleText={t('orderReason', 'Order reason')}
selectedItem={''}
itemToString={(item) => item?.label}
items={selectedLabTest.orderReasons}
items={orderReasons}
onBlur={onBlur}
onChange={({ selectedItem }) => onChange(selectedItem?.concept || '')}
/>
Expand Down
1 change: 1 addition & 0 deletions packages/esm-patient-labs-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"onDate": "on",
"orderActionNew": "New",
"ordered": "Ordered",
"orderReason": "Order reason",
"other": "Other",
"panel": "Panel",
"pleaseRequiredFields": "Please fill all required fields",
Expand Down

0 comments on commit 7cc625c

Please sign in to comment.