-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a67ea5
commit 8be51d1
Showing
6 changed files
with
474 additions
and
303 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { SelectFormField } from "../Form/FormFields/SelectFormField"; | ||
import { | ||
FormFieldBaseProps, | ||
useFormFieldPropsResolver, | ||
} from "../Form/FormFields/Utils"; | ||
|
||
export const ROUTE_TO_FACILITY_OPTIONS = { | ||
10: "Outpatient/Emergency Room", | ||
20: "Referred from another facility", | ||
30: "Internal Transfer within the facility", | ||
}; | ||
|
||
export type RouteToFacility = keyof typeof ROUTE_TO_FACILITY_OPTIONS; | ||
|
||
export const keys = Object.keys(ROUTE_TO_FACILITY_OPTIONS).map((key) => | ||
parseInt(key) | ||
) as RouteToFacility[]; | ||
|
||
type Props = FormFieldBaseProps<keyof typeof ROUTE_TO_FACILITY_OPTIONS>; | ||
|
||
export default function RouteToFacilitySelect(props: Props) { | ||
const field = useFormFieldPropsResolver(props as any); | ||
|
||
return ( | ||
<SelectFormField | ||
{...field} | ||
options={keys} | ||
optionLabel={(key) => ROUTE_TO_FACILITY_OPTIONS[key]} | ||
/> | ||
); | ||
} |
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.