Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/833 #837

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 28 additions & 257 deletions apps/demo-renderer-app/package-lock.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions apps/demo-renderer-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
"@types/fhir": "^0.0.38",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"typescript": "^5.0.2",
"vite": "^4.5.3"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/smart-forms-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"eslint": "^8.52.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"eslint-plugin-react-refresh": "^0.4.7",
"eslint-plugin-storybook": "^0.8.0",
"jest": "^29.7.0",
"prettier": "^3.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Bundle } from 'fhir/r4';
import type { Bundle } from 'fhir/r4';
import * as FHIR from 'fhirclient';
import { HEADERS } from '../../../api/headers.ts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import * as FHIR from 'fhirclient';
import { HEADERS } from '../../../api/headers.ts';
import { CapabilityStatement } from 'fhir/r4';
import type { CapabilityStatement } from 'fhir/r4';

export async function verifyFhirServer(
endpointUrl: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { StyledRoot, StyledToolbar } from '../../../components/Header/Header.sty
import { memo, useState } from 'react';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import useSmartClient from '../../../hooks/useSmartClient.ts';
import { Patient, Practitioner } from 'fhir/r4';
import type { Patient, Practitioner } from 'fhir/r4';
import PlaygroundSettingsDialog from './PlaygroundSettingsDialog.tsx';
import SettingsIcon from '@mui/icons-material/Settings';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import PrePopButtonForPlayground from './PrePopButtonForPlayground.tsx';
import { populateQuestionnaire } from '@aehrc/sdc-populate';
import { BaseRenderer, buildForm, useQuestionnaireStore } from '@aehrc/smart-forms-renderer';
import { fetchResourceCallback } from './PrePopCallbackForPlayground.tsx';
import { Patient, Practitioner } from 'fhir/r4';
import type { Patient, Practitioner } from 'fhir/r4';
import { Box, Typography } from '@mui/material';
import useLaunchContextNames from '../hooks/useLaunchContextNames.ts';
import { TERMINOLOGY_SERVER_URL } from '../../../globals.ts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';
import PlaygroundPatientPicker from './PlaygroundPatientPicker.tsx';
import { Patient, Practitioner } from 'fhir/r4';
import type { Patient, Practitioner } from 'fhir/r4';
import { useState } from 'react';
import PlaygroundUserPicker from './PlaygroundUserPicker.tsx';
import PlaygroundFhirServerUrlInput from './PlaygroundSourceFhirServerInput.tsx';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

import { IconButton, Stack, TextField, Tooltip, Typography } from '@mui/material';
import { ChangeEvent, useState } from 'react';
import type { ChangeEvent } from 'react';
import { useState } from 'react';
import InputAdornment from '@mui/material/InputAdornment';
import QuestionMarkIcon from '@mui/icons-material/QuestionMark';
import { verifyFhirServer } from '../api/verifyFhirServer.ts';
Expand Down
2 changes: 1 addition & 1 deletion apps/smart-forms-app/src/features/sdcide/GenericScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { Stack, Typography } from '@mui/material';
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

interface SdcIdeScreenProps {
screenTitle: string;
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/theme/ReactLiveScope/questionnaires.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Questionnaire } from 'fhir/r4';
import type { Questionnaire } from 'fhir/r4';

export const qItemControlDisplayContextDisplay: Questionnaire = {
resourceType: 'Questionnaire',
Expand Down
12 changes: 7 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1"
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react-refresh": "^0.4.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import React, { memo } from 'react';
import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import { grey } from '@mui/material/colors';
Expand All @@ -29,7 +28,7 @@ import { StyledRadioGroup } from '../Item.styles';
import { getChoiceOrientation } from '../../../utils/choice';
import FadingCheckIcon from '../ItemParts/FadingCheckIcon';

interface BooleanFieldProps extends PropsWithIsTabledAttribute {
interface BooleanFieldProps {
qItem: QuestionnaireItem;
readOnly: boolean;
valueBoolean: boolean | undefined;
Expand All @@ -39,8 +38,7 @@ interface BooleanFieldProps extends PropsWithIsTabledAttribute {
}

const BooleanField = memo(function BooleanField(props: BooleanFieldProps) {
const { qItem, readOnly, valueBoolean, calcExpUpdated, isTabled, onCheckedChange, onClear } =
props;
const { qItem, readOnly, valueBoolean, calcExpUpdated, onCheckedChange, onClear } = props;

// defaults to horizontal, only set to vertical if explicitly set
const orientation = getChoiceOrientation(qItem) ?? ChoiceItemOrientation.Horizontal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function BooleanItem(props: BooleanItemProps) {
<BooleanField
qItem={qItem}
readOnly={readOnly}
isTabled={isTabled}
valueBoolean={valueBoolean}
calcExpUpdated={calcExpUpdated}
onCheckedChange={handleValueChange}
Expand All @@ -111,7 +110,6 @@ function BooleanItem(props: BooleanItemProps) {
<BooleanField
qItem={qItem}
readOnly={readOnly}
isTabled={isTabled}
valueBoolean={valueBoolean}
calcExpUpdated={calcExpUpdated}
onCheckedChange={handleValueChange}
Expand All @@ -128,7 +126,6 @@ function BooleanItem(props: BooleanItemProps) {
<BooleanField
qItem={qItem}
readOnly={readOnly}
isTabled={isTabled}
valueBoolean={valueBoolean}
calcExpUpdated={calcExpUpdated}
onCheckedChange={handleValueChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
import type {
PropsWithIsRepeatedAttribute,
PropsWithIsTabledAttribute,
PropsWithParentIsReadOnlyAttribute,
PropsWithQrItemChangeHandler,
PropsWithShowMinimalViewAttribute
Expand All @@ -37,7 +36,6 @@ import ChoiceCheckboxAnswerOptionFields from './ChoiceCheckboxAnswerOptionFields
interface ChoiceCheckboxAnswerOptionItemProps
extends PropsWithQrItemChangeHandler,
PropsWithIsRepeatedAttribute,
PropsWithIsTabledAttribute,
PropsWithShowMinimalViewAttribute,
PropsWithParentIsReadOnlyAttribute {
qItem: QuestionnaireItem;
Expand All @@ -49,7 +47,6 @@ function ChoiceCheckboxAnswerOptionItem(props: ChoiceCheckboxAnswerOptionItemPro
qItem,
qrItem,
isRepeated,
isTabled,
showMinimalView = false,
parentIsReadOnly,
onQrItemChange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
import type {
PropsWithIsRepeatedAttribute,
PropsWithIsTabledAttribute,
PropsWithParentIsReadOnlyAttribute,
PropsWithQrItemChangeHandler,
PropsWithShowMinimalViewAttribute
Expand All @@ -39,7 +38,6 @@ interface ChoiceCheckboxAnswerValueSetItemProps
extends PropsWithQrItemChangeHandler,
PropsWithIsRepeatedAttribute,
PropsWithShowMinimalViewAttribute,
PropsWithIsTabledAttribute,
PropsWithParentIsReadOnlyAttribute {
qItem: QuestionnaireItem;
qrItem: QuestionnaireResponseItem | null;
Expand All @@ -51,7 +49,6 @@ function ChoiceCheckboxAnswerValueSetItem(props: ChoiceCheckboxAnswerValueSetIte
qItem,
qrItem,
isRepeated,
isTabled,
showMinimalView = false,
parentIsReadOnly,
onQrItemChange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ function ChoiceItemSwitcher(props: ChoiceItemSwitcherProps) {
qItem={qItem}
qrItem={qrItem}
isRepeated={isRepeated}
isTabled={isTabled}
parentIsReadOnly={parentIsReadOnly}
onQrItemChange={onQrItemChange}
/>
Expand All @@ -83,7 +82,6 @@ function ChoiceItemSwitcher(props: ChoiceItemSwitcherProps) {
qItem={qItem}
qrItem={qrItem}
isRepeated={qItem.repeats ?? false}
isTabled={isTabled}
showMinimalView={showMinimalView}
parentIsReadOnly={parentIsReadOnly}
onQrItemChange={onQrItemChange}
Expand All @@ -95,7 +93,6 @@ function ChoiceItemSwitcher(props: ChoiceItemSwitcherProps) {
qItem={qItem}
qrItem={qrItem}
isRepeated={qItem.repeats ?? false}
isTabled={isTabled}
showMinimalView={showMinimalView}
parentIsReadOnly={parentIsReadOnly}
onQrItemChange={onQrItemChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import type { QuestionnaireItem, QuestionnaireItemAnswerOption } from 'fhir/r4';
import RadioOptionList from '../ItemParts/RadioOptionList';
import { StyledRadioGroup } from '../Item.styles';
import { getChoiceOrientation } from '../../../utils/choice';
import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
import Box from '@mui/material/Box';
import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
import Fade from '@mui/material/Fade';
import Tooltip from '@mui/material/Tooltip';
import Button from '@mui/material/Button';
import { grey } from '@mui/material/colors';

interface ChoiceRadioAnswerOptionFieldsProps extends PropsWithIsTabledAttribute {
interface ChoiceRadioAnswerOptionFieldsProps {
qItem: QuestionnaireItem;
options: QuestionnaireItemAnswerOption[];
valueRadio: string | null;
Expand All @@ -40,16 +39,7 @@ interface ChoiceRadioAnswerOptionFieldsProps extends PropsWithIsTabledAttribute
}

function ChoiceRadioAnswerOptionFields(props: ChoiceRadioAnswerOptionFieldsProps) {
const {
qItem,
options,
valueRadio,
readOnly,
calcExpUpdated,
isTabled,
onCheckedChange,
onClear
} = props;
const { qItem, options, valueRadio, readOnly, calcExpUpdated, onCheckedChange, onClear } = props;

const orientation = getChoiceOrientation(qItem) ?? ChoiceItemOrientation.Vertical;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function ChoiceRadioAnswerOptionItem(props: ChoiceRadioAnswerOptionItemProps) {
options={options}
valueChoice={valueChoice}
isRepeated={isRepeated}
isTabled={isTabled}
readOnly={readOnly}
calcExpUpdated={calcExpUpdated}
onFocusLinkId={() => onFocusLinkId(qItem.linkId)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@ import React from 'react';
import ChoiceRadioAnswerOptionFields from './ChoiceRadioAnswerOptionFields';
import { FullWidthFormComponentBox } from '../../Box.styles';
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
import type {
PropsWithIsRepeatedAttribute,
PropsWithIsTabledAttribute
} from '../../../interfaces/renderProps.interface';
import type { PropsWithIsRepeatedAttribute } from '../../../interfaces/renderProps.interface';
import type { QuestionnaireItem, QuestionnaireItemAnswerOption } from 'fhir/r4';

interface ChoiceRadioAnswerOptionViewProps
extends PropsWithIsRepeatedAttribute,
PropsWithIsTabledAttribute {
interface ChoiceRadioAnswerOptionViewProps extends PropsWithIsRepeatedAttribute {
qItem: QuestionnaireItem;
options: QuestionnaireItemAnswerOption[];
valueChoice: string | null;
Expand All @@ -44,7 +39,6 @@ function ChoiceRadioAnswerOptionView(props: ChoiceRadioAnswerOptionViewProps) {
options,
valueChoice,
isRepeated,
isTabled,
readOnly,
calcExpUpdated,
onFocusLinkId,
Expand All @@ -58,7 +52,6 @@ function ChoiceRadioAnswerOptionView(props: ChoiceRadioAnswerOptionViewProps) {
qItem={qItem}
options={options}
valueRadio={valueChoice}
isTabled={isTabled}
readOnly={readOnly}
calcExpUpdated={calcExpUpdated}
onCheckedChange={onCheckedChange}
Expand All @@ -78,7 +71,6 @@ function ChoiceRadioAnswerOptionView(props: ChoiceRadioAnswerOptionViewProps) {
options={options}
valueRadio={valueChoice}
readOnly={readOnly}
isTabled={isTabled}
calcExpUpdated={calcExpUpdated}
onCheckedChange={onCheckedChange}
onClear={onClear}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ import { StyledAlert } from '../../Alert.styles';
import type { TerminologyError } from '../../../hooks/useValueSetCodings';
import { getChoiceOrientation } from '../../../utils/choice';
import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
import type { PropsWithIsTabledAttribute } from '../../../interfaces/renderProps.interface';
import Box from '@mui/material/Box';
import RadioOptionList from '../ItemParts/RadioOptionList';
import Tooltip from '@mui/material/Tooltip';
import Button from '@mui/material/Button';
import { grey } from '@mui/material/colors';
import Fade from '@mui/material/Fade';

interface ChoiceRadioAnswerValueSetFieldsProps extends PropsWithIsTabledAttribute {
interface ChoiceRadioAnswerValueSetFieldsProps {
qItem: QuestionnaireItem;
options: QuestionnaireItemAnswerOption[];
valueRadio: string | null;
Expand All @@ -52,7 +51,6 @@ function ChoiceRadioAnswerValueSetFields(props: ChoiceRadioAnswerValueSetFieldsP
readOnly,
calcExpUpdated,
terminologyError,
isTabled,
onCheckedChange,
onClear
} = props;
Expand Down
Loading
Loading