diff --git a/README.md b/README.md
index 54c7705..d92bdc6 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ Test patients can be created in the app by clicking on the "Create" button in th
#### Importing a Patient Bundle
-Test cases can be imported by clicking the "Import" button in the left panel, which will open a file dropzone that accepts JSON files of FHIR Patient Bundles and `.zip` files composed of FHIR Patient Bundles. Patient Bundles may contain additional FHIR resources. These FHIR resources are also loaded into the app and will belong to the patient contained in the Patient Bundle.
+Test cases can be imported by clicking the "Import" button in the left panel, which will open a file dropzone that accepts JSON files of FHIR Patient Bundles and `.zip` files composed of FHIR Patient Bundles. Patient Bundles may contain additional FHIR resources. These FHIR resources are also loaded into the app and will belong to the patient contained in the Patient Bundle. When importing a Patient Bundle or Bundles, there is a switch to remove resources not relevant to the Measure. When set, the resources that are not included in the provided Measure's data requirements will be removed from the Patient Bundle.
#### Selecting Desired Measure Populations
diff --git a/__tests__/components/modals/ImportModal.test.tsx b/__tests__/components/modals/ImportModal.test.tsx
index 7b103b4..d4e334f 100644
--- a/__tests__/components/modals/ImportModal.test.tsx
+++ b/__tests__/components/modals/ImportModal.test.tsx
@@ -1,6 +1,7 @@
import '@testing-library/jest-dom';
import { act, fireEvent, render, screen } from '@testing-library/react';
import ImportModal, { ImportModalProps } from '../../../components/modals/ImportModal';
+import { mantineRecoilWrap } from '../../helpers/testHelpers';
describe('ImportModal', () => {
it('should render a modal when set to open', () => {
@@ -9,7 +10,7 @@ describe('ImportModal', () => {
onClose: jest.fn(),
onImportSubmit: jest.fn()
};
- render();
+ render(mantineRecoilWrap());
const modal = screen.getByRole('dialog');
expect(modal).toBeInTheDocument();
@@ -21,7 +22,7 @@ describe('ImportModal', () => {
onClose: jest.fn(),
onImportSubmit: jest.fn()
};
- render();
+ render(mantineRecoilWrap());
const modal = screen.queryByRole('dialog');
expect(modal).not.toBeInTheDocument();
@@ -34,7 +35,7 @@ describe('ImportModal', () => {
onImportSubmit: jest.fn()
};
- render();
+ render(mantineRecoilWrap());
const submitButton = screen.getByRole('button', { name: 'Import' });
expect(submitButton).toBeInTheDocument();
@@ -72,7 +73,7 @@ describe('ImportModal', () => {
onImportSubmit: jest.fn()
};
- render();
+ render(mantineRecoilWrap());
const cancelButton = screen.getByRole('button', { name: 'Cancel' });
expect(cancelButton).toBeInTheDocument();
diff --git a/components/modals/ImportModal.tsx b/components/modals/ImportModal.tsx
index e17fba0..42b85ab 100644
--- a/components/modals/ImportModal.tsx
+++ b/components/modals/ImportModal.tsx
@@ -1,9 +1,25 @@
-import { Modal, Button, Center, Group, Grid, Text, Collapse, ScrollArea } from '@mantine/core';
+import {
+ Modal,
+ Button,
+ Center,
+ Group,
+ Grid,
+ Text,
+ Collapse,
+ ScrollArea,
+ Switch,
+ Popover,
+ ActionIcon,
+ Anchor
+} from '@mantine/core';
import { showNotification } from '@mantine/notifications';
import { Dropzone } from '@mantine/dropzone';
import { IconAlertCircle, IconCaretDown, IconCaretRight, IconFileCheck, IconFileImport } from '@tabler/icons';
import { useState } from 'react';
import JSZip from 'jszip';
+import { useRecoilState } from 'recoil';
+import { resourceSwitchOn } from '../../state/atoms/resourceSwitch';
+import { InfoCircle } from 'tabler-icons-react';
export interface ImportModalProps {
open: boolean;
@@ -16,6 +32,8 @@ export default function ImportModal({ open, onClose, onImportSubmit }: ImportMod
const [fileDisplay, setFileDisplay] = useState(null);
const [showZipFileExpansion, setShowZipFileExpansion] = useState(false);
const [isZipInfoExpanded, setIsZipInfoExpanded] = useState(false);
+ const [switchOn, setSwitchOn] = useRecoilState(resourceSwitchOn);
+ const [minimizeResourcesPopoverOpened, setMinimizeResourcesPopoverOpened] = useState(false);
const closeAndReset = () => {
setFiles([]);
@@ -139,6 +157,33 @@ export default function ImportModal({ open, onClose, onImportSubmit }: ImportMod
)}
+ setSwitchOn(event.currentTarget.checked)}
+ />
+ setMinimizeResourcesPopoverOpened(false)}
+ width={500}
+ >
+
+ setMinimizeResourcesPopoverOpened(o => !o)}
+ >
+
+
+
+
+ If set to minimize the resources on the Test Case, only resources relevant to the measure will be
+ included. Resources relevant to the measure are defined as resources included in the data requirements
+ of the measure.
+ here.
+
+