Skip to content

Commit

Permalink
fixed abha number linking issue (#8550)
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar authored Sep 17, 2024
1 parent 82a6700 commit f0a1627
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/Components/Patient/PatientRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 3 additions & 1 deletion src/Locale/en/Facility.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
7 changes: 7 additions & 0 deletions src/Redux/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,13 @@ const routes = {
TBody: Type<ICreateHealthIdRequest>(),
},

linkPatient: {
path: "/api/v1/abdm/healthid/link_patient/",
method: "POST",
TBody: Type<{ abha_number: string; patient: string }>(),
TRes: Type<AbhaNumberModel>(),
},

searchByHealthId: {
path: "/api/v1/abdm/healthid/search_by_health_id/",
method: "POST",
Expand Down

0 comments on commit f0a1627

Please sign in to comment.