diff --git a/packages/esm-appointments-app/src/config-schema.ts b/packages/esm-appointments-app/src/config-schema.ts index b7e3ce853..86dd54497 100644 --- a/packages/esm-appointments-app/src/config-schema.ts +++ b/packages/esm-appointments-app/src/config-schema.ts @@ -85,6 +85,11 @@ export const configSchema = { 'Whether to show the Unscheduled Appointments tab. Note that configuring this to true requires a custom unscheduledAppointment endpoint not currently available', _default: false, }, + allowAllDayAppointments: { + _type: Type.Boolean, + _description: 'Whether to allow scheduling of all-day appointments (vs appointments with start time and end time)', + _default: true, + }, }; export interface ConfigObject { @@ -104,4 +109,5 @@ export interface ConfigObject { customPatientChartUrl: string; patientIdentifierType: string; showUnscheduledAppointmentsTab: boolean; + allowAllDayAppointments: boolean; } diff --git a/packages/esm-appointments-app/src/form/appointments-form.component.tsx b/packages/esm-appointments-app/src/form/appointments-form.component.tsx index b89d72e96..5b0fdafed 100644 --- a/packages/esm-appointments-app/src/form/appointments-form.component.tsx +++ b/packages/esm-appointments-app/src/form/appointments-form.component.tsx @@ -84,9 +84,10 @@ const AppointmentsForm: React.FC = ({ const locations = useLocations(); const session = useSession(); const { data: services, isLoading } = useAppointmentService(); - const { appointmentStatuses, appointmentTypes } = useConfig(); + const { appointmentStatuses, appointmentTypes, allowAllDayAppointments } = useConfig(); const [isRecurringAppointment, setIsRecurringAppointment] = useState(false); + const [isAllDayAppointment, setIsAllDayAppointment] = useState(false); const defaultRecurringPatternType = recurringPattern?.type || 'DAY'; const defaultRecurringPatternPeriod = recurringPattern?.period || 1; @@ -396,6 +397,16 @@ const AppointmentsForm: React.FC = ({
{isRecurringAppointment && (
+ {allowAllDayAppointments && ( + setIsAllDayAppointment(!isAllDayAppointment)} + toggled={isAllDayAppointment} + /> + )} = ({ /> - + {!isAllDayAppointment && ( + + )} = ({ {!isRecurringAppointment && (
+ {allowAllDayAppointments && ( + setIsAllDayAppointment(!isAllDayAppointment)} + toggled={isAllDayAppointment} + /> + )} = ({ /> - + {!isAllDayAppointment && ( + + )}
)}
{getValues('selectedService') && ( -
+