@fuego-systems/react 0.5.0 → 0.6.0
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/HealthcareServiceCard/HealthcareServiceCard.d.ts +14 -1
- package/dist/HealthcareServiceCard/HealthcareServiceCard.d.ts.map +1 -1
- package/dist/HealthcareServiceCard/HealthcareServiceCard.js +54 -3
- package/dist/HealthcareServiceCard/HealthcareServiceCard.js.map +1 -1
- package/dist/HealthcareServiceDirectory/HealthcareServiceDirectory.d.ts.map +1 -1
- package/dist/HealthcareServiceDirectory/HealthcareServiceDirectory.js +5 -1
- package/dist/HealthcareServiceDirectory/HealthcareServiceDirectory.js.map +1 -1
- package/dist/booking-outcome/bookingOutcomeDisplay.d.ts +17 -0
- package/dist/booking-outcome/bookingOutcomeDisplay.d.ts.map +1 -0
- package/dist/booking-outcome/bookingOutcomeDisplay.js +27 -0
- package/dist/booking-outcome/bookingOutcomeDisplay.js.map +1 -0
- package/dist/search/HealthcareServiceAutocomplete.d.ts.map +1 -1
- package/dist/search/HealthcareServiceAutocomplete.js +3 -13
- package/dist/search/HealthcareServiceAutocomplete.js.map +1 -1
- package/dist/search/HealthcareServiceOption.d.ts +28 -0
- package/dist/search/HealthcareServiceOption.d.ts.map +1 -0
- package/dist/search/HealthcareServiceOption.js +43 -0
- package/dist/search/HealthcareServiceOption.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BookingOutcome } from '@fuego-systems/core';
|
|
1
2
|
import type { Duration } from '@medplum/fhirtypes';
|
|
2
3
|
import { type JSX, type ReactNode } from 'react';
|
|
3
4
|
/** A single protocol action entry to display in the card. */
|
|
@@ -54,8 +55,20 @@ export interface HealthcareServiceCardProps {
|
|
|
54
55
|
* Whether the study requires an appointment. When explicitly `false`, a
|
|
55
56
|
* "No requiere turno" (walk-in) badge is shown. `undefined`/`true` renders
|
|
56
57
|
* nothing. Mirrors `HealthcareService.appointmentRequired`.
|
|
58
|
+
*
|
|
59
|
+
* @deprecated Prefer {@link bookingOutcome}. Kept only as a fallback,
|
|
60
|
+
* rendered exclusively when `bookingOutcome` is `undefined`.
|
|
57
61
|
*/
|
|
58
62
|
readonly appointmentRequired?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Resolved booking outcome for the study (walk-in / contact / email), as
|
|
65
|
+
* produced by `readBookingOutcome` in `@fuego-systems/core`. When set, it
|
|
66
|
+
* always takes precedence over {@link appointmentRequired} and the card
|
|
67
|
+
* renders the corresponding badge — a channel row is added for `contact`
|
|
68
|
+
* and `email`. The card never re-derives outcome precedence itself; that
|
|
69
|
+
* lives in `readBookingOutcome`.
|
|
70
|
+
*/
|
|
71
|
+
readonly bookingOutcome?: BookingOutcome;
|
|
59
72
|
/** Whether to render a close button in the top-right corner. Defaults to false. */
|
|
60
73
|
readonly closable?: boolean;
|
|
61
74
|
/** Callback invoked when the close button is clicked. Only relevant when `closable` is true. */
|
|
@@ -75,5 +88,5 @@ export interface HealthcareServiceProtocolSelection {
|
|
|
75
88
|
/** The pra_ids of toggled-on variant-level add-ons within the selected action. */
|
|
76
89
|
readonly activityAddonIds?: readonly string[];
|
|
77
90
|
}
|
|
78
|
-
export declare function HealthcareServiceCard({ name, specialty, badge, appointmentRequired, closable, onClose, actions, protocolSelection, onProtocolSelectionChange }: HealthcareServiceCardProps): JSX.Element;
|
|
91
|
+
export declare function HealthcareServiceCard({ name, specialty, badge, appointmentRequired, bookingOutcome, closable, onClose, actions, protocolSelection, onProtocolSelectionChange }: HealthcareServiceCardProps): JSX.Element;
|
|
79
92
|
//# sourceMappingURL=HealthcareServiceCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthcareServiceCard.d.ts","sourceRoot":"","sources":["../../src/HealthcareServiceCard/HealthcareServiceCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HealthcareServiceCard.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sE;IACtE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;IACtC;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;IACxC,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,CAAA;IACpD,6EAA6E;IAC7E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,kCAAkC,CAAA;IAC/D,iEAAiE;IACjE,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC,iBAAiB,EAAE,kCAAkC,KAAK,IAAI,CAAA;CACrG;AAED,MAAM,WAAW,kCAAkC;IACjD,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,kFAAkF;IAClF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9C;AAgKD,wBAAgB,qBAAqB,CAAE,EACrC,IAAI,EACJ,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,cAAc,EACd,QAAgB,EAChB,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,yBAAyB,EAC1B,EAAE,0BAA0B,GAAG,GAAG,CAAC,OAAO,CA+N1C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Badge, Card, CloseButton, Group, Radio, Stack, Switch, Text } from '@mantine/core';
|
|
2
|
+
import { Badge, Box, Card, CloseButton, Group, Radio, Stack, Switch, Text } from '@mantine/core';
|
|
3
|
+
import { getBookingOutcomeDisplay } from '../booking-outcome/bookingOutcomeDisplay';
|
|
3
4
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
4
5
|
function CheckIcon(props) {
|
|
5
6
|
const { size, style, ...rest } = props;
|
|
@@ -10,6 +11,26 @@ function WalkInIcon(props) {
|
|
|
10
11
|
const { size, style, ...rest } = props;
|
|
11
12
|
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size !== null && size !== void 0 ? size : 14, height: size !== null && size !== void 0 ? size : 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", style: style, ...rest, children: [_jsx("path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" }), _jsx("polyline", { points: "10 17 15 12 10 7" }), _jsx("line", { x1: "15", y1: "12", x2: "3", y2: "12" })] }));
|
|
12
13
|
}
|
|
14
|
+
// Phone/contact glyph shown next to the "coordinate by contact" badge.
|
|
15
|
+
function ContactIcon(props) {
|
|
16
|
+
const { size, style, ...rest } = props;
|
|
17
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size !== null && size !== void 0 ? size : 14, height: size !== null && size !== void 0 ? size : 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", style: style, ...rest, children: _jsx("path", { d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z" }) }));
|
|
18
|
+
}
|
|
19
|
+
// Envelope glyph shown next to the "request by e-mail" badge.
|
|
20
|
+
function EmailIcon(props) {
|
|
21
|
+
const { size, style, ...rest } = props;
|
|
22
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size !== null && size !== void 0 ? size : 14, height: size !== null && size !== void 0 ? size : 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", style: style, ...rest, children: [_jsx("path", { d: "M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" }), _jsx("polyline", { points: "22 6 12 13 2 6" })] }));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The teal "No requiere turno" badge, shared by the `walk-in` outcome and
|
|
26
|
+
* the deprecated `appointmentRequired` fallback.
|
|
27
|
+
*
|
|
28
|
+
* @returns the badge element
|
|
29
|
+
*/
|
|
30
|
+
function WalkInBadge() {
|
|
31
|
+
const { color, label } = getBookingOutcomeDisplay('walk-in');
|
|
32
|
+
return (_jsx(Badge, { variant: "light", color: color, radius: "sm", size: "sm", leftSection: _jsx(WalkInIcon, { size: 12, style: { display: 'block' } }), style: { alignSelf: 'flex-start' }, children: label }));
|
|
33
|
+
}
|
|
13
34
|
/**
|
|
14
35
|
* Shared toggle row for secondary addons and variant-level add-ons.
|
|
15
36
|
*
|
|
@@ -28,7 +49,7 @@ function ToggleRow({ label, question, checked, onChange }) {
|
|
|
28
49
|
} }));
|
|
29
50
|
}
|
|
30
51
|
// ─── Component ───────────────────────────────────────────────────────────────
|
|
31
|
-
export function HealthcareServiceCard({ name, specialty, badge, appointmentRequired, closable = false, onClose, actions, protocolSelection, onProtocolSelectionChange }) {
|
|
52
|
+
export function HealthcareServiceCard({ name, specialty, badge, appointmentRequired, bookingOutcome, closable = false, onClose, actions, protocolSelection, onProtocolSelectionChange }) {
|
|
32
53
|
var _a;
|
|
33
54
|
const handleChange = (value) => {
|
|
34
55
|
if (value !== (protocolSelection === null || protocolSelection === void 0 ? void 0 : protocolSelection.actionId)) {
|
|
@@ -59,6 +80,35 @@ export function HealthcareServiceCard({ name, specialty, badge, appointmentRequi
|
|
|
59
80
|
activityAddonIds: next
|
|
60
81
|
});
|
|
61
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* The booking-outcome badge shown above the service name: `bookingOutcome`
|
|
85
|
+
* always wins when set (walk-in renders the same teal badge as the
|
|
86
|
+
* fallback; `contact`/`email` render their own badge), falling back to the
|
|
87
|
+
* deprecated `appointmentRequired` only when `bookingOutcome` is
|
|
88
|
+
* `undefined`. Never renders more than one badge.
|
|
89
|
+
*
|
|
90
|
+
* The card shows the outcome only, never the channel value: the channel is
|
|
91
|
+
* an action (open WhatsApp, copy an address) and belongs to the surface
|
|
92
|
+
* that owns the interaction, not to this presentational card.
|
|
93
|
+
*
|
|
94
|
+
* @returns the badge, or null when neither prop applies
|
|
95
|
+
*/
|
|
96
|
+
const renderOutcomeBadge = () => {
|
|
97
|
+
if (bookingOutcome !== undefined) {
|
|
98
|
+
if (bookingOutcome.type === 'walk-in') {
|
|
99
|
+
return _jsx(WalkInBadge, {});
|
|
100
|
+
}
|
|
101
|
+
const isContact = bookingOutcome.type === 'contact';
|
|
102
|
+
const { color, label } = getBookingOutcomeDisplay(bookingOutcome.type);
|
|
103
|
+
return (_jsx(Badge, { variant: "light", color: color, radius: "sm", size: "sm", leftSection: isContact
|
|
104
|
+
? _jsx(ContactIcon, { size: 12, style: { display: 'block' } })
|
|
105
|
+
: _jsx(EmailIcon, { size: 12, style: { display: 'block' } }), style: { alignSelf: 'flex-start' }, children: label }));
|
|
106
|
+
}
|
|
107
|
+
if (appointmentRequired === false) {
|
|
108
|
+
return _jsx(WalkInBadge, {});
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
};
|
|
62
112
|
/**
|
|
63
113
|
* The toggle block for one selected action: optional secondary addons
|
|
64
114
|
* first, then the action's optional variant-level add-ons.
|
|
@@ -78,7 +128,8 @@ export function HealthcareServiceCard({ name, specialty, badge, appointmentRequi
|
|
|
78
128
|
const selectedActivityAddons = isSelected ? (_d = protocolSelection === null || protocolSelection === void 0 ? void 0 : protocolSelection.activityAddonIds) !== null && _d !== void 0 ? _d : [] : [];
|
|
79
129
|
return (_jsxs(Stack, { gap: 2, children: [addons.map((addon) => (_jsx(ToggleRow, { label: addon.label, question: addon.question, checked: selectedAddons.includes(addon.id), onChange: (checked) => handleAddonToggle(action.id, addon.id, checked) }, addon.id))), activityAddons.map((addon) => (_jsx(ToggleRow, { label: addon.label, question: addon.question, checked: selectedActivityAddons.includes(addon.praId), onChange: (checked) => handleActivityAddonToggle(action.id, addon.praId, checked) }, `activity-${addon.praId}`)))] }));
|
|
80
130
|
};
|
|
81
|
-
|
|
131
|
+
const outcomeBadge = renderOutcomeBadge();
|
|
132
|
+
return (_jsx(Card, { withBorder: true, radius: "md", padding: "lg", children: _jsxs(Stack, { gap: "sm", children: [_jsxs(Stack, { gap: 4, children: [outcomeBadge !== null && _jsx(Box, { mb: 6, children: outcomeBadge }), _jsxs(Group, { justify: "space-between", wrap: "nowrap", align: "flex-start", gap: "xs", children: [_jsxs(Stack, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { fw: 700, size: "lg", style: { lineHeight: 1.2 }, children: name }), specialty && (_jsx(Text, { size: "xs", c: "dimmed", fw: 600, tt: "uppercase", style: { lineHeight: 1.2 }, children: specialty }))] }), closable && (_jsx(CloseButton, { onClick: onClose, size: "sm", c: "red", "aria-label": "Quitar", style: { flexShrink: 0 } }))] }), badge && (_jsx(Group, { gap: 6, wrap: "wrap", children: badge }))] }), actions.length === 1 && (() => {
|
|
82
133
|
const action = actions[0];
|
|
83
134
|
const toggles = renderToggles(action);
|
|
84
135
|
return (_jsxs(Stack, { gap: 4, children: [_jsx(Group, { gap: "sm", wrap: "nowrap", align: "flex-start", children: _jsx(Text, { component: "span", size: "sm", c: "dark", style: { flex: 1, minWidth: 0, display: 'block' }, children: action.label }) }), action.question && (_jsx(Text, { component: "span", size: "xs", c: "dimmed", style: { display: 'block' }, children: action.question })), toggles] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthcareServiceCard.js","sourceRoot":"","sources":["../../src/HealthcareServiceCard/HealthcareServiceCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAqF3F,gFAAgF;AAEhF,SAAS,SAAS,CAAE,KAAyE;IAC3F,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IACtC,OAAO,CACL,cACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EACjB,MAAM,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAClB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,CAAC,EACd,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,KAAK,EAAE,KAAK,KACR,IAAI,YAER,mBAAU,MAAM,EAAC,gBAAgB,GAAG,GAChC,CACP,CAAA;AACH,CAAC;AAED,0EAA0E;AAC1E,SAAS,UAAU,CAAE,KAAyE;IAC5F,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IACtC,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EACjB,MAAM,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAClB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EA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Switch, Text } from '@mantine/core'\nimport type { Duration } from '@medplum/fhirtypes'\nimport React, { type JSX, type ReactNode } from 'react'\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\n/** A single protocol action entry to display in the card. */\nexport interface HealthcareServiceAction {\n /** Unique identifier for this action. */\n readonly id: string\n /** Display label for the action (e.g. \"Helicoidal\"). */\n readonly label: string\n /** User-facing question / hint for this action. */\n readonly question?: string\n /**\n * FHIR Duration for this action. Currently NOT rendered: durations sourced\n * from PlanDefinition don't reflect real study times. Kept in the contract\n * so callers keep passing it and rendering can be re-enabled later.\n */\n readonly duration?: Duration\n /**\n * Only meaningful on addon entries. When `true`, the addon is always\n * included with its parent action and is hidden from the card UI — the\n * caller must still resolve and persist it server-side.\n */\n readonly mandatory?: boolean\n /** Optional addons (sub-actions with `any` selection — secondary prácticas). */\n readonly addons?: readonly HealthcareServiceAction[]\n /**\n * The action's variant-level add-ons (tipo-3 ActivityDefinitions). Optional\n * ones render as toggles after the secondary addons; mandatory ones are\n * hidden from the card UI (always included, resolved server-side).\n */\n readonly activityAddons?: readonly HealthcareServiceActivityAddon[]\n}\n\n/** A variant-level add-on (tipo 3) offered or implied by an action. */\nexport interface HealthcareServiceActivityAddon {\n /** EGES pra_id identifying the add-on práctica. */\n readonly praId: string\n /** Display label for the add-on. */\n readonly label: string\n /** User-facing question / hint for this add-on. */\n readonly question?: string\n /**\n * When `true`, the add-on is always included with its action and is hidden\n * from the card UI — the caller must still resolve it server-side.\n */\n readonly mandatory?: boolean\n}\n\nexport interface HealthcareServiceCardProps {\n /** Service display name. */\n readonly name: string\n /** Specialty display name (shown as a badge). */\n readonly specialty?: string\n /** Optional custom badge rendered inline next to the service name. */\n readonly badge?: ReactNode\n /**\n * Whether the study requires an appointment. When explicitly `false`, a\n * \"No requiere turno\" (walk-in) badge is shown. `undefined`/`true` renders\n * nothing. Mirrors `HealthcareService.appointmentRequired`.\n */\n readonly appointmentRequired?: boolean\n /** Whether to render a close button in the top-right corner. Defaults to false. */\n readonly closable?: boolean\n /** Callback invoked when the close button is clicked. Only relevant when `closable` is true. */\n readonly onClose?: () => void\n /** Protocol action variants the user can choose from. */\n readonly actions: readonly HealthcareServiceAction[]\n /** Current controlled selection for the chosen action and enabled addons. */\n readonly protocolSelection?: HealthcareServiceProtocolSelection\n /** Called whenever the controlled protocol selection changes. */\n readonly onProtocolSelectionChange?: (protocolSelection: HealthcareServiceProtocolSelection) => void\n}\n\nexport interface HealthcareServiceProtocolSelection {\n /** The `action.id` of the chosen top-level action. */\n readonly actionId: string\n /** The `action.id`s of toggled-on addon sub-actions within the selected action. */\n readonly addonIds?: readonly string[]\n /** The pra_ids of toggled-on variant-level add-ons within the selected action. */\n readonly activityAddonIds?: readonly string[]\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\nfunction CheckIcon (props: React.ComponentPropsWithoutRef<'svg'> & { size?: string | number }): JSX.Element {\n const { size, style, ...rest } = props\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size ?? 14}\n height={size ?? 14}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n {...rest}\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n )\n}\n\n// \"Walk-in / enter\" glyph shown next to the no-appointment-required note.\nfunction WalkInIcon (props: React.ComponentPropsWithoutRef<'svg'> & { size?: string | number }): JSX.Element {\n const { size, style, ...rest } = props\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size ?? 14}\n height={size ?? 14}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n {...rest}\n >\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" />\n <polyline points=\"10 17 15 12 10 7\" />\n <line x1=\"15\" y1=\"12\" x2=\"3\" y2=\"12\" />\n </svg>\n )\n}\n\n/**\n * Shared toggle row for secondary addons and variant-level add-ons.\n *\n * @param props - component props\n * @param props.label - the toggle label\n * @param props.question - user-facing question / hint below the label\n * @param props.checked - controlled checked state\n * @param props.onChange - called with the next checked state\n * @returns the toggle element\n */\nfunction ToggleRow ({ label, question, checked, onChange }: {\n readonly label: string\n readonly question?: string\n readonly checked: boolean\n readonly onChange: (checked: boolean) => void\n}): JSX.Element {\n return (\n <Switch\n checked={checked}\n onChange={(e) => onChange(e.currentTarget.checked)}\n size=\"xs\"\n label={\n <span>\n <Text component=\"span\" size=\"xs\" fw={500} style={{ display: 'block' }}>\n {label}\n </Text>\n {question && (\n <Text component=\"span\" size=\"xs\" c=\"dimmed\" style={{ display: 'block' }}>\n {question}\n </Text>\n )}\n </span>\n }\n styles={{\n root: { cursor: 'pointer' },\n track: { cursor: 'pointer' },\n label: { cursor: 'pointer', paddingLeft: 6 },\n }}\n />\n )\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport function HealthcareServiceCard ({\n name,\n specialty,\n badge,\n appointmentRequired,\n closable = false,\n onClose,\n actions,\n protocolSelection,\n onProtocolSelectionChange\n}: HealthcareServiceCardProps): JSX.Element {\n const handleChange = (value: string): void => {\n if (value !== protocolSelection?.actionId) {\n onProtocolSelectionChange?.({ actionId: value, addonIds: [], activityAddonIds: [] })\n }\n }\n\n const handleAddonToggle = (actionId: string, addonId: string, checked: boolean): void => {\n const current = protocolSelection?.addonIds ?? []\n const next = checked\n ? [...current, addonId]\n : current.filter((id) => id !== addonId)\n onProtocolSelectionChange?.({\n actionId,\n addonIds: next,\n activityAddonIds: protocolSelection?.activityAddonIds ?? []\n })\n }\n\n const handleActivityAddonToggle = (actionId: string, praId: string, checked: boolean): void => {\n const current = protocolSelection?.activityAddonIds ?? []\n const next = checked\n ? [...current, praId]\n : current.filter((id) => id !== praId)\n onProtocolSelectionChange?.({\n actionId,\n addonIds: protocolSelection?.addonIds ?? [],\n activityAddonIds: next\n })\n }\n\n /**\n * The toggle block for one selected action: optional secondary addons\n * first, then the action's optional variant-level add-ons.\n *\n * @param action - the selected action\n * @returns the toggle rows, or null when the action offers nothing\n */\n const renderToggles = (action: HealthcareServiceAction): JSX.Element | null => {\n const addons = (action.addons ?? []).filter((a) => !a.mandatory)\n const activityAddons = (action.activityAddons ?? []).filter((a) => !a.mandatory)\n if (addons.length === 0 && activityAddons.length === 0) {\n return null\n }\n const isSelected = protocolSelection?.actionId === action.id\n const selectedAddons = isSelected ? protocolSelection?.addonIds ?? [] : []\n const selectedActivityAddons = isSelected ? protocolSelection?.activityAddonIds ?? [] : []\n return (\n <Stack gap={2}>\n {addons.map((addon) => (\n <ToggleRow\n key={addon.id}\n label={addon.label}\n question={addon.question}\n checked={selectedAddons.includes(addon.id)}\n onChange={(checked) => handleAddonToggle(action.id, addon.id, checked)}\n />\n ))}\n {activityAddons.map((addon) => (\n <ToggleRow\n key={`activity-${addon.praId}`}\n label={addon.label}\n question={addon.question}\n checked={selectedActivityAddons.includes(addon.praId)}\n onChange={(checked) => handleActivityAddonToggle(action.id, addon.praId, checked)}\n />\n ))}\n </Stack>\n )\n }\n\n return (\n <Card withBorder radius=\"md\" padding=\"lg\">\n <Stack gap=\"sm\">\n {/* Header: name + optional close; specialty + optional badge below */}\n <Stack gap={4}>\n {appointmentRequired === false && (\n <Badge\n variant=\"light\"\n color=\"teal\"\n radius=\"sm\"\n size=\"sm\"\n leftSection={<WalkInIcon size={12} style={{ display: 'block' }} />}\n style={{ alignSelf: 'flex-start' }}\n >\n No requiere turno\n </Badge>\n )}\n <Group justify=\"space-between\" wrap=\"nowrap\" align=\"flex-start\" gap=\"xs\">\n <Text fw={700} size=\"lg\" style={{ flex: 1, minWidth: 0, lineHeight: 1.2 }}>{name}</Text>\n {closable && (\n <CloseButton\n onClick={onClose}\n size=\"sm\"\n c=\"red\"\n aria-label=\"Quitar\"\n style={{ flexShrink: 0 }}\n />\n )}\n </Group>\n {(specialty || badge) && (\n <Group gap={6} wrap=\"wrap\">\n {specialty && (\n <Badge variant=\"light\" color=\"blue\" radius=\"sm\" size=\"sm\">\n {specialty}\n </Badge>\n )}\n {badge}\n </Group>\n )}\n </Stack>\n\n {/* Action variants */}\n {actions.length === 1 && (() => {\n const action = actions[0]\n const toggles = renderToggles(action)\n return (\n <Stack gap={4}>\n <Group gap=\"sm\" wrap=\"nowrap\" align=\"flex-start\">\n <Text component=\"span\" size=\"sm\" c=\"dark\" style={{ flex: 1, minWidth: 0, display: 'block' }}>{action.label}</Text>\n </Group>\n {action.question && (\n <Text component=\"span\" size=\"xs\" c=\"dimmed\" style={{ display: 'block' }}>{action.question}</Text>\n )}\n {toggles}\n </Stack>\n )\n })()}\n {actions.length > 1 && (\n <Radio.Group value={protocolSelection?.actionId ?? null} onChange={handleChange}>\n <Stack gap={6}>\n {actions.map((action) => {\n const isSelected = action.id === protocolSelection?.actionId\n const toggles = isSelected ? renderToggles(action) : null\n return (\n <Stack key={action.id} gap={0}>\n <Radio.Card\n value={action.id}\n radius=\"md\"\n p=\"xs\"\n withBorder\n style={{\n cursor: 'pointer',\n borderColor: isSelected\n ? 'var(--mantine-color-blue-4)'\n : 'var(--mantine-color-gray-2)',\n backgroundColor: isSelected\n ? 'var(--mantine-color-white)'\n : 'var(--mantine-color-gray-0)',\n }}\n >\n <Stack gap={2}>\n <Group gap=\"sm\" wrap=\"nowrap\" align=\"flex-start\">\n <Radio.Indicator\n icon={CheckIcon}\n size=\"xs\"\n style={{ flexShrink: 0 }}\n />\n <Text component=\"span\" size=\"sm\" c=\"dark\" style={{ flex: 1, minWidth: 0, display: 'block' }}>{action.label}</Text>\n </Group>\n {action.question && (\n <Text component=\"span\" size=\"xs\" c=\"dimmed\" ml={28} style={{ display: 'block' }}>{action.question}</Text>\n )}\n </Stack>\n\n {/* Toggles (secondary addons + variant add-ons) — inside the selected card */}\n {toggles && (\n <Stack gap={2} mt={6} ml={28}>\n {toggles}\n </Stack>\n )}\n </Radio.Card>\n </Stack>\n )\n })}\n </Stack>\n </Radio.Group>\n )}\n </Stack>\n </Card>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HealthcareServiceCard.js","sourceRoot":"","sources":["../../src/HealthcareServiceCard/HealthcareServiceCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAGhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA;AA+FnF,gFAAgF;AAEhF,SAAS,SAAS,CAAE,KAAyE;IAC3F,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IACtC,OAAO,CACL,cACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EACjB,MAAM,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAClB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,CAAC,EACd,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,KAAK,EAAE,KAAK,KACR,IAAI,YAER,mBAAU,MAAM,EAAC,gBAAgB,GAAG,GAChC,CACP,CAAA;AACH,CAAC;AAED,0EAA0E;AAC1E,SAAS,UAAU,CAAE,KAAyE;IAC5F,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IACtC,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EACjB,MAAM,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAClB,OAAO,EAAC,WA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CloseButton, Group, Radio, Stack, Switch, Text } from '@mantine/core'\nimport type { Duration } from '@medplum/fhirtypes'\nimport React, { type JSX, type ReactNode } from 'react'\nimport { getBookingOutcomeDisplay } from '../booking-outcome/bookingOutcomeDisplay'\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\n/** A single protocol action entry to display in the card. */\nexport interface HealthcareServiceAction {\n /** Unique identifier for this action. */\n readonly id: string\n /** Display label for the action (e.g. \"Helicoidal\"). */\n readonly label: string\n /** User-facing question / hint for this action. */\n readonly question?: string\n /**\n * FHIR Duration for this action. Currently NOT rendered: durations sourced\n * from PlanDefinition don't reflect real study times. Kept in the contract\n * so callers keep passing it and rendering can be re-enabled later.\n */\n readonly duration?: Duration\n /**\n * Only meaningful on addon entries. When `true`, the addon is always\n * included with its parent action and is hidden from the card UI — the\n * caller must still resolve and persist it server-side.\n */\n readonly mandatory?: boolean\n /** Optional addons (sub-actions with `any` selection — secondary prácticas). */\n readonly addons?: readonly HealthcareServiceAction[]\n /**\n * The action's variant-level add-ons (tipo-3 ActivityDefinitions). Optional\n * ones render as toggles after the secondary addons; mandatory ones are\n * hidden from the card UI (always included, resolved server-side).\n */\n readonly activityAddons?: readonly HealthcareServiceActivityAddon[]\n}\n\n/** A variant-level add-on (tipo 3) offered or implied by an action. */\nexport interface HealthcareServiceActivityAddon {\n /** EGES pra_id identifying the add-on práctica. */\n readonly praId: string\n /** Display label for the add-on. */\n readonly label: string\n /** User-facing question / hint for this add-on. */\n readonly question?: string\n /**\n * When `true`, the add-on is always included with its action and is hidden\n * from the card UI — the caller must still resolve it server-side.\n */\n readonly mandatory?: boolean\n}\n\nexport interface HealthcareServiceCardProps {\n /** Service display name. */\n readonly name: string\n /** Specialty display name (shown as a badge). */\n readonly specialty?: string\n /** Optional custom badge rendered inline next to the service name. */\n readonly badge?: ReactNode\n /**\n * Whether the study requires an appointment. When explicitly `false`, a\n * \"No requiere turno\" (walk-in) badge is shown. `undefined`/`true` renders\n * nothing. Mirrors `HealthcareService.appointmentRequired`.\n *\n * @deprecated Prefer {@link bookingOutcome}. Kept only as a fallback,\n * rendered exclusively when `bookingOutcome` is `undefined`.\n */\n readonly appointmentRequired?: boolean\n /**\n * Resolved booking outcome for the study (walk-in / contact / email), as\n * produced by `readBookingOutcome` in `@fuego-systems/core`. When set, it\n * always takes precedence over {@link appointmentRequired} and the card\n * renders the corresponding badge — a channel row is added for `contact`\n * and `email`. The card never re-derives outcome precedence itself; that\n * lives in `readBookingOutcome`.\n */\n readonly bookingOutcome?: BookingOutcome\n /** Whether to render a close button in the top-right corner. Defaults to false. */\n readonly closable?: boolean\n /** Callback invoked when the close button is clicked. Only relevant when `closable` is true. */\n readonly onClose?: () => void\n /** Protocol action variants the user can choose from. */\n readonly actions: readonly HealthcareServiceAction[]\n /** Current controlled selection for the chosen action and enabled addons. */\n readonly protocolSelection?: HealthcareServiceProtocolSelection\n /** Called whenever the controlled protocol selection changes. */\n readonly onProtocolSelectionChange?: (protocolSelection: HealthcareServiceProtocolSelection) => void\n}\n\nexport interface HealthcareServiceProtocolSelection {\n /** The `action.id` of the chosen top-level action. */\n readonly actionId: string\n /** The `action.id`s of toggled-on addon sub-actions within the selected action. */\n readonly addonIds?: readonly string[]\n /** The pra_ids of toggled-on variant-level add-ons within the selected action. */\n readonly activityAddonIds?: readonly string[]\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\nfunction CheckIcon (props: React.ComponentPropsWithoutRef<'svg'> & { size?: string | number }): JSX.Element {\n const { size, style, ...rest } = props\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size ?? 14}\n height={size ?? 14}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n {...rest}\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n )\n}\n\n// \"Walk-in / enter\" glyph shown next to the no-appointment-required note.\nfunction WalkInIcon (props: React.ComponentPropsWithoutRef<'svg'> & { size?: string | number }): JSX.Element {\n const { size, style, ...rest } = props\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size ?? 14}\n height={size ?? 14}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n {...rest}\n >\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" />\n <polyline points=\"10 17 15 12 10 7\" />\n <line x1=\"15\" y1=\"12\" x2=\"3\" y2=\"12\" />\n </svg>\n )\n}\n\n// Phone/contact glyph shown next to the \"coordinate by contact\" badge.\nfunction ContactIcon (props: React.ComponentPropsWithoutRef<'svg'> & { size?: string | number }): JSX.Element {\n const { size, style, ...rest } = props\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size ?? 14}\n height={size ?? 14}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n {...rest}\n >\n <path d=\"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z\" />\n </svg>\n )\n}\n\n// Envelope glyph shown next to the \"request by e-mail\" badge.\nfunction EmailIcon (props: React.ComponentPropsWithoutRef<'svg'> & { size?: string | number }): JSX.Element {\n const { size, style, ...rest } = props\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size ?? 14}\n height={size ?? 14}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n {...rest}\n >\n <path d=\"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z\" />\n <polyline points=\"22 6 12 13 2 6\" />\n </svg>\n )\n}\n\n/**\n * The teal \"No requiere turno\" badge, shared by the `walk-in` outcome and\n * the deprecated `appointmentRequired` fallback.\n *\n * @returns the badge element\n */\nfunction WalkInBadge (): JSX.Element {\n const { color, label } = getBookingOutcomeDisplay('walk-in')\n return (\n <Badge\n variant=\"light\"\n color={color}\n radius=\"sm\"\n size=\"sm\"\n leftSection={<WalkInIcon size={12} style={{ display: 'block' }} />}\n style={{ alignSelf: 'flex-start' }}\n >\n {label}\n </Badge>\n )\n}\n\n/**\n * Shared toggle row for secondary addons and variant-level add-ons.\n *\n * @param props - component props\n * @param props.label - the toggle label\n * @param props.question - user-facing question / hint below the label\n * @param props.checked - controlled checked state\n * @param props.onChange - called with the next checked state\n * @returns the toggle element\n */\nfunction ToggleRow ({ label, question, checked, onChange }: {\n readonly label: string\n readonly question?: string\n readonly checked: boolean\n readonly onChange: (checked: boolean) => void\n}): JSX.Element {\n return (\n <Switch\n checked={checked}\n onChange={(e) => onChange(e.currentTarget.checked)}\n size=\"xs\"\n label={\n <span>\n <Text component=\"span\" size=\"xs\" fw={500} style={{ display: 'block' }}>\n {label}\n </Text>\n {question && (\n <Text component=\"span\" size=\"xs\" c=\"dimmed\" style={{ display: 'block' }}>\n {question}\n </Text>\n )}\n </span>\n }\n styles={{\n root: { cursor: 'pointer' },\n track: { cursor: 'pointer' },\n label: { cursor: 'pointer', paddingLeft: 6 },\n }}\n />\n )\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport function HealthcareServiceCard ({\n name,\n specialty,\n badge,\n appointmentRequired,\n bookingOutcome,\n closable = false,\n onClose,\n actions,\n protocolSelection,\n onProtocolSelectionChange\n}: HealthcareServiceCardProps): JSX.Element {\n const handleChange = (value: string): void => {\n if (value !== protocolSelection?.actionId) {\n onProtocolSelectionChange?.({ actionId: value, addonIds: [], activityAddonIds: [] })\n }\n }\n\n const handleAddonToggle = (actionId: string, addonId: string, checked: boolean): void => {\n const current = protocolSelection?.addonIds ?? []\n const next = checked\n ? [...current, addonId]\n : current.filter((id) => id !== addonId)\n onProtocolSelectionChange?.({\n actionId,\n addonIds: next,\n activityAddonIds: protocolSelection?.activityAddonIds ?? []\n })\n }\n\n const handleActivityAddonToggle = (actionId: string, praId: string, checked: boolean): void => {\n const current = protocolSelection?.activityAddonIds ?? []\n const next = checked\n ? [...current, praId]\n : current.filter((id) => id !== praId)\n onProtocolSelectionChange?.({\n actionId,\n addonIds: protocolSelection?.addonIds ?? [],\n activityAddonIds: next\n })\n }\n\n /**\n * The booking-outcome badge shown above the service name: `bookingOutcome`\n * always wins when set (walk-in renders the same teal badge as the\n * fallback; `contact`/`email` render their own badge), falling back to the\n * deprecated `appointmentRequired` only when `bookingOutcome` is\n * `undefined`. Never renders more than one badge.\n *\n * The card shows the outcome only, never the channel value: the channel is\n * an action (open WhatsApp, copy an address) and belongs to the surface\n * that owns the interaction, not to this presentational card.\n *\n * @returns the badge, or null when neither prop applies\n */\n const renderOutcomeBadge = (): JSX.Element | null => {\n if (bookingOutcome !== undefined) {\n if (bookingOutcome.type === 'walk-in') {\n return <WalkInBadge />\n }\n\n const isContact = bookingOutcome.type === 'contact'\n const { color, label } = getBookingOutcomeDisplay(bookingOutcome.type)\n return (\n <Badge\n variant=\"light\"\n color={color}\n radius=\"sm\"\n size=\"sm\"\n leftSection={\n isContact\n ? <ContactIcon size={12} style={{ display: 'block' }} />\n : <EmailIcon size={12} style={{ display: 'block' }} />\n }\n style={{ alignSelf: 'flex-start' }}\n >\n {label}\n </Badge>\n )\n }\n\n if (appointmentRequired === false) {\n return <WalkInBadge />\n }\n\n return null\n }\n\n /**\n * The toggle block for one selected action: optional secondary addons\n * first, then the action's optional variant-level add-ons.\n *\n * @param action - the selected action\n * @returns the toggle rows, or null when the action offers nothing\n */\n const renderToggles = (action: HealthcareServiceAction): JSX.Element | null => {\n const addons = (action.addons ?? []).filter((a) => !a.mandatory)\n const activityAddons = (action.activityAddons ?? []).filter((a) => !a.mandatory)\n if (addons.length === 0 && activityAddons.length === 0) {\n return null\n }\n const isSelected = protocolSelection?.actionId === action.id\n const selectedAddons = isSelected ? protocolSelection?.addonIds ?? [] : []\n const selectedActivityAddons = isSelected ? protocolSelection?.activityAddonIds ?? [] : []\n return (\n <Stack gap={2}>\n {addons.map((addon) => (\n <ToggleRow\n key={addon.id}\n label={addon.label}\n question={addon.question}\n checked={selectedAddons.includes(addon.id)}\n onChange={(checked) => handleAddonToggle(action.id, addon.id, checked)}\n />\n ))}\n {activityAddons.map((addon) => (\n <ToggleRow\n key={`activity-${addon.praId}`}\n label={addon.label}\n question={addon.question}\n checked={selectedActivityAddons.includes(addon.praId)}\n onChange={(checked) => handleActivityAddonToggle(action.id, addon.praId, checked)}\n />\n ))}\n </Stack>\n )\n }\n\n const outcomeBadge = renderOutcomeBadge()\n\n return (\n <Card withBorder radius=\"md\" padding=\"lg\">\n <Stack gap=\"sm\">\n {/* Header: the outcome badge sits alone on top, then the name with the\n specialty as quiet text right under it. Keeping the specialty out of\n a badge leaves the name as the only strong element in the block, so\n it is not squeezed between two coloured chips. */}\n <Stack gap={4}>\n {outcomeBadge !== null && <Box mb={6}>{outcomeBadge}</Box>}\n <Group justify=\"space-between\" wrap=\"nowrap\" align=\"flex-start\" gap=\"xs\">\n <Stack gap={2} style={{ flex: 1, minWidth: 0 }}>\n <Text fw={700} size=\"lg\" style={{ lineHeight: 1.2 }}>{name}</Text>\n {specialty && (\n <Text size=\"xs\" c=\"dimmed\" fw={600} tt=\"uppercase\" style={{ lineHeight: 1.2 }}>\n {specialty}\n </Text>\n )}\n </Stack>\n {closable && (\n <CloseButton\n onClick={onClose}\n size=\"sm\"\n c=\"red\"\n aria-label=\"Quitar\"\n style={{ flexShrink: 0 }}\n />\n )}\n </Group>\n {badge && (\n <Group gap={6} wrap=\"wrap\">\n {badge}\n </Group>\n )}\n </Stack>\n\n {/* Action variants */}\n {actions.length === 1 && (() => {\n const action = actions[0]\n const toggles = renderToggles(action)\n return (\n <Stack gap={4}>\n <Group gap=\"sm\" wrap=\"nowrap\" align=\"flex-start\">\n <Text component=\"span\" size=\"sm\" c=\"dark\" style={{ flex: 1, minWidth: 0, display: 'block' }}>{action.label}</Text>\n </Group>\n {action.question && (\n <Text component=\"span\" size=\"xs\" c=\"dimmed\" style={{ display: 'block' }}>{action.question}</Text>\n )}\n {toggles}\n </Stack>\n )\n })()}\n {actions.length > 1 && (\n <Radio.Group value={protocolSelection?.actionId ?? null} onChange={handleChange}>\n <Stack gap={6}>\n {actions.map((action) => {\n const isSelected = action.id === protocolSelection?.actionId\n const toggles = isSelected ? renderToggles(action) : null\n return (\n <Stack key={action.id} gap={0}>\n <Radio.Card\n value={action.id}\n radius=\"md\"\n p=\"xs\"\n withBorder\n style={{\n cursor: 'pointer',\n borderColor: isSelected\n ? 'var(--mantine-color-blue-4)'\n : 'var(--mantine-color-gray-2)',\n backgroundColor: isSelected\n ? 'var(--mantine-color-white)'\n : 'var(--mantine-color-gray-0)',\n }}\n >\n <Stack gap={2}>\n <Group gap=\"sm\" wrap=\"nowrap\" align=\"flex-start\">\n <Radio.Indicator\n icon={CheckIcon}\n size=\"xs\"\n style={{ flexShrink: 0 }}\n />\n <Text component=\"span\" size=\"sm\" c=\"dark\" style={{ flex: 1, minWidth: 0, display: 'block' }}>{action.label}</Text>\n </Group>\n {action.question && (\n <Text component=\"span\" size=\"xs\" c=\"dimmed\" ml={28} style={{ display: 'block' }}>{action.question}</Text>\n )}\n </Stack>\n\n {/* Toggles (secondary addons + variant add-ons) — inside the selected card */}\n {toggles && (\n <Stack gap={2} mt={6} ml={28}>\n {toggles}\n </Stack>\n )}\n </Radio.Card>\n </Stack>\n )\n })}\n </Stack>\n </Radio.Group>\n )}\n </Stack>\n </Card>\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthcareServiceDirectory.d.ts","sourceRoot":"","sources":["../../src/HealthcareServiceDirectory/HealthcareServiceDirectory.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HealthcareServiceDirectory.d.ts","sourceRoot":"","sources":["../../src/HealthcareServiceDirectory/HealthcareServiceDirectory.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAA6C,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAK3F,MAAM,WAAW,+BAA+B;IAC9C,oFAAoF;IACpF,QAAQ,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;IAC1D,6CAA6C;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1C,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACxD,sGAAsG;IACtG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,KAAK,SAAS,CAAA;IACrF,iFAAiF;IACjF,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAA;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAA;IACjC,mFAAmF;IACnF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAC5B;AA0ED,wBAAgB,0BAA0B,CAAC,EACzC,aAAa,EACb,WAAW,EACX,QAAQ,EACR,aAAa,EACb,UAAU,EACV,YAAY,EACZ,MAAM,GACP,EAAE,+BAA+B,GAAG,GAAG,CAAC,OAAO,CAyG/C"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { readBookingOutcome } from '@fuego-systems/core';
|
|
2
3
|
import { Accordion, ActionIcon, Alert, Badge, Group, Loader, Stack, Text, } from '@mantine/core';
|
|
3
4
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
+
import { getBookingOutcomeDisplay } from '../booking-outcome/bookingOutcomeDisplay';
|
|
4
6
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
5
7
|
function getSpecialty(hs) {
|
|
6
8
|
var _a, _b, _c, _d, _e;
|
|
@@ -92,7 +94,9 @@ function ServiceList({ services, selectedIds, onSelect, renderService, selectIco
|
|
|
92
94
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
93
95
|
const id = (_a = hs.id) !== null && _a !== void 0 ? _a : '';
|
|
94
96
|
const selected = (_b = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.has(id)) !== null && _b !== void 0 ? _b : false;
|
|
95
|
-
|
|
97
|
+
const outcome = readBookingOutcome(hs);
|
|
98
|
+
const outcomeDisplay = outcome !== undefined ? getBookingOutcomeDisplay(outcome.type) : undefined;
|
|
99
|
+
return (_jsxs(Group, { justify: "space-between", wrap: "nowrap", py: 4, children: [renderService ? (renderService(hs, selected)) : (_jsxs(Stack, { gap: 2, children: [_jsx(Text, { size: "sm", children: (_c = hs.name) !== null && _c !== void 0 ? _c : id }), _jsxs(Group, { gap: 6, wrap: "wrap", children: [((_g = (_f = (_e = (_d = hs.category) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.coding) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.display) && (_jsx(Text, { size: "xs", c: "dimmed", children: hs.category[0].coding[0].display })), outcomeDisplay && (_jsx(Badge, { variant: "light", color: outcomeDisplay.color, radius: "sm", size: "xs", children: outcomeDisplay.label }))] })] })), _jsx(ActionIcon, { variant: selected ? 'filled' : 'light', color: selected ? 'green' : 'blue', onClick: () => onSelect(hs), disabled: selected, children: selected
|
|
96
100
|
? (selectedIcon !== null && selectedIcon !== void 0 ? selectedIcon : _jsx(CheckIcon, {}))
|
|
97
101
|
: (selectIcon !== null && selectIcon !== void 0 ? selectIcon : _jsx(PlusIcon, {})) })] }, id));
|
|
98
102
|
}) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthcareServiceDirectory.js","sourceRoot":"","sources":["../../src/HealthcareServiceDirectory/HealthcareServiceDirectory.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,GACL,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAA4B,MAAM,OAAO,CAAA;AA+B3F,gFAAgF;AAEhF,SAAS,YAAY,CAAC,EAAqB;;IACzC,OAAO,MAAA,MAAA,MAAA,MAAA,MAAA,EAAE,CAAC,SAAS,0CAAG,CAAC,CAAC,0CAAE,MAAM,0CAAG,CAAC,CAAC,0CAAE,OAAO,mCAAI,OAAO,CAAA;AAC3D,CAAC;AAED,SAAS,WAAW,CAAC,EAAqB;;IACxC,OAAO,MAAA,MAAA,MAAA,MAAA,MAAA,EAAE,CAAC,QAAQ,0CAAG,CAAC,CAAC,0CAAE,MAAM,0CAAG,CAAC,CAAC,0CAAE,OAAO,mCAAI,SAAS,CAAA;AAC5D,CAAC;AAED,SAAS,SAAS,CAAC,QAA6B;IAC9C,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4C,CAAA;IAExE,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC1B,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,CAAC,CAAA;QAClC,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;QAEhC,IAA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AK,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,kCAEjD,CACT,IACK,IACF,CACT,EACD,KAAC,UAAU,IACT,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EACtC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAC3B,QAAQ,EAAE,QAAQ,YAEjB,QAAQ;4BACP,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAC,SAAS,KAAG,CAAC;4BACjC,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,KAAC,QAAQ,KAAG,CAAC,GACrB,KA7BH,EAAE,CA8BN,CACT,CAAA;QACH,CAAC,CAAC,GACI,CACT,CAAA;AACH,CAAC","sourcesContent":["import {\n Accordion,\n ActionIcon,\n Alert,\n Badge,\n Group,\n Loader,\n Stack,\n Text,\n} from '@mantine/core'\nimport type { HealthcareService } from '@medplum/fhirtypes'\nimport { useCallback, useEffect, useMemo, useState, type JSX, type ReactNode } from 'react'\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\nexport interface HealthcareServiceDirectoryProps {\n /** Function that fetches all HealthcareService resources to display in the tree. */\n readonly fetchServices: () => Promise<HealthcareService[]>\n /** Set of currently selected service IDs. */\n readonly selectedIds?: ReadonlySet<string>\n /** Called when the user clicks on a service to select it. */\n readonly onSelect?: (service: HealthcareService) => void\n /** Optional custom renderer for each service row. Receives the service and whether it is selected. */\n readonly renderService?: (service: HealthcareService, selected: boolean) => ReactNode\n /** Icon element for the select button when unselected. Defaults to a \"+\" SVG. */\n readonly selectIcon?: ReactNode\n /** Icon element for the select button when selected. Defaults to a check SVG. */\n readonly selectedIcon?: ReactNode\n /** Content to show at the bottom of the directory (e.g. fallback/contact info). */\n readonly footer?: ReactNode\n}\n\ninterface TreeCategory {\n name: string\n children: TreeSubcategory[]\n}\n\ninterface TreeSubcategory {\n name: string\n services: HealthcareService[]\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\nfunction getSpecialty(hs: HealthcareService): string {\n return hs.specialty?.[0]?.coding?.[0]?.display ?? 'Otros'\n}\n\nfunction getCategory(hs: HealthcareService): string {\n return hs.category?.[0]?.coding?.[0]?.display ?? 'General'\n}\n\nfunction buildTree(services: HealthcareService[]): TreeCategory[] {\n const specialtyMap = new Map<string, Map<string, HealthcareService[]>>()\n\n for (const hs of services) {\n const specialty = getSpecialty(hs)\n const category = getCategory(hs)\n\n let catMap = specialtyMap.get(specialty)\n if (!catMap) {\n catMap = new Map()\n specialtyMap.set(specialty, catMap)\n }\n\n let list = catMap.get(category)\n if (!list) {\n list = []\n catMap.set(category, list)\n }\n list.push(hs)\n }\n\n const tree: TreeCategory[] = []\n for (const [specialty, catMap] of specialtyMap) {\n const children: TreeSubcategory[] = []\n for (const [category, svcs] of catMap) {\n children.push({ name: category, services: svcs })\n }\n tree.push({ name: specialty, children })\n }\n\n return tree\n}\n\nfunction PlusIcon(): JSX.Element {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n )\n}\n\nfunction CheckIcon(): JSX.Element {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n )\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport function HealthcareServiceDirectory({\n fetchServices,\n selectedIds,\n onSelect,\n renderService,\n selectIcon,\n selectedIcon,\n footer,\n}: HealthcareServiceDirectoryProps): JSX.Element {\n const [services, setServices] = useState<HealthcareService[]>([])\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string>()\n\n useEffect(() => {\n let cancelled = false\n setLoading(true)\n setError(undefined)\n\n fetchServices()\n .then((result) => {\n if (!cancelled) {\n setServices(result)\n }\n })\n .catch((err) => {\n if (!cancelled) {\n setError(err instanceof Error ? err.message : String(err))\n }\n })\n .finally(() => {\n if (!cancelled) {\n setLoading(false)\n }\n })\n\n return () => { cancelled = true }\n }, [fetchServices])\n\n const tree = useMemo(() => buildTree(services), [services])\n\n const handleSelect = useCallback(\n (hs: HealthcareService) => {\n if (selectedIds?.has(hs.id ?? '')) {\n return\n }\n onSelect?.(hs)\n },\n [selectedIds, onSelect]\n )\n\n if (loading) {\n return (\n <Stack align=\"center\" py=\"xl\">\n <Loader size=\"md\" />\n </Stack>\n )\n }\n\n if (error) {\n return (\n <Alert color=\"red\" title=\"Error\">\n {error}\n </Alert>\n )\n }\n\n return (\n <Stack gap=\"md\">\n <Accordion variant=\"separated\">\n {tree.map((specialty) => (\n <Accordion.Item key={specialty.name} value={specialty.name}>\n <Accordion.Control>\n <Text fw={500}>{specialty.name}</Text>\n </Accordion.Control>\n <Accordion.Panel>\n {specialty.children.length === 1 ? (\n <ServiceList\n services={specialty.children[0].services}\n selectedIds={selectedIds}\n onSelect={handleSelect}\n renderService={renderService}\n selectIcon={selectIcon}\n selectedIcon={selectedIcon}\n />\n ) : (\n <Accordion variant=\"default\">\n {specialty.children.map((sub) => (\n <Accordion.Item key={sub.name} value={sub.name}>\n <Accordion.Control>\n <Text size=\"sm\">{sub.name}</Text>\n </Accordion.Control>\n <Accordion.Panel>\n <ServiceList\n services={sub.services}\n selectedIds={selectedIds}\n onSelect={handleSelect}\n renderService={renderService}\n selectIcon={selectIcon}\n selectedIcon={selectedIcon}\n />\n </Accordion.Panel>\n </Accordion.Item>\n ))}\n </Accordion>\n )}\n </Accordion.Panel>\n </Accordion.Item>\n ))}\n </Accordion>\n\n {footer}\n </Stack>\n )\n}\n\n// ─── ServiceList ─────────────────────────────────────────────────────────────\n\nfunction ServiceList({\n services,\n selectedIds,\n onSelect,\n renderService,\n selectIcon,\n selectedIcon,\n}: {\n services: HealthcareService[]\n selectedIds?: ReadonlySet<string>\n onSelect: (hs: HealthcareService) => void\n renderService?: (hs: HealthcareService, selected: boolean) => ReactNode\n selectIcon?: ReactNode\n selectedIcon?: ReactNode\n}): JSX.Element {\n return (\n <Stack gap=\"xs\">\n {services.map((hs) => {\n const id = hs.id ?? ''\n const selected = selectedIds?.has(id) ?? false\n return (\n <Group key={id} justify=\"space-between\" wrap=\"nowrap\" py={4}>\n {renderService ? (\n renderService(hs, selected)\n ) : (\n <Stack gap={2}>\n <Text size=\"sm\">{hs.name ?? id}</Text>\n <Group gap={6} wrap=\"wrap\">\n {hs.category?.[0]?.coding?.[0]?.display && (\n <Text size=\"xs\" c=\"dimmed\">\n {hs.category[0].coding[0].display}\n </Text>\n )}\n {hs.appointmentRequired === false && (\n <Badge variant=\"light\" color=\"teal\" radius=\"sm\" size=\"xs\">\n No requiere turno\n </Badge>\n )}\n </Group>\n </Stack>\n )}\n <ActionIcon\n variant={selected ? 'filled' : 'light'}\n color={selected ? 'green' : 'blue'}\n onClick={() => onSelect(hs)}\n disabled={selected}\n >\n {selected\n ? (selectedIcon ?? <CheckIcon />)\n : (selectIcon ?? <PlusIcon />)}\n </ActionIcon>\n </Group>\n )\n })}\n </Stack>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HealthcareServiceDirectory.js","sourceRoot":"","sources":["../../src/HealthcareServiceDirectory/HealthcareServiceDirectory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EACL,SAAS,EACT,U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AAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EACtC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAC3B,QAAQ,EAAE,QAAQ,YAEjB,QAAQ;4BACP,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAC,SAAS,KAAG,CAAC;4BACjC,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,KAAC,QAAQ,KAAG,CAAC,GACrB,KA7BH,EAAE,CA8BN,CACT,CAAA;QACH,CAAC,CAAC,GACI,CACT,CAAA;AACH,CAAC","sourcesContent":["import { readBookingOutcome } from '@fuego-systems/core'\nimport {\n Accordion,\n ActionIcon,\n Alert,\n Badge,\n Group,\n Loader,\n Stack,\n Text,\n} from '@mantine/core'\nimport type { HealthcareService } from '@medplum/fhirtypes'\nimport { useCallback, useEffect, useMemo, useState, type JSX, type ReactNode } from 'react'\nimport { getBookingOutcomeDisplay } from '../booking-outcome/bookingOutcomeDisplay'\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\nexport interface HealthcareServiceDirectoryProps {\n /** Function that fetches all HealthcareService resources to display in the tree. */\n readonly fetchServices: () => Promise<HealthcareService[]>\n /** Set of currently selected service IDs. */\n readonly selectedIds?: ReadonlySet<string>\n /** Called when the user clicks on a service to select it. */\n readonly onSelect?: (service: HealthcareService) => void\n /** Optional custom renderer for each service row. Receives the service and whether it is selected. */\n readonly renderService?: (service: HealthcareService, selected: boolean) => ReactNode\n /** Icon element for the select button when unselected. Defaults to a \"+\" SVG. */\n readonly selectIcon?: ReactNode\n /** Icon element for the select button when selected. Defaults to a check SVG. */\n readonly selectedIcon?: ReactNode\n /** Content to show at the bottom of the directory (e.g. fallback/contact info). */\n readonly footer?: ReactNode\n}\n\ninterface TreeCategory {\n name: string\n children: TreeSubcategory[]\n}\n\ninterface TreeSubcategory {\n name: string\n services: HealthcareService[]\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\nfunction getSpecialty(hs: HealthcareService): string {\n return hs.specialty?.[0]?.coding?.[0]?.display ?? 'Otros'\n}\n\nfunction getCategory(hs: HealthcareService): string {\n return hs.category?.[0]?.coding?.[0]?.display ?? 'General'\n}\n\nfunction buildTree(services: HealthcareService[]): TreeCategory[] {\n const specialtyMap = new Map<string, Map<string, HealthcareService[]>>()\n\n for (const hs of services) {\n const specialty = getSpecialty(hs)\n const category = getCategory(hs)\n\n let catMap = specialtyMap.get(specialty)\n if (!catMap) {\n catMap = new Map()\n specialtyMap.set(specialty, catMap)\n }\n\n let list = catMap.get(category)\n if (!list) {\n list = []\n catMap.set(category, list)\n }\n list.push(hs)\n }\n\n const tree: TreeCategory[] = []\n for (const [specialty, catMap] of specialtyMap) {\n const children: TreeSubcategory[] = []\n for (const [category, svcs] of catMap) {\n children.push({ name: category, services: svcs })\n }\n tree.push({ name: specialty, children })\n }\n\n return tree\n}\n\nfunction PlusIcon(): JSX.Element {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n )\n}\n\nfunction CheckIcon(): JSX.Element {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n )\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport function HealthcareServiceDirectory({\n fetchServices,\n selectedIds,\n onSelect,\n renderService,\n selectIcon,\n selectedIcon,\n footer,\n}: HealthcareServiceDirectoryProps): JSX.Element {\n const [services, setServices] = useState<HealthcareService[]>([])\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string>()\n\n useEffect(() => {\n let cancelled = false\n setLoading(true)\n setError(undefined)\n\n fetchServices()\n .then((result) => {\n if (!cancelled) {\n setServices(result)\n }\n })\n .catch((err) => {\n if (!cancelled) {\n setError(err instanceof Error ? err.message : String(err))\n }\n })\n .finally(() => {\n if (!cancelled) {\n setLoading(false)\n }\n })\n\n return () => { cancelled = true }\n }, [fetchServices])\n\n const tree = useMemo(() => buildTree(services), [services])\n\n const handleSelect = useCallback(\n (hs: HealthcareService) => {\n if (selectedIds?.has(hs.id ?? '')) {\n return\n }\n onSelect?.(hs)\n },\n [selectedIds, onSelect]\n )\n\n if (loading) {\n return (\n <Stack align=\"center\" py=\"xl\">\n <Loader size=\"md\" />\n </Stack>\n )\n }\n\n if (error) {\n return (\n <Alert color=\"red\" title=\"Error\">\n {error}\n </Alert>\n )\n }\n\n return (\n <Stack gap=\"md\">\n <Accordion variant=\"separated\">\n {tree.map((specialty) => (\n <Accordion.Item key={specialty.name} value={specialty.name}>\n <Accordion.Control>\n <Text fw={500}>{specialty.name}</Text>\n </Accordion.Control>\n <Accordion.Panel>\n {specialty.children.length === 1 ? (\n <ServiceList\n services={specialty.children[0].services}\n selectedIds={selectedIds}\n onSelect={handleSelect}\n renderService={renderService}\n selectIcon={selectIcon}\n selectedIcon={selectedIcon}\n />\n ) : (\n <Accordion variant=\"default\">\n {specialty.children.map((sub) => (\n <Accordion.Item key={sub.name} value={sub.name}>\n <Accordion.Control>\n <Text size=\"sm\">{sub.name}</Text>\n </Accordion.Control>\n <Accordion.Panel>\n <ServiceList\n services={sub.services}\n selectedIds={selectedIds}\n onSelect={handleSelect}\n renderService={renderService}\n selectIcon={selectIcon}\n selectedIcon={selectedIcon}\n />\n </Accordion.Panel>\n </Accordion.Item>\n ))}\n </Accordion>\n )}\n </Accordion.Panel>\n </Accordion.Item>\n ))}\n </Accordion>\n\n {footer}\n </Stack>\n )\n}\n\n// ─── ServiceList ─────────────────────────────────────────────────────────────\n\nfunction ServiceList({\n services,\n selectedIds,\n onSelect,\n renderService,\n selectIcon,\n selectedIcon,\n}: {\n services: HealthcareService[]\n selectedIds?: ReadonlySet<string>\n onSelect: (hs: HealthcareService) => void\n renderService?: (hs: HealthcareService, selected: boolean) => ReactNode\n selectIcon?: ReactNode\n selectedIcon?: ReactNode\n}): JSX.Element {\n return (\n <Stack gap=\"xs\">\n {services.map((hs) => {\n const id = hs.id ?? ''\n const selected = selectedIds?.has(id) ?? false\n const outcome = readBookingOutcome(hs)\n const outcomeDisplay = outcome !== undefined ? getBookingOutcomeDisplay(outcome.type) : undefined\n return (\n <Group key={id} justify=\"space-between\" wrap=\"nowrap\" py={4}>\n {renderService ? (\n renderService(hs, selected)\n ) : (\n <Stack gap={2}>\n <Text size=\"sm\">{hs.name ?? id}</Text>\n <Group gap={6} wrap=\"wrap\">\n {hs.category?.[0]?.coding?.[0]?.display && (\n <Text size=\"xs\" c=\"dimmed\">\n {hs.category[0].coding[0].display}\n </Text>\n )}\n {outcomeDisplay && (\n <Badge variant=\"light\" color={outcomeDisplay.color} radius=\"sm\" size=\"xs\">\n {outcomeDisplay.label}\n </Badge>\n )}\n </Group>\n </Stack>\n )}\n <ActionIcon\n variant={selected ? 'filled' : 'light'}\n color={selected ? 'green' : 'blue'}\n onClick={() => onSelect(hs)}\n disabled={selected}\n >\n {selected\n ? (selectedIcon ?? <CheckIcon />)\n : (selectIcon ?? <PlusIcon />)}\n </ActionIcon>\n </Group>\n )\n })}\n </Stack>\n )\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type BookingOutcomeType } from '@fuego-systems/core';
|
|
2
|
+
/** Mantine color name paired with the Spanish label shown for a {@link BookingOutcomeType}. */
|
|
3
|
+
export interface BookingOutcomeDisplay {
|
|
4
|
+
readonly color: 'teal' | 'orange' | 'violet';
|
|
5
|
+
readonly label: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the Mantine color and Spanish label for a booking outcome type.
|
|
9
|
+
* Shared by `HealthcareServiceCard`, `HealthcareServiceDirectory`'s default
|
|
10
|
+
* renderer and `HealthcareServiceAutocomplete`'s option renderer so the
|
|
11
|
+
* color/label mapping lives in exactly one place.
|
|
12
|
+
*
|
|
13
|
+
* @param type - the outcome type to resolve display for
|
|
14
|
+
* @returns the color + label pair
|
|
15
|
+
*/
|
|
16
|
+
export declare function getBookingOutcomeDisplay(type: BookingOutcomeType): BookingOutcomeDisplay;
|
|
17
|
+
//# sourceMappingURL=bookingOutcomeDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingOutcomeDisplay.d.ts","sourceRoot":"","sources":["../../src/booking-outcome/bookingOutcomeDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7H,+FAA+F;AAC/F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAE,IAAI,EAAE,kBAAkB,GAAG,qBAAqB,CAEzF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BOOKING_OUTCOME_CONTACT_DISPLAY, BOOKING_OUTCOME_EMAIL_DISPLAY } from '@fuego-systems/core';
|
|
2
|
+
/**
|
|
3
|
+
* Spanish label shown for the `'walk-in'` outcome. Not a core constant like
|
|
4
|
+
* the `contact`/`email` displays: `'walk-in'` has no `booking-outcome`
|
|
5
|
+
* characteristic code (it is read from `appointmentRequired === false`), so
|
|
6
|
+
* there is no coded value for core to own a display string for.
|
|
7
|
+
*/
|
|
8
|
+
const WALK_IN_LABEL = 'No requiere turno';
|
|
9
|
+
/** Color + label for each {@link BookingOutcomeType}, keyed so the mapping stays exhaustive. */
|
|
10
|
+
const DISPLAY_BY_TYPE = {
|
|
11
|
+
'walk-in': { color: 'teal', label: WALK_IN_LABEL },
|
|
12
|
+
contact: { color: 'orange', label: BOOKING_OUTCOME_CONTACT_DISPLAY },
|
|
13
|
+
email: { color: 'violet', label: BOOKING_OUTCOME_EMAIL_DISPLAY }
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the Mantine color and Spanish label for a booking outcome type.
|
|
17
|
+
* Shared by `HealthcareServiceCard`, `HealthcareServiceDirectory`'s default
|
|
18
|
+
* renderer and `HealthcareServiceAutocomplete`'s option renderer so the
|
|
19
|
+
* color/label mapping lives in exactly one place.
|
|
20
|
+
*
|
|
21
|
+
* @param type - the outcome type to resolve display for
|
|
22
|
+
* @returns the color + label pair
|
|
23
|
+
*/
|
|
24
|
+
export function getBookingOutcomeDisplay(type) {
|
|
25
|
+
return DISPLAY_BY_TYPE[type];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=bookingOutcomeDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingOutcomeDisplay.js","sourceRoot":"","sources":["../../src/booking-outcome/bookingOutcomeDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAA2B,MAAM,qBAAqB,CAAA;AAQ7H;;;;;GAKG;AACH,MAAM,aAAa,GAAG,mBAAmB,CAAA;AAEzC,gGAAgG;AAChG,MAAM,eAAe,GAAgE;IACnF,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE;IAClD,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,+BAA+B,EAAE;IACpE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,6BAA6B,EAAE;CACjE,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAE,IAAwB;IAChE,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC","sourcesContent":["import { BOOKING_OUTCOME_CONTACT_DISPLAY, BOOKING_OUTCOME_EMAIL_DISPLAY, type BookingOutcomeType } from '@fuego-systems/core'\n\n/** Mantine color name paired with the Spanish label shown for a {@link BookingOutcomeType}. */\nexport interface BookingOutcomeDisplay {\n readonly color: 'teal' | 'orange' | 'violet'\n readonly label: string\n}\n\n/**\n * Spanish label shown for the `'walk-in'` outcome. Not a core constant like\n * the `contact`/`email` displays: `'walk-in'` has no `booking-outcome`\n * characteristic code (it is read from `appointmentRequired === false`), so\n * there is no coded value for core to own a display string for.\n */\nconst WALK_IN_LABEL = 'No requiere turno'\n\n/** Color + label for each {@link BookingOutcomeType}, keyed so the mapping stays exhaustive. */\nconst DISPLAY_BY_TYPE: Readonly<Record<BookingOutcomeType, BookingOutcomeDisplay>> = {\n 'walk-in': { color: 'teal', label: WALK_IN_LABEL },\n contact: { color: 'orange', label: BOOKING_OUTCOME_CONTACT_DISPLAY },\n email: { color: 'violet', label: BOOKING_OUTCOME_EMAIL_DISPLAY }\n}\n\n/**\n * Resolves the Mantine color and Spanish label for a booking outcome type.\n * Shared by `HealthcareServiceCard`, `HealthcareServiceDirectory`'s default\n * renderer and `HealthcareServiceAutocomplete`'s option renderer so the\n * color/label mapping lives in exactly one place.\n *\n * @param type - the outcome type to resolve display for\n * @returns the color + label pair\n */\nexport function getBookingOutcomeDisplay (type: BookingOutcomeType): BookingOutcomeDisplay {\n return DISPLAY_BY_TYPE[type]\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthcareServiceAutocomplete.d.ts","sourceRoot":"","sources":["../../src/search/HealthcareServiceAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"HealthcareServiceAutocomplete.d.ts","sourceRoot":"","sources":["../../src/search/HealthcareServiceAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAGtD,OAAO,EAAE,GAAG,EAAe,MAAM,OAAO,CAAA;AAIxC,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,gBAAgB,CAAC;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAA;IACnE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CACjC;AAUD,wBAAgB,6BAA6B,CAAE,KAAK,EAAE,kCAAkC,GAAG,GAAG,CAAC,OAAO,CA2CrG"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { Badge, Box, Group, Text } from '@mantine/core';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { ContentType } from '@medplum/core';
|
|
4
3
|
import { useMedplum } from '@medplum/react';
|
|
5
4
|
import { useCallback } from 'react';
|
|
5
|
+
import { getServiceCode, renderHealthcareServiceOption } from './HealthcareServiceOption';
|
|
6
6
|
import { ServiceAutocomplete } from './ServiceAutocomplete';
|
|
7
|
-
const SERVICE_CODES_SYSTEM = 'http://fuego.health/fhir/service-codes';
|
|
8
|
-
function getServiceCode(hs) {
|
|
9
|
-
var _a, _b, _c;
|
|
10
|
-
return (_c = (_b = (_a = hs === null || hs === void 0 ? void 0 : hs.identifier) === null || _a === void 0 ? void 0 : _a.find((id) => id.system === SERVICE_CODES_SYSTEM)) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : '';
|
|
11
|
-
}
|
|
12
7
|
function getServiceId(hs) {
|
|
13
8
|
var _a;
|
|
14
9
|
return (_a = hs.id) !== null && _a !== void 0 ? _a : '';
|
|
@@ -33,11 +28,6 @@ export function HealthcareServiceAutocomplete(props) {
|
|
|
33
28
|
.map((entry) => entry.resource)
|
|
34
29
|
.filter((r) => !!r);
|
|
35
30
|
}, [medplum, count]);
|
|
36
|
-
return (_jsx(ServiceAutocomplete, { ...inputProps, searchFn: searchFn, getId: getServiceId, getLabel: getServiceLabel, getCode: getServiceCode, value: value, onChange: onChange, placeholder: placeholder, minQueryLength: minQueryLength, renderOption:
|
|
37
|
-
var _a, _b;
|
|
38
|
-
const name = (_b = (_a = hs.name) !== null && _a !== void 0 ? _a : hs.id) !== null && _b !== void 0 ? _b : '';
|
|
39
|
-
const code = getServiceCode(hs);
|
|
40
|
-
return (_jsxs(Group, { gap: "xs", wrap: "nowrap", style: { width: '100%' }, children: [_jsxs(Box, { style: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { size: "sm", fw: 500, truncate: true, children: name }), hs.active === false && (_jsx(Text, { size: "xs", c: "dimmed", children: "Inactivo" })), hs.appointmentRequired === false && (_jsx(Text, { size: "xs", c: "teal", children: "No requiere turno" }))] }), code && (_jsx(Badge, { size: "xs", variant: "light", color: "blue", style: { flexShrink: 0 }, children: code }))] }));
|
|
41
|
-
} }));
|
|
31
|
+
return (_jsx(ServiceAutocomplete, { ...inputProps, searchFn: searchFn, getId: getServiceId, getLabel: getServiceLabel, getCode: getServiceCode, value: value, onChange: onChange, placeholder: placeholder, minQueryLength: minQueryLength, renderOption: renderHealthcareServiceOption }));
|
|
42
32
|
}
|
|
43
33
|
//# sourceMappingURL=HealthcareServiceAutocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthcareServiceAutocomplete.js","sourceRoot":"","sources":["../../src/search/HealthcareServiceAutocomplete.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"HealthcareServiceAutocomplete.js","sourceRoot":"","sources":["../../src/search/HealthcareServiceAutocomplete.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAO,WAAW,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAW3D,SAAS,YAAY,CAAE,EAAqB;;IAC1C,OAAO,MAAA,EAAE,CAAC,EAAE,mCAAI,EAAE,CAAA;AACpB,CAAC;AAED,SAAS,eAAe,CAAE,EAAqB;;IAC7C,OAAO,MAAA,MAAA,EAAE,CAAC,IAAI,mCAAI,EAAE,CAAC,EAAE,mCAAI,EAAE,CAAA;AAC/B,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAE,KAAyC;IACtF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,WAAW,GAAG,oBAAoB,EAClC,KAAK,GAAG,EAAE,EACV,cAAc,GAAG,CAAC,EAClB,GAAG,UAAU,EACd,GAAG,KAAK,CAAA;IAET,MAAM,OAAO,GAAG,UAAU,EAAE,CAAA;IAE5B,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,KAAa,EAAgC,EAAE;;QACjF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAC/B,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,EACxD;YACE,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE;gBACT,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE;gBACjC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE;aACvC;SACF,EACD,WAAW,CAAC,SAAS,CACtB,CAAA;QACD,OAAO,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,EAAE,CAAC;aACzB,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,QAA6B,CAAC;aACxD,MAAM,CAAC,CAAC,CAAgC,EAA0B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9E,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;IAEpB,OAAO,CACL,KAAC,mBAAmB,OACd,UAAU,EACd,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,6BAA6B,GAC3C,CACH,CAAA;AACH,CAAC","sourcesContent":["import { AutocompleteProps } from '@mantine/core'\nimport { HealthcareService } from '@medplum/fhirtypes'\nimport { ContentType } from '@medplum/core'\nimport { useMedplum } from '@medplum/react'\nimport { JSX, useCallback } from 'react'\nimport { getServiceCode, renderHealthcareServiceOption } from './HealthcareServiceOption'\nimport { ServiceAutocomplete } from './ServiceAutocomplete'\n\nexport interface HealthcareServiceAutocompleteProps\n extends Omit<AutocompleteProps, 'data' | 'value' | 'defaultValue' | 'onChange' | 'onOptionSubmit'> {\n readonly value?: HealthcareService\n readonly onChange: (service: HealthcareService | undefined) => void\n readonly placeholder?: string\n readonly count?: number\n readonly minQueryLength?: number\n}\n\nfunction getServiceId (hs: HealthcareService): string {\n return hs.id ?? ''\n}\n\nfunction getServiceLabel (hs: HealthcareService): string {\n return hs.name ?? hs.id ?? ''\n}\n\nexport function HealthcareServiceAutocomplete (props: HealthcareServiceAutocompleteProps): JSX.Element {\n const {\n value,\n onChange,\n placeholder = 'Buscar servicio...',\n count = 20,\n minQueryLength = 2,\n ...inputProps\n } = props\n\n const medplum = useMedplum()\n\n const searchFn = useCallback(async (query: string): Promise<HealthcareService[]> => {\n const bundle = await medplum.post(\n medplum.fhirUrl('HealthcareService', '$search-services'),\n {\n resourceType: 'Parameters',\n parameter: [\n { name: 'q', valueString: query },\n { name: 'count', valueInteger: count }\n ]\n },\n ContentType.FHIR_JSON\n )\n return (bundle?.entry ?? [])\n .map((entry: any) => entry.resource as HealthcareService)\n .filter((r: HealthcareService | undefined): r is HealthcareService => !!r)\n }, [medplum, count])\n\n return (\n <ServiceAutocomplete<HealthcareService>\n {...inputProps}\n searchFn={searchFn}\n getId={getServiceId}\n getLabel={getServiceLabel}\n getCode={getServiceCode}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n minQueryLength={minQueryLength}\n renderOption={renderHealthcareServiceOption}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HealthcareService } from '@medplum/fhirtypes';
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Extracts the short service code identifier shown as a badge next to the option label.
|
|
5
|
+
*
|
|
6
|
+
* @param hs - the HealthcareService to extract the code from, if any
|
|
7
|
+
* @returns the service code, or an empty string when the service has none
|
|
8
|
+
*/
|
|
9
|
+
export declare function getServiceCode(hs: HealthcareService | undefined): string;
|
|
10
|
+
/**
|
|
11
|
+
* Renders one `HealthcareServiceAutocomplete` option row: name, "Inactivo"
|
|
12
|
+
* when `active === false`, the resolved booking outcome label (via
|
|
13
|
+
* `readBookingOutcome`) when the study is not normally bookable, and the
|
|
14
|
+
* service code badge.
|
|
15
|
+
*
|
|
16
|
+
* Kept in its own module — separate from `HealthcareServiceAutocomplete.tsx`,
|
|
17
|
+
* which imports `useMedplum` from `@medplum/react` — so it can be unit-tested
|
|
18
|
+
* without mounting a `MedplumProvider`: `@medplum/react`'s `useMedplum` pulls
|
|
19
|
+
* in `@medplum/react-hooks`, which is not installed for this package (only
|
|
20
|
+
* for `rossi-admin`/`bots`), so importing anything from
|
|
21
|
+
* `HealthcareServiceAutocomplete.tsx` fails to resolve in this package's Jest
|
|
22
|
+
* environment. See decisions.md.
|
|
23
|
+
*
|
|
24
|
+
* @param hs - the HealthcareService option to render
|
|
25
|
+
* @returns the option row element
|
|
26
|
+
*/
|
|
27
|
+
export declare function renderHealthcareServiceOption(hs: HealthcareService): JSX.Element;
|
|
28
|
+
//# sourceMappingURL=HealthcareServiceOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HealthcareServiceOption.d.ts","sourceRoot":"","sources":["../../src/search/HealthcareServiceOption.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAKhC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAE,EAAE,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAEzE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,6BAA6B,CAAE,EAAE,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAwBjF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { readBookingOutcome } from '@fuego-systems/core';
|
|
3
|
+
import { Badge, Box, Group, Text } from '@mantine/core';
|
|
4
|
+
import { getBookingOutcomeDisplay } from '../booking-outcome/bookingOutcomeDisplay';
|
|
5
|
+
const SERVICE_CODES_SYSTEM = 'http://fuego.health/fhir/service-codes';
|
|
6
|
+
/**
|
|
7
|
+
* Extracts the short service code identifier shown as a badge next to the option label.
|
|
8
|
+
*
|
|
9
|
+
* @param hs - the HealthcareService to extract the code from, if any
|
|
10
|
+
* @returns the service code, or an empty string when the service has none
|
|
11
|
+
*/
|
|
12
|
+
export function getServiceCode(hs) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
return (_c = (_b = (_a = hs === null || hs === void 0 ? void 0 : hs.identifier) === null || _a === void 0 ? void 0 : _a.find((id) => id.system === SERVICE_CODES_SYSTEM)) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : '';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders one `HealthcareServiceAutocomplete` option row: name, "Inactivo"
|
|
18
|
+
* when `active === false`, the resolved booking outcome label (via
|
|
19
|
+
* `readBookingOutcome`) when the study is not normally bookable, and the
|
|
20
|
+
* service code badge.
|
|
21
|
+
*
|
|
22
|
+
* Kept in its own module — separate from `HealthcareServiceAutocomplete.tsx`,
|
|
23
|
+
* which imports `useMedplum` from `@medplum/react` — so it can be unit-tested
|
|
24
|
+
* without mounting a `MedplumProvider`: `@medplum/react`'s `useMedplum` pulls
|
|
25
|
+
* in `@medplum/react-hooks`, which is not installed for this package (only
|
|
26
|
+
* for `rossi-admin`/`bots`), so importing anything from
|
|
27
|
+
* `HealthcareServiceAutocomplete.tsx` fails to resolve in this package's Jest
|
|
28
|
+
* environment. See decisions.md.
|
|
29
|
+
*
|
|
30
|
+
* @param hs - the HealthcareService option to render
|
|
31
|
+
* @returns the option row element
|
|
32
|
+
*/
|
|
33
|
+
export function renderHealthcareServiceOption(hs) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const name = (_b = (_a = hs.name) !== null && _a !== void 0 ? _a : hs.id) !== null && _b !== void 0 ? _b : '';
|
|
36
|
+
const code = getServiceCode(hs);
|
|
37
|
+
const outcome = readBookingOutcome(hs);
|
|
38
|
+
return (_jsxs(Group, { gap: "xs", wrap: "nowrap", style: { width: '100%' }, children: [_jsxs(Box, { style: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { size: "sm", fw: 500, truncate: true, children: name }), hs.active === false && (_jsx(Text, { size: "xs", c: "dimmed", children: "Inactivo" })), outcome !== undefined && (() => {
|
|
39
|
+
const display = getBookingOutcomeDisplay(outcome.type);
|
|
40
|
+
return _jsx(Text, { size: "xs", c: display.color, children: display.label });
|
|
41
|
+
})()] }), code && (_jsx(Badge, { size: "xs", variant: "light", color: "blue", style: { flexShrink: 0 }, children: code }))] }));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=HealthcareServiceOption.js.map
|