hplx-feature-library 1.0.188 → 1.0.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SearchPatients/components/SearchPatients.d.ts +3 -1
- package/dist/SearchPatients/index.js +1 -1
- package/dist/SearchPatients-BXNWucYz.cjs +1 -0
- package/dist/{SearchPatients-BEOQqXc-.js → SearchPatients-BYGGaUoD.js} +62 -51
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/SearchPatients-UWwihvaP.cjs +0 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { IPerson } from '../../types/CommonTypes';
|
|
1
2
|
import { ENV_PARAMS } from '../../types/ApiResponseTypes';
|
|
2
3
|
interface SearchPatientsProps {
|
|
3
4
|
addPatientHandler: () => void;
|
|
4
5
|
disabled: boolean;
|
|
5
6
|
showSearchBar: boolean;
|
|
6
7
|
setShowSearchBar: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
-
manipulateExistingDOM
|
|
8
|
+
manipulateExistingDOM?: () => void;
|
|
8
9
|
variable: ENV_PARAMS;
|
|
10
|
+
onPatientSelect?: (params: IPerson) => void;
|
|
9
11
|
}
|
|
10
12
|
declare const SearchPatients: (props: SearchPatientsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export default SearchPatients;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("./index-DQlbIHh3.cjs"),n=require("react"),W=require("./APIAction-5-3i1gGx.cjs"),J=require("./useMediaQuery-D4SIgdMW.cjs"),p=require("./common-utils-CJv4_aVl.cjs"),V=Math.abs(window.orientation||0)===90,X=P=>{const{addPatientHandler:k,disabled:x,manipulateExistingDOM:C,onPatientSelect:w,showSearchBar:D,setShowSearchBar:a,variable:T}=P,{window_var:o,token:y,envName:v}=T,[c,f]=n.useState(!1),d=n.useRef(null),u=n.useRef(null),[A,G]=n.useState(0),[L,l]=n.useState([]),U=6,[E,b]=n.useState(""),[F,B]=n.useState([]),[$,R]=n.useState(!0),[q,S]=n.useState([]),h=J.useMediaQuery("(max-width: 1024px)"),m=(e,s,r,i)=>{B([{id:1,title:e,description:s,type:r,duration:i}])},_=n.useCallback(async e=>{try{const s={branch_id:o?.org_branch_id_for_seg||"",doctor_id:o?.person_id_for_seg||"",doctor_role_id:o?.doctor_role_id_for_seg||"",term:encodeURIComponent(e),limit:30},r=await W.getPatientList(s,{envName:v,token:y});if(!r){l([]),m("Error","No response received from server","Error",3e3);return}const i=r,N=window.filteredUpcomingAppts||[];if(i.apiError){l([]),m("Error",i.apiError,"Error",3e3);return}i?.persons?.length?(l(i.persons),f(!0),G(Number(i.total_persons))):l([]),N?.length?(R(!1),S(N.slice(0,5))):(R(!0),S([]))}catch(s){console.error(s),m("Error","Something went wrong while fetching patients","Error",3e3)}},[v,y,o?.doctor_role_id_for_seg,o?.org_branch_id_for_seg,o?.person_id_for_seg]),z=n.useMemo(()=>p.debounceFn(e=>{_(e)},500),[_]),H=e=>{const s=e.currentTarget.value.trim();(!isNaN(Number(s.charAt(0)))||s.length>=2)&&z(s)},M=()=>{c||_(E)},O=()=>{x||f(e=>!e)},g=n.useCallback(e=>{u.current&&c&&!u.current.contains(e.target)&&(f(!1),l([]))},[c]);n.useEffect(()=>(document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)),[g,c]);const Q=e=>{window.location.href.includes("/frontdesk")?window.patientPopupHandlerFromFD(e.patient_role_id,e.patient_person_id):p.goToPage(`viewPatientDashboard.php?pid=${e.patient_role_id}`)},I=async e=>{let s=!0;if(typeof window.beforePatientChange=="function"&&window.location.pathname==p.EAPP_ROUTES.visitpad&&(s=window.beforePatientChange()),f(!1),l([]),!s)return;if(w){w(e);return}window.patient_role_id=e.person_role_id!=="0"?e.person_role_id.toString():"0",window.patient_person_id=e.person_id!=="0"?e.person_id.toString():"0";const r=(e.person_role_id==="0",e.person_role_id);if(r&&(C?.(),window.location.href.includes("/frontdesk"))){window.patientPopupHandlerFromFD(r,e.person_id);return}p.goToPage(`viewPatientDashboard.php?pid=${r}`)},K=()=>{O(),k(),b("")},j=n.useCallback(e=>{d.current&&!d.current.contains(e.target)&&h&&a(!1)},[h,a]);return n.useEffect(()=>(document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)),[j]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[D?t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-items-center hfl-justify-center hfl-rounded-full hfl-bg-Blue-900 hfl-text-White ${x?"hfl-pointer-events-none hfl-opacity-60":""}`,title:x?"Low internet speed. Feature available only in online mode":"Search Patient",children:[t.jsxRuntimeExports.jsx("input",{ref:d,type:"text",placeholder:"Search Patient 🔍",className:`hfl-rounded-full hfl-border-none hfl-bg-Blue-900 hfl-py-2 hfl-pl-4 ${h&&!V?"xxs:hfl-w-[400px]":"hfl-min-w-[150px]"} sm:hfl-w-full`,"data-qa":"testid_patientSearch",value:E,onKeyUp:H,onChange:e=>b(e.target.value),onClick:M,onBlur:()=>h&&a(!1)}),h&&t.jsxRuntimeExports.jsx("div",{className:"hx_close hfl-cursor-pointer hfl-pr-4",onClick:()=>a(e=>!e)})]}):t.jsxRuntimeExports.jsxs("div",{onClick:()=>a(e=>!e),className:"hfl-flex hfl-cursor-pointer hfl-flex-col hfl-items-center xs:hfl-mr-1 md:hfl-mr-0",children:[t.jsxRuntimeExports.jsx("i",{className:"hx_search",style:{fontSize:"18px"}}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text md",children:"Search"})]}),t.jsxRuntimeExports.jsx(t.qh,{toastList:F}),t.jsxRuntimeExports.jsxs("div",{ref:u,className:`hfl-absolute hfl-right-[255px] hfl-top-[50px] hfl-max-h-[400px] hfl-w-[430px] hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Gray-300 hfl-bg-White hfl-shadow-md ${c?"hfl-block":"hfl-hidden"}`,children:[!$&&t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col",children:[t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-py-[10px] ",children:[t.jsxRuntimeExports.jsx(t.bs,{className:"hfl-px-[12px] hfl-text-Gray-400",variant:"Semibold",type:"Text xs",children:"Upcoming Appointments"}),t.jsxRuntimeExports.jsx("a",{href:"viewPatientAppointments.php",children:t.jsxRuntimeExports.jsx("i",{className:"hx_r-open hfl-text-Primary-700"})})]}),q.map((e,s)=>t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-cursor-pointer hfl-justify-between hfl-px-[12px] hfl-py-[4px] hover:hfl-bg-Blue_gray-200 ${s%2===1?"":"hfl-bg-Gray-100"}`,onClick:()=>Q(e),children:[t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-min-w-[92px] hfl-items-center hfl-justify-center hfl-rounded-lg hfl-border hfl-border-Gray-100 hfl-bg-White_20 hfl-p-2",children:t.jsxRuntimeExports.jsx(t.bs,{className:"hfl-whitespace-nowrap hfl-text-Gray-500",variant:"Regular",type:"Text lg",children:e.appnt_time})}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-px-3",children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text md",className:"hfl-text-Gray-700",children:e.org_person_name}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-text-Gray-500",children:e.org_person_phone})]}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-center",children:t.jsxRuntimeExports.jsx("i",{className:"hx_play-filled hfl-text-Gray-300"})})]},e.patient_role_id))]}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col",children:[t.jsxRuntimeExports.jsx(t.bs,{style:{fontSize:"14px"},variant:"Semibold",type:"Text sm",className:"hfl-px-[12px] hfl-py-[8px] hfl-text-Primary-600",children:"Patients List"}),t.jsxRuntimeExports.jsx("div",{className:"hfl-max-h-[40vh] hfl-overflow-y-auto scrollbar-hide",children:L.map((e,s)=>t.jsxRuntimeExports.jsxs("div",{className:`hfl-cursor-pointer hfl-px-[11px] hfl-py-[12px] hfl-leading-9 hover:hfl-bg-Blue_gray-200 ${s%2===1?"":"hfl-bg-Gray-100"}`,onClick:()=>I(e),children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-inline hfl-uppercase hfl-text-Gray-700",style:{fontSize:"14px"},children:e.org_person_bid_str?e.org_person_bid_str+": ":""}),t.jsxRuntimeExports.jsxs(t.bs,{variant:"Medium",type:"Text sm",className:" hfl-inline hfl-capitalize hfl-text-Gray-700",style:{fontSize:"14px"},children:[e.org_person_name," ",t.jsxRuntimeExports.jsxs("div",{className:"hfl-inline-block",children:["(",e.ageStr.split(" ")[0],", ",p.getGender(Number(e.org_person_gender)),")"]})," "]}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-inline-block hfl-text-Gray-700",style:{fontSize:"14px"},children:e.org_person_phone?`Ph: ${e.org_person_phone}`:""})]},e.person_role_id))})]}),A<U&&t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-justify-center",id:"newPatientAdd",children:t.jsxRuntimeExports.jsx(t.Ku,{hierarchy:"Secondary",icon:"Left",iconFile:"hx_add",onClick:K,size:"lg",textField:"Create New Patient",className:"hfl-flex hfl-w-full hfl-justify-center"})})]})]})};exports.SearchPatients=X;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { j as t, b as r, q as
|
|
2
|
-
import { useState as o, useRef as
|
|
3
|
-
import { g as
|
|
4
|
-
import { u as
|
|
5
|
-
import { d as
|
|
6
|
-
const
|
|
7
|
-
const {
|
|
8
|
-
|
|
1
|
+
import { j as t, b as r, q as Y, K as Z } from "./index-Bd0CDVpH.js";
|
|
2
|
+
import { useState as o, useRef as C, useCallback as y, useMemo as ee, useEffect as D } from "react";
|
|
3
|
+
import { g as te } from "./APIAction-l6i46qgX.js";
|
|
4
|
+
import { u as ne } from "./useMediaQuery-CZAbdJzN.js";
|
|
5
|
+
import { d as re, g as le, a as T, E as se } from "./common-utils-Dq5TMP7t.js";
|
|
6
|
+
const oe = Math.abs(window.orientation || 0) === 90, de = (G) => {
|
|
7
|
+
const {
|
|
8
|
+
addPatientHandler: R,
|
|
9
|
+
disabled: p,
|
|
10
|
+
manipulateExistingDOM: A,
|
|
11
|
+
onPatientSelect: v,
|
|
12
|
+
showSearchBar: L,
|
|
13
|
+
setShowSearchBar: h,
|
|
14
|
+
variable: U
|
|
15
|
+
} = G, { window_var: i, token: b, envName: S } = U, [c, d] = o(!1), x = C(null), m = C(null), [F, B] = o(0), [$, a] = o([]), z = 6, [j, N] = o(""), [H, O] = o([]), [M, P] = o(!0), [K, E] = o([]), f = ne("(max-width: 1024px)"), u = (e, n, l, s) => {
|
|
16
|
+
O([{ id: 1, title: e, description: n, type: l, duration: s }]);
|
|
9
17
|
}, _ = y(
|
|
10
18
|
async (e) => {
|
|
11
19
|
try {
|
|
@@ -15,39 +23,39 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
15
23
|
doctor_role_id: i?.doctor_role_id_for_seg || "",
|
|
16
24
|
term: encodeURIComponent(e),
|
|
17
25
|
limit: 30
|
|
18
|
-
}, l = await
|
|
19
|
-
envName:
|
|
20
|
-
token:
|
|
26
|
+
}, l = await te(n, {
|
|
27
|
+
envName: S,
|
|
28
|
+
token: b
|
|
21
29
|
});
|
|
22
30
|
if (!l) {
|
|
23
31
|
a([]), u("Error", "No response received from server", "Error", 3e3);
|
|
24
32
|
return;
|
|
25
33
|
}
|
|
26
|
-
const s = l,
|
|
34
|
+
const s = l, k = window.filteredUpcomingAppts || [];
|
|
27
35
|
if (s.apiError) {
|
|
28
36
|
a([]), u("Error", s.apiError, "Error", 3e3);
|
|
29
37
|
return;
|
|
30
38
|
}
|
|
31
|
-
s?.persons?.length ? (a(s.persons), d(!0),
|
|
39
|
+
s?.persons?.length ? (a(s.persons), d(!0), B(Number(s.total_persons))) : a([]), k?.length ? (P(!1), E(k.slice(0, 5))) : (P(!0), E([]));
|
|
32
40
|
} catch (n) {
|
|
33
41
|
console.error(n), u("Error", "Something went wrong while fetching patients", "Error", 3e3);
|
|
34
42
|
}
|
|
35
43
|
},
|
|
36
44
|
[
|
|
45
|
+
S,
|
|
37
46
|
b,
|
|
38
|
-
v,
|
|
39
47
|
i?.doctor_role_id_for_seg,
|
|
40
48
|
i?.org_branch_id_for_seg,
|
|
41
49
|
i?.person_id_for_seg
|
|
42
50
|
]
|
|
43
|
-
),
|
|
51
|
+
), q = ee(() => re((e) => {
|
|
44
52
|
_(e);
|
|
45
|
-
}, 500), [_]),
|
|
53
|
+
}, 500), [_]), Q = (e) => {
|
|
46
54
|
const n = e.currentTarget.value.trim();
|
|
47
|
-
(!isNaN(Number(n.charAt(0))) || n.length >= 2) &&
|
|
48
|
-
}, Q = () => {
|
|
49
|
-
c || _(S);
|
|
55
|
+
(!isNaN(Number(n.charAt(0))) || n.length >= 2) && q(n);
|
|
50
56
|
}, W = () => {
|
|
57
|
+
c || _(j);
|
|
58
|
+
}, I = () => {
|
|
51
59
|
p || d((e) => !e);
|
|
52
60
|
}, g = y(
|
|
53
61
|
(e) => {
|
|
@@ -55,30 +63,33 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
55
63
|
},
|
|
56
64
|
[c]
|
|
57
65
|
);
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
window.location.href.includes("/frontdesk") ? window.patientPopupHandlerFromFD(e.patient_role_id, e.patient_person_id) :
|
|
61
|
-
},
|
|
66
|
+
D(() => (document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g)), [g, c]);
|
|
67
|
+
const J = (e) => {
|
|
68
|
+
window.location.href.includes("/frontdesk") ? window.patientPopupHandlerFromFD(e.patient_role_id, e.patient_person_id) : T(`viewPatientDashboard.php?pid=${e.patient_role_id}`);
|
|
69
|
+
}, V = async (e) => {
|
|
62
70
|
let n = !0;
|
|
63
|
-
if (typeof window.beforePatientChange == "function" && window.location.pathname ==
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
if (typeof window.beforePatientChange == "function" && window.location.pathname == se.visitpad && (n = window.beforePatientChange()), d(!1), a([]), !n) return;
|
|
72
|
+
if (v) {
|
|
73
|
+
v(e);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
window.patient_role_id = e.person_role_id !== "0" ? e.person_role_id.toString() : "0", window.patient_person_id = e.person_id !== "0" ? e.person_id.toString() : "0";
|
|
77
|
+
const l = (e.person_role_id === "0", e.person_role_id);
|
|
78
|
+
if (l && (A?.(), window.location.href.includes("/frontdesk"))) {
|
|
79
|
+
window.patientPopupHandlerFromFD(l, e.person_id);
|
|
80
|
+
return;
|
|
71
81
|
}
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
T(`viewPatientDashboard.php?pid=${l}`);
|
|
83
|
+
}, X = () => {
|
|
84
|
+
I(), R(), N("");
|
|
74
85
|
}, w = y(
|
|
75
86
|
(e) => {
|
|
76
87
|
x.current && !x.current.contains(e.target) && f && h(!1);
|
|
77
88
|
},
|
|
78
89
|
[f, h]
|
|
79
90
|
);
|
|
80
|
-
return
|
|
81
|
-
|
|
91
|
+
return D(() => (document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w)), [w]), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
92
|
+
L ? /* @__PURE__ */ t.jsxs(
|
|
82
93
|
"div",
|
|
83
94
|
{
|
|
84
95
|
className: `hfl-flex hfl-items-center hfl-justify-center hfl-rounded-full hfl-bg-Blue-900 hfl-text-White ${p ? "hfl-pointer-events-none hfl-opacity-60" : ""}`,
|
|
@@ -90,12 +101,12 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
90
101
|
ref: x,
|
|
91
102
|
type: "text",
|
|
92
103
|
placeholder: "Search Patient 🔍",
|
|
93
|
-
className: `hfl-rounded-full hfl-border-none hfl-bg-Blue-900 hfl-py-2 hfl-pl-4 ${f && !
|
|
104
|
+
className: `hfl-rounded-full hfl-border-none hfl-bg-Blue-900 hfl-py-2 hfl-pl-4 ${f && !oe ? "xxs:hfl-w-[400px]" : "hfl-min-w-[150px]"} sm:hfl-w-full`,
|
|
94
105
|
"data-qa": "testid_patientSearch",
|
|
95
|
-
value:
|
|
96
|
-
onKeyUp:
|
|
97
|
-
onChange: (e) =>
|
|
98
|
-
onClick:
|
|
106
|
+
value: j,
|
|
107
|
+
onKeyUp: Q,
|
|
108
|
+
onChange: (e) => N(e.target.value),
|
|
109
|
+
onClick: W,
|
|
99
110
|
onBlur: () => f && h(!1)
|
|
100
111
|
}
|
|
101
112
|
),
|
|
@@ -119,23 +130,23 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
119
130
|
]
|
|
120
131
|
}
|
|
121
132
|
),
|
|
122
|
-
/* @__PURE__ */ t.jsx(
|
|
133
|
+
/* @__PURE__ */ t.jsx(Y, { toastList: H }),
|
|
123
134
|
/* @__PURE__ */ t.jsxs(
|
|
124
135
|
"div",
|
|
125
136
|
{
|
|
126
137
|
ref: m,
|
|
127
138
|
className: `hfl-absolute hfl-right-[255px] hfl-top-[50px] hfl-max-h-[400px] hfl-w-[430px] hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Gray-300 hfl-bg-White hfl-shadow-md ${c ? "hfl-block" : "hfl-hidden"}`,
|
|
128
139
|
children: [
|
|
129
|
-
!
|
|
140
|
+
!M && /* @__PURE__ */ t.jsxs("div", { className: "hfl-flex hfl-flex-col", children: [
|
|
130
141
|
/* @__PURE__ */ t.jsxs("div", { className: "hfl-flex hfl-items-center hfl-py-[10px] ", children: [
|
|
131
142
|
/* @__PURE__ */ t.jsx(r, { className: "hfl-px-[12px] hfl-text-Gray-400", variant: "Semibold", type: "Text xs", children: "Upcoming Appointments" }),
|
|
132
143
|
/* @__PURE__ */ t.jsx("a", { href: "viewPatientAppointments.php", children: /* @__PURE__ */ t.jsx("i", { className: "hx_r-open hfl-text-Primary-700" }) })
|
|
133
144
|
] }),
|
|
134
|
-
|
|
145
|
+
K.map((e, n) => /* @__PURE__ */ t.jsxs(
|
|
135
146
|
"div",
|
|
136
147
|
{
|
|
137
148
|
className: `hfl-flex hfl-cursor-pointer hfl-justify-between hfl-px-[12px] hfl-py-[4px] hover:hfl-bg-Blue_gray-200 ${n % 2 === 1 ? "" : "hfl-bg-Gray-100"}`,
|
|
138
|
-
onClick: () =>
|
|
149
|
+
onClick: () => J(e),
|
|
139
150
|
children: [
|
|
140
151
|
/* @__PURE__ */ t.jsx("div", { className: "hfl-flex hfl-min-w-[92px] hfl-items-center hfl-justify-center hfl-rounded-lg hfl-border hfl-border-Gray-100 hfl-bg-White_20 hfl-p-2", children: /* @__PURE__ */ t.jsx(r, { className: "hfl-whitespace-nowrap hfl-text-Gray-500", variant: "Regular", type: "Text lg", children: e.appnt_time }) }),
|
|
141
152
|
/* @__PURE__ */ t.jsxs("div", { className: "hfl-flex hfl-w-full hfl-flex-col hfl-px-3", children: [
|
|
@@ -159,11 +170,11 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
159
170
|
children: "Patients List"
|
|
160
171
|
}
|
|
161
172
|
),
|
|
162
|
-
/* @__PURE__ */ t.jsx("div", { className: "hfl-max-h-[40vh] hfl-overflow-y-auto scrollbar-hide", children:
|
|
173
|
+
/* @__PURE__ */ t.jsx("div", { className: "hfl-max-h-[40vh] hfl-overflow-y-auto scrollbar-hide", children: $.map((e, n) => /* @__PURE__ */ t.jsxs(
|
|
163
174
|
"div",
|
|
164
175
|
{
|
|
165
176
|
className: `hfl-cursor-pointer hfl-px-[11px] hfl-py-[12px] hfl-leading-9 hover:hfl-bg-Blue_gray-200 ${n % 2 === 1 ? "" : "hfl-bg-Gray-100"}`,
|
|
166
|
-
onClick: () =>
|
|
177
|
+
onClick: () => V(e),
|
|
167
178
|
children: [
|
|
168
179
|
/* @__PURE__ */ t.jsx(
|
|
169
180
|
r,
|
|
@@ -189,7 +200,7 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
189
200
|
"(",
|
|
190
201
|
e.ageStr.split(" ")[0],
|
|
191
202
|
", ",
|
|
192
|
-
|
|
203
|
+
le(Number(e.org_person_gender)),
|
|
193
204
|
")"
|
|
194
205
|
] }),
|
|
195
206
|
" "
|
|
@@ -211,13 +222,13 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
211
222
|
e.person_role_id
|
|
212
223
|
)) })
|
|
213
224
|
] }),
|
|
214
|
-
|
|
215
|
-
|
|
225
|
+
F < z && /* @__PURE__ */ t.jsx("div", { className: "hfl-flex hfl-justify-center", id: "newPatientAdd", children: /* @__PURE__ */ t.jsx(
|
|
226
|
+
Z,
|
|
216
227
|
{
|
|
217
228
|
hierarchy: "Secondary",
|
|
218
229
|
icon: "Left",
|
|
219
230
|
iconFile: "hx_add",
|
|
220
|
-
onClick:
|
|
231
|
+
onClick: X,
|
|
221
232
|
size: "lg",
|
|
222
233
|
textField: "Create New Patient",
|
|
223
234
|
className: "hfl-flex hfl-w-full hfl-justify-center"
|
|
@@ -229,5 +240,5 @@ const se = Math.abs(window.orientation || 0) === 90, fe = (T) => {
|
|
|
229
240
|
] });
|
|
230
241
|
};
|
|
231
242
|
export {
|
|
232
|
-
|
|
243
|
+
de as S
|
|
233
244
|
};
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { A as e } from "./AllInvestigationsTable-Dg-YXASz.js";
|
|
|
3
3
|
import { P as i } from "./PatientPopupContainer-CHmoFq-V.js";
|
|
4
4
|
import { A as P } from "./Attachments-BzZHI8d3.js";
|
|
5
5
|
import { P as m } from "./PatientAddEdit-CPjv2_ZF.js";
|
|
6
|
-
import { S as n } from "./SearchPatients-
|
|
6
|
+
import { S as n } from "./SearchPatients-BYGGaUoD.js";
|
|
7
7
|
import { N as d } from "./NineDots-CCtE2t9I.js";
|
|
8
8
|
import { U as c } from "./UserProfile-CcEbhDhd.js";
|
|
9
9
|
import { P as u } from "./PrintModal-BVQ0vEX3.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./index-DQlbIHh3.cjs"),n=require("react"),K=require("./APIAction-5-3i1gGx.cjs"),W=require("./useMediaQuery-D4SIgdMW.cjs"),p=require("./common-utils-CJv4_aVl.cjs"),J=Math.abs(window.orientation||0)===90,V=N=>{const{addPatientHandler:P,disabled:x,manipulateExistingDOM:k,showSearchBar:C,setShowSearchBar:a,variable:D}=N,{window_var:o,token:w,envName:y}=D,[c,f]=n.useState(!1),d=n.useRef(null),u=n.useRef(null),[T,A]=n.useState(0),[G,l]=n.useState([]),L=6,[v,E]=n.useState(""),[U,F]=n.useState([]),[B,b]=n.useState(!0),[$,R]=n.useState([]),h=W.useMediaQuery("(max-width: 1024px)"),m=(e,s,r,i)=>{F([{id:1,title:e,description:s,type:r,duration:i}])},_=n.useCallback(async e=>{try{const s={branch_id:o?.org_branch_id_for_seg||"",doctor_id:o?.person_id_for_seg||"",doctor_role_id:o?.doctor_role_id_for_seg||"",term:encodeURIComponent(e),limit:30},r=await K.getPatientList(s,{envName:y,token:w});if(!r){l([]),m("Error","No response received from server","Error",3e3);return}const i=r,S=window.filteredUpcomingAppts||[];if(i.apiError){l([]),m("Error",i.apiError,"Error",3e3);return}i?.persons?.length?(l(i.persons),f(!0),A(Number(i.total_persons))):l([]),S?.length?(b(!1),R(S.slice(0,5))):(b(!0),R([]))}catch(s){console.error(s),m("Error","Something went wrong while fetching patients","Error",3e3)}},[y,w,o?.doctor_role_id_for_seg,o?.org_branch_id_for_seg,o?.person_id_for_seg]),q=n.useMemo(()=>p.debounceFn(e=>{_(e)},500),[_]),z=e=>{const s=e.currentTarget.value.trim();(!isNaN(Number(s.charAt(0)))||s.length>=2)&&q(s)},H=()=>{c||_(v)},O=()=>{x||f(e=>!e)},g=n.useCallback(e=>{u.current&&c&&!u.current.contains(e.target)&&(f(!1),l([]))},[c]);n.useEffect(()=>(document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)),[g,c]);const M=e=>{window.location.href.includes("/frontdesk")?window.patientPopupHandlerFromFD(e.patient_role_id,e.patient_person_id):p.goToPage(`viewPatientDashboard.php?pid=${e.patient_role_id}`)},Q=async e=>{let s=!0;if(typeof window.beforePatientChange=="function"&&window.location.pathname==p.EAPP_ROUTES.visitpad&&(s=window.beforePatientChange()),f(!1),l([]),s){window.patient_role_id=e.person_role_id!="0"?e.person_role_id.toString():"0",window.patient_person_id=e.person_id!="0"?e.person_id.toString():"0";const r=(e.person_role_id=="0",e.person_role_id);if(r&&(k(),window.location.href.indexOf("/frontdesk")!==-1)){window.patientPopupHandlerFromFD(r,e.person_id);return}p.goToPage(`viewPatientDashboard.php?pid=${r}`)}},I=()=>{O(),P(),E("")},j=n.useCallback(e=>{d.current&&!d.current.contains(e.target)&&h&&a(!1)},[h,a]);return n.useEffect(()=>(document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)),[j]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[C?t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-items-center hfl-justify-center hfl-rounded-full hfl-bg-Blue-900 hfl-text-White ${x?"hfl-pointer-events-none hfl-opacity-60":""}`,title:x?"Low internet speed. Feature available only in online mode":"Search Patient",children:[t.jsxRuntimeExports.jsx("input",{ref:d,type:"text",placeholder:"Search Patient 🔍",className:`hfl-rounded-full hfl-border-none hfl-bg-Blue-900 hfl-py-2 hfl-pl-4 ${h&&!J?"xxs:hfl-w-[400px]":"hfl-min-w-[150px]"} sm:hfl-w-full`,"data-qa":"testid_patientSearch",value:v,onKeyUp:z,onChange:e=>E(e.target.value),onClick:H,onBlur:()=>h&&a(!1)}),h&&t.jsxRuntimeExports.jsx("div",{className:"hx_close hfl-cursor-pointer hfl-pr-4",onClick:()=>a(e=>!e)})]}):t.jsxRuntimeExports.jsxs("div",{onClick:()=>a(e=>!e),className:"hfl-flex hfl-cursor-pointer hfl-flex-col hfl-items-center xs:hfl-mr-1 md:hfl-mr-0",children:[t.jsxRuntimeExports.jsx("i",{className:"hx_search",style:{fontSize:"18px"}}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text md",children:"Search"})]}),t.jsxRuntimeExports.jsx(t.qh,{toastList:U}),t.jsxRuntimeExports.jsxs("div",{ref:u,className:`hfl-absolute hfl-right-[255px] hfl-top-[50px] hfl-max-h-[400px] hfl-w-[430px] hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Gray-300 hfl-bg-White hfl-shadow-md ${c?"hfl-block":"hfl-hidden"}`,children:[!B&&t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col",children:[t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-py-[10px] ",children:[t.jsxRuntimeExports.jsx(t.bs,{className:"hfl-px-[12px] hfl-text-Gray-400",variant:"Semibold",type:"Text xs",children:"Upcoming Appointments"}),t.jsxRuntimeExports.jsx("a",{href:"viewPatientAppointments.php",children:t.jsxRuntimeExports.jsx("i",{className:"hx_r-open hfl-text-Primary-700"})})]}),$.map((e,s)=>t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-cursor-pointer hfl-justify-between hfl-px-[12px] hfl-py-[4px] hover:hfl-bg-Blue_gray-200 ${s%2===1?"":"hfl-bg-Gray-100"}`,onClick:()=>M(e),children:[t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-min-w-[92px] hfl-items-center hfl-justify-center hfl-rounded-lg hfl-border hfl-border-Gray-100 hfl-bg-White_20 hfl-p-2",children:t.jsxRuntimeExports.jsx(t.bs,{className:"hfl-whitespace-nowrap hfl-text-Gray-500",variant:"Regular",type:"Text lg",children:e.appnt_time})}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-px-3",children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text md",className:"hfl-text-Gray-700",children:e.org_person_name}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-text-Gray-500",children:e.org_person_phone})]}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-center",children:t.jsxRuntimeExports.jsx("i",{className:"hx_play-filled hfl-text-Gray-300"})})]},e.patient_role_id))]}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col",children:[t.jsxRuntimeExports.jsx(t.bs,{style:{fontSize:"14px"},variant:"Semibold",type:"Text sm",className:"hfl-px-[12px] hfl-py-[8px] hfl-text-Primary-600",children:"Patients List"}),t.jsxRuntimeExports.jsx("div",{className:"hfl-max-h-[40vh] hfl-overflow-y-auto scrollbar-hide",children:G.map((e,s)=>t.jsxRuntimeExports.jsxs("div",{className:`hfl-cursor-pointer hfl-px-[11px] hfl-py-[12px] hfl-leading-9 hover:hfl-bg-Blue_gray-200 ${s%2===1?"":"hfl-bg-Gray-100"}`,onClick:()=>Q(e),children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-inline hfl-uppercase hfl-text-Gray-700",style:{fontSize:"14px"},children:e.org_person_bid_str?e.org_person_bid_str+": ":""}),t.jsxRuntimeExports.jsxs(t.bs,{variant:"Medium",type:"Text sm",className:" hfl-inline hfl-capitalize hfl-text-Gray-700",style:{fontSize:"14px"},children:[e.org_person_name," ",t.jsxRuntimeExports.jsxs("div",{className:"hfl-inline-block",children:["(",e.ageStr.split(" ")[0],", ",p.getGender(Number(e.org_person_gender)),")"]})," "]}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-inline-block hfl-text-Gray-700",style:{fontSize:"14px"},children:e.org_person_phone?`Ph: ${e.org_person_phone}`:""})]},e.person_role_id))})]}),T<L&&t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-justify-center",id:"newPatientAdd",children:t.jsxRuntimeExports.jsx(t.Ku,{hierarchy:"Secondary",icon:"Left",iconFile:"hx_add",onClick:I,size:"lg",textField:"Create New Patient",className:"hfl-flex hfl-w-full hfl-justify-center"})})]})]})};exports.SearchPatients=V;
|