-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patient Consultation: Route to Facility π₯, Admission Date & Time π (#β¦
β¦6458) * `formatDateTime`: hide time if 12AM * refactor patient_consultation * Changes based on QA * microsecond accuracy * cypress fix * fix cypress
- Loading branch information
1 parent
f4275e5
commit c1c4e56
Showing
10 changed files
with
490 additions
and
363 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
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.