}
+ className="xl:justify-center"
+ containerClassName="w-full lg:w-auto mt-2 2xl:mt-0 flex justify-center"
+ >
+
+ {[
+ [
+ `/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/update`,
+ "Edit Consultation Details",
+ "pen",
+ patient.is_active &&
+ consultation?.id &&
+ !consultation?.discharge_date,
+ ],
+ [
+ `/patient/${patient.id}/investigation_reports`,
+ "Investigation Summary",
+ "align-alt",
+ true,
+ ],
+ [
+ `/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/treatment-summary`,
+ "Treatment Summary",
+ "file-medical",
+ consultation?.id,
+ ],
+ ]
+ .concat(
+ enable_hcx
+ ? [
+ [
+ `/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/claims`,
+ "Claims",
+ "copy-landscape",
+ consultation?.id,
+ ],
+ ]
+ : []
+ )
+ .map(
+ (action: any, i) =>
+ action[3] && (
+
+
-
-
{action[1]}
-
- {action?.[4]?.[0] && (
+ onClick={() => {
+ if (
+ action[1] !== "Treatment Summary" &&
+ consultation?.admitted &&
+ !consultation?.current_bed &&
+ i === 1
+ ) {
+ Notification.Error({
+ msg: "Please assign a bed to the patient",
+ });
+ setOpen(true);
+ }
+ triggerGoal("Patient Card Button Clicked", {
+ buttonName: action[1],
+ consultationId: consultation?.id,
+ userId: authUser?.id,
+ });
+ }}
+ >
+
+
{action[1]}
+
+ {action?.[4]?.[0] && (
+ <>
+
+ {action[4][1]}
+
+ >
+ )}
+
+ )
+ )}
+
+ {enable_abdm &&
+ (patient.abha_number ? (
+ <>
+
+ {({ close }) => (
<>
-
- {action[4][1]}
-
+ {
+ close();
+ setShowABHAProfile(true);
+ triggerGoal("Patient Card Button Clicked", {
+ buttonName: "Show ABHA Profile",
+ consultationId: consultation?.id,
+ userId: authUser?.id,
+ });
+ }}
+ >
+
+ Show ABHA Profile
+
+ {
+ triggerGoal("Patient Card Button Clicked", {
+ buttonName: "Link Care Context",
+ consultationId: consultation?.id,
+ userId: authUser?.id,
+ });
+ close();
+ setShowLinkCareContext(true);
+ }}
+ >
+
+ Link Care Context
+
>
)}
-