diff --git a/src/uberComponents/ResourceListPage/actions.tsx b/src/uberComponents/ResourceListPage/actions.tsx index cdd361cb..2a9fc009 100644 --- a/src/uberComponents/ResourceListPage/actions.tsx +++ b/src/uberComponents/ResourceListPage/actions.tsx @@ -1,6 +1,6 @@ import { t, Trans } from '@lingui/macro'; import { Button, notification } from 'antd'; -import { List, Resource } from 'fhir/r4b'; +import { Bundle, Resource } from 'fhir/r4b'; import { useNavigate } from 'react-router-dom'; import { ModalTrigger } from 'src/components/ModalTrigger'; @@ -105,12 +105,12 @@ export function HeaderQuestionnaireAction({ action, reload }: { action: Question export function BatchQuestionnaireAction({ action, - list, + bundle, reload, disabled, }: { action: QuestionnaireActionType; - list: List; + bundle: Bundle; reload: () => void; disabled?: boolean; }) { @@ -128,8 +128,8 @@ export function BatchQuestionnaireAction({ questionnaireLoader={questionnaireIdLoader(action.questionnaireId)} launchContextParameters={[ { - name: 'List', - resource: list, + name: 'Bundle', + resource: bundle as Bundle, }, ]} onSuccess={() => { diff --git a/src/uberComponents/ResourceListPage/hooks.ts b/src/uberComponents/ResourceListPage/hooks.ts index 2b68a8f9..d6a6828d 100644 --- a/src/uberComponents/ResourceListPage/hooks.ts +++ b/src/uberComponents/ResourceListPage/hooks.ts @@ -1,4 +1,4 @@ -import { Bundle, List, Resource } from 'fhir/r4b'; +import { Bundle, Resource } from 'fhir/r4b'; import { useMemo, useState } from 'react'; import { SearchParams } from '@beda.software/fhir-react'; @@ -44,11 +44,12 @@ export function useResourceListPage( bundle: bundle as Bundle, })), ); - const selectedResourcesList: List = { - resourceType: 'List', - status: 'current', - mode: 'working', - entry: isSuccess(recordResponse) ? recordResponse.data.map(({ resource }) => ({ item: resource })) : [], + const selectedResourcesBundle: Bundle = { + resourceType: 'Bundle', + type: 'collection', + entry: isSuccess(recordResponse) + ? recordResponse.data.map(({ resource }) => ({ resource: resource as R })) + : [], }; return { @@ -58,7 +59,7 @@ export function useResourceListPage( handleTableChange, selectedRowKeys, setSelectedRowKeys, - selectedResourcesList, + selectedResourcesBundle, }; } diff --git a/src/uberComponents/ResourceListPage/index.tsx b/src/uberComponents/ResourceListPage/index.tsx index 4ff75622..2f5b5686 100644 --- a/src/uberComponents/ResourceListPage/index.tsx +++ b/src/uberComponents/ResourceListPage/index.tsx @@ -73,7 +73,7 @@ interface ResourceListPageProps { * Batch actions that are available when rows are selected * (for example, delete multiple organizations) * - * NOTE: Theoretically getHeaderActions can accept selected resources List + * NOTE: Theoretically getHeaderActions can accept selected resources Bundle */ getBatchActions?: () => Array; } @@ -100,7 +100,7 @@ export function ResourceListPage({ handleTableChange, selectedRowKeys, setSelectedRowKeys, - selectedResourcesList, + selectedResourcesBundle, } = useResourceListPage(resourceType, extractPrimaryResources, columnsFilterValues, searchParams ?? {}); const headerActions = getHeaderActions?.() ?? []; @@ -131,10 +131,10 @@ export function ResourceListPage({ {batchActions.map((action, index) => ( - action={action} reload={pagerManager.reload} - list={selectedResourcesList} + bundle={selectedResourcesBundle} disabled={!selectedRowKeys.length} />