diff --git a/src/components/Patient/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx index 19bc05394f1..a8097a77907 100644 --- a/src/components/Patient/PatientRegistration.tsx +++ b/src/components/Patient/PatientRegistration.tsx @@ -44,6 +44,7 @@ import { } from "@/common/constants"; import countryList from "@/common/static/countries.json"; +import { PLUGIN_Component } from "@/PluginEngine"; import * as Notification from "@/Utils/Notifications"; import routes from "@/Utils/request/api"; import mutate from "@/Utils/request/mutate"; @@ -51,6 +52,7 @@ import query from "@/Utils/request/query"; import { parsePhoneNumber } from "@/Utils/utils"; import OrganizationSelector from "@/pages/Organization/components/OrganizationSelector"; import { PatientModel } from "@/types/emr/patient"; +import { Organization } from "@/types/organization/organization"; import Autocomplete from "../ui/autocomplete"; @@ -256,6 +258,9 @@ export default function PatientRegistration( same_address: patientQuery.data.address === patientQuery.data.permanent_address, yob_or_dob: patientQuery.data.date_of_birth ? "dob" : "age", + geo_organization: ( + patientQuery.data.geo_organization as unknown as Organization + )?.id, } as unknown as z.infer); } }, [patientQuery.data]); // eslint-disable-line react-hooks/exhaustive-deps @@ -289,6 +294,12 @@ export default function PatientRegistration( className="md:w-[500px] space-y-10" onSubmit={form.handleSubmit(onSubmit)} > + +

@@ -400,7 +411,7 @@ export default function PatientRegistration( {GENDER_TYPES.map((g) => ( diff --git a/src/pluginTypes.ts b/src/pluginTypes.ts index 0697a24e902..7f8c963e7f4 100644 --- a/src/pluginTypes.ts +++ b/src/pluginTypes.ts @@ -1,4 +1,5 @@ import { LazyExoticComponent } from "react"; +import { UseFormReturn } from "react-hook-form"; import { FacilityModel } from "@/components/Facility/models"; import { UserAssignedModel } from "@/components/Users/models"; @@ -23,11 +24,17 @@ export type PatientHomeActionsComponentType = React.FC<{ className?: string; }>; +export type PatientRegistrationFormComponentType = React.FC<{ + form: UseFormReturn; // eslint-disable-line @typescript-eslint/no-explicit-any + patientId?: string; +}>; + // Define supported plugin components export type SupportedPluginComponents = { DoctorConnectButtons: DoctorConnectButtonComponentType; Scribe: ScribeComponentType; PatientHomeActions: PatientHomeActionsComponentType; + PatientRegistrationForm: PatientRegistrationFormComponentType; }; // Create a type for lazy-loaded components