fhir-react 0.3.4 → 0.3.5
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/build/bootstrap-reboot.min.css +8 -2
- package/build/index.js +7 -7
- package/build/style.css +4 -5
- package/package.json +1 -1
- package/src/assets/containers/Binary/binary.svg +9 -0
- package/src/components/containers/Accordion/Accordion.js +10 -9
- package/src/components/datatypes/Annotation/Annotation.js +4 -4
- package/src/components/datatypes/CodeableConcept/CodeableConcept.css +4 -1
- package/src/components/datatypes/Coding/Coding.css +0 -1
- package/src/components/datatypes/Reference/Reference.css +3 -0
- package/src/components/datatypes/Reference/Reference.js +2 -0
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +87 -76
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +11 -1
- package/src/components/resources/Binary/Binary.js +31 -20
- package/src/components/resources/Binary/Binary.stories.js +6 -5
- package/src/components/resources/CarePlan/CarePlan.js +111 -96
- package/src/components/resources/CarePlan/CarePlan.test.js +2 -2
- package/src/components/resources/CarePlan/CarePlanActivity.js +6 -2
- package/src/components/resources/Device/Device.js +54 -34
- package/src/components/resources/DiagnosticReport/DiagnosticReport.js +53 -43
- package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +7 -1
- package/src/components/resources/DocumentReference/DocumentReference.js +101 -65
- package/src/components/resources/DocumentReference/DocumentReference.stories.js +4 -0
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +47 -38
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +4 -0
- package/src/components/resources/Goal/Goal.js +104 -85
- package/src/components/resources/Goal/Goal.stories.js +37 -7
- package/src/components/resources/Goal/Goal.test.js +1 -3
- package/src/components/resources/MedicationOrder/MedicationOrder.js +45 -28
- package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +2 -1
- package/src/components/resources/MedicationRequest/MedicationRequest.js +65 -43
- package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +16 -5
- package/src/components/resources/MedicationStatement/MedicationDetails.js +52 -0
- package/src/components/resources/MedicationStatement/MedicationDosage.js +46 -0
- package/src/components/resources/MedicationStatement/MedicationStatement.js +65 -118
- package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +6 -0
- package/src/components/resources/MedicationStatement/MedicationStatement.test.js +31 -6
- package/src/components/ui/bootstrap-reboot.min.css +8 -2
- package/src/components/ui/index.js +11 -0
- package/src/fixtures/example-icons.jsx +7 -0
- package/src/style.scss +1 -0
- package/src/utils/formatDate.js +6 -4
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.css +0 -4
- package/src/components/resources/CarePlan/CarePlan.css +0 -7
|
@@ -10,18 +10,17 @@ import { isNotEmptyArray } from '../../../utils';
|
|
|
10
10
|
import fhirVersions from '../fhirResourceVersions';
|
|
11
11
|
import UnhandledResourceDataStructure from '../UnhandledResourceDataStructure';
|
|
12
12
|
import CarePlanActivity from './CarePlanActivity';
|
|
13
|
-
import './CarePlan.css';
|
|
14
13
|
|
|
15
14
|
import {
|
|
16
15
|
Root,
|
|
17
16
|
Header,
|
|
18
|
-
Title,
|
|
19
17
|
Badge,
|
|
20
18
|
BadgeSecondary,
|
|
21
19
|
Body,
|
|
22
|
-
Value,
|
|
23
20
|
MissingValue,
|
|
21
|
+
ValueSectionItem,
|
|
24
22
|
} from '../../ui';
|
|
23
|
+
import Accordion from '../../containers/Accordion';
|
|
25
24
|
|
|
26
25
|
const commonDTO = fhirResource => {
|
|
27
26
|
const status = _get(fhirResource, 'status', '');
|
|
@@ -163,8 +162,7 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
163
162
|
}
|
|
164
163
|
};
|
|
165
164
|
|
|
166
|
-
const CarePlan =
|
|
167
|
-
const { fhirResource, fhirVersion } = props;
|
|
165
|
+
const CarePlan = ({ fhirResource, fhirVersion, fhirIcons }) => {
|
|
168
166
|
let fhirResourceData = {};
|
|
169
167
|
try {
|
|
170
168
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -197,99 +195,116 @@ const CarePlan = props => {
|
|
|
197
195
|
const authorArr = Array.isArray(author) ? author : [author];
|
|
198
196
|
return (
|
|
199
197
|
<Root name="CarePlan">
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
198
|
+
<Accordion
|
|
199
|
+
headerContent={
|
|
200
|
+
<Header
|
|
201
|
+
icon={fhirIcons}
|
|
202
|
+
resourceName="CarePlan"
|
|
203
|
+
badges={status && <Badge data-testid="status">{status}</Badge>}
|
|
204
|
+
title={'Care Plan'}
|
|
205
|
+
additionalContent={
|
|
206
|
+
expiry && <BadgeSecondary>expires on ${expiry}</BadgeSecondary>
|
|
207
|
+
}
|
|
208
|
+
/>
|
|
209
|
+
}
|
|
210
|
+
bodyContent={
|
|
211
|
+
<Body>
|
|
212
|
+
{hasCategory && (
|
|
213
|
+
<ValueSectionItem label="Category" data-testid="category">
|
|
214
|
+
{category.map((category, i) =>
|
|
215
|
+
(category.coding || []).map((coding, j) => (
|
|
216
|
+
<Coding key={`item-${i}${j}`} fhirData={coding} />
|
|
217
|
+
)),
|
|
218
|
+
)}
|
|
219
|
+
</ValueSectionItem>
|
|
212
220
|
)}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
{intent}
|
|
218
|
-
</Value>
|
|
219
|
-
)}
|
|
220
|
-
{hasGoals && (
|
|
221
|
-
<Value label="Goals" data-testid="goals">
|
|
222
|
-
{goals.map((goal, i) => (
|
|
223
|
-
<div key={`goal-${i}`}>
|
|
224
|
-
<Reference fhirData={goal} />
|
|
225
|
-
</div>
|
|
226
|
-
))}
|
|
227
|
-
</Value>
|
|
228
|
-
)}
|
|
229
|
-
{description && (
|
|
230
|
-
<Value label="Description" data-testid="description">
|
|
231
|
-
{description}
|
|
232
|
-
</Value>
|
|
233
|
-
)}
|
|
234
|
-
{subject && (
|
|
235
|
-
<Value label="Subject" data-testid="subject">
|
|
236
|
-
<Reference fhirData={subject} />
|
|
237
|
-
</Value>
|
|
238
|
-
)}
|
|
239
|
-
{hasValue(author) && (
|
|
240
|
-
<Value label="Author" data-testid="author">
|
|
241
|
-
{authorArr.map((item, i) => (
|
|
242
|
-
<Reference key={`author-${i}`} fhirData={item} />
|
|
243
|
-
))}
|
|
244
|
-
</Value>
|
|
245
|
-
)}
|
|
246
|
-
{periodStart && (
|
|
247
|
-
<Value label="Plan Period Start" data-testid="periodStart">
|
|
248
|
-
{periodStart ? (
|
|
249
|
-
<DateType fhirData={periodStart} />
|
|
250
|
-
) : (
|
|
251
|
-
<MissingValue />
|
|
221
|
+
{intent && (
|
|
222
|
+
<ValueSectionItem label="Intent" data-testid="intent">
|
|
223
|
+
{intent}
|
|
224
|
+
</ValueSectionItem>
|
|
252
225
|
)}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
{
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
</
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
226
|
+
{hasGoals && (
|
|
227
|
+
<ValueSectionItem label="Goals" data-testid="goals">
|
|
228
|
+
{goals.map((goal, i) => (
|
|
229
|
+
<div key={`goal-${i}`}>
|
|
230
|
+
<Reference fhirData={goal} />
|
|
231
|
+
</div>
|
|
232
|
+
))}
|
|
233
|
+
</ValueSectionItem>
|
|
234
|
+
)}
|
|
235
|
+
{description && (
|
|
236
|
+
<ValueSectionItem label="Description" data-testid="description">
|
|
237
|
+
{description}
|
|
238
|
+
</ValueSectionItem>
|
|
239
|
+
)}
|
|
240
|
+
{subject && (
|
|
241
|
+
<ValueSectionItem label="Subject" data-testid="subject">
|
|
242
|
+
<Reference fhirData={subject} />
|
|
243
|
+
</ValueSectionItem>
|
|
244
|
+
)}
|
|
245
|
+
{hasValue(author) && (
|
|
246
|
+
<ValueSectionItem label="Author" data-testid="author">
|
|
247
|
+
{authorArr.map((item, i) => (
|
|
248
|
+
<Reference key={`author-${i}`} fhirData={item} />
|
|
249
|
+
))}
|
|
250
|
+
</ValueSectionItem>
|
|
251
|
+
)}
|
|
252
|
+
{periodStart && (
|
|
253
|
+
<ValueSectionItem
|
|
254
|
+
label="Plan Period Start"
|
|
255
|
+
data-testid="periodStart"
|
|
256
|
+
>
|
|
257
|
+
{periodStart ? (
|
|
258
|
+
<DateType fhirData={periodStart} isBlack />
|
|
259
|
+
) : (
|
|
260
|
+
<MissingValue />
|
|
261
|
+
)}
|
|
262
|
+
</ValueSectionItem>
|
|
263
|
+
)}
|
|
264
|
+
{periodEnd && (
|
|
265
|
+
<ValueSectionItem label="Plan Period End" data-testid="periodEnd">
|
|
266
|
+
{periodEnd ? (
|
|
267
|
+
<DateType fhirData={periodEnd} isBlack />
|
|
268
|
+
) : (
|
|
269
|
+
<MissingValue />
|
|
270
|
+
)}
|
|
271
|
+
</ValueSectionItem>
|
|
272
|
+
)}
|
|
273
|
+
{hasAddresses && (
|
|
274
|
+
<ValueSectionItem label="Addresses" data-testid="addresses">
|
|
275
|
+
{addresses.map((address, i) => (
|
|
276
|
+
<div key={`item-${i}`}>
|
|
277
|
+
<Reference fhirData={address} />
|
|
278
|
+
</div>
|
|
279
|
+
))}
|
|
280
|
+
</ValueSectionItem>
|
|
281
|
+
)}
|
|
282
|
+
{isNotEmptyArray(basedOn) && (
|
|
283
|
+
<ValueSectionItem label="Based on" data-testid="basedOn">
|
|
284
|
+
{basedOn.map((item, i) => (
|
|
285
|
+
<Reference key={`based-on-${i}`} fhirData={item} />
|
|
286
|
+
))}
|
|
287
|
+
</ValueSectionItem>
|
|
288
|
+
)}
|
|
289
|
+
{isNotEmptyArray(partOf) && (
|
|
290
|
+
<ValueSectionItem label="Part of" data-testid="partOf">
|
|
291
|
+
{partOf.map((item, i) => (
|
|
292
|
+
<Reference key={`part-of-${i}`} fhirData={item} />
|
|
293
|
+
))}
|
|
294
|
+
</ValueSectionItem>
|
|
295
|
+
)}
|
|
296
|
+
{hasActivity && (
|
|
297
|
+
<ValueSectionItem label="Activity" data-testid="activity">
|
|
298
|
+
{activity.map((activity, i) => (
|
|
299
|
+
<div key={`item-${i}`}>
|
|
300
|
+
<CarePlanActivity fhirData={activity} />
|
|
301
|
+
</div>
|
|
302
|
+
))}
|
|
303
|
+
</ValueSectionItem>
|
|
304
|
+
)}
|
|
305
|
+
</Body>
|
|
306
|
+
}
|
|
307
|
+
/>
|
|
293
308
|
</Root>
|
|
294
309
|
);
|
|
295
310
|
};
|
|
@@ -21,7 +21,7 @@ describe('should render component correctly', () => {
|
|
|
21
21
|
expect(getByTestId('status').textContent).toContain('active');
|
|
22
22
|
expect(getByTestId('category').textContent).toContain('Longitudinal');
|
|
23
23
|
expect(getByTestId('addresses').textContent).toContain('Dog bite');
|
|
24
|
-
expect(getByTestId('activity').textContent).toContain('
|
|
24
|
+
expect(getByTestId('activity').textContent).toContain('Adult diet');
|
|
25
25
|
expect(getByTestId('subject').textContent).toEqual('Patient/d47f763e7c7f');
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -84,7 +84,7 @@ describe('should render component correctly', () => {
|
|
|
84
84
|
expect(container).not.toBeNull();
|
|
85
85
|
|
|
86
86
|
expect(getByTestId('addresses').textContent).toContain('pregnancy');
|
|
87
|
-
expect(getByTestId('activity').textContent).toContain('First
|
|
87
|
+
expect(getByTestId('activity').textContent).toContain('First antenatal');
|
|
88
88
|
expect(getByTestId('intent').textContent).toEqual('plan');
|
|
89
89
|
expect(getByTestId('goals').textContent).toEqual('#goal');
|
|
90
90
|
expect(getByTestId('subject').textContent).toContain('Eve Everywoman');
|
|
@@ -5,8 +5,12 @@ import Coding from '../../datatypes/Coding';
|
|
|
5
5
|
const CarePlanActivity = props => {
|
|
6
6
|
const { title = '', hasCategories, categories } = props.fhirData;
|
|
7
7
|
return (
|
|
8
|
-
<div className="fhir-resource__CarePlan__activity">
|
|
9
|
-
<div className="fhir-resource__CarePlan__activity-title">
|
|
8
|
+
<div className="fhir-resource__CarePlan__activity mb-2">
|
|
9
|
+
<div className="fhir-resource__CarePlan__activity-title fw-bold">
|
|
10
|
+
{title
|
|
11
|
+
.toLowerCase()
|
|
12
|
+
.replace(/./, firstLetter => firstLetter.toUpperCase())}
|
|
13
|
+
</div>
|
|
10
14
|
{hasCategories &&
|
|
11
15
|
categories.map((coding, i) => (
|
|
12
16
|
<Coding key={`item-${i}`} fhirData={coding} />
|
|
@@ -11,13 +11,12 @@ import UnhandledResourceDataStructure from '../UnhandledResourceDataStructure';
|
|
|
11
11
|
import {
|
|
12
12
|
Root,
|
|
13
13
|
Header,
|
|
14
|
-
Title,
|
|
15
14
|
Badge,
|
|
16
|
-
BadgeSecondary,
|
|
17
15
|
Body,
|
|
18
|
-
Value,
|
|
19
16
|
MissingValue,
|
|
17
|
+
ValueSectionItem,
|
|
20
18
|
} from '../../ui';
|
|
19
|
+
import Accordion from '../../containers/Accordion';
|
|
21
20
|
|
|
22
21
|
const commonDTO = fhirResource => {
|
|
23
22
|
const model = _get(fhirResource, 'model', 'Device');
|
|
@@ -103,8 +102,7 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
103
102
|
}
|
|
104
103
|
};
|
|
105
104
|
|
|
106
|
-
const Device =
|
|
107
|
-
const { fhirResource, fhirVersion } = props;
|
|
105
|
+
const Device = ({ fhirResource, fhirVersion, fhirIcons }) => {
|
|
108
106
|
let fhirResourceData = {};
|
|
109
107
|
try {
|
|
110
108
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -130,35 +128,57 @@ const Device = props => {
|
|
|
130
128
|
const safetyArr = hasSafety && !Array.isArray(safety) ? [safety] : safety;
|
|
131
129
|
return (
|
|
132
130
|
<Root name="Device">
|
|
133
|
-
<
|
|
134
|
-
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
131
|
+
<Accordion
|
|
132
|
+
headerContent={
|
|
133
|
+
<Header
|
|
134
|
+
icon={fhirIcons}
|
|
135
|
+
resourceName="Device"
|
|
136
|
+
badges={status && <Badge data-testid="status">{status}</Badge>}
|
|
137
|
+
title={model}
|
|
138
|
+
additionalContent={
|
|
139
|
+
hasExpiry && (
|
|
140
|
+
<div data-testid="expiry">
|
|
141
|
+
<span className="text-secondary">expires on</span>{' '}
|
|
142
|
+
<Date fhirData={getExpiry} isBlack />
|
|
143
|
+
</div>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
}
|
|
148
|
+
bodyContent={
|
|
149
|
+
<Body>
|
|
150
|
+
{hasTypeCoding && (
|
|
151
|
+
<ValueSectionItem data-testid="typeCoding" label="Type">
|
|
152
|
+
{getTypeCoding.map((coding, i) => (
|
|
153
|
+
<Coding key={`item-${i}`} fhirData={coding} />
|
|
154
|
+
))}
|
|
155
|
+
</ValueSectionItem>
|
|
156
|
+
)}
|
|
157
|
+
<ValueSectionItem
|
|
158
|
+
label="Unique device identifier"
|
|
159
|
+
data-testid="uniqueId"
|
|
160
|
+
>
|
|
161
|
+
{getUdi ? getUdi : <MissingValue />}
|
|
162
|
+
</ValueSectionItem>
|
|
163
|
+
{udiCarrierAIDC && (
|
|
164
|
+
<ValueSectionItem label="AIDC barcode">
|
|
165
|
+
{udiCarrierAIDC}
|
|
166
|
+
</ValueSectionItem>
|
|
167
|
+
)}
|
|
168
|
+
{udiCarrierHRF && (
|
|
169
|
+
<ValueSectionItem label="HRF barcode">
|
|
170
|
+
{udiCarrierHRF}
|
|
171
|
+
</ValueSectionItem>
|
|
172
|
+
)}
|
|
173
|
+
{hasSafety &&
|
|
174
|
+
safetyArr.map((item, i) => (
|
|
175
|
+
<ValueSectionItem label="HRF barcode" key={`safety-${i}`}>
|
|
176
|
+
<CodeableConcept fhirData={item} />
|
|
177
|
+
</ValueSectionItem>
|
|
178
|
+
))}
|
|
179
|
+
</Body>
|
|
180
|
+
}
|
|
181
|
+
/>
|
|
162
182
|
</Root>
|
|
163
183
|
);
|
|
164
184
|
};
|
|
@@ -7,16 +7,9 @@ import _get from 'lodash/get';
|
|
|
7
7
|
import _has from 'lodash/has';
|
|
8
8
|
import fhirVersions from '../fhirResourceVersions';
|
|
9
9
|
import UnhandledResourceDataStructure from '../UnhandledResourceDataStructure';
|
|
10
|
+
import Accordion from '../../containers/Accordion';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
-
Root,
|
|
13
|
-
Header,
|
|
14
|
-
Title,
|
|
15
|
-
Badge,
|
|
16
|
-
BadgeSecondary,
|
|
17
|
-
Body,
|
|
18
|
-
Value,
|
|
19
|
-
} from '../../ui';
|
|
12
|
+
import { Root, Header, Badge, Body, Value } from '../../ui';
|
|
20
13
|
|
|
21
14
|
const commonDTO = fhirResource => {
|
|
22
15
|
const title =
|
|
@@ -101,7 +94,7 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
101
94
|
};
|
|
102
95
|
|
|
103
96
|
const DiagnosticReport = props => {
|
|
104
|
-
const { fhirResource, fhirVersion } = props;
|
|
97
|
+
const { fhirResource, fhirVersion, fhirIcons } = props;
|
|
105
98
|
let fhirResourceData = {};
|
|
106
99
|
try {
|
|
107
100
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -121,41 +114,58 @@ const DiagnosticReport = props => {
|
|
|
121
114
|
performer,
|
|
122
115
|
issued,
|
|
123
116
|
} = fhirResourceData;
|
|
117
|
+
|
|
118
|
+
const tableData = [
|
|
119
|
+
{
|
|
120
|
+
label: 'Issued',
|
|
121
|
+
testId: 'issued',
|
|
122
|
+
data: <Date fhirData={issued} isBlack />,
|
|
123
|
+
status: issued,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: 'Category',
|
|
127
|
+
testId: 'categoryCoding',
|
|
128
|
+
data:
|
|
129
|
+
categoryCoding &&
|
|
130
|
+
categoryCoding.map((coding, i) => (
|
|
131
|
+
<Coding key={`item-${i}`} fhirData={coding} />
|
|
132
|
+
)),
|
|
133
|
+
status: hasCategoryCoding,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: 'Performer',
|
|
137
|
+
testId: 'performer',
|
|
138
|
+
data: <Reference fhirData={performer} />,
|
|
139
|
+
status: hasPerformer,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: 'Conclusion',
|
|
143
|
+
testId: 'conclusion',
|
|
144
|
+
data: conclusion,
|
|
145
|
+
status: conclusion,
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
|
|
124
149
|
return (
|
|
125
150
|
<Root name="DiagnosticReport">
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
<Coding key={`item-${i}`} fhirData={coding} />
|
|
145
|
-
))}
|
|
146
|
-
</Value>
|
|
147
|
-
)}
|
|
148
|
-
{hasPerformer && (
|
|
149
|
-
<Value label="Performer" data-testid="performer">
|
|
150
|
-
<Reference fhirData={performer} />
|
|
151
|
-
</Value>
|
|
152
|
-
)}
|
|
153
|
-
{conclusion && (
|
|
154
|
-
<Value label="Conclusion" data-testid="conclusion">
|
|
155
|
-
{conclusion}
|
|
156
|
-
</Value>
|
|
157
|
-
)}
|
|
158
|
-
</Body>
|
|
151
|
+
<Accordion
|
|
152
|
+
headerContent={
|
|
153
|
+
<Header
|
|
154
|
+
icon={fhirIcons}
|
|
155
|
+
resourceName="DiagnosticReport"
|
|
156
|
+
badges={status && <Badge data-testid="status">{status}</Badge>}
|
|
157
|
+
title={title}
|
|
158
|
+
additionalContent={
|
|
159
|
+
effectiveDateTime && (
|
|
160
|
+
<Value label="On" data-testid="effectiveDateTime">
|
|
161
|
+
<Date fhirData={effectiveDateTime} isBlack />
|
|
162
|
+
</Value>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
/>
|
|
166
|
+
}
|
|
167
|
+
bodyContent={<Body tableData={tableData} />}
|
|
168
|
+
/>
|
|
159
169
|
</Root>
|
|
160
170
|
);
|
|
161
171
|
};
|
|
@@ -9,6 +9,7 @@ import exampleDiagnosticReportSTU3 from '../../../fixtures/stu3/resources/diagno
|
|
|
9
9
|
import exampleDiagnosticReportR4 from '../../../fixtures/r4/resources/diagnosticReport/example1.json';
|
|
10
10
|
import example2DiagnosticReportR4 from '../../../fixtures/r4/resources/diagnosticReport/example2.json';
|
|
11
11
|
import example3DiagnosticReportR4 from '../../../fixtures/r4/resources/diagnosticReport/example3.json';
|
|
12
|
+
import fhirIcons from '../../../fixtures/example-icons';
|
|
12
13
|
|
|
13
14
|
export default { title: 'DiagnosticReport' };
|
|
14
15
|
|
|
@@ -18,6 +19,7 @@ export const DefaultVisualizationDSTU2 = () => {
|
|
|
18
19
|
<DiagnosticReport
|
|
19
20
|
fhirVersion={fhirVersions.DSTU2}
|
|
20
21
|
fhirResource={fhirResource}
|
|
22
|
+
fhirIcons={fhirIcons}
|
|
21
23
|
/>
|
|
22
24
|
);
|
|
23
25
|
};
|
|
@@ -28,6 +30,7 @@ export const ExampleDiagnosticReportSTU3 = () => {
|
|
|
28
30
|
<DiagnosticReport
|
|
29
31
|
fhirVersion={fhirVersions.STU3}
|
|
30
32
|
fhirResource={fhirResource}
|
|
33
|
+
fhirIcons={fhirIcons}
|
|
31
34
|
/>
|
|
32
35
|
);
|
|
33
36
|
};
|
|
@@ -38,6 +41,7 @@ export const ExampleDiagnosticReportR4 = () => {
|
|
|
38
41
|
<DiagnosticReport
|
|
39
42
|
fhirVersion={fhirVersions.R4}
|
|
40
43
|
fhirResource={fhirResource}
|
|
44
|
+
fhirIcons={fhirIcons}
|
|
41
45
|
/>
|
|
42
46
|
);
|
|
43
47
|
};
|
|
@@ -48,6 +52,7 @@ export const Example2DiagnosticReportR4 = () => {
|
|
|
48
52
|
<DiagnosticReport
|
|
49
53
|
fhirVersion={fhirVersions.R4}
|
|
50
54
|
fhirResource={fhirResource}
|
|
55
|
+
fhirIcons={fhirIcons}
|
|
51
56
|
/>
|
|
52
57
|
);
|
|
53
58
|
};
|
|
@@ -58,11 +63,12 @@ export const Example3DiagnosticReportR4 = () => {
|
|
|
58
63
|
<DiagnosticReport
|
|
59
64
|
fhirVersion={fhirVersions.R4}
|
|
60
65
|
fhirResource={fhirResource}
|
|
66
|
+
fhirIcons={fhirIcons}
|
|
61
67
|
/>
|
|
62
68
|
);
|
|
63
69
|
};
|
|
64
70
|
|
|
65
71
|
export const ExampleWithoutFhirVersionProperty = () => {
|
|
66
72
|
const fhirResource = object('Resource', exampleDiagnosticReportSTU3);
|
|
67
|
-
return <DiagnosticReport fhirResource={fhirResource} />;
|
|
73
|
+
return <DiagnosticReport fhirResource={fhirResource} fhirIcons={fhirIcons} />;
|
|
68
74
|
};
|