diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index 708c2e1b072..ab20ff91e59 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -785,6 +785,25 @@ export const PatientRegister = (props: PatientRegisterProps) => { controllerRef: submitController, }); if (res?.ok && requestData) { + if (state.form.abha_number) { + const { res, data } = await request(routes.abha.linkPatient, { + body: { + patient: requestData.id, + abha_number: state.form.abha_number, + }, + }); + + if (res?.status === 200 && data) { + Notification.Success({ + msg: t("abha_number_linked_successfully"), + }); + } else { + Notification.Error({ + msg: t("failed_to_link_abha_number"), + }); + } + } + await Promise.all( insuranceDetails.map(async (obj) => { const policy = { diff --git a/src/Locale/en/Facility.json b/src/Locale/en/Facility.json index d19c889a98f..e061dee620e 100644 --- a/src/Locale/en/Facility.json +++ b/src/Locale/en/Facility.json @@ -115,5 +115,7 @@ "add_details_of_patient": "Add Details of Patient", "choose_location": "Choose Location", "live_monitoring": "Live Monitoring", - "open_live_monitoring": "Open Live Monitoring" + "open_live_monitoring": "Open Live Monitoring", + "abha_number_linked_successfully": "ABHA number linked successfully", + "failed_to_link_abha_number": "Failed to link ABHA number" } diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index b7785d74b98..228b24c7360 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -1400,6 +1400,13 @@ const routes = { TBody: Type(), }, + linkPatient: { + path: "/api/v1/abdm/healthid/link_patient/", + method: "POST", + TBody: Type<{ abha_number: string; patient: string }>(), + TRes: Type(), + }, + searchByHealthId: { path: "/api/v1/abdm/healthid/search_by_health_id/", method: "POST",