sdc-qrf 0.3.16 → 0.3.17
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/README.md +2 -0
- package/{lib → dist}/components.d.ts +3 -4
- package/dist/components.d.ts.map +1 -0
- package/{lib → dist}/components.js +84 -44
- package/dist/components.js.map +1 -0
- package/{lib → dist}/context.d.ts +1 -0
- package/dist/context.d.ts.map +1 -0
- package/{lib → dist}/converter/extensions.d.ts +2 -1
- package/dist/converter/extensions.d.ts.map +1 -0
- package/{lib → dist}/converter/extensions.js +9 -13
- package/dist/converter/extensions.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/index.d.ts +2 -1
- package/dist/converter/fceToFhir/index.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/index.js +2 -3
- package/dist/converter/fceToFhir/index.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/index.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaire/index.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/index.js +6 -6
- package/dist/converter/fceToFhir/questionnaire/index.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/processExtensions.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaire/processExtensions.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/processExtensions.js +4 -7
- package/dist/converter/fceToFhir/questionnaire/processExtensions.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/processItems.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaire/processItems.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/processItems.js +19 -18
- package/dist/converter/fceToFhir/questionnaire/processItems.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/processMeta.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaire/processMeta.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaire/processMeta.js +3 -6
- package/dist/converter/fceToFhir/questionnaire/processMeta.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaireResponse/index.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaireResponse/index.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaireResponse/index.js +5 -4
- package/dist/converter/fceToFhir/questionnaireResponse/index.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaireResponse/processAnswers.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaireResponse/processAnswers.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaireResponse/processAnswers.js +8 -7
- package/dist/converter/fceToFhir/questionnaireResponse/processAnswers.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaireResponse/processMeta.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaireResponse/processMeta.d.ts.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaireResponse/processMeta.js +2 -4
- package/dist/converter/fceToFhir/questionnaireResponse/processMeta.js.map +1 -0
- package/{lib → dist}/converter/fceToFhir/questionnaireResponse/processReference.d.ts +2 -1
- package/dist/converter/fceToFhir/questionnaireResponse/processReference.d.ts.map +1 -0
- package/dist/converter/fceToFhir/questionnaireResponse/processReference.js +30 -0
- package/dist/converter/fceToFhir/questionnaireResponse/processReference.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/index.d.ts +2 -1
- package/dist/converter/fhirToFce/index.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/index.js +2 -3
- package/dist/converter/fhirToFce/index.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaire/index.d.ts +2 -1
- package/dist/converter/fhirToFce/questionnaire/index.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaire/index.js +12 -6
- package/dist/converter/fhirToFce/questionnaire/index.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaire/processExtensions.d.ts +1 -0
- package/dist/converter/fhirToFce/questionnaire/processExtensions.d.ts.map +1 -0
- package/dist/converter/fhirToFce/questionnaire/processExtensions.js +79 -0
- package/dist/converter/fhirToFce/questionnaire/processExtensions.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaire/processItems.d.ts +2 -1
- package/dist/converter/fhirToFce/questionnaire/processItems.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaire/processItems.js +21 -17
- package/dist/converter/fhirToFce/questionnaire/processItems.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaire/processMeta.d.ts +1 -0
- package/dist/converter/fhirToFce/questionnaire/processMeta.d.ts.map +1 -0
- package/dist/converter/fhirToFce/questionnaire/processMeta.js +16 -0
- package/dist/converter/fhirToFce/questionnaire/processMeta.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/index.d.ts +2 -1
- package/dist/converter/fhirToFce/questionnaireResponse/index.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/index.js +5 -4
- package/dist/converter/fhirToFce/questionnaireResponse/index.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/processAnswers.d.ts +1 -0
- package/dist/converter/fhirToFce/questionnaireResponse/processAnswers.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/processAnswers.js +10 -10
- package/dist/converter/fhirToFce/questionnaireResponse/processAnswers.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/processMeta.d.ts +2 -1
- package/dist/converter/fhirToFce/questionnaireResponse/processMeta.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/processMeta.js +4 -6
- package/dist/converter/fhirToFce/questionnaireResponse/processMeta.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/processReference.d.ts +2 -1
- package/dist/converter/fhirToFce/questionnaireResponse/processReference.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/questionnaireResponse/processReference.js +5 -7
- package/dist/converter/fhirToFce/questionnaireResponse/processReference.js.map +1 -0
- package/{lib → dist}/converter/fhirToFce/utils.d.ts +1 -0
- package/dist/converter/fhirToFce/utils.d.ts.map +1 -0
- package/{lib → dist}/converter/fhirToFce/utils.js +5 -7
- package/dist/converter/fhirToFce/utils.js.map +1 -0
- package/{lib → dist}/converter/index.d.ts +2 -1
- package/dist/converter/index.d.ts.map +1 -0
- package/{lib → dist}/converter/index.js +40 -18
- package/dist/converter/index.js.map +1 -0
- package/{lib → dist}/converter/utils.d.ts +1 -0
- package/dist/converter/utils.d.ts.map +1 -0
- package/{lib → dist}/converter/utils.js +5 -4
- package/dist/converter/utils.js.map +1 -0
- package/{lib → dist}/hooks.d.ts +1 -0
- package/dist/hooks.d.ts.map +1 -0
- package/{lib → dist}/hooks.js +1 -2
- package/dist/hooks.js.map +1 -0
- package/{lib → dist}/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/{lib → dist}/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -0
- package/{lib → dist}/utils.d.ts +3 -2
- package/dist/utils.d.ts.map +1 -0
- package/{lib → dist}/utils.js +121 -100
- package/dist/utils.js.map +1 -0
- package/package.json +47 -38
- package/src/components.tsx +27 -98
- package/src/converter/__tests__/fce.test.ts +2 -1
- package/src/converter/extensions.ts +10 -19
- package/src/converter/fceToFhir/index.ts +1 -1
- package/src/converter/fceToFhir/questionnaire/index.ts +1 -1
- package/src/converter/fceToFhir/questionnaire/processExtensions.ts +1 -1
- package/src/converter/fceToFhir/questionnaire/processItems.ts +9 -24
- package/src/converter/fceToFhir/questionnaire/processMeta.ts +1 -1
- package/src/converter/fceToFhir/questionnaireResponse/index.ts +1 -1
- package/src/converter/fceToFhir/questionnaireResponse/processAnswers.ts +4 -6
- package/src/converter/fceToFhir/questionnaireResponse/processMeta.ts +1 -1
- package/src/converter/fceToFhir/questionnaireResponse/processReference.ts +1 -1
- package/src/converter/fhirToFce/index.ts +1 -1
- package/src/converter/fhirToFce/questionnaire/index.ts +1 -1
- package/src/converter/fhirToFce/questionnaire/processItems.ts +1 -1
- package/src/converter/fhirToFce/questionnaireResponse/index.ts +1 -1
- package/src/converter/fhirToFce/questionnaireResponse/processAnswers.ts +5 -7
- package/src/converter/fhirToFce/questionnaireResponse/processMeta.ts +1 -1
- package/src/converter/fhirToFce/questionnaireResponse/processReference.ts +1 -1
- package/src/converter/index.ts +1 -1
- package/src/setupTests.ts +1 -1
- package/src/types.ts +1 -1
- package/src/utils.ts +23 -55
- package/lib/components.js.map +0 -1
- package/lib/converter/extensions.js.map +0 -1
- package/lib/converter/fceToFhir/index.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaire/index.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaire/processExtensions.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaire/processItems.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaire/processMeta.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaireResponse/index.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaireResponse/processAnswers.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaireResponse/processMeta.js.map +0 -1
- package/lib/converter/fceToFhir/questionnaireResponse/processReference.js +0 -23
- package/lib/converter/fceToFhir/questionnaireResponse/processReference.js.map +0 -1
- package/lib/converter/fhirToFce/index.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaire/index.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaire/processExtensions.js +0 -90
- package/lib/converter/fhirToFce/questionnaire/processExtensions.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaire/processItems.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaire/processMeta.js +0 -14
- package/lib/converter/fhirToFce/questionnaire/processMeta.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaireResponse/index.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaireResponse/processAnswers.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaireResponse/processMeta.js.map +0 -1
- package/lib/converter/fhirToFce/questionnaireResponse/processReference.js.map +0 -1
- package/lib/converter/fhirToFce/utils.js.map +0 -1
- package/lib/converter/index.js.map +0 -1
- package/lib/converter/utils.js.map +0 -1
- package/lib/hooks.js.map +0 -1
- package/lib/index.js +0 -9
- package/lib/index.js.map +0 -1
- package/lib/setupTests.d.ts +0 -1
- package/lib/setupTests.js +0 -4
- package/lib/setupTests.js.map +0 -1
- package/lib/utils.js.map +0 -1
- /package/{lib → dist}/context.js +0 -0
- /package/{lib → dist}/context.js.map +0 -0
- /package/{lib → dist}/types.js +0 -0
- /package/{lib → dist}/types.js.map +0 -0
package/src/components.tsx
CHANGED
|
@@ -2,23 +2,17 @@ import { Expression } from 'fhir/r4b';
|
|
|
2
2
|
import fhirpath from 'fhirpath';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import isEqual from 'lodash/isEqual';
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { PropsWithChildren, useEffect, useContext, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { QuestionnaireItem } from '
|
|
7
|
+
import { QuestionnaireItem } from '@beda.software/aidbox-types';
|
|
8
8
|
|
|
9
9
|
import { useQuestionnaireResponseFormContext } from '.';
|
|
10
10
|
import { QRFContext } from './context';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
ItemContext,
|
|
14
|
-
QRFContextData,
|
|
15
|
-
QuestionItemProps,
|
|
16
|
-
QuestionItemsProps,
|
|
17
|
-
} from './types';
|
|
18
|
-
import { calcContext, getBranchItems, getEnabledQuestions, wrapAnswerValue } from './utils';
|
|
11
|
+
import { FormAnswerItems, ItemContext, QRFContextData, QuestionItemProps, QuestionItemsProps } from './types';
|
|
12
|
+
import { calcContext, getBranchItems, getEnabledQuestions, wrapAnswerValue } from './utils.js';
|
|
19
13
|
|
|
20
14
|
export function usePreviousValue<T = any>(value: T) {
|
|
21
|
-
const prevValue = useRef<T>();
|
|
15
|
+
const prevValue = useRef<T | undefined>(value);
|
|
22
16
|
|
|
23
17
|
useEffect(() => {
|
|
24
18
|
prevValue.current = value;
|
|
@@ -38,14 +32,7 @@ export function QuestionItems(props: QuestionItemsProps) {
|
|
|
38
32
|
return (
|
|
39
33
|
<React.Fragment>
|
|
40
34
|
{getEnabledQuestions(questionItems, parentPath, formValues, context).map((item) => {
|
|
41
|
-
return
|
|
42
|
-
<QuestionItem
|
|
43
|
-
key={item.linkId}
|
|
44
|
-
questionItem={item}
|
|
45
|
-
context={context}
|
|
46
|
-
parentPath={parentPath}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
35
|
+
return <QuestionItem key={item.linkId} questionItem={item} context={context} parentPath={parentPath} />;
|
|
49
36
|
})}
|
|
50
37
|
</React.Fragment>
|
|
51
38
|
);
|
|
@@ -64,34 +51,19 @@ export function QuestionItem(props: QuestionItemProps) {
|
|
|
64
51
|
const [questionItem, setQuestionItem] = useState(initialQuestionItem);
|
|
65
52
|
const prevQuestionItem: QuestionnaireItem | undefined = usePreviousValue(questionItem);
|
|
66
53
|
|
|
67
|
-
const {
|
|
68
|
-
|
|
69
|
-
linkId,
|
|
70
|
-
calculatedExpression,
|
|
71
|
-
variable,
|
|
72
|
-
repeats,
|
|
73
|
-
itemControl,
|
|
74
|
-
_text,
|
|
75
|
-
_readOnly,
|
|
76
|
-
_required,
|
|
77
|
-
} = questionItem;
|
|
54
|
+
const { type, linkId, calculatedExpression, variable, repeats, itemControl, _text, _readOnly, _required } =
|
|
55
|
+
questionItem;
|
|
78
56
|
const fieldPath = useMemo(() => [...parentPath, linkId!], [parentPath, linkId]);
|
|
79
57
|
|
|
80
58
|
// TODO: how to do when item is not in QR (e.g. default element of repeatable group)
|
|
81
|
-
const branchItems = getBranchItems(
|
|
82
|
-
fieldPath,
|
|
83
|
-
initialContext.questionnaire,
|
|
84
|
-
initialContext.resource,
|
|
85
|
-
);
|
|
59
|
+
const branchItems = getBranchItems(fieldPath, initialContext.questionnaire, initialContext.resource);
|
|
86
60
|
const context =
|
|
87
61
|
type === 'group'
|
|
88
62
|
? branchItems.qrItems.map((curQRItem) =>
|
|
89
63
|
calcContext(initialContext, variable, branchItems.qItem, curQRItem),
|
|
90
64
|
)
|
|
91
65
|
: calcContext(initialContext, variable, branchItems.qItem, branchItems.qrItems[0]!);
|
|
92
|
-
const prevAnswers: FormAnswerItems[] | undefined = usePreviousValue(
|
|
93
|
-
_.get(formValues, fieldPath),
|
|
94
|
-
);
|
|
66
|
+
const prevAnswers: FormAnswerItems[] | undefined = usePreviousValue(_.get(formValues, fieldPath));
|
|
95
67
|
|
|
96
68
|
const itemContext = isGroupItem(questionItem, context) ? context[0] : context;
|
|
97
69
|
|
|
@@ -141,12 +113,8 @@ export function QuestionItem(props: QuestionItemProps) {
|
|
|
141
113
|
if (itemContext && _text) {
|
|
142
114
|
const cqfExpression = _text.cqfExpression;
|
|
143
115
|
const calculatedValue =
|
|
144
|
-
evaluateQuestionItemExpression(
|
|
145
|
-
|
|
146
|
-
'_text.cqfExpression',
|
|
147
|
-
itemContext,
|
|
148
|
-
cqfExpression,
|
|
149
|
-
)[0] ?? initialQuestionItem.text;
|
|
116
|
+
evaluateQuestionItemExpression(linkId, '_text.cqfExpression', itemContext, cqfExpression)[0] ??
|
|
117
|
+
initialQuestionItem.text;
|
|
150
118
|
|
|
151
119
|
if (prevQuestionItem?.text !== calculatedValue) {
|
|
152
120
|
setQuestionItem((qi) => ({
|
|
@@ -159,12 +127,8 @@ export function QuestionItem(props: QuestionItemProps) {
|
|
|
159
127
|
if (itemContext && _readOnly) {
|
|
160
128
|
const cqfExpression = _readOnly.cqfExpression;
|
|
161
129
|
const calculatedValue =
|
|
162
|
-
evaluateQuestionItemExpression(
|
|
163
|
-
|
|
164
|
-
'_readOnly.cqfExpression',
|
|
165
|
-
itemContext,
|
|
166
|
-
cqfExpression,
|
|
167
|
-
)[0] ?? initialQuestionItem.readOnly;
|
|
130
|
+
evaluateQuestionItemExpression(linkId, '_readOnly.cqfExpression', itemContext, cqfExpression)[0] ??
|
|
131
|
+
initialQuestionItem.readOnly;
|
|
168
132
|
|
|
169
133
|
if (prevQuestionItem?.readOnly !== calculatedValue) {
|
|
170
134
|
setQuestionItem((qi) => ({
|
|
@@ -177,12 +141,8 @@ export function QuestionItem(props: QuestionItemProps) {
|
|
|
177
141
|
if (itemContext && _required) {
|
|
178
142
|
const cqfExpression = _required.cqfExpression;
|
|
179
143
|
const calculatedValue =
|
|
180
|
-
evaluateQuestionItemExpression(
|
|
181
|
-
|
|
182
|
-
'_required.cqfExpression',
|
|
183
|
-
itemContext,
|
|
184
|
-
cqfExpression,
|
|
185
|
-
)[0] ?? initialQuestionItem.required;
|
|
144
|
+
evaluateQuestionItemExpression(linkId, '_required.cqfExpression', itemContext, cqfExpression)[0] ??
|
|
145
|
+
initialQuestionItem.required;
|
|
186
146
|
|
|
187
147
|
if (prevQuestionItem?.required !== calculatedValue) {
|
|
188
148
|
setQuestionItem((qi) => ({
|
|
@@ -195,28 +155,18 @@ export function QuestionItem(props: QuestionItemProps) {
|
|
|
195
155
|
|
|
196
156
|
if (isGroupItem(questionItem, context)) {
|
|
197
157
|
if (itemControl) {
|
|
198
|
-
if (
|
|
199
|
-
!
|
|
200
|
-
!itemControlGroupItemComponents[itemControl.coding![0]!.code!]
|
|
201
|
-
) {
|
|
202
|
-
console.warn(`QRF: Unsupported group itemControl '${itemControl.coding![0]!
|
|
203
|
-
.code!}'.
|
|
158
|
+
if (!itemControlGroupItemComponents || !itemControlGroupItemComponents[itemControl.coding![0]!.code!]) {
|
|
159
|
+
console.warn(`QRF: Unsupported group itemControl '${itemControl.coding![0]!.code!}'.
|
|
204
160
|
Please define 'itemControlGroupWidgets' for '${itemControl.coding![0]!.code!}'`);
|
|
205
161
|
const DefaultComponent = groupItemComponent;
|
|
206
162
|
return DefaultComponent ? (
|
|
207
|
-
<DefaultComponent
|
|
208
|
-
context={context}
|
|
209
|
-
parentPath={parentPath}
|
|
210
|
-
questionItem={questionItem}
|
|
211
|
-
/>
|
|
163
|
+
<DefaultComponent context={context} parentPath={parentPath} questionItem={questionItem} />
|
|
212
164
|
) : null;
|
|
213
165
|
}
|
|
214
166
|
|
|
215
167
|
const Component = itemControlGroupItemComponents[itemControl.coding![0]!.code!]!;
|
|
216
168
|
|
|
217
|
-
return
|
|
218
|
-
<Component context={context} parentPath={parentPath} questionItem={questionItem} />
|
|
219
|
-
);
|
|
169
|
+
return <Component context={context} parentPath={parentPath} questionItem={questionItem} />;
|
|
220
170
|
}
|
|
221
171
|
if (!groupItemComponent) {
|
|
222
172
|
console.warn(`QRF: groupWidget is not specified but used in questionnaire.`);
|
|
@@ -226,20 +176,11 @@ export function QuestionItem(props: QuestionItemProps) {
|
|
|
226
176
|
|
|
227
177
|
const GroupWidgetComponent = groupItemComponent;
|
|
228
178
|
|
|
229
|
-
return
|
|
230
|
-
<GroupWidgetComponent
|
|
231
|
-
context={context}
|
|
232
|
-
parentPath={parentPath}
|
|
233
|
-
questionItem={questionItem}
|
|
234
|
-
/>
|
|
235
|
-
);
|
|
179
|
+
return <GroupWidgetComponent context={context} parentPath={parentPath} questionItem={questionItem} />;
|
|
236
180
|
}
|
|
237
181
|
|
|
238
182
|
if (itemControl) {
|
|
239
|
-
if (
|
|
240
|
-
!itemControlQuestionItemComponents ||
|
|
241
|
-
!itemControlQuestionItemComponents[itemControl.coding![0]!.code!]
|
|
242
|
-
) {
|
|
183
|
+
if (!itemControlQuestionItemComponents || !itemControlQuestionItemComponents[itemControl.coding![0]!.code!]) {
|
|
243
184
|
console.warn(
|
|
244
185
|
`QRF: Unsupported itemControl '${itemControl.coding![0]!.code!}'.
|
|
245
186
|
Please define 'itemControlWidgets' for '${itemControl.coding![0]!.code!}'`,
|
|
@@ -247,11 +188,7 @@ Please define 'itemControlWidgets' for '${itemControl.coding![0]!.code!}'`,
|
|
|
247
188
|
|
|
248
189
|
const DefaultComponent = questionItemComponents[questionItem.type];
|
|
249
190
|
return DefaultComponent ? (
|
|
250
|
-
<DefaultComponent
|
|
251
|
-
context={context}
|
|
252
|
-
parentPath={parentPath}
|
|
253
|
-
questionItem={questionItem}
|
|
254
|
-
/>
|
|
191
|
+
<DefaultComponent context={context} parentPath={parentPath} questionItem={questionItem} />
|
|
255
192
|
) : null;
|
|
256
193
|
}
|
|
257
194
|
|
|
@@ -262,9 +199,7 @@ Please define 'itemControlWidgets' for '${itemControl.coding![0]!.code!}'`,
|
|
|
262
199
|
|
|
263
200
|
// TODO: deprecate!
|
|
264
201
|
if (customWidgets && linkId && linkId in customWidgets) {
|
|
265
|
-
console.warn(
|
|
266
|
-
`QRF: 'customWidgets' are deprecated, use 'Questionnaire.item.itemControl' instead`,
|
|
267
|
-
);
|
|
202
|
+
console.warn(`QRF: 'customWidgets' are deprecated, use 'Questionnaire.item.itemControl' instead`);
|
|
268
203
|
|
|
269
204
|
if (type === 'group') {
|
|
270
205
|
console.error(`QRF: Use 'itemControl' for group custom widgets`);
|
|
@@ -287,18 +222,12 @@ Please define 'itemControlWidgets' for '${itemControl.coding![0]!.code!}'`,
|
|
|
287
222
|
return null;
|
|
288
223
|
}
|
|
289
224
|
|
|
290
|
-
export function QuestionnaireResponseFormProvider({
|
|
291
|
-
children,
|
|
292
|
-
...props
|
|
293
|
-
}: QRFContextData & { children: ReactChild }) {
|
|
225
|
+
export function QuestionnaireResponseFormProvider({ children, ...props }: PropsWithChildren<QRFContextData>) {
|
|
294
226
|
return <QRFContext.Provider value={props}>{children}</QRFContext.Provider>;
|
|
295
227
|
}
|
|
296
228
|
|
|
297
229
|
/* Helper that resolves right context type */
|
|
298
|
-
function isGroupItem(
|
|
299
|
-
questionItem: QuestionnaireItem,
|
|
300
|
-
context: ItemContext | ItemContext[],
|
|
301
|
-
): context is ItemContext[] {
|
|
230
|
+
function isGroupItem(questionItem: QuestionnaireItem, context: ItemContext | ItemContext[]): context is ItemContext[] {
|
|
302
231
|
return questionItem.type === 'group';
|
|
303
232
|
}
|
|
304
233
|
|
|
@@ -318,7 +247,7 @@ export function evaluateQuestionItemExpression(
|
|
|
318
247
|
}
|
|
319
248
|
|
|
320
249
|
try {
|
|
321
|
-
return fhirpath.evaluate(context.context ?? {}, expression.expression!, context);
|
|
250
|
+
return fhirpath.evaluate(context.context ?? {}, expression.expression!, context, undefined, { async: false });
|
|
322
251
|
} catch (err: unknown) {
|
|
323
252
|
throw Error(`FHIRPath expression evaluation failure for ${linkId}.${path}: ${err}`);
|
|
324
253
|
}
|
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
QuestionnaireResponse as FHIRQuestionnaireResponse,
|
|
3
3
|
Questionnaire as FHIRQuestionnaire,
|
|
4
4
|
} from 'fhir/r4b';
|
|
5
|
+
import {describe, expect, test} from 'vitest'
|
|
5
6
|
|
|
6
7
|
import {
|
|
7
8
|
QuestionnaireResponse as FCEQuestionnaireResponse,
|
|
8
9
|
Questionnaire as FCEQuestionnaire,
|
|
9
|
-
} from '
|
|
10
|
+
} from '@beda.software/aidbox-types';
|
|
10
11
|
|
|
11
12
|
// fce questionnaire
|
|
12
13
|
import fce_allergies from './resources/questionnaire_fce/allergies.json';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Extension as FHIRExtension } from 'fhir/r4b';
|
|
2
2
|
|
|
3
|
-
import { QuestionnaireItem as FCEQuestionnaireItem } from '
|
|
3
|
+
import { QuestionnaireItem as FCEQuestionnaireItem } from '@beda.software/aidbox-types';
|
|
4
4
|
|
|
5
5
|
export enum ExtensionIdentifier {
|
|
6
6
|
Hidden = 'http://hl7.org/fhir/StructureDefinition/questionnaire-hidden',
|
|
@@ -50,9 +50,7 @@ export type ExtensionTransformer = {
|
|
|
50
50
|
[key in ExtensionIdentifier]:
|
|
51
51
|
| {
|
|
52
52
|
transform: {
|
|
53
|
-
fromExtensions: (
|
|
54
|
-
extensions: FHIRExtension[],
|
|
55
|
-
) => Partial<FCEQuestionnaireItem> | undefined;
|
|
53
|
+
fromExtensions: (extensions: FHIRExtension[]) => Partial<FCEQuestionnaireItem> | undefined;
|
|
56
54
|
toExtensions: (item: FCEQuestionnaireItem) => FHIRExtension[];
|
|
57
55
|
};
|
|
58
56
|
}
|
|
@@ -186,16 +184,11 @@ export const extensionTransformers: ExtensionTransformer = {
|
|
|
186
184
|
|
|
187
185
|
return {
|
|
188
186
|
key: itemConstraintExtension.find((obj) => obj.url === 'key')!.valueId!,
|
|
189
|
-
requirements: itemConstraintExtension.find(
|
|
190
|
-
|
|
191
|
-
)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
human: itemConstraintExtension.find((obj) => obj.url === 'human')!
|
|
195
|
-
.valueString!,
|
|
196
|
-
expression: itemConstraintExtension.find(
|
|
197
|
-
(obj) => obj.url === 'expression',
|
|
198
|
-
)!.valueString!,
|
|
187
|
+
requirements: itemConstraintExtension.find((obj) => obj.url === 'requirements')
|
|
188
|
+
?.valueString,
|
|
189
|
+
severity: itemConstraintExtension.find((obj) => obj.url === 'severity')!.valueCode!,
|
|
190
|
+
human: itemConstraintExtension.find((obj) => obj.url === 'human')!.valueString!,
|
|
191
|
+
expression: itemConstraintExtension.find((obj) => obj.url === 'expression')!.valueString!,
|
|
199
192
|
};
|
|
200
193
|
}),
|
|
201
194
|
};
|
|
@@ -254,10 +247,8 @@ export const extensionTransformers: ExtensionTransformer = {
|
|
|
254
247
|
|
|
255
248
|
return {
|
|
256
249
|
forDisplay:
|
|
257
|
-
choiceColumnExtension.find((obj) => obj.url === 'forDisplay')
|
|
258
|
-
|
|
259
|
-
path: choiceColumnExtension.find((obj) => obj.url === 'path')
|
|
260
|
-
?.valueString,
|
|
250
|
+
choiceColumnExtension.find((obj) => obj.url === 'forDisplay')?.valueBoolean ?? false,
|
|
251
|
+
path: choiceColumnExtension.find((obj) => obj.url === 'path')?.valueString,
|
|
261
252
|
};
|
|
262
253
|
}),
|
|
263
254
|
};
|
|
@@ -284,7 +275,7 @@ export const extensionTransformers: ExtensionTransformer = {
|
|
|
284
275
|
},
|
|
285
276
|
},
|
|
286
277
|
[ExtensionIdentifier.CqfExpression]: {
|
|
287
|
-
// @ts-
|
|
278
|
+
// @ts-expect-error: Type '"cqfExpression"' is not assignable to type 'keyof QuestionnaireItem'
|
|
288
279
|
path: { extension: 'valueExpression', questionnaire: 'cqfExpression' },
|
|
289
280
|
},
|
|
290
281
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
Questionnaire as FCEQuestionnaire,
|
|
8
8
|
QuestionnaireResponse as FCEQuestionnaireResponse,
|
|
9
|
-
} from '
|
|
9
|
+
} from '@beda.software/aidbox-types';
|
|
10
10
|
|
|
11
11
|
import { convertQuestionnaire } from './questionnaire';
|
|
12
12
|
import { convertQuestionnaireResponse } from './questionnaireResponse';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Questionnaire as FHIRQuestionnaire } from 'fhir/r4b';
|
|
2
2
|
import cloneDeep from 'lodash/cloneDeep';
|
|
3
3
|
|
|
4
|
-
import { Questionnaire as FCEQuestionnaire } from '
|
|
4
|
+
import { Questionnaire as FCEQuestionnaire } from '@beda.software/aidbox-types';
|
|
5
5
|
|
|
6
6
|
import { processExtensions } from './processExtensions';
|
|
7
7
|
import { processItems } from './processItems';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Extension as FHIRExtension, Questionnaire as FHIRQuestionnaire } from 'fhir/r4b';
|
|
2
2
|
|
|
3
|
-
import { Questionnaire as FCEQuestionnaire } from '
|
|
3
|
+
import { Questionnaire as FCEQuestionnaire } from '@beda.software/aidbox-types';
|
|
4
4
|
|
|
5
5
|
export function processExtensions(questionnaire: FCEQuestionnaire): FHIRQuestionnaire {
|
|
6
6
|
const { launchContext, mapping, sourceQueries, targetStructureMap, ...fhirQuestionnaire } =
|
|
@@ -13,14 +13,11 @@ import {
|
|
|
13
13
|
QuestionnaireItemEnableWhenAnswer as FCEQuestionnaireItemEnableWhenAnswer,
|
|
14
14
|
QuestionnaireItemAnswerOption as FCEQuestionnaireItemAnswerOption,
|
|
15
15
|
QuestionnaireItemInitial as FCEQuestionnaireItemInitial,
|
|
16
|
-
} from '
|
|
16
|
+
} from '@beda.software/aidbox-types';
|
|
17
17
|
|
|
18
18
|
import { convertFromFHIRExtension, convertToFHIRExtension, toFHIRReference } from '../..';
|
|
19
19
|
|
|
20
|
-
export function processItems(
|
|
21
|
-
items: FCEQuestionnaireItem[],
|
|
22
|
-
onlyExtensions = false,
|
|
23
|
-
): FHIRQuestionnaireItem[] {
|
|
20
|
+
export function processItems(items: FCEQuestionnaireItem[], onlyExtensions = false): FHIRQuestionnaireItem[] {
|
|
24
21
|
return items.map((item) => {
|
|
25
22
|
const extensions = convertToFHIRExtension(item);
|
|
26
23
|
if (extensions.length > 0) {
|
|
@@ -29,21 +26,13 @@ export function processItems(
|
|
|
29
26
|
.filter((ext): ext is Partial<FCEQuestionnaireItem> => ext !== undefined)
|
|
30
27
|
.flatMap(Object.keys);
|
|
31
28
|
for (const field of fieldsToOmit) {
|
|
32
|
-
//@ts-
|
|
29
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
33
30
|
delete item[field];
|
|
34
31
|
}
|
|
35
32
|
item.extension = extensions.sort();
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
const {
|
|
39
|
-
enableBehavior,
|
|
40
|
-
enableWhen,
|
|
41
|
-
answerOption,
|
|
42
|
-
initial,
|
|
43
|
-
item: nestedItems,
|
|
44
|
-
type,
|
|
45
|
-
...commonOptions
|
|
46
|
-
} = item;
|
|
35
|
+
const { enableBehavior, enableWhen, answerOption, initial, item: nestedItems, type, ...commonOptions } = item;
|
|
47
36
|
|
|
48
37
|
const fhirItem: FHIRQuestionnaireItem = {
|
|
49
38
|
...commonOptions,
|
|
@@ -54,19 +43,17 @@ export function processItems(
|
|
|
54
43
|
const element = item[property as keyof FCEQuestionnaireItem];
|
|
55
44
|
|
|
56
45
|
if (property.startsWith('_') && element instanceof Object) {
|
|
57
|
-
|
|
46
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
58
47
|
fhirItem[property] = {
|
|
59
48
|
// TODO: update convertToFHIRExtension to accept element type to convert
|
|
60
|
-
|
|
49
|
+
//@ts-expect-error: Argument of type is not assignable to parameter of type 'QuestionnaireItem'
|
|
61
50
|
extension: convertToFHIRExtension(element),
|
|
62
51
|
};
|
|
63
52
|
}
|
|
64
53
|
}
|
|
65
54
|
|
|
66
55
|
if (answerOption !== undefined) {
|
|
67
|
-
fhirItem.answerOption = onlyExtensions
|
|
68
|
-
? answerOption
|
|
69
|
-
: processAnswerOption(answerOption);
|
|
56
|
+
fhirItem.answerOption = onlyExtensions ? answerOption : processAnswerOption(answerOption);
|
|
70
57
|
}
|
|
71
58
|
|
|
72
59
|
if (enableBehavior !== undefined) {
|
|
@@ -96,7 +83,7 @@ const convertEnableWhen = (
|
|
|
96
83
|
answerType: string,
|
|
97
84
|
result: FHIRQuestionnaireItemEnableWhen,
|
|
98
85
|
) => {
|
|
99
|
-
//@ts-
|
|
86
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
100
87
|
if (answer[answerType] !== undefined) {
|
|
101
88
|
switch (answerType) {
|
|
102
89
|
case 'boolean':
|
|
@@ -135,9 +122,7 @@ const convertEnableWhen = (
|
|
|
135
122
|
}
|
|
136
123
|
};
|
|
137
124
|
|
|
138
|
-
function processAnswerOption(
|
|
139
|
-
options: FCEQuestionnaireItemAnswerOption[],
|
|
140
|
-
): FHIRQuestionnaireItemAnswerOption[] {
|
|
125
|
+
function processAnswerOption(options: FCEQuestionnaireItemAnswerOption[]): FHIRQuestionnaireItemAnswerOption[] {
|
|
141
126
|
return options.map((option) => {
|
|
142
127
|
const { value, ...commonOptions } = option;
|
|
143
128
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta as FHIRMeta } from 'fhir/r4b';
|
|
2
2
|
|
|
3
|
-
import { Meta as FCEMeta } from '
|
|
3
|
+
import { Meta as FCEMeta } from '@beda.software/aidbox-types';
|
|
4
4
|
|
|
5
5
|
export function processMeta(meta: FCEMeta): FHIRMeta {
|
|
6
6
|
const { createdAt, ...fhirMeta } = meta;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QuestionnaireResponse as FHIRQuestionnaireResponse } from 'fhir/r4b';
|
|
2
2
|
import cloneDeep from 'lodash/cloneDeep';
|
|
3
3
|
|
|
4
|
-
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '
|
|
4
|
+
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '@beda.software/aidbox-types';
|
|
5
5
|
|
|
6
6
|
import { processAnswers } from './processAnswers';
|
|
7
7
|
import { processMeta } from './processMeta';
|
|
@@ -4,7 +4,7 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
4
4
|
import {
|
|
5
5
|
QuestionnaireResponseItem as FCEQuestionnaireResponseItem,
|
|
6
6
|
QuestionnaireResponseItemAnswer as FCEQuestionnaireResponseItemAnswer,
|
|
7
|
-
} from '
|
|
7
|
+
} from '@beda.software/aidbox-types';
|
|
8
8
|
|
|
9
9
|
import { toFHIRReference } from '../../../converter';
|
|
10
10
|
|
|
@@ -19,9 +19,7 @@ export function processAnswers(items: FCEQuestionnaireResponseItem[]) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function processAnswer(
|
|
23
|
-
answerItem: FCEQuestionnaireResponseItemAnswer,
|
|
24
|
-
): FHIRQuestionnaireResponseItemAnswer {
|
|
22
|
+
function processAnswer(answerItem: FCEQuestionnaireResponseItemAnswer): FHIRQuestionnaireResponseItemAnswer {
|
|
25
23
|
if (!answerItem.value) {
|
|
26
24
|
return answerItem;
|
|
27
25
|
}
|
|
@@ -41,10 +39,10 @@ function processAnswer(
|
|
|
41
39
|
};
|
|
42
40
|
for (const key in valueMappings) {
|
|
43
41
|
if (key in value) {
|
|
44
|
-
//@ts-
|
|
42
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
45
43
|
const newKey = valueMappings[key];
|
|
46
44
|
if (newKey) {
|
|
47
|
-
//@ts-
|
|
45
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
48
46
|
fhirAnswerItem[newKey] = value[key];
|
|
49
47
|
}
|
|
50
48
|
break;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta as FHIRMeta } from 'fhir/r4b';
|
|
2
2
|
|
|
3
|
-
import { Meta as FCEMeta } from '
|
|
3
|
+
import { Meta as FCEMeta } from '@beda.software/aidbox-types';
|
|
4
4
|
|
|
5
5
|
export function processMeta(meta: FCEMeta): FHIRMeta {
|
|
6
6
|
const { createdAt, ...fhirMeta } = meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QuestionnaireResponse as FHIRQuestionnaireResponse } from 'fhir/r4b';
|
|
2
2
|
|
|
3
|
-
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '
|
|
3
|
+
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '@beda.software/aidbox-types';
|
|
4
4
|
|
|
5
5
|
export function processReference(fceQR: FCEQuestionnaireResponse): FHIRQuestionnaireResponse {
|
|
6
6
|
const { encounter, source, subject, ...commonProperties } = fceQR;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
Questionnaire as FCEQuestionnaire,
|
|
8
8
|
QuestionnaireResponse as FCEQuestionnaireResponse,
|
|
9
|
-
} from '
|
|
9
|
+
} from '@beda.software/aidbox-types';
|
|
10
10
|
|
|
11
11
|
import { convertQuestionnaire } from './questionnaire';
|
|
12
12
|
import { convertQuestionnaireResponse } from './questionnaireResponse';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Questionnaire as FHIRQuestionnaire } from 'fhir/r4b';
|
|
2
2
|
import cloneDeep from 'lodash/cloneDeep';
|
|
3
3
|
|
|
4
|
-
import { Questionnaire as FCEQuestionnaire } from '
|
|
4
|
+
import { Questionnaire as FCEQuestionnaire } from '@beda.software/aidbox-types';
|
|
5
5
|
|
|
6
6
|
import { processExtensions } from './processExtensions';
|
|
7
7
|
import { processItems } from './processItems';
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
QuestionnaireItemEnableWhenAnswer as FCEQuestionnaireItemEnableWhenAnswer,
|
|
15
15
|
QuestionnaireItemAnswerOption as FCEQuestionnaireItemAnswerOption,
|
|
16
16
|
QuestionnaireItemInitial as FCEQuestionnaireItemInitial,
|
|
17
|
-
} from '
|
|
17
|
+
} from '@beda.software/aidbox-types';
|
|
18
18
|
|
|
19
19
|
import { convertFromFHIRExtension, filterExtensions, fromFHIRReference } from '../../../converter';
|
|
20
20
|
import { ExtensionIdentifier } from '../../extensions';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QuestionnaireResponse as FHIRQuestionnaireResponse } from 'fhir/r4b';
|
|
2
2
|
import cloneDeep from 'lodash/cloneDeep';
|
|
3
3
|
|
|
4
|
-
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '
|
|
4
|
+
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '@beda.software/aidbox-types';
|
|
5
5
|
|
|
6
6
|
import { processAnswers } from './processAnswers';
|
|
7
7
|
import { processMeta } from './processMeta';
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from 'fhir/r4b';
|
|
8
8
|
import isEmpty from 'lodash/isEmpty';
|
|
9
9
|
|
|
10
|
-
import { QuestionnaireResponseItemAnswer as FCEQuestionnaireResponseItemAnswer } from '
|
|
10
|
+
import { QuestionnaireResponseItemAnswer as FCEQuestionnaireResponseItemAnswer } from '@beda.software/aidbox-types';
|
|
11
11
|
|
|
12
12
|
import { fromFHIRReference } from '../../../converter';
|
|
13
13
|
|
|
@@ -25,9 +25,7 @@ export function processAnswers(items: FHIRQuestionnaireResponseItem[]) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function processAnswer(
|
|
29
|
-
answer: FHIRQuestionnaireResponseItemAnswer,
|
|
30
|
-
): FCEQuestionnaireResponseItemAnswer {
|
|
28
|
+
function processAnswer(answer: FHIRQuestionnaireResponseItemAnswer): FCEQuestionnaireResponseItemAnswer {
|
|
31
29
|
const fceAnswer: FCEQuestionnaireResponseItemAnswer = { ...answer };
|
|
32
30
|
const valueHandlers = {
|
|
33
31
|
valueString: (value: string) => ({ string: value }),
|
|
@@ -47,11 +45,11 @@ function processAnswer(
|
|
|
47
45
|
|
|
48
46
|
for (const key in valueHandlers) {
|
|
49
47
|
if (key in fceAnswer) {
|
|
50
|
-
//@ts-
|
|
48
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
51
49
|
const value = fceAnswer[key];
|
|
52
|
-
//@ts-
|
|
50
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
53
51
|
delete fceAnswer[key];
|
|
54
|
-
//@ts-
|
|
52
|
+
//@ts-expect-error: Element implicitly has an 'any' type
|
|
55
53
|
fceAnswer.value = valueHandlers[key]?.(value);
|
|
56
54
|
}
|
|
57
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QuestionnaireResponse as FHIRQuestionnaireResponse } from 'fhir/r4b';
|
|
2
2
|
|
|
3
|
-
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '
|
|
3
|
+
import { QuestionnaireResponse as FCEQuestionnaireResponse } from '@beda.software/aidbox-types';
|
|
4
4
|
|
|
5
5
|
import { fromFHIRReference } from '../../../converter';
|
|
6
6
|
|
package/src/converter/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Extension as FCEExtension,
|
|
9
9
|
QuestionnaireItem as FCEQuestionnaireItem,
|
|
10
10
|
InternalReference,
|
|
11
|
-
} from '
|
|
11
|
+
} from '@beda.software/aidbox-types';
|
|
12
12
|
|
|
13
13
|
import { ExtensionIdentifier, extensionTransformers } from './extensions';
|
|
14
14
|
import { fromFirstClassExtension, fromFirstClassExtensionV2 } from './fceToFhir';
|
package/src/setupTests.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
1
|
+
// import '@testing-library/jest-dom/extend-expect';
|
package/src/types.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
QuestionnaireResponse,
|
|
9
9
|
QuestionnaireResponseItem,
|
|
10
10
|
QuestionnaireResponseItemAnswer,
|
|
11
|
-
} from '
|
|
11
|
+
} from '@beda.software/aidbox-types';
|
|
12
12
|
|
|
13
13
|
export type GroupItemComponent = ComponentType<GroupItemProps>;
|
|
14
14
|
export type QuestionItemComponent = ComponentType<QuestionItemProps>;
|