@fuego-systems/react 0.5.0 → 0.6.1
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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HealthcareServiceOption.js","sourceRoot":"","sources":["../../src/search/HealthcareServiceOption.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAGvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA;AAEnF,MAAM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CAAC,KAAK,GAAQ,CAAA;oBACjE,CAAC,CAAC,EAAE,IACA,EACL,IAAI,IAAI,CACP,KAAC,KAAK,IAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YACnE,IAAI,GACC,CACT,IACK,CACT,CAAA;AACH,CAAC","sourcesContent":["import { readBookingOutcome } from '@fuego-systems/core'\nimport { Badge, Box, Group, Text } from '@mantine/core'\nimport type { HealthcareService } from '@medplum/fhirtypes'\nimport type { JSX } from 'react'\nimport { getBookingOutcomeDisplay } from '../booking-outcome/bookingOutcomeDisplay'\n\nconst SERVICE_CODES_SYSTEM = 'http://fuego.health/fhir/service-codes'\n\n/**\n * Extracts the short service code identifier shown as a badge next to the option label.\n *\n * @param hs - the HealthcareService to extract the code from, if any\n * @returns the service code, or an empty string when the service has none\n */\nexport function getServiceCode (hs: HealthcareService | undefined): string {\n return hs?.identifier?.find((id) => id.system === SERVICE_CODES_SYSTEM)?.value ?? ''\n}\n\n/**\n * Renders one `HealthcareServiceAutocomplete` option row: name, \"Inactivo\"\n * when `active === false`, the resolved booking outcome label (via\n * `readBookingOutcome`) when the study is not normally bookable, and the\n * service code badge.\n *\n * Kept in its own module — separate from `HealthcareServiceAutocomplete.tsx`,\n * which imports `useMedplum` from `@medplum/react` — so it can be unit-tested\n * without mounting a `MedplumProvider`: `@medplum/react`'s `useMedplum` pulls\n * in `@medplum/react-hooks`, which is not installed for this package (only\n * for `rossi-admin`/`bots`), so importing anything from\n * `HealthcareServiceAutocomplete.tsx` fails to resolve in this package's Jest\n * environment. See decisions.md.\n *\n * @param hs - the HealthcareService option to render\n * @returns the option row element\n */\nexport function renderHealthcareServiceOption (hs: HealthcareService): JSX.Element {\n const name = hs.name ?? hs.id ?? ''\n const code = getServiceCode(hs)\n const outcome = readBookingOutcome(hs)\n\n return (\n <Group gap=\"xs\" wrap=\"nowrap\" style={{ width: '100%' }}>\n <Box style={{ flex: 1, minWidth: 0 }}>\n <Text size=\"sm\" fw={500} truncate>{name}</Text>\n {hs.active === false && (\n <Text size=\"xs\" c=\"dimmed\">Inactivo</Text>\n )}\n {outcome !== undefined && (() => {\n const display = getBookingOutcomeDisplay(outcome.type)\n return <Text size=\"xs\" c={display.color}>{display.label}</Text>\n })()}\n </Box>\n {code && (\n <Badge size=\"xs\" variant=\"light\" color=\"blue\" style={{ flexShrink: 0 }}>\n {code}\n </Badge>\n )}\n </Group>\n )\n}\n"]}
|