diff --git a/apps/smart-forms-app/package.json b/apps/smart-forms-app/package.json index 20de2cbd5..4a830cc33 100644 --- a/apps/smart-forms-app/package.json +++ b/apps/smart-forms-app/package.json @@ -27,7 +27,7 @@ "dependencies": { "@aehrc/sdc-assemble": "^1.2.0", "@aehrc/sdc-populate": "^1.8.0", - "@aehrc/smart-forms-renderer": "^0.27.4", + "@aehrc/smart-forms-renderer": "^0.28.0", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", "@fontsource/material-icons": "^5.0.16", diff --git a/apps/smart-forms-app/src/features/renderer/types/choice.enum.ts b/apps/smart-forms-app/src/features/renderer/types/choice.enum.ts deleted file mode 100644 index 60d3860fd..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/choice.enum.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2024 Commonwealth Scientific and Industrial Research - * Organisation (CSIRO) ABN 41 687 119 230. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export enum QItemChoiceControl { - Radio = 'radio', - Select = 'select', - Autocomplete = 'autocomplete', - Checkbox = 'check-box' -} - -export enum QItemOpenChoiceControl { - Select = 'select', - Autocomplete = 'autocomplete', - Checkbox = 'check-box', - Radio = 'radio' -} - -export enum QItemChoiceOrientation { - Horizontal = 'horizontal', - Vertical = 'vertical' -} - -export enum CheckBoxOptionType { - AnswerOption = 'answerOption', - AnswerValueSet = 'answerValueSet' -} diff --git a/apps/smart-forms-app/src/features/renderer/types/currentTabIndexContext.type.ts b/apps/smart-forms-app/src/features/renderer/types/currentTabIndexContext.type.ts deleted file mode 100644 index 7fd719580..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/currentTabIndexContext.type.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2024 Commonwealth Scientific and Industrial Research - * Organisation (CSIRO) ABN 41 687 119 230. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export type CurrentTabIndexContextType = { - currentTabIndex: number; - setCurrentTabIndex: (updatedIndex: number) => unknown; -}; diff --git a/apps/smart-forms-app/src/features/renderer/types/groupTable.interface.ts b/apps/smart-forms-app/src/features/renderer/types/groupTable.interface.ts deleted file mode 100644 index d964751d8..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/groupTable.interface.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2024 Commonwealth Scientific and Industrial Research - * Organisation (CSIRO) ABN 41 687 119 230. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { QuestionnaireResponseItem } from 'fhir/r4'; - -export interface GroupTableRow { - nanoId: string; - qrItem: QuestionnaireResponseItem | null; -} diff --git a/apps/smart-forms-app/src/features/renderer/types/regex.ts b/apps/smart-forms-app/src/features/renderer/types/regex.ts deleted file mode 100644 index e92845f16..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/regex.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2024 Commonwealth Scientific and Industrial Research - * Organisation (CSIRO) ABN 41 687 119 230. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface RegexValidation { - expression: RegExp; - feedback: string | null; -} diff --git a/apps/smart-forms-app/src/features/renderer/types/renderer.interface.ts b/apps/smart-forms-app/src/features/renderer/types/renderer.interface.ts deleted file mode 100644 index 91b0fc44c..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/renderer.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { QuestionnaireResponse } from 'fhir/r4'; - -export interface Renderer { - response: QuestionnaireResponse; - hasChanges: boolean; -} diff --git a/apps/smart-forms-app/src/features/renderer/types/repeatGroup.interface.ts b/apps/smart-forms-app/src/features/renderer/types/repeatGroup.interface.ts deleted file mode 100644 index 43c65afc1..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/repeatGroup.interface.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2024 Commonwealth Scientific and Industrial Research - * Organisation (CSIRO) ABN 41 687 119 230. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { QuestionnaireResponseItem } from 'fhir/r4'; - -export interface QrRepeatGroup { - linkId: string; - qrItems: QuestionnaireResponseItem[]; -} - -export interface RepeatGroupSingle { - nanoId: string; - qrItem: QuestionnaireResponseItem | null; -} diff --git a/apps/smart-forms-app/src/features/renderer/types/repeatItem.interface.ts b/apps/smart-forms-app/src/features/renderer/types/repeatItem.interface.ts deleted file mode 100644 index 6fdbec979..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/repeatItem.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { QuestionnaireResponseItemAnswer } from 'fhir/r4'; - -export interface RepeatAnswer { - nanoId: string; - answer: QuestionnaireResponseItemAnswer | null; -} diff --git a/apps/smart-forms-app/src/features/renderer/types/tab.interface.ts b/apps/smart-forms-app/src/features/renderer/types/tab.interface.ts deleted file mode 100644 index 053bb4231..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/tab.interface.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2024 Commonwealth Scientific and Industrial Research - * Organisation (CSIRO) ABN 41 687 119 230. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export type Tab = { tabIndex: number; isComplete: boolean; isHidden: boolean }; -export type Tabs = Record; diff --git a/apps/smart-forms-app/src/features/renderer/types/table.interface.ts b/apps/smart-forms-app/src/features/renderer/types/table.interface.ts deleted file mode 100644 index 30544c79b..000000000 --- a/apps/smart-forms-app/src/features/renderer/types/table.interface.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2024 Commonwealth Scientific and Industrial Research - * Organisation (CSIRO) ABN 41 687 119 230. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface TableAttributes { - id: string; - label: string; - alignRight: boolean; -} diff --git a/documentation/docs/components/open-choice.mdx b/documentation/docs/components/open-choice.mdx index 5de19d460..5e4230eed 100644 --- a/documentation/docs/components/open-choice.mdx +++ b/documentation/docs/components/open-choice.mdx @@ -65,7 +65,7 @@ If there are any advanced usage scenarios you'd like to see, feel free to [let u | enableWhenExpression | http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression | | openLabel | http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-openLabel
- OpenLabel is only supported on [itemControl](https://hl7.org/fhir/extensions/CodeSystem-questionnaire-item-control.html) "radio-button" and "check-box" extensions | | hidden | http://hl7.org/fhir/StructureDefinition/questionnaire-hidden | -| itemControl | http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl
Supports:
- autocomplete
- drop-down
- check-box
- radio-button | +| itemControl | http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl
Supports:
- autocomplete
- check-box
- radio-button | | choiceOrientation | http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation
- ChoiceOrientation is only supported on [itemControl](https://hl7.org/fhir/extensions/CodeSystem-questionnaire-item-control.html) "radio-button" and "check-box" extensions | | required | item.required | | repeats | item.repeats | diff --git a/documentation/docs/sdc/advanced/common.mdx b/documentation/docs/sdc/advanced/common.mdx deleted file mode 100644 index 9d5306136..000000000 --- a/documentation/docs/sdc/advanced/common.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Common Elements - -Common Elements Placeholder - -- required (also included in validation) -- repeats -- readOnly -- hidden -- initial diff --git a/documentation/docs/sdc/advanced/constraint.mdx b/documentation/docs/sdc/advanced/constraint.mdx new file mode 100644 index 000000000..4f74869b1 --- /dev/null +++ b/documentation/docs/sdc/advanced/constraint.mdx @@ -0,0 +1,145 @@ +--- +sidebar_position: 5 +--- + +import IframeContainer from '../../../src/react/IframeContainer'; + +# Value Constraints + +This subsection consists of extensions related to value constraints and form validation. + +The elements/extensions that fall under this subsection are: + +**From Core Questionnaire** + +- [required](https://www.hl7.org/fhir/r4/questionnaire-definitions.html#Questionnaire.item.required) + +**From SDC** + +- [maxLength](http://hl7.org/fhir/uv/sdc/behavior.html#maxLength) +- [minLength](http://hl7.org/fhir/uv/sdc/behavior.html#minLength) +- [regex](http://hl7.org/fhir/uv/sdc/behavior.html#regex) +- [minValue](http://hl7.org/fhir/uv/sdc/behavior.html#minValue) +- [maxValue](http://hl7.org/fhir/uv/sdc/behavior.html#maxValue) +- [maxDecimalPlaces](http://hl7.org/fhir/uv/sdc/behavior.html#maxDecimalPlaces) + +[//]: # 'FIXME dev docs reference' + +:::tip +Elements/extensions in this subsection invokes form validation in the renderer. OperationOutcome resources are generated when the current state of the form does not meet the constraints defined in the Questionnaire. + +For more information, refer to developer usage. + +::: + +### Required + +An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. + +Also appears in the [Fundamental Elements](/smart-forms/docs/sdc/advanced/fundamental) subsection. + +#### Basic Usage + + +