@aehrc/smart-forms-renderer 0.6.1 → 0.6.4
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 +88 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/package.json +15 -4
- package/src/index.ts +1 -2
- package/lib/api/populate.d.ts +0 -8
- package/lib/api/populate.js +0 -63
- package/lib/api/populate.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.d.ts +0 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.js +0 -25
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.d.ts +0 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.js +0 -25
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.d.ts +0 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.js +0 -25
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoice.d.ts +0 -9
- package/lib/components/FormComponents/ChoiceItems/QItemChoice.js +0 -61
- package/lib/components/FormComponents/ChoiceItems/QItemChoice.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.d.ts +0 -9
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.js +0 -89
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.js +0 -70
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.d.ts +0 -11
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.js +0 -67
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.js +0 -70
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.d.ts +0 -11
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.js +0 -72
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.d.ts +0 -8
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.js +0 -25
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.d.ts +0 -9
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.js +0 -73
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.d.ts +0 -9
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.js +0 -82
- package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.d.ts +0 -10
- package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.js +0 -35
- package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.d.ts +0 -10
- package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js +0 -25
- package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.d.ts +0 -10
- package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js +0 -35
- package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.d.ts +0 -10
- package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js +0 -31
- package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.d.ts +0 -10
- package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.js +0 -31
- package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.d.ts +0 -9
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.js +0 -49
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.d.ts +0 -9
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.js +0 -109
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.js +0 -105
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.js +0 -116
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.d.ts +0 -9
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.js +0 -75
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.d.ts +0 -9
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.js +0 -68
- package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoice.d.ts +0 -9
- package/lib/components/FormComponents/QItemChoice/QItemChoice.js +0 -61
- package/lib/components/FormComponents/QItemChoice/QItemChoice.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.d.ts +0 -9
- package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js +0 -89
- package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js +0 -70
- package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.d.ts +0 -11
- package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js +0 -67
- package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js +0 -70
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.d.ts +0 -11
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js +0 -72
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.d.ts +0 -8
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js +0 -25
- package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.d.ts +0 -9
- package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js +0 -73
- package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.d.ts +0 -9
- package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js +0 -82
- package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js.map +0 -1
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.d.ts +0 -9
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js +0 -49
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js.map +0 -1
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.d.ts +0 -9
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js +0 -109
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js.map +0 -1
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js +0 -105
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.d.ts +0 -11
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js +0 -116
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.d.ts +0 -9
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js +0 -75
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js.map +0 -1
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.d.ts +0 -9
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js +0 -68
- package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map +0 -1
- package/lib/components/FormRenderer/BaseRenderer.d.ts +0 -3
- package/lib/components/FormRenderer/BaseRenderer.js +0 -54
- package/lib/components/FormRenderer/BaseRenderer.js.map +0 -1
- package/lib/components/FormRenderer/FormBodyCollapsible.d.ts +0 -9
- package/lib/components/FormRenderer/FormBodyCollapsible.js +0 -57
- package/lib/components/FormRenderer/FormBodyCollapsible.js.map +0 -1
- package/lib/components/FormRenderer/FormBodySingleCollapsible.d.ts +0 -12
- package/lib/components/FormRenderer/FormBodySingleCollapsible.js +0 -39
- package/lib/components/FormRenderer/FormBodySingleCollapsible.js.map +0 -1
- package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.d.ts +0 -12
- package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.js +0 -31
- package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.js.map +0 -1
- package/lib/components/FormRenderer/FormBodyTabbed.d.ts +0 -9
- package/lib/components/FormRenderer/FormBodyTabbed.js +0 -60
- package/lib/components/FormRenderer/FormBodyTabbed.js.map +0 -1
- package/lib/components/FormRenderer/FormRenderer.d.ts +0 -3
- package/lib/components/FormRenderer/FormRenderer.js +0 -54
- package/lib/components/FormRenderer/FormRenderer.js.map +0 -1
- package/lib/components/FormRenderer/FormTitle.d.ts +0 -7
- package/lib/components/FormRenderer/FormTitle.js +0 -30
- package/lib/components/FormRenderer/FormTitle.js.map +0 -1
- package/lib/components/FormRenderer/FormTopLevelItem.d.ts +0 -9
- package/lib/components/FormRenderer/FormTopLevelItem.js +0 -45
- package/lib/components/FormRenderer/FormTopLevelItem.js.map +0 -1
- package/lib/components/FormRenderer/SmartFormsRenderer.d.ts +0 -9
- package/lib/components/FormRenderer/SmartFormsRenderer.js +0 -39
- package/lib/components/FormRenderer/SmartFormsRenderer.js.map +0 -1
- package/lib/components/FormRenderer/index.d.ts +0 -2
- package/lib/components/FormRenderer/index.js +0 -19
- package/lib/components/FormRenderer/index.js.map +0 -1
- package/lib/contexts/TestContext.d.ts +0 -11
- package/lib/contexts/TestContext.js +0 -32
- package/lib/contexts/TestContext.js.map +0 -1
- package/lib/contexts/index.d.ts +0 -1
- package/lib/contexts/index.js +0 -2
- package/lib/contexts/index.js.map +0 -1
- package/lib/hooks/useTestContext.d.ts +0 -5
- package/lib/hooks/useTestContext.js +0 -27
- package/lib/hooks/useTestContext.js.map +0 -1
- package/lib/stores/useConfigStore.d.ts +0 -18
- package/lib/stores/useConfigStore.js +0 -17
- package/lib/stores/useConfigStore.js.map +0 -1
- package/lib/stores/useSmartClientStore.d.ts +0 -7
- package/lib/stores/useSmartClientStore.js +0 -7
- package/lib/stores/useSmartClientStore.js.map +0 -1
- package/lib/theme/globalStyles.d.ts +0 -2
- package/lib/theme/globalStyles.js +0 -64
- package/lib/theme/globalStyles.js.map +0 -1
- package/lib/utils/populate.d.ts +0 -16
- package/lib/utils/populate.js +0 -78
- package/lib/utils/populate.js.map +0 -1
- package/lib/utils/populateCallback.d.ts +0 -6
- package/lib/utils/populateCallback.js +0 -40
- package/lib/utils/populateCallback.js.map +0 -1
- package/src/hooks/index.ts +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Smart Forms Renderer
|
|
2
|
+
This React-based package acts as the rendering engine for the [Smart Forms app](https://github.com/aehrc/smart-forms).
|
|
3
|
+
|
|
4
|
+
## Installation
|
|
5
|
+
```bash
|
|
6
|
+
npm install @aehrc/smart-forms-renderer
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Basic Usage
|
|
10
|
+
|
|
11
|
+
```typescript jsx
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { SmartFormsRenderer, getResponse } from 'aehrc/smart-forms-renderer';
|
|
14
|
+
|
|
15
|
+
export default function App () {
|
|
16
|
+
const questionnaire = {...} // FHIR R4.Questionnaire
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<SmartFormsRenderer questionnaire={questionnaire}/>
|
|
21
|
+
<button onClick={() => {
|
|
22
|
+
const response = getResponse()
|
|
23
|
+
// Do something with the questionnaire response
|
|
24
|
+
}}/>
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
### SmartFormsRenderer Props
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
| Name | Type | Description | Required? |
|
|
34
|
+
|-----------------------|------------------------------------------------------|------------------------------------------------------------------------------------------------|-----------|
|
|
35
|
+
| questionnaire | FHIR R4.Questionnaire | Questionnaire to be rendered | Required |
|
|
36
|
+
| questionnaireResponse | FHIR R4.QuestionnaireResponse | Pre-populated QuestionnaireResponse to be rendered | Optional |
|
|
37
|
+
| additionalVariables | Record<string, Extension> | Key-value pair of [SDC variables](http://hl7.org/fhir/R4/extension-variable.html) <name, variable extension> | Optional |
|
|
38
|
+
|
|
39
|
+
The below props are not supported at the moment, but will be in the future.
|
|
40
|
+
|
|
41
|
+
| Name | Type | Description |
|
|
42
|
+
|----------------------|------------------------------------------------------|---------------------------------------------|
|
|
43
|
+
| fhirClient | [Client](https://github.com/smart-on-fhir/client-js) | FhirClient to perform further FHIR calls |
|
|
44
|
+
| terminologyServerUrl | string | Terminology server url to fetch terminology |
|
|
45
|
+
|
|
46
|
+
### Functions
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
/**
|
|
50
|
+
* Get the filled QuestionnaireResponse at its current state.
|
|
51
|
+
* If no changes have been made to the form, the initial or an empty QuestionnaireResponse is returned.
|
|
52
|
+
*
|
|
53
|
+
* @returns {FHIR R4.QuestionnaireResponse} The filled QuestionnaireResponse
|
|
54
|
+
*/
|
|
55
|
+
function getResponse() {}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Advanced Usage (If basic usage does not suffice)
|
|
60
|
+
```typescript
|
|
61
|
+
/* Components */
|
|
62
|
+
// A self-initialising wrapper around the rendering engine. This is sufficient for most use cases.
|
|
63
|
+
function SmartFormsRenderer(props: {
|
|
64
|
+
questionnaire: Questionnaire,
|
|
65
|
+
questionnaireResponse?: QuestionnaireResponse,
|
|
66
|
+
additionalVariables?: Record<string, Extension>
|
|
67
|
+
}) {}
|
|
68
|
+
|
|
69
|
+
// BaseRenderer underneath the SmartFormsRenderer wrapper. Requires buildForm() to initialise form.
|
|
70
|
+
function BaseRenderer() {}
|
|
71
|
+
|
|
72
|
+
/* Functions */
|
|
73
|
+
// Get the filled QuestionnaireResponse at its current state.
|
|
74
|
+
// If no changes have been made to the form, the initial QuestionnaireResponse is returned.
|
|
75
|
+
function getResponse() {}
|
|
76
|
+
|
|
77
|
+
// Build the form with an initial Questionnaire and an optional filled QuestionnaireResponse.
|
|
78
|
+
// If a QuestionnaireResponse is not provided, an empty QuestionnaireResponse is set as the initial QuestionnaireResponse.
|
|
79
|
+
function buildForm(questionnaire: Questionnaire, questionnaireResponse?: QuestionnaireResponse) {}
|
|
80
|
+
|
|
81
|
+
// Destroy the form to clean up the questionnaire and questionnaireResponse stores.
|
|
82
|
+
function destroyForm() {}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// Remove all hidden answers from the filled QuestionnaireResponse.
|
|
86
|
+
// This takes into account the questionnaire-hidden extension, enableWhens and enableWhenExpressions.
|
|
87
|
+
function removeHiddenAnswersFromResponse(questionnaire: Questionnaire, questionnaireResponse: QuestionnaireResponse) {}
|
|
88
|
+
```
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
2
2
|
export * from './components';
|
|
3
|
-
export * from './hooks';
|
|
4
3
|
export * from './stores';
|
|
5
4
|
/**
|
|
6
5
|
* Build the form with an initial Questionnaire and an optional filled QuestionnaireResponse.
|
|
@@ -21,7 +20,7 @@ export declare function destroyForm(): void;
|
|
|
21
20
|
*
|
|
22
21
|
* @author Sean Fong
|
|
23
22
|
*/
|
|
24
|
-
export declare function
|
|
23
|
+
export declare function getResponse(): QuestionnaireResponse;
|
|
25
24
|
/**
|
|
26
25
|
* Remove all hidden answers from the filled QuestionnaireResponse.
|
|
27
26
|
* This takes into account the questionnaire-hidden extension, enableWhens and enableWhenExpressions.
|
package/lib/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import { createQuestionnaireResponse } from './utils/qrItem';
|
|
|
12
12
|
import useQuestionnaireResponseStore from './stores/useQuestionnaireResponseStore';
|
|
13
13
|
import { removeHiddenAnswers } from './utils/removeHidden';
|
|
14
14
|
export * from './components';
|
|
15
|
-
export * from './hooks';
|
|
16
15
|
export * from './stores';
|
|
17
16
|
/**
|
|
18
17
|
* Build the form with an initial Questionnaire and an optional filled QuestionnaireResponse.
|
|
@@ -48,7 +47,7 @@ export function destroyForm() {
|
|
|
48
47
|
*
|
|
49
48
|
* @author Sean Fong
|
|
50
49
|
*/
|
|
51
|
-
export function
|
|
50
|
+
export function getResponse() {
|
|
52
51
|
return useQuestionnaireResponseStore.getState().updatableResponse;
|
|
53
52
|
}
|
|
54
53
|
/**
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,6BAA6B,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,6BAA6B,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,UAAgB,SAAS,CAC7B,aAA4B,EAC5B,qBAA6C;;QAE7C,MAAM,qBAAqB,CAAC,QAAQ,EAAE,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAE/E,IAAI,CAAC,qBAAqB,EAAE;YAC1B,6BAA6B;iBAC1B,QAAQ,EAAE;iBACV,mBAAmB,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC,CAAC;YACnE,OAAO;SACR;QAED,6BAA6B,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QACpF,qBAAqB,CAAC,QAAQ,EAAE,CAAC,yBAAyB,CAAC,qBAAqB,CAAC,CAAC;IACpF,CAAC;CAAA;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW;IACzB,qBAAqB,CAAC,QAAQ,EAAE,CAAC,0BAA0B,EAAE,CAAC;IAC9D,6BAA6B,CAAC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,6BAA6B,CAAC,QAAQ,EAAE,CAAC,iBAAiB,CAAC;AACpE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAC7C,aAA4B,EAC5B,qBAA4C;IAE5C,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,CAAC,qBAAqB,CAAC;IACrF,MAAM,eAAe,GAAG,qBAAqB,CAAC,QAAQ,EAAE,CAAC,eAAe,CAAC;IACzE,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,CAAC,qBAAqB,CAAC;IAErF,OAAO,mBAAmB,CAAC;QACzB,aAAa;QACb,qBAAqB;QACrB,qBAAqB;QACrB,eAAe;QACf,qBAAqB;KACtB,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aehrc/smart-forms-renderer",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
|
+
"description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
|
|
4
5
|
"main": "lib/index.js",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"compile": "tsc",
|
|
7
|
-
"
|
|
8
|
+
"compile:watch": "tsc -w",
|
|
8
9
|
"prepare": "npm run compile",
|
|
9
10
|
"test": "jest",
|
|
10
11
|
"test:watch": "jest --watch",
|
|
11
12
|
"storybook": "storybook dev -p 6006",
|
|
12
13
|
"build-storybook": "storybook build"
|
|
13
14
|
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/aehrc/smart-forms.git"
|
|
18
|
+
},
|
|
19
|
+
"author": "Sean Fong",
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/aehrc/smart-forms/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/aehrc/smart-forms#readme",
|
|
14
25
|
"dependencies": {
|
|
15
26
|
"@iconify/react": "^4.1.1",
|
|
16
27
|
"dayjs": "^1.11.9",
|
|
@@ -23,7 +34,7 @@
|
|
|
23
34
|
"@types/fhir": "^0.0.37",
|
|
24
35
|
"zustand": "^4.4.1",
|
|
25
36
|
"react-markdown": "^8.0.7",
|
|
26
|
-
"sdc-assemble": "^1.0.
|
|
37
|
+
"@aehrc/sdc-assemble": "^1.0.2"
|
|
27
38
|
},
|
|
28
39
|
"peerDependencies": {
|
|
29
40
|
"@emotion/react": ">=11.11.0",
|
|
@@ -48,7 +59,7 @@
|
|
|
48
59
|
"@storybook/react-vite": "^7.4.0",
|
|
49
60
|
"@storybook/testing-library": "^0.2.0",
|
|
50
61
|
"@testing-library/jest-dom": "^5.14.1",
|
|
51
|
-
"@testing-library/react": "^
|
|
62
|
+
"@testing-library/react": "^14.0.0",
|
|
52
63
|
"@testing-library/react-hooks": "^7.0.2",
|
|
53
64
|
"@types/jest": "^29.5.4",
|
|
54
65
|
"@types/react": "^18.2.18",
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,6 @@ import useQuestionnaireResponseStore from './stores/useQuestionnaireResponseStor
|
|
|
5
5
|
import { removeHiddenAnswers } from './utils/removeHidden';
|
|
6
6
|
|
|
7
7
|
export * from './components';
|
|
8
|
-
export * from './hooks';
|
|
9
8
|
export * from './stores';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -47,7 +46,7 @@ export function destroyForm(): void {
|
|
|
47
46
|
*
|
|
48
47
|
* @author Sean Fong
|
|
49
48
|
*/
|
|
50
|
-
export function
|
|
49
|
+
export function getResponse(): QuestionnaireResponse {
|
|
51
50
|
return useQuestionnaireResponseStore.getState().updatableResponse;
|
|
52
51
|
}
|
|
53
52
|
|
package/lib/api/populate.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { InputParameters, OutputParameters } from 'sdc-populate';
|
|
2
|
-
import type Client from 'fhirclient/lib/Client';
|
|
3
|
-
import type { OperationOutcome } from 'fhir/r4';
|
|
4
|
-
export declare const HEADERS: {
|
|
5
|
-
'Content-Type': string;
|
|
6
|
-
Accept: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function requestPopulate(fhirClient: Client, inputParameters: InputParameters): Promise<OutputParameters | OperationOutcome>;
|
package/lib/api/populate.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
import { isOutputParameters, populate } from 'sdc-populate';
|
|
27
|
-
import { fetchResourceCallback } from '../utils/populateCallback';
|
|
28
|
-
const IS_IN_APP_POPULATE = true;
|
|
29
|
-
export const HEADERS = {
|
|
30
|
-
'Content-Type': 'application/json;charset=utf-8',
|
|
31
|
-
Accept: 'application/json;charset=utf-8'
|
|
32
|
-
};
|
|
33
|
-
export function requestPopulate(fhirClient, inputParameters) {
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const requestConfig = {
|
|
36
|
-
clientEndpoint: fhirClient.state.serverUrl,
|
|
37
|
-
authToken: fhirClient.state.tokenResponse.access_token
|
|
38
|
-
};
|
|
39
|
-
if (IS_IN_APP_POPULATE) {
|
|
40
|
-
return yield populate(inputParameters, fetchResourceCallback, requestConfig);
|
|
41
|
-
}
|
|
42
|
-
const outputParameters = yield fhirClient.request({
|
|
43
|
-
url: 'Questionnaire/$populate',
|
|
44
|
-
method: 'POST',
|
|
45
|
-
body: JSON.stringify(inputParameters),
|
|
46
|
-
headers: Object.assign(Object.assign({}, HEADERS), { 'Content-Type': 'application/json', Authorization: `Bearer ${requestConfig.authToken}` })
|
|
47
|
-
});
|
|
48
|
-
if (isOutputParameters(outputParameters)) {
|
|
49
|
-
return outputParameters;
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
resourceType: 'OperationOutcome',
|
|
53
|
-
issue: [
|
|
54
|
-
{
|
|
55
|
-
severity: 'error',
|
|
56
|
-
code: 'invalid',
|
|
57
|
-
details: { text: 'Output parameters does not match the specification.' }
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=populate.js.map
|
package/lib/api/populate.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"populate.js","sourceRoot":"","sources":["../../src/api/populate.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
|
|
2
|
-
* Copyright 2023 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
|
-
import React from 'react';
|
|
18
|
-
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
19
|
-
import Radio from '@mui/material/Radio';
|
|
20
|
-
function ChoiceRadio(props) {
|
|
21
|
-
const { value, label, readOnly } = props;
|
|
22
|
-
return (React.createElement(FormControlLabel, { disabled: readOnly, value: value, control: React.createElement(Radio, { size: "small" }), label: label, sx: { mr: 3 } }));
|
|
23
|
-
}
|
|
24
|
-
export default ChoiceRadio;
|
|
25
|
-
//# sourceMappingURL=ChoiceRadio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceRadio.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadio.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAQxC,SAAS,WAAW,CAAC,KAAY;IAC/B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEzC,OAAO,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,oBAAC,KAAK,IAAC,IAAI,EAAC,OAAO,GAAG,EAC/B,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GACb,CACH,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 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
|
-
import React from 'react';
|
|
18
|
-
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
19
|
-
import Radio from '@mui/material/Radio';
|
|
20
|
-
function ChoiceRadioButton(props) {
|
|
21
|
-
const { value, label, readOnly } = props;
|
|
22
|
-
return (React.createElement(FormControlLabel, { disabled: readOnly, value: value, control: React.createElement(Radio, { size: "small" }), label: label, sx: { mr: 3 } }));
|
|
23
|
-
}
|
|
24
|
-
export default ChoiceRadioButton;
|
|
25
|
-
//# sourceMappingURL=ChoiceRadioButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceRadioButton.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAQxC,SAAS,iBAAiB,CAAC,KAAY;IACrC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEzC,OAAO,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,oBAAC,KAAK,IAAC,IAAI,EAAC,OAAO,GAAG,EAC/B,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GACb,CACH,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 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
|
-
import React from 'react';
|
|
18
|
-
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
19
|
-
import Radio from '@mui/material/Radio';
|
|
20
|
-
function ChoiceRadioSingleItem(props) {
|
|
21
|
-
const { value, label, readOnly } = props;
|
|
22
|
-
return (React.createElement(FormControlLabel, { disabled: readOnly, value: value, control: React.createElement(Radio, { size: "small" }), label: label, sx: { mr: 3 } }));
|
|
23
|
-
}
|
|
24
|
-
export default ChoiceRadioSingleItem;
|
|
25
|
-
//# sourceMappingURL=ChoiceRadioSingleItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceRadioSingleItem.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAQxC,SAAS,qBAAqB,CAAC,KAAY;IACzC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEzC,OAAO,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,oBAAC,KAAK,IAAC,IAAI,EAAC,OAAO,GAAG,EAC/B,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GACb,CACH,CAAC;AACJ,CAAC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
-
}
|
|
8
|
-
declare function QItemChoice(props: Props): React.JSX.Element | null;
|
|
9
|
-
export default QItemChoice;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 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
|
-
import React from 'react';
|
|
18
|
-
import { QItemChoiceControl } from '../../../interfaces/choice.enum';
|
|
19
|
-
import QItemChoiceRadioAnswerOption from './QItemChoiceRadioAnswerOption';
|
|
20
|
-
import QItemChoiceSelectAnswerOption from './QItemChoiceSelectAnswerOption';
|
|
21
|
-
import QItemChoiceCheckboxAnswerOption from './QItemChoiceCheckboxAnswerOption';
|
|
22
|
-
import QItemChoiceAutocomplete from './QItemChoiceAutocomplete';
|
|
23
|
-
import QItemChoiceSelectAnswerValueSet from './QItemChoiceSelectAnswerValueSet';
|
|
24
|
-
import { getChoiceControlType, getChoiceOrientation } from '../../../utils/choice';
|
|
25
|
-
import QItemChoiceRadioAnswerValueSet from './QItemChoiceRadioAnswerValueSet';
|
|
26
|
-
import QItemChoiceCheckboxAnswerValueSet from './QItemChoiceCheckboxAnswerValueSet';
|
|
27
|
-
function QItemChoice(props) {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
30
|
-
const orientation = getChoiceOrientation(qItem);
|
|
31
|
-
const choiceControlType = getChoiceControlType(qItem);
|
|
32
|
-
switch (choiceControlType) {
|
|
33
|
-
case QItemChoiceControl.Radio:
|
|
34
|
-
if (qItem.answerOption) {
|
|
35
|
-
return (React.createElement(QItemChoiceRadioAnswerOption, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, onQrItemChange: onQrItemChange, orientation: orientation }));
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
return (React.createElement(QItemChoiceRadioAnswerValueSet, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, onQrItemChange: onQrItemChange, orientation: orientation }));
|
|
39
|
-
}
|
|
40
|
-
case QItemChoiceControl.Checkbox:
|
|
41
|
-
if (qItem.answerOption) {
|
|
42
|
-
return (React.createElement(QItemChoiceCheckboxAnswerOption, { qItem: qItem, qrItem: qrItem, isRepeated: (_a = qItem['repeats']) !== null && _a !== void 0 ? _a : false, onQrItemChange: onQrItemChange, orientation: orientation }));
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
return (React.createElement(QItemChoiceCheckboxAnswerValueSet, { qItem: qItem, qrItem: qrItem, isRepeated: (_b = qItem['repeats']) !== null && _b !== void 0 ? _b : false, onQrItemChange: onQrItemChange, orientation: orientation }));
|
|
46
|
-
}
|
|
47
|
-
case QItemChoiceControl.Autocomplete:
|
|
48
|
-
return (React.createElement(QItemChoiceAutocomplete, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
49
|
-
case QItemChoiceControl.Select:
|
|
50
|
-
if (qItem.answerOption) {
|
|
51
|
-
return (React.createElement(QItemChoiceSelectAnswerOption, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return (React.createElement(QItemChoiceSelectAnswerValueSet, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
|
|
55
|
-
}
|
|
56
|
-
default:
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export default QItemChoice;
|
|
61
|
-
//# sourceMappingURL=QItemChoice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QItemChoice.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/QItemChoice.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAC5E,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AAepF,SAAS,WAAW,CAAC,KAAY;;IAC/B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACtE,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAEtD,QAAQ,iBAAiB,EAAE;QACzB,KAAK,kBAAkB,CAAC,KAAK;YAC3B,IAAI,KAAK,CAAC,YAAY,EAAE;gBACtB,OAAO,CACL,oBAAC,4BAA4B,IAC3B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UA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CACL,oBAAC,+BAA+B,IAC9B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;aACH;QACH;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
3
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
4
|
-
interface QItemChoiceAutocompleteProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
|
|
5
|
-
qItem: QuestionnaireItem;
|
|
6
|
-
qrItem: QuestionnaireResponseItem;
|
|
7
|
-
}
|
|
8
|
-
declare function QItemChoiceAutocomplete(props: QItemChoiceAutocompleteProps): React.JSX.Element | null;
|
|
9
|
-
export default QItemChoiceAutocomplete;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 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
|
-
import React, { useState } from 'react';
|
|
18
|
-
import Autocomplete from '@mui/material/Autocomplete';
|
|
19
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
20
|
-
import Fade from '@mui/material/Fade';
|
|
21
|
-
import Grid from '@mui/material/Grid';
|
|
22
|
-
import Tooltip from '@mui/material/Tooltip';
|
|
23
|
-
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
24
|
-
import { StandardTextField } from '../Textfield.styles';
|
|
25
|
-
import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
26
|
-
import SearchIcon from '@mui/icons-material/Search';
|
|
27
|
-
import useDebounce from '../../../hooks/useDebounce';
|
|
28
|
-
import useTerminologyServerQuery from '../../../hooks/useTerminologyServerQuery';
|
|
29
|
-
import InfoIcon from '@mui/icons-material/Info';
|
|
30
|
-
import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
|
31
|
-
import DoneIcon from '@mui/icons-material/Done';
|
|
32
|
-
import ErrorIcon from '@mui/icons-material/Error';
|
|
33
|
-
import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
|
|
34
|
-
import { getTerminologyServerUrl } from '../../../utils/valueSet';
|
|
35
|
-
import { AUTOCOMPLETE_DEBOUNCE_DURATION } from '../../../utils/debounce';
|
|
36
|
-
import DisplayInstructions from '../DisplayItem/DisplayInstructions';
|
|
37
|
-
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
38
|
-
function QItemChoiceAutocomplete(props) {
|
|
39
|
-
const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
|
|
40
|
-
const qrChoice = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
|
|
41
|
-
// Init input value
|
|
42
|
-
let valueCoding;
|
|
43
|
-
if (qrChoice.answer) {
|
|
44
|
-
valueCoding = qrChoice.answer[0].valueCoding;
|
|
45
|
-
}
|
|
46
|
-
// Get additional rendering extensions
|
|
47
|
-
const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
|
|
48
|
-
// Query ontoserver for options
|
|
49
|
-
const maxList = 10;
|
|
50
|
-
const [input, setInput] = useState('');
|
|
51
|
-
const debouncedInput = useDebounce(input, AUTOCOMPLETE_DEBOUNCE_DURATION);
|
|
52
|
-
const answerValueSetUrl = qItem.answerValueSet;
|
|
53
|
-
const terminologyServerUrl = getTerminologyServerUrl(qItem);
|
|
54
|
-
const { options, loading, feedback } = useTerminologyServerQuery(answerValueSetUrl, maxList, input, debouncedInput, terminologyServerUrl);
|
|
55
|
-
if (!answerValueSetUrl)
|
|
56
|
-
return null;
|
|
57
|
-
// Event handlers
|
|
58
|
-
function handleValueChange(_, newValue) {
|
|
59
|
-
if (newValue === null) {
|
|
60
|
-
setInput('');
|
|
61
|
-
onQrItemChange(createEmptyQrItem(qItem));
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueCoding: newValue }] }));
|
|
65
|
-
}
|
|
66
|
-
const choiceAutocomplete = (React.createElement(React.Fragment, null,
|
|
67
|
-
React.createElement(Autocomplete, { id: qItem.id, value: valueCoding !== null && valueCoding !== void 0 ? valueCoding : null, placeholder: entryFormat, options: options, getOptionLabel: (option) => `${option.display}`, isOptionEqualToValue: (option, value) => option.id === value.id, loading: loading, loadingText: 'Fetching results...', clearOnEscape: true, autoHighlight: true, onChange: handleValueChange, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160, flexGrow: 1 }, filterOptions: (x) => x, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({}, params, { onChange: (e) => setInput(e.target.value), isTabled: isTabled, disabled: readOnly, label: displayPrompt, size: "small", InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React.createElement(React.Fragment, null,
|
|
68
|
-
!valueCoding ? React.createElement(SearchIcon, { fontSize: "small", sx: { ml: 0.5 } }) : null,
|
|
69
|
-
params.InputProps.startAdornment)), endAdornment: (React.createElement(React.Fragment, null,
|
|
70
|
-
loading ? (React.createElement(CircularProgress, { color: "inherit", size: 16 })) : feedback ? (React.createElement(Fade, { in: !!feedback, timeout: 300 },
|
|
71
|
-
React.createElement(Tooltip, { title: feedback.message, arrow: true, sx: { ml: 1 } }, {
|
|
72
|
-
info: React.createElement(InfoIcon, { fontSize: "small", color: "info" }),
|
|
73
|
-
warning: React.createElement(WarningAmberIcon, { fontSize: "small", color: "warning" }),
|
|
74
|
-
success: React.createElement(DoneIcon, { fontSize: "small", color: "success" }),
|
|
75
|
-
error: React.createElement(ErrorIcon, { fontSize: "small", color: "error" })
|
|
76
|
-
}[feedback.color]))) : null,
|
|
77
|
-
params.InputProps.endAdornment,
|
|
78
|
-
displayUnit)) }) }))) })));
|
|
79
|
-
const renderQItemChoiceAutocomplete = isRepeated ? (React.createElement(React.Fragment, null, choiceAutocomplete)) : (React.createElement(FullWidthFormComponentBox, null,
|
|
80
|
-
React.createElement(Grid, { container: true, columnSpacing: 6 },
|
|
81
|
-
React.createElement(Grid, { item: true, xs: 5 },
|
|
82
|
-
React.createElement(LabelWrapper, { qItem: qItem })),
|
|
83
|
-
React.createElement(Grid, { item: true, xs: 7 },
|
|
84
|
-
choiceAutocomplete,
|
|
85
|
-
React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
|
|
86
|
-
return React.createElement(React.Fragment, null, renderQItemChoiceAutocomplete);
|
|
87
|
-
}
|
|
88
|
-
export default QItemChoiceAutocomplete;
|
|
89
|
-
//# sourceMappingURL=QItemChoiceAutocomplete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QItemChoiceAutocomplete.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,YAAY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import React from 'react';
|
|
2
|
-
import { QItemChoiceOrientation } from '../../../interfaces/choice.enum';
|
|
3
|
-
import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
4
|
-
import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
|
|
5
|
-
interface QItemChoiceCheckboxProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
|
|
6
|
-
qItem: QuestionnaireItem;
|
|
7
|
-
qrItem: QuestionnaireResponseItem;
|
|
8
|
-
orientation: QItemChoiceOrientation;
|
|
9
|
-
}
|
|
10
|
-
declare function QItemChoiceCheckboxAnswerOption(props: QItemChoiceCheckboxProps): React.JSX.Element;
|
|
11
|
-
export default QItemChoiceCheckboxAnswerOption;
|