fhir-react 0.3.9 → 0.3.10
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/.storybook/main.js +5 -0
- package/.storybook/manager.js +6 -0
- package/.storybook/preview.js +7 -0
- package/README.md +1 -1
- package/package.json +5 -4
- package/src/components/containers/Accordion/Accordion.stories.js +74 -58
- package/src/components/containers/ResourceContainer/ResourceContainer.stories.js +43 -41
- package/src/components/defaultArgTypes.js +12 -0
- package/src/components/resources/AdverseEvent/AdverseEvent.stories.js +17 -19
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +46 -70
- package/src/components/resources/Appointment/Appointment.stories.js +51 -62
- package/src/components/resources/Binary/Binary.stories.js +27 -21
- package/src/components/resources/Bundle/Bundle.stories.js +59 -49
- package/src/components/resources/CarePlan/CarePlan.stories.js +44 -54
- package/src/components/resources/CareTeam/CareTeam.stories.js +22 -28
- package/src/components/resources/Claim/Claim.stories.js +36 -49
- package/src/components/resources/ClaimResponse/ClaimResponse.stories.js +42 -52
- package/src/components/resources/Condition/Condition.stories.js +47 -62
- package/src/components/resources/Coverage/Coverage.stories.js +38 -50
- package/src/components/resources/Device/Device.stories.js +40 -52
- package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +38 -50
- package/src/components/resources/DocumentReference/DocumentReference.stories.js +25 -29
- package/src/components/resources/Encounter/Encounter.stories.js +43 -59
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +53 -67
- package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.stories.js +74 -38
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +22 -28
- package/src/components/resources/Generic/Generic.stories.js +21 -12
- package/src/components/resources/Goal/Goal.stories.js +35 -49
- package/src/components/resources/Immunization/Immunization.stories.js +38 -51
- package/src/components/resources/List/List.stories.js +66 -70
- package/src/components/resources/Location/Location.stories.js +23 -18
- package/src/components/resources/Medication/Medication.stories.js +42 -64
- package/src/components/resources/MedicationAdministration/MedicationAdministration.stories.js +32 -46
- package/src/components/resources/MedicationDispense/MedicationDispense.stories.js +39 -57
- package/src/components/resources/MedicationKnowledge/MedicationKnowledge.stories.js +49 -58
- package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +11 -4
- package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +27 -30
- package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +32 -46
- package/src/components/resources/Observation/Observation.stories.js +39 -33
- package/src/components/resources/Organization/Organization.stories.js +40 -52
- package/src/components/resources/Patient/Patient.stories.js +36 -28
- package/src/components/resources/Practitioner/Practitioner.stories.js +39 -52
- package/src/components/resources/PractitionerRole/PractitionerRole.stories.js +43 -63
- package/src/components/resources/Procedure/Procedure.stories.js +33 -25
- package/src/components/resources/Questionnaire/Questionnaire.stories.js +47 -62
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.stories.js +43 -63
- package/src/components/resources/ReferralRequest/ReferralRequest.stories.js +20 -20
- package/src/components/resources/RelatedPerson/RelatedPerson.stories.js +26 -30
- package/src/components/resources/ResearchStudy/ResearchStudy.stories.js +17 -15
- package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +40 -27
- package/.storybook/addons.js +0 -1
- package/.storybook/config.js +0 -26
- package/.storybook/presets.js +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://circleci.com/gh/1uphealth/fhir-react/tree/master)
|
|
2
|
-
[](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/release-0-3-
|
|
2
|
+
[](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/release-0-3-10/index.html)
|
|
3
3
|
|
|
4
4
|
# fhir-react
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fhir-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"description": "React component library for displaying FHIR Resources ",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"@nivo/core": "^0.78.0",
|
|
11
11
|
"@nivo/pie": "^0.78.0",
|
|
12
12
|
"@popperjs/core": "^2.11.2",
|
|
13
|
+
"@storybook/addons": "^6.4.22",
|
|
13
14
|
"bootstrap": "^5.1.3",
|
|
14
15
|
"dompurify": "^2.3.6",
|
|
15
16
|
"lodash": "^4.17.21",
|
|
@@ -82,10 +83,10 @@
|
|
|
82
83
|
"@babel/polyfill": "^7.0.0",
|
|
83
84
|
"@babel/preset-env": "^7.16.11",
|
|
84
85
|
"@babel/preset-react": "^7.16.7",
|
|
85
|
-
"@storybook/addon-
|
|
86
|
+
"@storybook/addon-controls": "^6.4.22",
|
|
86
87
|
"@storybook/preset-scss": "^1.0.3",
|
|
87
|
-
"@storybook/react": "^
|
|
88
|
-
"@storybook/storybook-deployer": "^2.8.
|
|
88
|
+
"@storybook/react": "^6.4.22",
|
|
89
|
+
"@storybook/storybook-deployer": "^2.8.11",
|
|
89
90
|
"@testing-library/react": "^12.1.4",
|
|
90
91
|
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
|
91
92
|
"@typescript-eslint/parser": "^5.14.0",
|
|
@@ -1,76 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import _get from 'lodash/get';
|
|
3
|
+
|
|
1
4
|
import { BadgeSecondary, Body, MissingValue, Title, Value } from '../../ui';
|
|
2
5
|
|
|
3
6
|
import Accordion from './Accordion';
|
|
4
7
|
import Annotation from '../../datatypes/Annotation';
|
|
5
8
|
import Date from '../../datatypes/Date';
|
|
6
|
-
import Procedure from '../../resources/Procedure/Procedure';
|
|
7
|
-
import React from 'react';
|
|
8
9
|
import Reference from '../../datatypes/Reference';
|
|
9
|
-
import
|
|
10
|
+
import Procedure from '../../resources/Procedure/Procedure';
|
|
11
|
+
|
|
10
12
|
import example1 from '../../../fixtures/dstu2/resources/procedure/example1.json';
|
|
11
|
-
import fhirIcons from '../../../fixtures/example-icons';
|
|
12
|
-
import { object } from '@storybook/addon-knobs';
|
|
13
13
|
import stu3Example1 from '../../../fixtures/stu3/resources/procedure/example1.json';
|
|
14
|
+
import fhirIcons from '../../../fixtures/example-icons';
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
title: 'Accordion',
|
|
18
|
+
component: Accordion,
|
|
19
|
+
argTypes: {
|
|
20
|
+
headerContent: {
|
|
21
|
+
table: {
|
|
22
|
+
disable: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
bodyContent: {
|
|
26
|
+
table: {
|
|
27
|
+
disable: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
17
31
|
};
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
const fhirResource = object('Resource', stu3Example1);
|
|
21
|
-
const title =
|
|
22
|
-
_get(fhirResource, 'code.coding[0].display') ||
|
|
23
|
-
_get(fhirResource, 'code.text');
|
|
24
|
-
const performedDateTime = _get(fhirResource, 'performedDateTime');
|
|
25
|
-
const performer = _get(fhirResource, 'performer', []);
|
|
26
|
-
const locationReference = _get(fhirResource, 'location[0]');
|
|
27
|
-
const reasonCode = _get(fhirResource, 'reasonCode', []);
|
|
28
|
-
const note = _get(fhirResource, 'note', []);
|
|
33
|
+
const Template = args => <Accordion {...args} />;
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
const DefaultVisualizationFhirResource = stu3Example1;
|
|
36
|
+
export const DefaultVisualization = Template.bind({});
|
|
37
|
+
DefaultVisualization.args = {
|
|
38
|
+
headerContent: (
|
|
39
|
+
<div className="">
|
|
40
|
+
<Title>
|
|
41
|
+
{_get(DefaultVisualizationFhirResource, 'code.coding[0].display') ||
|
|
42
|
+
_get(DefaultVisualizationFhirResource, 'code.text')}
|
|
43
|
+
</Title>
|
|
44
|
+
<div className="pb-3" />
|
|
45
|
+
<BadgeSecondary data-testid="performedDateTime">
|
|
46
|
+
<Date
|
|
47
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'performedDateTime')}
|
|
48
|
+
/>
|
|
49
|
+
</BadgeSecondary>
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
bodyContent: (
|
|
53
|
+
<Body>
|
|
54
|
+
<Value label="Performed by">
|
|
55
|
+
{_get(DefaultVisualizationFhirResource, 'performer', []).map(
|
|
56
|
+
(item, i) => (
|
|
57
|
+
<div key={`item-${i}`}>
|
|
58
|
+
{_get(item, 'actor.display', <MissingValue />)}
|
|
59
|
+
</div>
|
|
60
|
+
),
|
|
61
|
+
)}
|
|
62
|
+
</Value>
|
|
63
|
+
<Value label="Location" data-testid="location">
|
|
64
|
+
<Reference
|
|
65
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'location[0]')}
|
|
66
|
+
/>
|
|
67
|
+
</Value>
|
|
68
|
+
<Value label="Reason" data-testid="hasReasonCode">
|
|
69
|
+
<Annotation
|
|
70
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'reasonCode', [])}
|
|
71
|
+
/>
|
|
72
|
+
</Value>
|
|
73
|
+
<Value label="Notes" data-testid="hasNote">
|
|
74
|
+
<Annotation
|
|
75
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'note', [])}
|
|
76
|
+
/>
|
|
77
|
+
</Value>
|
|
78
|
+
</Body>
|
|
79
|
+
),
|
|
63
80
|
};
|
|
64
81
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
82
|
+
const ProcedureVisualizationFhirResource = example1;
|
|
83
|
+
export const ProcedureVisualization = Template.bind({});
|
|
84
|
+
ProcedureVisualization.args = {
|
|
85
|
+
headerContent: <div className="" />,
|
|
86
|
+
bodyContent: (
|
|
87
|
+
<Procedure
|
|
88
|
+
fhirResource={ProcedureVisualizationFhirResource}
|
|
89
|
+
fhirIcons={fhirIcons}
|
|
74
90
|
/>
|
|
75
|
-
)
|
|
91
|
+
),
|
|
76
92
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import ResourceContainer from './ResourceContainer';
|
|
5
5
|
import Encounter from '../../../components/resources/Encounter';
|
|
@@ -10,50 +10,52 @@ import fhirVersions from '../../../components/resources/fhirResourceVersions';
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
title: 'ResourceContainer',
|
|
13
|
+
component: ResourceContainer,
|
|
14
|
+
argTypes: {
|
|
15
|
+
...defaultArgTypes,
|
|
16
|
+
children: {
|
|
17
|
+
table: {
|
|
18
|
+
disable: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
13
22
|
};
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
const fhirResource = object('Resource', example1);
|
|
17
|
-
const props = {
|
|
18
|
-
fhirVersion: fhirVersions.DSTU2,
|
|
19
|
-
fhirResource: fhirResource,
|
|
20
|
-
};
|
|
21
|
-
return (
|
|
22
|
-
<ResourceContainer {...props}>
|
|
23
|
-
<Encounter {...props} />
|
|
24
|
-
</ResourceContainer>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const DefaultVisualizationWithRawButtonVisibleOutsideAccordion = () => {
|
|
29
|
-
const exampleResource = {
|
|
30
|
-
resourceType: 'UnknownResource',
|
|
31
|
-
id: '12345',
|
|
32
|
-
code: {
|
|
33
|
-
text: 'Resource code text',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
24
|
+
const Template = args => <ResourceContainer {...args} />;
|
|
36
25
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
const propsRawInsideAccordion = {
|
|
27
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
28
|
+
fhirResource: example1,
|
|
29
|
+
};
|
|
30
|
+
export const DefaultVisualizationWithRawButtonHiddenInsideAccordion = Template.bind(
|
|
31
|
+
{},
|
|
32
|
+
);
|
|
33
|
+
DefaultVisualizationWithRawButtonHiddenInsideAccordion.args = {
|
|
34
|
+
...propsRawInsideAccordion,
|
|
35
|
+
children: <Encounter {...propsRawInsideAccordion} />,
|
|
36
|
+
};
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
const exampleResource = {
|
|
39
|
+
resourceType: 'UnknownResource',
|
|
40
|
+
id: '12345',
|
|
41
|
+
code: {
|
|
42
|
+
text: 'Resource code text',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
const propsRawOutsideAccordion = { fhirResource: exampleResource };
|
|
46
|
+
export const DefaultVisualizationWithRawButtonVisibleOutsideAccordion = Template.bind(
|
|
47
|
+
{},
|
|
48
|
+
);
|
|
49
|
+
DefaultVisualizationWithRawButtonVisibleOutsideAccordion.args = {
|
|
50
|
+
...propsRawOutsideAccordion,
|
|
51
|
+
children: <Generic {...propsRawOutsideAccordion} />,
|
|
47
52
|
};
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<Encounter {...props} />
|
|
57
|
-
</ResourceContainer>
|
|
58
|
-
);
|
|
54
|
+
const propsWithoutVersion = {
|
|
55
|
+
fhirResource: example1,
|
|
56
|
+
};
|
|
57
|
+
export const VisualizationWithoutFhirVersion = Template.bind({});
|
|
58
|
+
VisualizationWithoutFhirVersion.args = {
|
|
59
|
+
...propsWithoutVersion,
|
|
60
|
+
children: <Encounter {...propsWithoutVersion} />,
|
|
59
61
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import AdverseEvent from './AdverseEvent';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -11,26 +11,24 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
13
|
title: 'AdverseEvent',
|
|
14
|
+
component: AdverseEvent,
|
|
15
|
+
argTypes: {
|
|
16
|
+
...defaultArgTypes,
|
|
17
|
+
},
|
|
14
18
|
};
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
20
|
+
const Template = args => <AdverseEvent {...args} />;
|
|
21
|
+
|
|
22
|
+
export const DefaultVisualizationSTU3 = Template.bind({});
|
|
23
|
+
DefaultVisualizationSTU3.args = {
|
|
24
|
+
fhirVersion: fhirVersions.STU3,
|
|
25
|
+
fhirResource: stu3Example1,
|
|
26
|
+
fhirIcons: fhirIcons,
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
export const Example1ofR4 = ()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
fhirVersion={fhirVersions.R4}
|
|
33
|
-
fhirIcons={false}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
29
|
+
export const Example1ofR4 = Template.bind({});
|
|
30
|
+
Example1ofR4.args = {
|
|
31
|
+
fhirVersion: fhirVersions.R4,
|
|
32
|
+
fhirResource: r4Example1,
|
|
33
|
+
fhirIcons: false,
|
|
36
34
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import AllergyIntolerance from './AllergyIntolerance';
|
|
5
5
|
|
|
@@ -14,88 +14,64 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
14
14
|
import fhirVersions from '../fhirResourceVersions';
|
|
15
15
|
import AllergyIntoleranceIcon from '../../../assets/containers/AllergyIntolerance/allergy-intolerance.svg';
|
|
16
16
|
|
|
17
|
-
export default {
|
|
17
|
+
export default {
|
|
18
|
+
title: 'AllergyIntolerance',
|
|
19
|
+
component: AllergyIntolerance,
|
|
20
|
+
argTypes: {
|
|
21
|
+
...defaultArgTypes,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const Template = args => <AllergyIntolerance {...args} />;
|
|
18
26
|
|
|
19
|
-
export const DefaultVisualizationDSTU2 = ()
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
fhirResource={fhirResource}
|
|
25
|
-
fhirIcons={require('../../../assets/containers/AllergyIntolerance/allergy-intolerance.svg')}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
27
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
28
|
+
DefaultVisualizationDSTU2.args = {
|
|
29
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
30
|
+
fhirResource: exampleAllergyIntoleranceDSTU2,
|
|
31
|
+
fhirIcons: require('../../../assets/containers/AllergyIntolerance/allergy-intolerance.svg'),
|
|
28
32
|
};
|
|
29
33
|
|
|
30
|
-
export const Example2ofDSTU2 = ()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fhirResource={fhirResource}
|
|
36
|
-
fhirIcons={AllergyIntoleranceIcon}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
34
|
+
export const Example2ofDSTU2 = Template.bind({});
|
|
35
|
+
Example2ofDSTU2.args = {
|
|
36
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
37
|
+
fhirResource: example2AllergyIntoleranceDSTU2,
|
|
38
|
+
fhirIcons: AllergyIntoleranceIcon,
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
export const ExampleDiagnosticReportSTU3 = ()
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
fhirResource={fhirResource}
|
|
47
|
-
fhirIcons={fhirIcons}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
41
|
+
export const ExampleDiagnosticReportSTU3 = Template.bind({});
|
|
42
|
+
ExampleDiagnosticReportSTU3.args = {
|
|
43
|
+
fhirVersion: fhirVersions.STU3,
|
|
44
|
+
fhirResource: exampleAllergyIntoleranceSTU3,
|
|
45
|
+
fhirIcons: fhirIcons,
|
|
50
46
|
};
|
|
51
47
|
|
|
52
|
-
export const Example2DiagnosticReportSTU3 = ()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
fhirResource={fhirResource}
|
|
58
|
-
fhirIcons={false}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
48
|
+
export const Example2DiagnosticReportSTU3 = Template.bind({});
|
|
49
|
+
Example2DiagnosticReportSTU3.args = {
|
|
50
|
+
fhirVersion: fhirVersions.STU3,
|
|
51
|
+
fhirResource: example2AllergyIntoleranceSTU3,
|
|
52
|
+
fhirIcons: false,
|
|
61
53
|
};
|
|
62
54
|
|
|
63
|
-
export const Example1R4 = ()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
fhirResource={fhirResource}
|
|
69
|
-
fhirIcons={'random text'}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
55
|
+
export const Example1R4 = Template.bind({});
|
|
56
|
+
Example1R4.args = {
|
|
57
|
+
fhirVersion: fhirVersions.R4,
|
|
58
|
+
fhirResource: example1AllergyIntoleranceR4,
|
|
59
|
+
fhirIcons: 'random text',
|
|
72
60
|
};
|
|
73
61
|
|
|
74
|
-
export const Example2R4 = ()
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
fhirVersion={fhirVersions.R4}
|
|
79
|
-
fhirResource={fhirResource}
|
|
80
|
-
fhirIcons={fhirIcons}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
62
|
+
export const Example2R4 = Template.bind({});
|
|
63
|
+
Example2R4.args = {
|
|
64
|
+
fhirVersion: fhirVersions.R4,
|
|
65
|
+
fhirResource: example2AllergyIntoleranceR4,
|
|
83
66
|
};
|
|
84
67
|
|
|
85
|
-
export const Example3R4 = ()
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
fhirVersion={fhirVersions.R4}
|
|
90
|
-
fhirResource={fhirResource}
|
|
91
|
-
fhirIcons={fhirIcons}
|
|
92
|
-
/>
|
|
93
|
-
);
|
|
68
|
+
export const Example3R4 = Template.bind({});
|
|
69
|
+
Example3R4.args = {
|
|
70
|
+
fhirVersion: fhirVersions.R4,
|
|
71
|
+
fhirResource: example3AllergyIntoleranceR4,
|
|
94
72
|
};
|
|
95
73
|
|
|
96
|
-
export const ExampleWithoutFhirVersionProperty = ()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<AllergyIntolerance fhirResource={fhirResource} fhirIcons={fhirIcons} />
|
|
100
|
-
);
|
|
74
|
+
export const ExampleWithoutFhirVersionProperty = Template.bind({});
|
|
75
|
+
ExampleWithoutFhirVersionProperty.args = {
|
|
76
|
+
fhirResource: example2AllergyIntoleranceSTU3,
|
|
101
77
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
import fhirVersions from '../fhirResourceVersions';
|
|
4
4
|
|
|
5
5
|
import Appointment from './Appointment';
|
|
@@ -16,76 +16,65 @@ import example3AppointmentR4 from '../../../fixtures/r4/resources/appointment/ex
|
|
|
16
16
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
17
17
|
import AppointmentIcon from '../../../assets/containers/Appointment/appointment.svg';
|
|
18
18
|
|
|
19
|
-
export default {
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Appointment',
|
|
21
|
+
component: Appointment,
|
|
22
|
+
argTypes: {
|
|
23
|
+
...defaultArgTypes,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const Template = args => <Appointment {...args} />;
|
|
20
28
|
|
|
21
|
-
export const DefaultVisualizationDSTU2 = ()
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
27
|
-
fhirIcons={require('../../../assets/containers/Appointment/appointment.svg')}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
29
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
30
|
+
DefaultVisualizationDSTU2.args = {
|
|
31
|
+
fhirResource: exampleAppointmentDSTU2,
|
|
32
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
33
|
+
fhirIcons: require('../../../assets/containers/Appointment/appointment.svg'),
|
|
30
34
|
};
|
|
31
35
|
|
|
32
|
-
export const Example2OfDSTU2 = ()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
38
|
-
fhirIcons={AppointmentIcon}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
36
|
+
export const Example2OfDSTU2 = Template.bind({});
|
|
37
|
+
Example2OfDSTU2.args = {
|
|
38
|
+
fhirResource: example2AppointmentDSTU2,
|
|
39
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
40
|
+
fhirIcons: AppointmentIcon,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export const Example1OfSTU3 = ()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
fhirVersion={fhirVersions.STU3}
|
|
49
|
-
fhirIcons={fhirIcons}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
43
|
+
export const Example1OfSTU3 = Template.bind({});
|
|
44
|
+
Example1OfSTU3.args = {
|
|
45
|
+
fhirResource: example1AppointmentSTU3,
|
|
46
|
+
fhirVersion: fhirVersions.STU3,
|
|
47
|
+
fhirIcons: fhirIcons,
|
|
52
48
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
fhirIcons={false}
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
49
|
+
|
|
50
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
51
|
+
Example2OfSTU3.args = {
|
|
52
|
+
fhirResource: example2AppointmentSTU3,
|
|
53
|
+
fhirVersion: fhirVersions.STU3,
|
|
54
|
+
fhirIcons: false,
|
|
62
55
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
fhirIcons={'random text'}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
56
|
+
|
|
57
|
+
export const Example3OfSTU3 = Template.bind({});
|
|
58
|
+
Example3OfSTU3.args = {
|
|
59
|
+
fhirResource: example3AppointmentSTU3,
|
|
60
|
+
fhirVersion: fhirVersions.STU3,
|
|
61
|
+
fhirIcons: 'random text',
|
|
72
62
|
};
|
|
73
63
|
|
|
74
|
-
export const Example1OfR4 = ()
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
);
|
|
64
|
+
export const Example1OfR4 = Template.bind({});
|
|
65
|
+
Example1OfR4.args = {
|
|
66
|
+
fhirResource: example1AppointmentR4,
|
|
67
|
+
fhirVersion: fhirVersions.R4,
|
|
79
68
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
|
|
70
|
+
export const Example2OfR4 = Template.bind({});
|
|
71
|
+
Example2OfR4.args = {
|
|
72
|
+
fhirResource: example2AppointmentR4,
|
|
73
|
+
fhirVersion: fhirVersions.R4,
|
|
85
74
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
|
|
76
|
+
export const Example3OfR4 = Template.bind({});
|
|
77
|
+
Example3OfR4.args = {
|
|
78
|
+
fhirResource: example3AppointmentR4,
|
|
79
|
+
fhirVersion: fhirVersions.R4,
|
|
91
80
|
};
|