Skip to content

Commit

Permalink
Merge pull request #35 from PiusKariuki/bug/SJT-72
Browse files Browse the repository at this point in the history
chore: solved body-site filter error
  • Loading branch information
Michaelndula authored Aug 7, 2024
2 parents cdcf2e8 + 82dd17e commit bd904b7
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 324 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect, useState, useMemo } from "react";
import classNames from "classnames";
import {
type DefaultWorkspaceProps,
type DefaultPatientWorkspaceProps,
launchPatientWorkspace,
useOrderBasket,
} from "@openmrs/esm-patient-common-lib";
Expand Down Expand Up @@ -47,9 +47,9 @@ import { moduleName } from "../../../constants";

export interface ProceduresOrderFormProps {
initialOrder: ProcedureOrderBasketItem;
closeWorkspace: DefaultWorkspaceProps["closeWorkspace"];
closeWorkspaceWithSavedChanges: DefaultWorkspaceProps["closeWorkspaceWithSavedChanges"];
promptBeforeClosing: DefaultWorkspaceProps["promptBeforeClosing"];
closeWorkspace: DefaultPatientWorkspaceProps["closeWorkspace"];
closeWorkspaceWithSavedChanges: DefaultPatientWorkspaceProps["closeWorkspaceWithSavedChanges"];
promptBeforeClosing: DefaultPatientWorkspaceProps["promptBeforeClosing"];
}

export function ProceduresOrderForm({
Expand Down Expand Up @@ -93,10 +93,9 @@ export function ProceduresOrderForm({
) || {}
).required;

// const {
// items: { answers: bodySiteItems },
// } = useConceptById("162668AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");

const {
items: { answers: bodySiteItems, name },
} = useConceptById("162668AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");

const proceduresOrderFormSchema = z.object({
instructions: z.string().optional(),
Expand Down Expand Up @@ -374,36 +373,38 @@ export function ProceduresOrderForm({
</Column>
</Grid>
)}
{/* <Grid className={styles.gridRow}>
<Column lg={16} md={8} sm={4}>
<InputWrapper>
<Controller
name="bodySite"
control={control}
render={({ field: { onChange, onBlur, value } }) => (
<ComboBox
size="lg"
id="bodySiteInput"
titleText={t("bodySite", "Body Site")}
selectedItem={
bodySiteItems?.find(
(option) => option.uuid === value
) || null
}
items={bodySiteItems}
onBlur={onBlur}
onChange={({ selectedItem }) =>
onChange(selectedItem?.uuid || "")
}
invalid={errors.bodySite?.message}
invalidText={errors.bodySite?.message}
itemToString={(item) => item?.display}
/>
)}
/>
</InputWrapper>
</Column>
</Grid> */}
{bodySiteItems && (
<Grid className={styles.gridRow}>
<Column lg={16} md={8} sm={4}>
<InputWrapper>
<Controller
name="bodySite"
control={control}
render={({ field: { onChange, onBlur, value } }) => (
<ComboBox
size="lg"
id="bodySiteInput"
titleText={t("bodySite", "Body Site")}
selectedItem={
bodySiteItems?.find(
(option) => option.uuid === value
) || null
}
items={bodySiteItems}
onBlur={onBlur}
onChange={({ selectedItem }) =>
onChange(selectedItem?.uuid || "")
}
invalid={errors.bodySite?.message}
invalidText={errors.bodySite?.message}
itemToString={(item) => item?.display}
/>
)}
/>
</InputWrapper>
</Column>
</Grid>
)}
<Grid className={styles.gridRow}>
<Column lg={16} md={8} sm={4}>
<InputWrapper>
Expand Down
Loading

0 comments on commit bd904b7

Please sign in to comment.