Skip to content
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

(feat) Update procedure form to include body site #33

Merged
merged 5 commits into from
Apr 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed speimen source and speciment type from procedure payload and …
…also procedure form
  • Loading branch information
agesa3 committed Apr 17, 2024
commit 47c421db417fceea6d8adf5d0784782cfdec541b
Original file line number Diff line number Diff line change
@@ -92,6 +92,10 @@ export function ProceduresOrderForm({
) || {}
).required;

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use a config for this?


const proceduresOrderFormSchema = z.object({
instructions: z.string().optional(),
urgency: z.string().refine((value) => value !== "", {
@@ -139,8 +143,6 @@ export function ProceduresOrderForm({
commentsToFulfiller: z.string().optional(),
numberOfRepeats: z.string().optional(),
previousOrder: z.string().optional(),
specimenSource: z.string().optional(),
specimenType: z.string().optional(),
frequency: z.string().optional(),
bodySite: z.string().optional(),
});
@@ -365,99 +367,31 @@ export function ProceduresOrderForm({
</Column>
</Grid>
)}
<Grid className={styles.gridRowHidden}>
<Column lg={16} md={8} sm={4}>
<InputWrapper>
<Controller
name="specimenSource"
control={control}
render={({ field: { onChange, onBlur, value } }) => (
<ComboBox
size="lg"
id="specimenSourceInput"
titleText={t("specimenSource", "Specimen Source")}
selectedItem={
specimenSourceItems?.find(
(option) => option.uuid === value
) || null
}
items={specimenSourceItems}
onBlur={onBlur}
onChange={({ selectedItem }) =>
onChange(selectedItem?.value || "")
}
invalid={errors.specimenSource?.message}
invalidText={errors.specimenSource?.message}
itemToString={(item) => item?.display}
disabled={isLoadingSpecimenSourceItems}
placeholder={
isLoadingSpecimenSourceItems
? `${t("loading", "Loading")}...`
: t("testTypePlaceholder", "Select one")
}
/>
)}
/>
</InputWrapper>
</Column>
</Grid>
<Grid className={styles.gridRowHidden}>
<Column lg={16} md={8} sm={4}>
<InputWrapper>
<Controller
name="specimenType"
control={control}
render={({ field: { onChange, onBlur, value } }) => (
<ComboBox
size="lg"
id="specimenTypeInput"
titleText={t("specimenType", "Specimen Type")}
selectedItem={
specimenTypeItems?.find(
(option) => option.uuid === value
) || null
}
items={specimenTypeItems}
onBlur={onBlur}
onChange={({ selectedItem }) =>
onChange(selectedItem?.value || "")
}
invalid={errors.specimenType?.message}
invalidText={errors.specimenType?.message}
itemToString={(item?: Concept) =>
item && item?.display ? `${item?.display}` : ""
}
disabled={isLoadingSpecimenTypeItems}
placeholder={
isLoadingSpecimenTypeItems
? `${t("loading", "Loading")}...`
: t("testTypePlaceholder", "Select one")
}
/>
)}
/>
</InputWrapper>
</Column>
</Grid>
<Grid className={styles.gridRow}>
<Column lg={16} md={8} sm={4}>
<InputWrapper>
<Controller
name="bodySite"
control={control}
render={({ field: { onChange, onBlur, value } }) => (
<TextArea
enableCounter
id="bodySite"
size="lg"
labelText={t("bodySite", "Body Site")}
value={value}
onChange={onChange}
onBlur={onBlur}
maxCount={500}
invalid={errors.bodySite?.message}
invalidText={errors.bodySite?.message}
/>
<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>
Original file line number Diff line number Diff line change
@@ -44,11 +44,6 @@
}
}


.gridRowHidden {
display: none;
}

.field {
margin-bottom: spacing.$spacing-05;
}
2 changes: 0 additions & 2 deletions src/form/procedures-orders/api.ts
Original file line number Diff line number Diff line change
@@ -113,8 +113,6 @@ export function prepProceduresOrderPostData(
orderer: order.orderer,
encounter: encounterUuid,
concept: order.testType.conceptUuid,
specimenSource: order.specimenSource,
specimenType: order.specimenType,
frequency: order.frequency,
numberOfRepeats: order.numberOfRepeats,
urgency: order.urgency,