PageSourceSearch

https://app.clariumhealth.com/assets/co._recommendationId.preference-cards-D8-GDYjJ.js

js clariumhealth.com collected 2026-09-25 15:17:27 UTC 16,083 bytes, 321 lines download raw bytes

1import { o as __toESM } from "./chunk-6z4oVpB-.js";
2import "./capitalize-YV0fqYBS.js";
3import { t as require_react } from "./react-CCT1erMQ.js";
4import "./prop-types-BP3O0vhg.js";
5import { t as require_jsx_runtime } from "./jsx-runtime-6ToSbptA.js";
6import "./hoist-non-react-statics.cjs-aYVW55CP.js";
7import "./clsx-BbsgvS4T.js";
8import "./Stack-DHo_Jfjl.js";
9import "./setPrototypeOf-BJGl62Ep.js";
10import "./chainPropTypes-Bly6swO2.js";
11import "./SvgIcon-C1SXqgmo.js";
12import "./typeof-CtObx4yR.js";
13import "./Amplify-ydFdTLPK.js";
14import { n as _objectSpread2, r as init_objectSpread2 } from "./objectWithoutProperties-Cgp7QKOy.js";
15import "./types-CQ-ki0qK.js";
16import "./amplifyUrl-DhBXUoj8.js";
17import "./tslib.es6-CGMJRn24.js";
18import "./api-BN7R4l5b.js";
19import "./createCognitoUserPoolEndpointResolver-DIsnsOMn.js";
20import "./auth-D-8td4-a.js";
21import { u as formatNumber } from "./helpers-BQW8LNh3.js";
22import "./getCurrentUser-CO2hH9tr.js";
23import "./_baseGetTag-CcQT-b-8.js";
24import "./errors-CJ9PkTii.js";
25import "./isObjectLike-C0C335kY.js";
26import "./shim-BLxGA08a.js";
27import "./use-isomorphic-layout-effect.browser.esm-BDjLKVP-.js";
28import "./isSymbol-BD-EcKMA.js";
29import "./debounce-CIlO4Yzq.js";
30import "./dist-Cz4mcmaa.js";
31import "./dist-DaeMORX8.js";
32import "./react-dom-Dddidh9b.js";
33import "./dist-DetJSI7l.js";
34import "./dist-DjKy_3Dj.js";
35import "./Combination-CE9BhVA8.js";
36import "./dist-BHtPb5hX.js";
37import "./dist-C5RjQM0F.js";
38import "./dist-SbNcsVrs.js";
39import { n as ie } from "./esm-BezjtZdK.js";
40import { E as useLocation, F as useSearchParams, j as useParams, r as Link } from "./chunk-62JRHF6Z-z8JX8DDB.js";
41import "./exports-PpHA8CsK.js";
42import "./notifyManager-Bch6NZ-h.js";
43import "./useBaseQuery-1WImwwVq.js";
44import "./useInfiniteQuery-CX5ozztk.js";
45import "./useMutation-k2qXTuOE.js";
46import "./QueryClientProvider-DBT_lM_H.js";
47import { t as useQuery } from "./useQuery-DLS21iiV.js";
48import "./constants-TZTPDohO.js";
49import "./session-BF1M_iJk.js";
50import "./iconPropTypes-C5chbmyn-CpVo52O4.js";
51import "./bucket-3-DKA1ROBB.js";
52import "./bucket-10-Ca5cox4R.js";
53import "./bucket-13-DojbEaO8.js";
54import "./bucket-15-CpBPyEaO.js";
55import "./bucket-18-BV3V-3UN.js";
56import "./dist-W5s9RbHT.js";
57import "./dist-DCv7IJcI.js";
58import { t as cn } from "./utils-DL_RvPHk.js";
59import "./mixpanel.module-D03As0KW.js";
60import "./subDays-vez96V8M.js";
61import "./addMonths-C0iKCEqw.js";
62import "./endOfMonth-h_W7cRKV.js";
63import "./roundingMethods-DuMrTbDg.js";
64import "./differenceInWeeks-B00-N4lk.js";
65import { n as buttonVariants } from "./button-BgUr9YaP.js";
66import "./tooltip-BQPMLsOF.js";
67import { n as LongText_default } from "./LongText-Chh0tzMc.js";
68import { t as Badge } from "./badge-BfOudBXs.js";
69import "./xstate-react.esm-DX2qQh45.js";
70import "./Button-BBS-SiZR.js";
71import "./Typography-l0CVJQ2v.js";
72import "./Link-BjqzfEsO.js";
73import "./ErrorPage-BcFaH7ir.js";
74import "./useSessionQuery-CydkiRrr.js";
75import "./bootstrap-BQ86EXdW.js";
76import "./dist-C_Pp4NuF.js";
77import "./dialog-odsl4nrF.js";
78import "./useDebounce-4Thlngbw.js";
79import "./track-BOLPaScP.js";
80import { Et as usePrefCardsConflictSummary, Tt as usePrefCardsBootstrapQuery } from "./utils-BFgzP0mr.js";
81import "./comments-Z3QCdchs.js";
82import { n as base_path_default } from "./base-path-CtfbOIOI.js";
83import "./input-wPGsBI9X.js";
84import { t as Skeleton } from "./skeleton-DlrxaJwT.js";
85import { t as LogErrorBoundary } from "./LogErrorBoundary-CEgwOwnc.js";
86import "./useDebounceCallback-CpDQu6xV.js";
87import { a as TableHead, c as TableRow, n as TableBody, o as TableHeader, r as TableCell, s as TableHeaderRow, t as Table } from "./table-BhizvUWs.js";
88import "./reset-to-first-page-Buz3wC4q.js";
89import "./filter-search-params-CGhr97jh.js";
90import "./label-DQ77xjEK.js";
91import "./icon-input-BR-SHD_t.js";
92import "./dist-C2D8DSus.js";
93import "./popover-SmfnFw8c.js";
94import { t as require_lodash } from "./lodash-CmkmHUhD.js";
95import { t as TableLink } from "./table-cell-link-DIcdJU9e.js";
96import "./SearchBar-ZjGoiUAB.js";
97import { f as selectProcedureAdminPermission } from "./selectors-8yo1wgXa.js";
98import { t as ItemsTableSearch } from "./search-DElqQcKt.js";
99import { t as useHiddenPrefCardColumnIds } from "./not-applicable-data-fields-C1oLNi1m.js";
100import { o as recommendationPrefCardQueueQuery } from "./procedure-recommendations-Cx6cKmpE.js";
101import { n as AddLinkedPreferenceCardModal, t as RemoveLinkedPreferenceCard } from "./remove-linked-pref-card-76B4qSgZ.js";
102var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
103var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
104function useLinkedPreferenceCardTableLayout() {
105	const { pathname } = useLocation();
106	const isProceduresPage = pathname.includes("procedures");
107	const { hasCoProcedureCards } = ie();
108	const { data: isProcedureCardAdmin }
108 = usePrefCardsBootstrapQuery(selectProcedureAdminPermission);
109	const hidePrimaryLocationColumn = useHiddenPrefCardColumnIds().includes("primary_location_display_name");
110	return {
111		columnCount: import_react.useMemo(() => {
112			let count = 4;
113			if (!hidePrimaryLocationColumn) count += 1;
114			if (isProceduresPage && hasCoProcedureCards) count += 3;
115			if (isProceduresPage && isProcedureCardAdmin) count += 1;
116			return count;
117		}, [
118			hidePrimaryLocationColumn,
119			hasCoProcedureCards,
120			isProcedureCardAdmin,
121			isProceduresPage
122		]),
123		hidePrimaryLocationColumn,
124		hasCoProcedureCards,
125		isProcedureCardAdmin,
126		isProceduresPage
127	};
128}
129var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
130init_objectSpread2();
131function LinkedCardTableBody({ isFetching, isSuccess, data, resultCount }) {
132	const { columnCount, hidePrimaryLocationColumn, hasCoProcedureCards, isProcedureCardAdmin, isProceduresPage } = useLinkedPreferenceCardTableLayout();
133	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableBody, { children: [
134		isFetching ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
135			className: "h-1.5 p-0",
136			colSpan: columnCount,
137			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-full w-full rounded-none bg-gradient-to-l from-primary to-primary-purple" })
138		}) }) : null,
139		isSuccess && data.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, { children: [
140			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableLink, {
141				to: `${base_path_default}/${row.preference_card_id}`,
142				children: row.client_card_id
143			}) }),
144			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
145				className: "max-w-[280px]",
146				children: row.procedure_name ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LongText_default, { text: (0, import_lodash.unescape)(row.procedure_name) }) : "–"
147			}),
148			!hidePrimaryLocationColumn ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: row.primary_location_display_name ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LongText_default, {
149				text: row.primary_location_display_name,
150				className: "max-w-48"
151			}) : "–" }) : null,
152			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: row.primary_physician_display_name || "–" }),
153			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
154				align: "right",
155				children: typeof row.count_cases_in_last_12_months === "number" ? formatNumber(row.count_cases_in_last_12_months) : "–"
156			}),
157			isProceduresPage && hasCoProcedureCards ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
158				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
159					align: "center",
160					children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConflictsButton, { preferenceCardId: row.preference_card_id })
161				}),
162				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
163					align: "center",
164					children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PendingRequestsLink, { preferenceCardId: row.preference_card_id })
165				}),
166				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
167					align: "center",
168					children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DeclinedRequestsLink, { preferenceCardId: row.preference_card_id })
169				})
170			] }) : null,
171			isProceduresPage && isProcedureCardAdmin && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
172				align: "center",
173				children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RemoveLinkedPreferenceCard, { preferenceCardId: row.preference_card_id })
174			})
175		] }, `${row.preference_card_id}`)),
176		isSuccess && resultCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
177			colSpan: columnCount,
178			className: "h-12 text-center",
179			children: "No results found."
180		}) }) : null
181	] });
182}
183function ConflictsButton({ preferenceCardId }) {
184	var _summary$data$total_d, _summary$data;
185	const summary = usePrefCardsConflictSummary(preferenceCardId);
186	if (summary.isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-6 w-18 bg-slate-100" });
187	const count = (_summary$data$total_d = (_summary$data = summary.data) === null || _summary$data === void 0 ? void 0 : _summary$data.total_differences) !== null && _summary$data$total_d !== void 0 ? _summary$data$total_d : 0;
188	if (count === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValueBadge, { children: "0" });
189	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
190		to: `${base_path_default}/${preferenceCardId}/standardization`,
191		className: cn(buttonVariants({
192			variant: "outline",
193			size: "badge"
194		}), "rounded-lg bg-yellow-200 px-3 py-1.5 leading-4 text-zinc-900 shadow-[0px_2px_4px_0px_hsla(0_0%_0%_/_0.08)] hover:bg-yellow-300"),
195		children: ["View ", `(${count})`]
196	});
197}
198function PendingRequestsLink(props) {
199	var _summary$data2;
200	const summary = usePrefCardsConflictSummary(props.preferenceCardId);
201	if (summary.isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-4 w-8 bg-slate-100" });
202	const count = (_summary$data2 = summary.data) === null || _summary$data2 === void 0 ? void 0 : _summary$data2.open_change_requests;
203	if (!count) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: "—" });
204	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
205		to: `${base_path_default}/${props.preferenceCardId}/requests`,
206		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValueBadge, { children: formatNumber(count) })
207	});
208}
209function DeclinedRequestsLink(props) {
210	var _summary$data3;
211	const summary = usePrefCardsConflictSummary(props.preferenceCardId);
212	if (summary.isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-4 w-8 bg-slate-100" });
213	const count = (_summary$data3 = summary.data) === null || _summary$data3 === void 0 ? void 0 : _summary$data3.declined_differences;
214	if (!count) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: "—" });
215	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
216		to: `${base_path_default}/${props.preferenceCardId}/standardization`,
217		children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValueBadge, { children: formatNumber(count) })
218	});
219}
220function ValueBadge(props) {
221	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, _objectSpread2(_objectSpread2({}, props), {}, {
222		variant: "outline",
223		className: "rounded-lg px-3 py-1.5 leading-4 shadow-[0px_2px_4px_0px_hsla(0_0%_0%_/_0.08)]"
224	}));
225}
226function LinkedPreferenceCardTableHeader() {
227	const { hidePrimaryLocationColumn, hasCoProcedureCards, isProcedureCardAdmin, isProceduresPage } = useLinkedPreferenceCardTableLayout();
228	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHeader, {
229		sticky: true,
230		children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableHeaderRow, { children: [
231			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
232				className: "text-nowrap",
233				children: "Card ID"
234			}),
235			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
236				className: "w-[99%] text-nowrap",
237				children: "Preference Card Name"
238			}),
239			!hidePrimaryLocationColumn ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
240				className: "text-nowrap",
241				children: "Primary Location"
242			}) : null,
243			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
244				className: "text-nowrap",
245				children: "Performing Physician"
246			}),
247			/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
248				align: "right",
249				className: "w-28 text-nowrap text-right",
250				children: "Cases"
251			}),
252			isProceduresPage && hasCoProcedureCards ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
253				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
254					className: "w-28 text-nowrap text-center",
255					children: "Conflicts"
256				}),
257				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
258					className: "leading-4",
259					children: "Pending Requests"
260				}),
261				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, { children: "Declined" })
262			] }) : null,
263			isProceduresPage && isProcedureCardAdmin ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
264				align: "center",
265				className: "border-r"
266			}) : null
267		] })
268	});
269}
270function LinkedCardTableSearch({ showAddButton, linkedCards }) {
271	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
272		className: cn(showAddButton ? "flex gap-2" : ""),
273		children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemsTableSearch, {
274			placeholder: "Search cards",
275			param: "for_string_search",
276			containerClassName: "mb-4"
277		}), showAddButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AddLinkedPreferenceCardModal, { linkedCards })]
278	});
279}
280function LinkedPreferenceCardTable({ queryResults, showAddButton }) {
281	const [searchParams] = useSearchParams();
282	const { data, isError, isFetching, isSuccess } = queryResults;
283	const { data: isProcedureCardAdmin } = usePrefCardsBootstrapQuery(selectProcedureAdminPermission);
284	const search = searchParams.get("for_string_search");
285	const filteredData = import_react.useMemo(() => {
286		if (!data) return [];
287		if (search && search !== "") return data.items.filter((item) => (item.client_card_id || "").toLowerCase().includes(search.toLowerCase()) || (item.procedure_name || "").toLowerCase().includes(search.toLowerCase()) || (item.primary_physician_display_name || "").toLowerCase().includes(search.toLowerCase()));
288		return data.items;
289	}, [data, search]);
290	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinkedCardTableSearch, {
291		showAddButton: showAddButton && isProcedureCardAdmin,
292		linkedCards: showAddButton ? data === null || data === void 0 ? void 0 : data.items : void 0
293	}
293), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
294		className: "min-h-0 grow-0",
295		children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table, {
296			containerClassName: "h-full",
297			children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinkedPreferenceCardTableHeader, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinkedCardTableBody, {
298				data: filteredData,
299				resultCount: filteredData.length,
300				isError,
301				isFetching,
302				isSuccess
303			})]
304		})
305	})] });
306}
307function RecommendationPrefCardTable() {
308	const { recommendationId } = useParams();
309	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinkedPreferenceCardTable, { queryResults: useQuery(recommendationPrefCardQueueQuery(recommendationId)) });
310}
311async function loader() {
312	return {};
313}
314function Component() {
315	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RecommendationPrefCardTable, {});
316}
317Component.displayName = "CardRecDetailPreferenceCards";
318const ErrorBoundary = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogErrorBoundary, { routeComponent: "CardRecDetailPreferenceCards" });
319export { Component, ErrorBoundary, loader };
320
321//# sourceMappingURL=co._recommendationId.preference-cards-D8-GDYjJ.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.