@aehrc/smart-forms-renderer 0.28.0 → 0.29.0

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.
@@ -155,7 +155,7 @@ function initialiseItemCalculatedExpressionValueRecursive(qItem, qrItem, calcula
155
155
  }
156
156
  return constructGroupItem(qItem, qrItem, calculatedExpressions);
157
157
  }
158
- return constructSingleItem(qItem, calculatedExpressions);
158
+ return constructSingleItem(qItem, qrItem, calculatedExpressions);
159
159
  }
160
160
  function getCalculatedExpressionAnswer(qItem, calculatedExpressions) {
161
161
  var _a;
@@ -183,10 +183,10 @@ function constructGroupItem(qItem, qrItem, calculatedExpressions) {
183
183
  answer: [calculatedExpressionAnswer]
184
184
  };
185
185
  }
186
- function constructSingleItem(qItem, calculatedExpressions) {
186
+ function constructSingleItem(qItem, qrItem, calculatedExpressions) {
187
187
  const calculatedExpressionAnswer = getCalculatedExpressionAnswer(qItem, calculatedExpressions);
188
188
  if (!calculatedExpressionAnswer) {
189
- return null;
189
+ return qrItem !== null && qrItem !== void 0 ? qrItem : null;
190
190
  }
191
191
  return {
192
192
  linkId: qItem.linkId,
@@ -1 +1 @@
1
- {"version":3,"file":"calculatedExpression.js","sourceRoot":"","sources":["../../src/utils/calculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AAUzD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,MAAM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AAa,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,SAAS,GAAG,4DAA4D,CAAC;IAC/E,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aehrc/smart-forms-renderer",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/aehrc/smart-forms#readme",
29
29
  "dependencies": {
30
+ "@aehrc/sdc-populate": "^2.0.1",
30
31
  "@iconify/react": "^4.1.1",
31
32
  "dayjs": "^1.11.10",
32
33
  "deep-diff": "^1.0.2",
@@ -15,13 +15,14 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import React, { useLayoutEffect, useState } from 'react';
18
+ // @ts-ignore
19
+ import React from 'react';
19
20
  import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
20
21
  import { BaseRenderer } from '../components';
21
22
  import { QueryClientProvider } from '@tanstack/react-query';
22
23
  import ThemeProvider from '../theme/Theme';
23
24
  import useQueryClient from '../hooks/useQueryClient';
24
- import { buildForm } from '../utils';
25
+ import useBuildFormForStorybook from './useBuildFormForStorybook';
25
26
 
26
27
  interface BuildFormWrapperProps {
27
28
  questionnaire: Questionnaire;
@@ -31,17 +32,11 @@ interface BuildFormWrapperProps {
31
32
  function BuildFormWrapper(props: BuildFormWrapperProps) {
32
33
  const { questionnaire, questionnaireResponse } = props;
33
34
 
34
- const [isLoading, setIsLoading] = useState(true);
35
-
36
- useLayoutEffect(() => {
37
- buildForm(questionnaire, questionnaireResponse).then(() => {
38
- setIsLoading(false);
39
- });
40
- }, [questionnaire, questionnaireResponse]);
41
-
42
35
  const queryClient = useQueryClient();
43
36
 
44
- if (isLoading) {
37
+ const isBuilding = useBuildFormForStorybook(questionnaire, questionnaireResponse);
38
+
39
+ if (isBuilding) {
45
40
  return <div>Loading...</div>;
46
41
  }
47
42
 
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ // @ts-ignore
19
+ import React from 'react';
20
+ import { Box, CircularProgress, Fade, IconButton, Tooltip } from '@mui/material';
21
+ import PlayCircleIcon from '@mui/icons-material/PlayCircle';
22
+ import Typography from '@mui/material/Typography';
23
+
24
+ interface PrePopButtonProps {
25
+ isPopulating: boolean;
26
+ onPopulate: () => void;
27
+ }
28
+
29
+ function PrePopButtonForStorybook(props: PrePopButtonProps) {
30
+ const { isPopulating, onPopulate } = props;
31
+
32
+ return (
33
+ <Box display="flex" mb={0.5} alignItems="center" columnGap={3}>
34
+ <Tooltip title="Pre-populate form" placement="right">
35
+ <IconButton disabled={isPopulating} onClick={onPopulate} size="small" color="primary">
36
+ {isPopulating ? (
37
+ <CircularProgress size={20} color="inherit" sx={{ mb: 0.5 }} />
38
+ ) : (
39
+ <PlayCircleIcon />
40
+ )}
41
+ </IconButton>
42
+ </Tooltip>
43
+ {isPopulating ? (
44
+ <Fade in={true} timeout={100}>
45
+ <Typography variant="body2" color="text.secondary">
46
+ Pre-populating form...
47
+ </Typography>
48
+ </Fade>
49
+ ) : null}
50
+ </Box>
51
+ );
52
+ }
53
+
54
+ export default PrePopButtonForStorybook;
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Copyright 2024 Commonwealth Scientific and Industrial Research
3
+ * Organisation (CSIRO) ABN 41 687 119 230.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ // @ts-ignore
19
+ import React, { useState } from 'react';
20
+ import type { Patient, Practitioner, Questionnaire } from 'fhir/r4';
21
+ import { BaseRenderer } from '../components';
22
+ import { QueryClientProvider } from '@tanstack/react-query';
23
+ import ThemeProvider from '../theme/Theme';
24
+ import useQueryClient from '../hooks/useQueryClient';
25
+ import type Client from 'fhirclient/lib/Client';
26
+ import useBuildFormForStorybook from './useBuildFormForStorybook';
27
+ import { buildForm } from '../utils';
28
+ import PrePopButtonForStorybook from './PrePopButtonForStorybook';
29
+ import { populateQuestionnaire } from '@aehrc/sdc-populate';
30
+ import { fetchResourceCallback } from './populateCallbackForStorybook';
31
+
32
+ interface PrePopWrapperProps {
33
+ questionnaire: Questionnaire;
34
+ fhirClient: Client;
35
+ patient: Patient;
36
+ user: Practitioner;
37
+ }
38
+
39
+ function PrePopWrapper(props: PrePopWrapperProps) {
40
+ const { questionnaire, fhirClient, patient, user } = props;
41
+
42
+ const [isPopulating, setIsPopulating] = useState(false);
43
+
44
+ const isBuilding = useBuildFormForStorybook(questionnaire);
45
+
46
+ const queryClient = useQueryClient();
47
+
48
+ function handlePrepopulate() {
49
+ setIsPopulating(true);
50
+
51
+ populateQuestionnaire({
52
+ questionnaire: questionnaire,
53
+ fetchResourceCallback: fetchResourceCallback,
54
+ requestConfig: {
55
+ clientEndpoint: fhirClient.state.serverUrl,
56
+ authToken: null
57
+ },
58
+ patient: patient,
59
+ user: user
60
+ }).then(async ({ populateSuccess, populateResult }) => {
61
+ if (!populateSuccess || !populateResult) {
62
+ setIsPopulating(false);
63
+ return;
64
+ }
65
+
66
+ const { populatedResponse } = populateResult;
67
+
68
+ // buildForm is used here because there is a really bizarre bug - using the store hooks directly doesn't update the baseRenderer
69
+ // could be the fact that it doesn't play well with storybook
70
+ await buildForm(questionnaire, populatedResponse);
71
+
72
+ setIsPopulating(false);
73
+ });
74
+ }
75
+
76
+ if (isBuilding) {
77
+ return <div>Loading...</div>;
78
+ }
79
+
80
+ return (
81
+ <ThemeProvider>
82
+ <QueryClientProvider client={queryClient}>
83
+ <div>
84
+ <PrePopButtonForStorybook isPopulating={isPopulating} onPopulate={handlePrepopulate} />
85
+ {isPopulating ? null : <BaseRenderer />}
86
+ </div>
87
+ </QueryClientProvider>
88
+ </ThemeProvider>
89
+ );
90
+ }
91
+
92
+ export default PrePopWrapper;
@@ -0,0 +1,52 @@
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 Client from 'fhirclient/lib/Client';
19
+
20
+ const iss = 'https://proxy.smartforms.io/v/r4/fhir';
21
+
22
+ const clientId = 'smart-forms-storybook';
23
+
24
+ const scope =
25
+ 'fhirUser online_access openid profile patient/Condition.rs patient/Observation.rs launch patient/Encounter.rs patient/Patient.rs';
26
+
27
+ // This must be a patient ID that exists in the EHR
28
+ const patientId = 'pat-sf';
29
+
30
+ // This must be a practitioner ID that exists in the EHR
31
+ const userId = 'primary-peter';
32
+
33
+ export const mockFhirClient = {
34
+ state: {
35
+ clientId: clientId,
36
+ scope: scope,
37
+ serverUrl: iss,
38
+ tokenResponse: {
39
+ access_token: 'mock_access_token'
40
+ }
41
+ },
42
+ patient: {
43
+ id: patientId
44
+ },
45
+ encounter: { id: null },
46
+
47
+ user: {
48
+ id: userId,
49
+ fhirUser: `Practitioner/${userId}`,
50
+ resourceType: 'Practitioner'
51
+ }
52
+ } as unknown as Client;
@@ -0,0 +1,281 @@
1
+ import type { Patient } from 'fhir/r4';
2
+
3
+ export const patSmartForm: Patient = {
4
+ resourceType: 'Patient',
5
+ id: 'pat-sf',
6
+ meta: {
7
+ versionId: '1',
8
+ lastUpdated: '2024-05-14T04:18:27.156+00:00',
9
+ source: '#7awrHf9svvQ9oRrA',
10
+ profile: ['http://hl7.org.au/fhir/core/StructureDefinition/au-core-patient']
11
+ },
12
+ text: {
13
+ status: 'generated',
14
+ div: '<div xmlns="http://www.w3.org/1999/xhtml"><p style="border: 1px #661aff solid; background-color: #e6e6ff; padding: 10px;"><b>Clever Form</b> female, DoB: 1968-10-11 ( Medicare Number/69514496771 (period: (?) --&gt; 2024-08))</p><hr/><table class="grid"><tr><td style="background-color: #f3f5da" title="Other Ids (see the one above)">Other Id:</td><td colspan="3">IHI/8003608833357361</td></tr><tr><td style="background-color: #f3f5da" title="Alternate names (see the one above)">Alt. Name:</td><td colspan="3">Mrs. Smart Form(OFFICIAL)</td></tr><tr><td style="background-color: #f3f5da" title="Ways to contact the Patient">Contact Details:</td><td colspan="3"><ul><li>ph: 0491 572 665(MOBILE)</li><li>ph: 0123456879(HOME)</li><li>4 Brisbane Street Brisbane QLD 4112 AU (HOME)</li><li>PO Box Number Brisbane QLD 4112 AU (TEMP)</li></ul></td></tr><tr><td style="background-color: #f3f5da" title="Languages spoken">Language:</td><td colspan="3"><span title="Codes: {urn:ietf:bcp:47 yub}">Yugambal</span></td></tr><tr><td style="background-color: #f3f5da" title="Nominated Contact: Emergency Contact">Emergency Contact:</td><td colspan="3"><ul><li>Ms Phone A Friend</li><li>0987654321</li></ul></td></tr><tr><td style="background-color: #f3f5da" title="The pronouns to use when referring to an individual in verbal or written communication.">Individual Pronouns:</td><td colspan="3"><ul><li>value: <span title="Codes: {http://loinc.org LA29520-6}">they/them/their/theirs/themselves</span></li><li>period: 2018-02 --&gt; 2022-06</li></ul></td></tr><tr><td style="background-color: #f3f5da" title="The pronouns to use when referring to an individual in verbal or written communication.">Individual Pronouns:</td><td colspan="3"><ul><li>value: <span title="Codes: {http://loinc.org LA29519-8}">she/her/her/hers/herself</span></li><li>period: 2022-06 --&gt; (ongoing)</li></ul></td></tr><tr><td style="background-color: #f3f5da" title="Recorded sex or gender (RSG) information includes the various sex and gender concepts that are often used in existing systems but are known NOT to represent a gender identity, sex parameter for clinical use, or attributes related to sexuality, such as sexual orientation, sexual activity, or sexual attraction. Examples of recorded sex or gender concepts include administrative gender, administrative sex, and sex assigned at birth. When exchanging this concept, refer to the guidance in the [Gender Harmony Implementation Guide](http://hl7.org/xprod/ig/uv/gender-harmony/).\n\nThis extension is published in this guide to pre-adopt an extension published in the R5 [FHIR Extensions Pack](http://hl7.org/fhir/extensions/StructureDefinition-individual-recordedSexOrGender.html). The only material difference is the data type for extension part sourceDocument (R5 CodeableReference to a choice between R4 CodeableConcept or Reference).">Person Recorded Sex Or Gender:</td><td colspan="3"><ul><li>value: <span title="Codes: {http://snomed.info/sct 248152002}">Female</span></li><li>type: <span title="Codes: {http://snomed.info/sct 1515311000168102}">Sex at Birth</span></li><li>effectivePeriod: 2022-06 --&gt; (ongoing)</li></ul></td></tr><tr><td style="background-color: #f3f5da" title="Recorded sex or gender (RSG) information includes the various sex and gender concepts that are often used in existing systems but are known NOT to represent a gender identity, sex parameter for clinical use, or attributes related to sexuality, such as sexual orientation, sexual activity, or sexual attraction. Examples of recorded sex or gender concepts include administrative gender, administrative sex, and sex assigned at birth. When exchanging this concept, refer to the guidance in the [Gender Harmony Implementation Guide](http://hl7.org/xprod/ig/uv/gender-harmony/).\n\nThis extension is published in this guide to pre-adopt an extension published in the R5 [FHIR Extensions Pack](http://hl7.org/fhir/extensions/StructureDefinition-individual-recordedSexOrGender.html). The only material difference is the data type for extension part sourceDocument (R5 CodeableReference to a choice between R4 CodeableConcept or Reference).">Person Recorded Sex Or Gender:</td><td colspan="3"><ul><li>value: <span title="Codes: {http://snomed.info/sct 32570681000036106}">Indeterminate sex</span></li><li>type: <span title="Codes: {http://snomed.info/sct 1515311000168102}">Sex at Birth</span></li><li>effectivePeriod: 2018-02 --&gt; 2022-06</li></ul></td></tr><tr><td style="background-color: #f3f5da" title="This extension applies to the Patient, Person, and RelatedPerson resources and is used to indicate whether a person identifies as being of Aboriginal or Torres Strait Islander origin."><a href="https://build.fhir.org/ig/hl7au/au-fhir-base//StructureDefinition-indigenous-status.html">Australian Indigenous Status:</a></td><td colspan="3"><ul><li>https://healthterminologies.gov.au/fhir/CodeSystem/australian-indigenous-status-1 1: Aboriginal but not Torres Strait Islander origin</li></ul></td></tr><tr><td style="background-color: #f3f5da" title="An individual\'s personal sense of being a man, woman, boy, girl, nonbinary, or something else. This represents an individual’s identity, ascertained by asking them what that identity is. \n In the case where the gender identity is communicated by a third party, for example, if a spouse indicates the gender identity of their partner on an intake form, a Provenance resource can be used with a Provenance.target referring to the Patient, with a targetElement extension identifying the gender identity extension as the target element within the Patient resource. When exchanging this concept, refer to the guidance in the [Gender Harmony Implementation Guide](http://hl7.org/xprod/ig/uv/gender-harmony/).">Individual Gender Identity:</td><td colspan="3"><ul><li>value: <span title="Codes: {http://snomed.info/sct 446141000124107}">Identifies as female gender</span></li></ul></td></tr></table></div>'
15
+ },
16
+ extension: [
17
+ {
18
+ url: 'http://hl7.org.au/fhir/StructureDefinition/indigenous-status',
19
+ valueCoding: {
20
+ system: 'https://healthterminologies.gov.au/fhir/CodeSystem/australian-indigenous-status-1',
21
+ code: '1',
22
+ display: 'Aboriginal but not Torres Strait Islander origin'
23
+ }
24
+ },
25
+ {
26
+ url: 'http://hl7.org/fhir/StructureDefinition/individual-genderIdentity',
27
+ extension: [
28
+ {
29
+ url: 'value',
30
+ valueCodeableConcept: {
31
+ coding: [
32
+ {
33
+ system: 'http://snomed.info/sct',
34
+ code: '446141000124107',
35
+ display: 'Identifies as female gender'
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ url: 'http://hl7.org/fhir/StructureDefinition/individual-pronouns',
44
+ extension: [
45
+ {
46
+ url: 'value',
47
+ valueCodeableConcept: {
48
+ coding: [
49
+ {
50
+ system: 'http://loinc.org',
51
+ code: 'LA29520-6',
52
+ display: 'they/them/their/theirs/themselves'
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ url: 'period',
59
+ valuePeriod: {
60
+ start: '2018-02',
61
+ end: '2022-06'
62
+ }
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ url: 'http://hl7.org/fhir/StructureDefinition/individual-pronouns',
68
+ extension: [
69
+ {
70
+ url: 'value',
71
+ valueCodeableConcept: {
72
+ coding: [
73
+ {
74
+ system: 'http://loinc.org',
75
+ code: 'LA29519-8',
76
+ display: 'she/her/her/hers/herself'
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ {
82
+ url: 'period',
83
+ valuePeriod: {
84
+ start: '2022-06'
85
+ }
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ url: 'http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender',
91
+ extension: [
92
+ {
93
+ url: 'value',
94
+ valueCodeableConcept: {
95
+ coding: [
96
+ {
97
+ system: 'http://snomed.info/sct',
98
+ code: '248152002',
99
+ display: 'Female'
100
+ }
101
+ ],
102
+ text: 'Female'
103
+ }
104
+ },
105
+ {
106
+ url: 'type',
107
+ valueCodeableConcept: {
108
+ coding: [
109
+ {
110
+ system: 'http://snomed.info/sct',
111
+ code: '1515311000168102',
112
+ display: 'Biological sex at birth'
113
+ }
114
+ ],
115
+ text: 'Sex at Birth'
116
+ }
117
+ },
118
+ {
119
+ url: 'effectivePeriod',
120
+ valuePeriod: {
121
+ start: '2022-06'
122
+ }
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ url: 'http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender',
128
+ extension: [
129
+ {
130
+ url: 'value',
131
+ valueCodeableConcept: {
132
+ coding: [
133
+ {
134
+ system: 'http://snomed.info/sct',
135
+ code: '32570681000036106',
136
+ display: 'Indeterminate sex'
137
+ }
138
+ ],
139
+ text: 'Indeterminate sex'
140
+ }
141
+ },
142
+ {
143
+ url: 'type',
144
+ valueCodeableConcept: {
145
+ coding: [
146
+ {
147
+ system: 'http://snomed.info/sct',
148
+ code: '1515311000168102',
149
+ display: 'Biological sex at birth'
150
+ }
151
+ ],
152
+ text: 'Sex at Birth'
153
+ }
154
+ },
155
+ {
156
+ url: 'effectivePeriod',
157
+ valuePeriod: {
158
+ start: '2018-02',
159
+ end: '2022-06'
160
+ }
161
+ }
162
+ ]
163
+ }
164
+ ],
165
+ identifier: [
166
+ {
167
+ type: {
168
+ coding: [
169
+ {
170
+ system: 'http://terminology.hl7.org/CodeSystem/v2-0203',
171
+ code: 'MC'
172
+ }
173
+ ],
174
+ text: 'Medicare Number'
175
+ },
176
+ system: 'http://ns.electronichealth.net.au/id/medicare-number',
177
+ value: '69514496771',
178
+ period: {
179
+ end: '2024-08'
180
+ }
181
+ },
182
+ {
183
+ type: {
184
+ coding: [
185
+ {
186
+ system: 'http://terminology.hl7.org/CodeSystem/v2-0203',
187
+ code: 'NI',
188
+ display: 'National unique individual identifier'
189
+ }
190
+ ],
191
+ text: 'IHI'
192
+ },
193
+ system: 'http://ns.electronichealth.net.au/id/hi/ihi/1.0',
194
+ value: '8003608833357361'
195
+ }
196
+ ],
197
+ name: [
198
+ {
199
+ use: 'official',
200
+ text: 'Mrs. Smart Form',
201
+ family: 'Form',
202
+ given: ['Smart'],
203
+ prefix: ['Mrs']
204
+ },
205
+ {
206
+ use: 'usual',
207
+ text: 'Clever Form'
208
+ }
209
+ ],
210
+ telecom: [
211
+ {
212
+ system: 'phone',
213
+ value: '0491 572 665',
214
+ use: 'mobile'
215
+ },
216
+ {
217
+ system: 'phone',
218
+ value: '0123456879',
219
+ use: 'home'
220
+ }
221
+ ],
222
+ gender: 'female',
223
+ birthDate: '1968-10-11',
224
+ address: [
225
+ {
226
+ use: 'home',
227
+ type: 'physical',
228
+ line: ['4 Brisbane Street'],
229
+ city: 'Brisbane',
230
+ state: 'QLD',
231
+ postalCode: '4112',
232
+ country: 'AU'
233
+ },
234
+ {
235
+ use: 'temp',
236
+ type: 'postal',
237
+ line: ['PO Box Number'],
238
+ city: 'Brisbane',
239
+ state: 'QLD',
240
+ postalCode: '4112',
241
+ country: 'AU'
242
+ }
243
+ ],
244
+ contact: [
245
+ {
246
+ relationship: [
247
+ {
248
+ coding: [
249
+ {
250
+ system: 'http://terminology.hl7.org/CodeSystem/v2-0131',
251
+ code: 'C'
252
+ }
253
+ ]
254
+ }
255
+ ],
256
+ name: {
257
+ use: 'usual',
258
+ text: 'Ms Phone A Friend'
259
+ },
260
+ telecom: [
261
+ {
262
+ system: 'phone',
263
+ value: '0987654321'
264
+ }
265
+ ]
266
+ }
267
+ ],
268
+ communication: [
269
+ {
270
+ language: {
271
+ coding: [
272
+ {
273
+ system: 'urn:ietf:bcp:47',
274
+ code: 'yub'
275
+ }
276
+ ],
277
+ text: 'Yugambal'
278
+ }
279
+ }
280
+ ]
281
+ };
@@ -0,0 +1,38 @@
1
+ import type { Practitioner } from 'fhir/r4';
2
+
3
+ export const pracPrimaryPeter: Practitioner = {
4
+ resourceType: 'Practitioner',
5
+ id: 'primary-peter',
6
+ meta: {
7
+ versionId: '1',
8
+ lastUpdated: '2024-05-14T04:18:27.156+00:00',
9
+ source: '#7awrHf9svvQ9oRrA',
10
+ profile: ['http://hl7.org.au/fhir/core/StructureDefinition/au-core-practitioner']
11
+ },
12
+ text: {
13
+ status: 'generated',
14
+ div: '<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative: Practitioner</b><a name="primary-peter"> </a></p><div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Practitioner &quot;primary-peter&quot; Version &quot;2&quot; Updated &quot;2022-04-21 20:04:20+0000&quot; </p><p style="margin-bottom: 0px">Information Source: #PFl2LJ5HsUkESlP1!</p><p style="margin-bottom: 0px">Profile: <a href="StructureDefinition-au-core-practitioner.html">AU Core Practitioner</a></p></div><p><b>identifier</b>: <code>http://www.acme.org/practitioners</code>/25456</p><p><b>name</b>: Peter Primary </p><p><b>address</b>: 310 Hay St East Perth WA 6004 (WORK)</p></div>'
15
+ },
16
+ identifier: [
17
+ {
18
+ system: 'http://www.acme.org/practitioners',
19
+ value: '25456'
20
+ }
21
+ ],
22
+ name: [
23
+ {
24
+ family: 'Primary',
25
+ given: ['Peter'],
26
+ prefix: ['Dr']
27
+ }
28
+ ],
29
+ address: [
30
+ {
31
+ use: 'work',
32
+ line: ['310 Hay St'],
33
+ city: 'East Perth',
34
+ state: 'WA',
35
+ postalCode: '6004'
36
+ }
37
+ ]
38
+ };