@aehrc/smart-forms-renderer 1.0.0-alpha.42.dev2 → 1.0.0-alpha.42.dev4
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/package.json +1 -6
- package/.storybook/main.ts +0 -34
- package/.storybook/preview.tsx +0 -40
- package/src/stories/assets/fhirClient/mockFhirClient.ts +0 -52
- package/src/stories/assets/patients/PatSmartForm.ts +0 -281
- package/src/stories/assets/practitioners/PracPrimaryPeter.ts +0 -38
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreAllergyIntolerance.json +0 -209
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreCondition.json +0 -220
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreEncounter.json +0 -299
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreImmunization.json +0 -175
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreMedicationRequest.json +0 -229
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBP.json +0 -359
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyHeight.json +0 -195
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyWeight.json +0 -195
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationHeartRate.json +0 -195
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationSmokingStatus.json +0 -174
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePatient.json +0 -495
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitioner.json +0 -139
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitionerRole.json +0 -216
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreProcedure.json +0 -199
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreRespirationRate.json +0 -195
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreWaistCircumference.json +0 -195
- package/src/stories/assets/questionnaires/QAdvancedAdditionalDisplayContent.ts +0 -113
- package/src/stories/assets/questionnaires/QAdvancedControlAppearance.ts +0 -865
- package/src/stories/assets/questionnaires/QAdvancedOther.ts +0 -494
- package/src/stories/assets/questionnaires/QAdvancedTextApperance.ts +0 -503
- package/src/stories/assets/questionnaires/QAttachment.ts +0 -38
- package/src/stories/assets/questionnaires/QAuCoreTesting.ts +0 -3796
- package/src/stories/assets/questionnaires/QBehaviorCalculations.ts +0 -643
- package/src/stories/assets/questionnaires/QBehaviorChoiceRestriction.ts +0 -281
- package/src/stories/assets/questionnaires/QBehaviorOther.ts +0 -1241
- package/src/stories/assets/questionnaires/QBehaviorValueConstraints.ts +0 -508
- package/src/stories/assets/questionnaires/QBoolean.ts +0 -180
- package/src/stories/assets/questionnaires/QButtonTester.ts +0 -497
- package/src/stories/assets/questionnaires/QChoice.ts +0 -493
- package/src/stories/assets/questionnaires/QDate.ts +0 -56
- package/src/stories/assets/questionnaires/QDateTime.ts +0 -56
- package/src/stories/assets/questionnaires/QDecimal.ts +0 -56
- package/src/stories/assets/questionnaires/QDisplay.ts +0 -197
- package/src/stories/assets/questionnaires/QFormPopulation.ts +0 -1349
- package/src/stories/assets/questionnaires/QGroup.ts +0 -52
- package/src/stories/assets/questionnaires/QGroupTableTester.ts +0 -461
- package/src/stories/assets/questionnaires/QIdRemoverDebugger.ts +0 -161
- package/src/stories/assets/questionnaires/QInteger.ts +0 -119
- package/src/stories/assets/questionnaires/QItemControlDisplay.ts +0 -558
- package/src/stories/assets/questionnaires/QItemControlGroup.ts +0 -1530
- package/src/stories/assets/questionnaires/QItemControlQuestion.ts +0 -1271
- package/src/stories/assets/questionnaires/QMbs715Tester.ts +0 -32888
- package/src/stories/assets/questionnaires/QOpenChoice.ts +0 -151
- package/src/stories/assets/questionnaires/QParameterisedValueSets.ts +0 -312
- package/src/stories/assets/questionnaires/QPrePopTester.ts +0 -543
- package/src/stories/assets/questionnaires/QQuantity.ts +0 -365
- package/src/stories/assets/questionnaires/QReference.ts +0 -38
- package/src/stories/assets/questionnaires/QSingleItems.ts +0 -251
- package/src/stories/assets/questionnaires/QString.ts +0 -131
- package/src/stories/assets/questionnaires/QTerminologyControl.ts +0 -59
- package/src/stories/assets/questionnaires/QText.ts +0 -169
- package/src/stories/assets/questionnaires/QTime.ts +0 -38
- package/src/stories/assets/questionnaires/QUrl.ts +0 -38
- package/src/stories/assets/questionnaires/QValidateTester.ts +0 -118
- package/src/stories/assets/questionnaires/index.ts +0 -43
- package/src/stories/itemTypes/Attachment.stories.tsx +0 -39
- package/src/stories/itemTypes/Boolean.stories.tsx +0 -65
- package/src/stories/itemTypes/Choice.stories.tsx +0 -78
- package/src/stories/itemTypes/Date.stories.tsx +0 -46
- package/src/stories/itemTypes/DateTime.stories.tsx +0 -45
- package/src/stories/itemTypes/Decimal.stories.tsx +0 -56
- package/src/stories/itemTypes/Display.stories.tsx +0 -55
- package/src/stories/itemTypes/Group.stories.tsx +0 -39
- package/src/stories/itemTypes/Integer.stories.tsx +0 -55
- package/src/stories/itemTypes/OpenChoice.stories.tsx +0 -64
- package/src/stories/itemTypes/Quantity.stories.tsx +0 -71
- package/src/stories/itemTypes/Reference.stories.tsx +0 -39
- package/src/stories/itemTypes/String.stories.tsx +0 -51
- package/src/stories/itemTypes/Text.stories.tsx +0 -51
- package/src/stories/itemTypes/Time.stories.tsx +0 -39
- package/src/stories/itemTypes/Url.stories.tsx +0 -39
- package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +0 -51
- package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +0 -90
- package/src/stories/sdc/AdvancedOther.stories.tsx +0 -76
- package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +0 -104
- package/src/stories/sdc/BehaviorCalculations.stories.tsx +0 -69
- package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +0 -76
- package/src/stories/sdc/BehaviorOther.stories.tsx +0 -97
- package/src/stories/sdc/BehaviorValueConstraints.stories.tsx +0 -88
- package/src/stories/sdc/FormPopulation.stories.tsx +0 -97
- package/src/stories/sdc/ItemControlDisplay.stories.tsx +0 -69
- package/src/stories/sdc/ItemControlGroup.stories.tsx +0 -90
- package/src/stories/sdc/ItemControlQuestion.stories.tsx +0 -118
- package/src/stories/sdc/OtherExtensions.stories.tsx +0 -39
- package/src/stories/sdc/ParameterisedValueSets.stories.tsx +0 -48
- package/src/stories/storybookWrappers/BuildFormButtonForStorybook.tsx +0 -54
- package/src/stories/storybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx +0 -76
- package/src/stories/storybookWrappers/BuildFormWrapperForStorybook.tsx +0 -61
- package/src/stories/storybookWrappers/FormValidationTesterWrapperForStorybook.tsx +0 -70
- package/src/stories/storybookWrappers/FormValidationViewerForStorybook.tsx +0 -28
- package/src/stories/storybookWrappers/IdRemoverButtonForStorybook.tsx +0 -49
- package/src/stories/storybookWrappers/IdRemoverDebuggerWrapperForStorybook.tsx +0 -84
- package/src/stories/storybookWrappers/InitialiseFormWrapperForStorybook.tsx +0 -105
- package/src/stories/storybookWrappers/PrePopButtonForStorybook.tsx +0 -56
- package/src/stories/storybookWrappers/PrePopWrapperForStorybook.tsx +0 -114
- package/src/stories/storybookWrappers/TestCssSheet.css +0 -17
- package/src/stories/storybookWrappers/ValidateFormButtonForStorybook.tsx +0 -41
- package/src/stories/storybookWrappers/globals.ts +0 -18
- package/src/stories/storybookWrappers/iframeResizerChild.js +0 -1063
- package/src/stories/storybookWrappers/index.ts +0 -19
- package/src/stories/storybookWrappers/populateCallbackForStorybook.ts +0 -55
- package/src/stories/testing/AuCoreTester.stories.tsx +0 -196
- package/src/stories/testing/BuildFormButtonTesterWrapper.stories.tsx +0 -40
- package/src/stories/testing/GroupTableTester.stories.tsx +0 -39
- package/src/stories/testing/IdRemoverDebuggerWrapper.stories.tsx +0 -39
- package/src/stories/testing/Mbs715Tester.stories.tsx +0 -57
- package/src/stories/testing/PrePopButtonTesterWrapper.stories.tsx +0 -55
- package/src/stories/testing/ValidateFormTesterWrapper.stories.tsx +0 -39
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import BuildFormWrapperForStorybook from '../storybookWrappers/BuildFormWrapperForStorybook';
|
|
20
|
-
import {
|
|
21
|
-
qMaxDecimalPlaces,
|
|
22
|
-
qMaxLength,
|
|
23
|
-
qMaxValue,
|
|
24
|
-
qMinLength,
|
|
25
|
-
qMinValue,
|
|
26
|
-
qRegex,
|
|
27
|
-
qrMaxDecimalPlaces,
|
|
28
|
-
qrMaxLength,
|
|
29
|
-
qrMaxValue,
|
|
30
|
-
qrMinLength,
|
|
31
|
-
qrMinValue,
|
|
32
|
-
qrRegex
|
|
33
|
-
} from '../assets/questionnaires'; // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
34
|
-
|
|
35
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
36
|
-
const meta = {
|
|
37
|
-
title: 'SDC/9.1.1 Form Behavior Value Constraints',
|
|
38
|
-
component: BuildFormWrapperForStorybook,
|
|
39
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
40
|
-
tags: []
|
|
41
|
-
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
42
|
-
|
|
43
|
-
export default meta;
|
|
44
|
-
type Story = StoryObj<typeof meta>;
|
|
45
|
-
|
|
46
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
47
|
-
|
|
48
|
-
export const MaxLength: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
questionnaire: qMaxLength,
|
|
51
|
-
questionnaireResponse: qrMaxLength
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const MinLength: Story = {
|
|
56
|
-
args: {
|
|
57
|
-
questionnaire: qMinLength,
|
|
58
|
-
questionnaireResponse: qrMinLength
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const Regex: Story = {
|
|
63
|
-
args: {
|
|
64
|
-
questionnaire: qRegex,
|
|
65
|
-
questionnaireResponse: qrRegex
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const MinValue: Story = {
|
|
70
|
-
args: {
|
|
71
|
-
questionnaire: qMinValue,
|
|
72
|
-
questionnaireResponse: qrMinValue
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const MaxValue: Story = {
|
|
77
|
-
args: {
|
|
78
|
-
questionnaire: qMaxValue,
|
|
79
|
-
questionnaireResponse: qrMaxValue
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const MaxDecimalPlaces: Story = {
|
|
84
|
-
args: {
|
|
85
|
-
questionnaire: qMaxDecimalPlaces,
|
|
86
|
-
questionnaireResponse: qrMaxDecimalPlaces
|
|
87
|
-
}
|
|
88
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import PrePopWrapperForStorybook from '../storybookWrappers/PrePopWrapperForStorybook';
|
|
20
|
-
import {
|
|
21
|
-
qCalculatedExpressionBMICalculatorPrepop,
|
|
22
|
-
qCalculatedExpressionCvdRiskCalculatorPrepop,
|
|
23
|
-
qInitialExpressionBasic,
|
|
24
|
-
qItemPopulationContextHomeAddress,
|
|
25
|
-
qItemPopulationContextMedicalHistory,
|
|
26
|
-
qSourceQueriesBMICalculator
|
|
27
|
-
} from '../assets/questionnaires/QFormPopulation';
|
|
28
|
-
import { mockFhirClient } from '../assets/fhirClient/mockFhirClient';
|
|
29
|
-
import { patSmartForm } from '../assets/patients/PatSmartForm';
|
|
30
|
-
import { pracPrimaryPeter } from '../assets/practitioners/PracPrimaryPeter';
|
|
31
|
-
|
|
32
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
33
|
-
const meta = {
|
|
34
|
-
title: 'SDC/12 Form Population',
|
|
35
|
-
component: PrePopWrapperForStorybook,
|
|
36
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
37
|
-
tags: []
|
|
38
|
-
} satisfies Meta<typeof PrePopWrapperForStorybook>;
|
|
39
|
-
|
|
40
|
-
export default meta;
|
|
41
|
-
type Story = StoryObj<typeof meta>;
|
|
42
|
-
|
|
43
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
44
|
-
|
|
45
|
-
export const InitialExpression: Story = {
|
|
46
|
-
args: {
|
|
47
|
-
questionnaire: qInitialExpressionBasic,
|
|
48
|
-
fhirClient: mockFhirClient,
|
|
49
|
-
patient: patSmartForm,
|
|
50
|
-
user: pracPrimaryPeter
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const CalculatedExpressionBMICalculatorPrepop: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
questionnaire: qCalculatedExpressionBMICalculatorPrepop,
|
|
57
|
-
fhirClient: mockFhirClient,
|
|
58
|
-
patient: patSmartForm,
|
|
59
|
-
user: pracPrimaryPeter
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const CalculatedExpressionCvdRiskCalculatorPrepop: Story = {
|
|
64
|
-
args: {
|
|
65
|
-
questionnaire: qCalculatedExpressionCvdRiskCalculatorPrepop,
|
|
66
|
-
fhirClient: mockFhirClient,
|
|
67
|
-
patient: patSmartForm,
|
|
68
|
-
user: pracPrimaryPeter
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const ItemPopulationContextHomeAddress: Story = {
|
|
73
|
-
args: {
|
|
74
|
-
questionnaire: qItemPopulationContextHomeAddress,
|
|
75
|
-
fhirClient: mockFhirClient,
|
|
76
|
-
patient: patSmartForm,
|
|
77
|
-
user: pracPrimaryPeter
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const ItemPopulationContextMedicalHistory: Story = {
|
|
82
|
-
args: {
|
|
83
|
-
questionnaire: qItemPopulationContextMedicalHistory,
|
|
84
|
-
fhirClient: mockFhirClient,
|
|
85
|
-
patient: patSmartForm,
|
|
86
|
-
user: pracPrimaryPeter
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const SourceQueriesBMICalculator: Story = {
|
|
91
|
-
args: {
|
|
92
|
-
questionnaire: qSourceQueriesBMICalculator,
|
|
93
|
-
fhirClient: mockFhirClient,
|
|
94
|
-
patient: patSmartForm,
|
|
95
|
-
user: pracPrimaryPeter
|
|
96
|
-
}
|
|
97
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import BuildFormWrapperForStorybook from '../storybookWrappers/BuildFormWrapperForStorybook';
|
|
20
|
-
import {
|
|
21
|
-
qItemControlDisplayContextDisplay,
|
|
22
|
-
qItemControlDisplayFlyover,
|
|
23
|
-
qItemControlDisplayLowerAndUpper,
|
|
24
|
-
qItemControlDisplayPrompt,
|
|
25
|
-
qItemControlDisplayUnit
|
|
26
|
-
} from '../assets/questionnaires'; // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
27
|
-
|
|
28
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
29
|
-
const meta = {
|
|
30
|
-
title: 'SDC/8.1.2 Advanced Control Appearance - Item Control Display',
|
|
31
|
-
component: BuildFormWrapperForStorybook,
|
|
32
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
33
|
-
tags: []
|
|
34
|
-
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
35
|
-
|
|
36
|
-
export default meta;
|
|
37
|
-
type Story = StoryObj<typeof meta>;
|
|
38
|
-
|
|
39
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
40
|
-
|
|
41
|
-
export const Prompt: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
questionnaire: qItemControlDisplayPrompt
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Unit: Story = {
|
|
48
|
-
args: {
|
|
49
|
-
questionnaire: qItemControlDisplayUnit
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const LowerAndUpper: Story = {
|
|
54
|
-
args: {
|
|
55
|
-
questionnaire: qItemControlDisplayLowerAndUpper
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const Flyover: Story = {
|
|
60
|
-
args: {
|
|
61
|
-
questionnaire: qItemControlDisplayFlyover
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const CustomContextDisplay: Story = {
|
|
66
|
-
args: {
|
|
67
|
-
questionnaire: qItemControlDisplayContextDisplay
|
|
68
|
-
}
|
|
69
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import BuildFormWrapperForStorybook from '../storybookWrappers/BuildFormWrapperForStorybook';
|
|
20
|
-
import {
|
|
21
|
-
qItemControlDisplayTabContainer,
|
|
22
|
-
qItemControlGroupGridMultiRow,
|
|
23
|
-
qItemControlGroupGridSingleRow,
|
|
24
|
-
qItemControlGroupGTableRepeats,
|
|
25
|
-
qItemControlGroupGTableSingle,
|
|
26
|
-
qItemControlGroupPage,
|
|
27
|
-
qItemControlGroupPageContainer,
|
|
28
|
-
qItemControlGroupPageNonTopLevelPageContainer
|
|
29
|
-
} from '../assets/questionnaires';
|
|
30
|
-
|
|
31
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
32
|
-
const meta = {
|
|
33
|
-
title: 'SDC/8.1.2 Advanced Control Appearance - Item Control Group',
|
|
34
|
-
component: BuildFormWrapperForStorybook,
|
|
35
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
36
|
-
tags: []
|
|
37
|
-
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
type Story = StoryObj<typeof meta>;
|
|
41
|
-
|
|
42
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
43
|
-
|
|
44
|
-
export const GTableRepeats: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
questionnaire: qItemControlGroupGTableRepeats
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const GTableSingle: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
questionnaire: qItemControlGroupGTableSingle
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const GridSingleRow: Story = {
|
|
57
|
-
args: {
|
|
58
|
-
questionnaire: qItemControlGroupGridSingleRow
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const GridMultiRow: Story = {
|
|
63
|
-
args: {
|
|
64
|
-
questionnaire: qItemControlGroupGridMultiRow
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const TabContainer: Story = {
|
|
69
|
-
args: {
|
|
70
|
-
questionnaire: qItemControlDisplayTabContainer
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const Page: Story = {
|
|
75
|
-
args: {
|
|
76
|
-
questionnaire: qItemControlGroupPage
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const PageContainer: Story = {
|
|
81
|
-
args: {
|
|
82
|
-
questionnaire: qItemControlGroupPageContainer
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const PageContainerNonSingleTopLevel: Story = {
|
|
87
|
-
args: {
|
|
88
|
-
questionnaire: qItemControlGroupPageNonTopLevelPageContainer
|
|
89
|
-
}
|
|
90
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import BuildFormWrapperForStorybook from '../storybookWrappers/BuildFormWrapperForStorybook';
|
|
20
|
-
import {
|
|
21
|
-
qChoiceCheckboxAnswerOption,
|
|
22
|
-
qChoiceCheckboxAnswerValueSet,
|
|
23
|
-
qChoiceDropDownAnswerOption,
|
|
24
|
-
qChoiceDropDownAnswerValueSet,
|
|
25
|
-
qChoiceRadioAnswerOption,
|
|
26
|
-
qChoiceRadioAnswerValueSet,
|
|
27
|
-
qOpenChoiceAutocomplete,
|
|
28
|
-
qOpenChoiceCheckboxAnswerOption,
|
|
29
|
-
qOpenChoiceCheckboxAnswerValueSet,
|
|
30
|
-
qOpenChoiceRadioAnswerOption,
|
|
31
|
-
qOpenChoiceRadioAnswerValueSet,
|
|
32
|
-
qSliderStepValue
|
|
33
|
-
} from '../assets/questionnaires';
|
|
34
|
-
|
|
35
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
36
|
-
const meta = {
|
|
37
|
-
title: 'SDC/8.1.2 Advanced Control Appearance - Item Control Question',
|
|
38
|
-
component: BuildFormWrapperForStorybook,
|
|
39
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
40
|
-
tags: []
|
|
41
|
-
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
42
|
-
|
|
43
|
-
export default meta;
|
|
44
|
-
type Story = StoryObj<typeof meta>;
|
|
45
|
-
|
|
46
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
47
|
-
|
|
48
|
-
export const AutocompleteOpenChoice: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
questionnaire: qOpenChoiceAutocomplete
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const DropDownChoiceAnswerOption: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
questionnaire: qChoiceDropDownAnswerOption
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const DropDownChoiceAnswerValueSet: Story = {
|
|
61
|
-
args: {
|
|
62
|
-
questionnaire: qChoiceDropDownAnswerValueSet
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const CheckboxChoiceAnswerOption: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
questionnaire: qChoiceCheckboxAnswerOption
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const CheckboxChoiceAnswerValueSet: Story = {
|
|
73
|
-
args: {
|
|
74
|
-
questionnaire: qChoiceCheckboxAnswerValueSet
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const CheckboxOpenChoiceAnswerOption: Story = {
|
|
79
|
-
args: {
|
|
80
|
-
questionnaire: qOpenChoiceCheckboxAnswerOption
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const CheckboxOpenChoiceAnswerValueSet: Story = {
|
|
85
|
-
args: {
|
|
86
|
-
questionnaire: qOpenChoiceCheckboxAnswerValueSet
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const RadioChoiceAnswerOption: Story = {
|
|
91
|
-
args: {
|
|
92
|
-
questionnaire: qChoiceRadioAnswerOption
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export const RadioChoiceAnswerValueSet: Story = {
|
|
97
|
-
args: {
|
|
98
|
-
questionnaire: qChoiceRadioAnswerValueSet
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const RadioOpenChoiceAnswerOption: Story = {
|
|
103
|
-
args: {
|
|
104
|
-
questionnaire: qOpenChoiceRadioAnswerOption
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export const RadioOpenChoiceAnswerValueSet: Story = {
|
|
109
|
-
args: {
|
|
110
|
-
questionnaire: qOpenChoiceRadioAnswerValueSet
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const SliderInteger: Story = {
|
|
115
|
-
args: {
|
|
116
|
-
questionnaire: qSliderStepValue
|
|
117
|
-
}
|
|
118
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import BuildFormWrapperForStorybook from '../storybookWrappers/BuildFormWrapperForStorybook';
|
|
20
|
-
import { qPreferredTerminologyServer } from '../assets/questionnaires';
|
|
21
|
-
|
|
22
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
23
|
-
const meta = {
|
|
24
|
-
title: 'SDC/Other Extensions',
|
|
25
|
-
component: BuildFormWrapperForStorybook,
|
|
26
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
27
|
-
tags: []
|
|
28
|
-
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
29
|
-
|
|
30
|
-
export default meta;
|
|
31
|
-
type Story = StoryObj<typeof meta>;
|
|
32
|
-
|
|
33
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
34
|
-
|
|
35
|
-
export const PreferredTerminologyServer: Story = {
|
|
36
|
-
args: {
|
|
37
|
-
questionnaire: qPreferredTerminologyServer
|
|
38
|
-
}
|
|
39
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
19
|
-
import BuildFormWrapperForStorybook from '../storybookWrappers/BuildFormWrapperForStorybook';
|
|
20
|
-
import {
|
|
21
|
-
qParameterisedValueSetBasic,
|
|
22
|
-
qParameterisedValueSetMultiple
|
|
23
|
-
} from '../assets/questionnaires/QParameterisedValueSets';
|
|
24
|
-
|
|
25
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
26
|
-
const meta = {
|
|
27
|
-
title: 'SDC/Parameterised Value Sets',
|
|
28
|
-
component: BuildFormWrapperForStorybook,
|
|
29
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
30
|
-
tags: []
|
|
31
|
-
} satisfies Meta<typeof BuildFormWrapperForStorybook>;
|
|
32
|
-
|
|
33
|
-
export default meta;
|
|
34
|
-
type Story = StoryObj<typeof meta>;
|
|
35
|
-
|
|
36
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
37
|
-
|
|
38
|
-
export const ParameterisedValueSetBasic: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
questionnaire: qParameterisedValueSetBasic
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const ParameterisedValueSetMultipleParams: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
questionnaire: qParameterisedValueSetMultiple
|
|
47
|
-
}
|
|
48
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
21
|
-
import { Box, IconButton, Tooltip } from '@mui/material';
|
|
22
|
-
import Iconify from '../../components/Iconify/Iconify';
|
|
23
|
-
import { buildForm } from '../../utils';
|
|
24
|
-
import { STORYBOOK_TERMINOLOGY_SERVER_URL } from './globals';
|
|
25
|
-
|
|
26
|
-
interface BuildFormButtonProps {
|
|
27
|
-
questionnaire: Questionnaire;
|
|
28
|
-
questionnaireResponse?: QuestionnaireResponse;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function BuildFormButtonForStorybook(props: BuildFormButtonProps) {
|
|
32
|
-
const { questionnaire, questionnaireResponse } = props;
|
|
33
|
-
|
|
34
|
-
async function handleBuildForm() {
|
|
35
|
-
await buildForm(
|
|
36
|
-
questionnaire,
|
|
37
|
-
questionnaireResponse,
|
|
38
|
-
undefined,
|
|
39
|
-
STORYBOOK_TERMINOLOGY_SERVER_URL
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Box display="flex" mb={0.5} alignItems="center" columnGap={3}>
|
|
45
|
-
<Tooltip title="Build form with questionnaire response" placement="right">
|
|
46
|
-
<IconButton onClick={handleBuildForm} size="small" color="primary">
|
|
47
|
-
<Iconify icon="ph:hammer" />
|
|
48
|
-
</IconButton>
|
|
49
|
-
</Tooltip>
|
|
50
|
-
</Box>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default BuildFormButtonForStorybook;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
21
|
-
import { BaseRenderer } from '../../components';
|
|
22
|
-
import { QueryClientProvider } from '@tanstack/react-query';
|
|
23
|
-
import { RendererThemeProvider } from '../../theme';
|
|
24
|
-
import { useBuildForm, useRendererQueryClient } from '../../hooks';
|
|
25
|
-
import BuildFormButtonForStorybook from './BuildFormButtonForStorybook';
|
|
26
|
-
import { STORYBOOK_TERMINOLOGY_SERVER_URL } from './globals';
|
|
27
|
-
|
|
28
|
-
interface BuildFormButtonTesterWrapperForStorybookProps {
|
|
29
|
-
questionnaire: Questionnaire;
|
|
30
|
-
questionnaireResponse?: QuestionnaireResponse;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* This is a demo wrapper which initialises the BaseRenderer with the passed in questionnaire using useBuildForm.
|
|
35
|
-
* It also provides a button to build the form with the passed in questionnaire + questionnaireResponse.
|
|
36
|
-
* It was done as a two-step process for demo purposes.
|
|
37
|
-
*
|
|
38
|
-
* Use this pattern if you already have a pre-populated/pre-filled/draft response.
|
|
39
|
-
* If you want to pre-pop on the fly, see https://github.com/aehrc/smart-forms/blob/main/packages/smart-forms-renderer/src/stories/storybookWrappers/PrePopWrapperForStorybook.tsx instead
|
|
40
|
-
*
|
|
41
|
-
* @author Sean Fong
|
|
42
|
-
*/
|
|
43
|
-
function BuildFormButtonTesterWrapperForStorybook(
|
|
44
|
-
props: BuildFormButtonTesterWrapperForStorybookProps
|
|
45
|
-
) {
|
|
46
|
-
const { questionnaire, questionnaireResponse } = props;
|
|
47
|
-
|
|
48
|
-
const queryClient = useRendererQueryClient();
|
|
49
|
-
|
|
50
|
-
const isBuilding = useBuildForm(
|
|
51
|
-
questionnaire,
|
|
52
|
-
undefined,
|
|
53
|
-
undefined,
|
|
54
|
-
STORYBOOK_TERMINOLOGY_SERVER_URL
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
if (isBuilding) {
|
|
58
|
-
return <div>Loading...</div>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<RendererThemeProvider>
|
|
63
|
-
<QueryClientProvider client={queryClient}>
|
|
64
|
-
<div>
|
|
65
|
-
<BuildFormButtonForStorybook
|
|
66
|
-
questionnaire={questionnaire}
|
|
67
|
-
questionnaireResponse={questionnaireResponse}
|
|
68
|
-
/>
|
|
69
|
-
<BaseRenderer />
|
|
70
|
-
</div>
|
|
71
|
-
</QueryClientProvider>
|
|
72
|
-
</RendererThemeProvider>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default BuildFormButtonTesterWrapperForStorybook;
|