@aehrc/smart-forms-renderer 0.35.2 → 0.35.3

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.
@@ -22,10 +22,10 @@ import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
22
22
  function ItemFieldGrid(props) {
23
23
  const { children, qItem, readOnly } = props;
24
24
  const { displayInstructions } = useRenderingExtensions(qItem);
25
- return (React.createElement(Grid, { container: true, columnSpacing: 6 },
26
- React.createElement(Grid, { item: true, xs: 5 },
25
+ return (React.createElement(Grid, { container: true, columnSpacing: 4 },
26
+ React.createElement(Grid, { item: true, xs: 4 },
27
27
  React.createElement(LabelWrapper, { qItem: qItem, readOnly: readOnly })),
28
- React.createElement(Grid, { item: true, xs: 7 },
28
+ React.createElement(Grid, { item: true, xs: 8 },
29
29
  children,
30
30
  React.createElement(DisplayInstructions, { displayInstructions: displayInstructions, readOnly: readOnly }))));
31
31
  }
@@ -100,11 +100,12 @@ export function getOpenChoiceControlType(qItem) {
100
100
  * @author Sean Fong
101
101
  */
102
102
  export function getAnswerOptionLabel(option) {
103
+ var _a;
103
104
  if (typeof option === 'string') {
104
105
  return option;
105
106
  }
106
107
  if (option['valueCoding']) {
107
- return `${option.valueCoding.display}`;
108
+ return (_a = option.valueCoding.display) !== null && _a !== void 0 ? _a : `${option.valueCoding.code}`;
108
109
  }
109
110
  else if (option['valueString']) {
110
111
  return option.valueString;
@@ -1 +1 @@
1
- {"version":3,"file":"openChoice.js","sourceRoot":"","sources":["../../src/utils/openChoice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,gBAAyB,EACzB,qBAA6B,EAC7B,OAA0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YAAY,CAAC;KAC3C;SAAM,IAAI,qBAAqB,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE;QACpD,OAAO,qBAAqB,CAAC,QAAQ,CAAC;KACvC;SAAM,IAAI,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE;QACvD,OAAO,qBAAqB,CAAC,KAAK,CAAC;KACpC;SAAM;QACL,OAAO,qBAAqB,CAAC,MAAM,CAAC;KACrC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA8C;;IACjF,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,OAAO,MAAM,CAAC;KACf;IAED,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;QACzB,OAAO,MAAA,MAAM,CAAC,WAAW,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KACnE;SAAM,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;QAChC,OAAO,MAAM,CAAC,WAAW,CAAC;KAC3B;SAAM,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;QACjC,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;KACvC;SAAM;QACL,OAAO,EAAE,CAAC;KACX;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aehrc/smart-forms-renderer",
3
- "version": "0.35.2",
3
+ "version": "0.35.3",
4
4
  "description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -35,11 +35,11 @@ function ItemFieldGrid(props: ItemFieldGridProps) {
35
35
  const { displayInstructions } = useRenderingExtensions(qItem);
36
36
 
37
37
  return (
38
- <Grid container columnSpacing={6}>
39
- <Grid item xs={5}>
38
+ <Grid container columnSpacing={4}>
39
+ <Grid item xs={4}>
40
40
  <LabelWrapper qItem={qItem} readOnly={readOnly} />
41
41
  </Grid>
42
- <Grid item xs={7}>
42
+ <Grid item xs={8}>
43
43
  {children}
44
44
  <DisplayInstructions displayInstructions={displayInstructions} readOnly={readOnly} />
45
45
  </Grid>
@@ -0,0 +1,201 @@
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 { Questionnaire } from 'fhir/r4';
19
+
20
+ export const qSelectivePrePopTester: Questionnaire = {
21
+ resourceType: 'Questionnaire',
22
+ id: 'SelectivePrePopTester',
23
+ name: 'SelectivePrePopTester',
24
+ title: 'Selective Pre-pop Tester',
25
+ version: '0.1.0',
26
+ status: 'draft',
27
+ publisher: 'AEHRC CSIRO',
28
+ date: '2024-05-01',
29
+ url: 'https://smartforms.csiro.au/docs/tester/prepop-1',
30
+ contained: [
31
+ {
32
+ resourceType: 'ValueSet',
33
+ id: 'administrative-gender',
34
+ meta: {
35
+ profile: ['http://hl7.org/fhir/StructureDefinition/shareablevalueset']
36
+ },
37
+ extension: [
38
+ {
39
+ url: 'http://hl7.org/fhir/StructureDefinition/structuredefinition-wg',
40
+ valueCode: 'pa'
41
+ },
42
+ {
43
+ url: 'http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status',
44
+ valueCode: 'normative'
45
+ },
46
+ {
47
+ url: 'http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm',
48
+ valueInteger: 5
49
+ },
50
+ {
51
+ url: 'http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version',
52
+ valueCode: '4.0.0'
53
+ }
54
+ ],
55
+ url: 'http://hl7.org/fhir/ValueSet/administrative-gender',
56
+ identifier: [
57
+ {
58
+ system: 'urn:ietf:rfc:3986',
59
+ value: 'urn:oid:2.16.840.1.113883.4.642.3.1'
60
+ }
61
+ ],
62
+ version: '4.0.1',
63
+ name: 'AdministrativeGender',
64
+ title: 'AdministrativeGender',
65
+ status: 'active',
66
+ experimental: false,
67
+ date: '2019-11-01T09:29:23+11:00',
68
+ publisher: 'HL7 (FHIR Project)',
69
+ contact: [
70
+ {
71
+ telecom: [
72
+ {
73
+ system: 'url',
74
+ value: 'http://hl7.org/fhir'
75
+ },
76
+ {
77
+ system: 'email',
78
+ value: 'fhir@lists.hl7.org'
79
+ }
80
+ ]
81
+ }
82
+ ],
83
+ description: 'The gender of a person used for administrative purposes.',
84
+ immutable: true,
85
+ copyright: 'Copyright © 2011+ HL7. Licensed under Creative Commons "No Rights Reserved".',
86
+ compose: {
87
+ include: [
88
+ {
89
+ system: 'http://hl7.org/fhir/administrative-gender'
90
+ }
91
+ ]
92
+ },
93
+ expansion: {
94
+ identifier: 'urn:uuid:50f050c9-3975-48d6-bdb7-baae4ebc70cd',
95
+ timestamp: '2024-04-05T12:31:27+10:00',
96
+ total: 4,
97
+ parameter: [
98
+ {
99
+ name: 'version',
100
+ valueUri: 'http://hl7.org/fhir/administrative-gender|4.0.1'
101
+ },
102
+ {
103
+ name: 'used-codesystem',
104
+ valueUri: 'http://hl7.org/fhir/administrative-gender|4.0.1'
105
+ }
106
+ ],
107
+ contains: [
108
+ {
109
+ system: 'http://hl7.org/fhir/administrative-gender',
110
+ code: 'female',
111
+ display: 'Female'
112
+ },
113
+ {
114
+ system: 'http://hl7.org/fhir/administrative-gender',
115
+ code: 'male',
116
+ display: 'Male'
117
+ },
118
+ {
119
+ system: 'http://hl7.org/fhir/administrative-gender',
120
+ code: 'other',
121
+ display: 'Other'
122
+ },
123
+ {
124
+ system: 'http://hl7.org/fhir/administrative-gender',
125
+ code: 'unknown',
126
+ display: 'Unknown'
127
+ }
128
+ ]
129
+ }
130
+ }
131
+ ],
132
+ extension: [
133
+ {
134
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext',
135
+ extension: [
136
+ {
137
+ url: 'name',
138
+ valueCoding: {
139
+ system: 'http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext',
140
+ code: 'patient'
141
+ }
142
+ },
143
+ {
144
+ url: 'type',
145
+ valueCode: 'Patient'
146
+ },
147
+ {
148
+ url: 'description',
149
+ valueString: 'The patient that is to be used to pre-populate the form'
150
+ }
151
+ ]
152
+ }
153
+ ],
154
+ item: [
155
+ {
156
+ linkId: 'display-description',
157
+ extension: [
158
+ {
159
+ url: 'http://hl7.org/fhir/StructureDefinition/rendering-xhtml',
160
+ valueString:
161
+ '<div xmlns="http://www.w3.org/1999/xhtml">\r\n <div style="font-size:0.875em"> This questionnaire is used by Playwright to do regression testing of the <pre style="display: inline">@aehrc/sdc-populate</pre> library\'s pre-population logic. Items will be incrementally added as needed.</div><br/></div>'
162
+ }
163
+ ],
164
+ text: "This questionnaire is used by Playwright to do regression testing of the @aehrc/sdc-populate library's pre-population logic. Items will be incrementally added as needed.",
165
+ type: 'display',
166
+ repeats: false
167
+ },
168
+ {
169
+ extension: [
170
+ {
171
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
172
+ valueExpression: {
173
+ language: 'text/fhirpath',
174
+ expression: '%patient.gender'
175
+ }
176
+ }
177
+ ],
178
+ linkId: 'gender-avs-url',
179
+ text: 'Administrative gender (answerValueSet url)',
180
+ type: 'choice',
181
+ repeats: false,
182
+ answerValueSet: 'http://hl7.org/fhir/ValueSet/administrative-gender'
183
+ },
184
+ {
185
+ extension: [
186
+ {
187
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
188
+ valueExpression: {
189
+ language: 'text/fhirpath',
190
+ expression: '%patient.gender'
191
+ }
192
+ }
193
+ ],
194
+ linkId: 'gender-avs-contained',
195
+ text: 'Administrative gender (answerValueSet contained)',
196
+ type: 'choice',
197
+ repeats: false,
198
+ answerValueSet: 'http://hl7.org/fhir/ValueSet/administrative-gender'
199
+ }
200
+ ]
201
+ };
@@ -18,7 +18,6 @@
18
18
  import type { Meta, StoryObj } from '@storybook/react';
19
19
  import BuildFormButtonTesterWrapperForStorybook from '../storybookWrappers/BuildFormButtonTesterWrapperForStorybook';
20
20
  import { qButtonTester, qrButtonTesterResponse } from '../assets/questionnaires/QButtonTester';
21
- import { qBooleanBasic, qrBooleanBasicResponse } from '../assets/questionnaires';
22
21
 
23
22
  // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
24
23
  const meta = {
@@ -39,10 +38,3 @@ export const BuildFormButtonTester: Story = {
39
38
  questionnaireResponse: qrButtonTesterResponse
40
39
  }
41
40
  };
42
-
43
- export const BuildFormButtonTesterBoolean: Story = {
44
- args: {
45
- questionnaire: qBooleanBasic,
46
- questionnaireResponse: qrBooleanBasicResponse
47
- }
48
- };
@@ -21,10 +21,11 @@ import { mockFhirClient } from '../assets/fhirClient/mockFhirClient';
21
21
  import { patSmartForm } from '../assets/patients/PatSmartForm';
22
22
  import { pracPrimaryPeter } from '../assets/practitioners/PracPrimaryPeter';
23
23
  import { qButtonTester } from '../assets/questionnaires/QButtonTester';
24
+ import { qSelectivePrePopTester } from '../assets/questionnaires/QPrePopTester';
24
25
 
25
26
  // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
26
27
  const meta = {
27
- title: 'Component/Testing/Pre Pop Button Tester',
28
+ title: 'Component/Testing/Pre Pop Tester',
28
29
  component: PrePopWrapperForStorybook,
29
30
  // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
30
31
  tags: []
@@ -35,7 +36,7 @@ type Story = StoryObj<typeof meta>;
35
36
 
36
37
  // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
37
38
 
38
- export const PrePopButtonTester: Story = {
39
+ export const BasicPrePopTester: Story = {
39
40
  args: {
40
41
  questionnaire: qButtonTester,
41
42
  fhirClient: mockFhirClient,
@@ -43,3 +44,12 @@ export const PrePopButtonTester: Story = {
43
44
  user: pracPrimaryPeter
44
45
  }
45
46
  };
47
+
48
+ export const SelectivePrePopTester: Story = {
49
+ args: {
50
+ questionnaire: qSelectivePrePopTester,
51
+ fhirClient: mockFhirClient,
52
+ patient: patSmartForm,
53
+ user: pracPrimaryPeter
54
+ }
55
+ };
@@ -153,7 +153,7 @@ export function getAnswerOptionLabel(option: QuestionnaireItemAnswerOption | str
153
153
  }
154
154
 
155
155
  if (option['valueCoding']) {
156
- return `${option.valueCoding.display}`;
156
+ return option.valueCoding.display ?? `${option.valueCoding.code}`;
157
157
  } else if (option['valueString']) {
158
158
  return option.valueString;
159
159
  } else if (option['valueInteger']) {