fhir-react 0.3.8 → 0.3.11
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 +56 -0
- package/README.md +1 -1
- package/build/index.js +8 -8
- package/build/style.css +2 -2
- package/package.json +5 -4
- package/src/components/containers/Accordion/Accordion.js +24 -1
- package/src/components/containers/Accordion/Accordion.stories.js +74 -58
- package/src/components/containers/ResourceContainer/ResourceContainer.css +4 -0
- package/src/components/containers/ResourceContainer/ResourceContainer.js +28 -37
- package/src/components/containers/ResourceContainer/ResourceContainer.stories.js +46 -22
- package/src/components/defaultArgTypes.js +12 -0
- package/src/components/resources/AdverseEvent/AdverseEvent.js +8 -1
- package/src/components/resources/AdverseEvent/AdverseEvent.stories.js +17 -19
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +2 -0
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +46 -70
- package/src/components/resources/Appointment/Appointment.js +8 -1
- package/src/components/resources/Appointment/Appointment.stories.js +51 -62
- package/src/components/resources/Binary/Binary.js +2 -1
- 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.js +8 -1
- package/src/components/resources/CarePlan/CarePlan.stories.js +44 -54
- package/src/components/resources/CareTeam/CareTeam.js +8 -1
- package/src/components/resources/CareTeam/CareTeam.stories.js +22 -28
- package/src/components/resources/Claim/Claim.js +8 -1
- package/src/components/resources/Claim/Claim.stories.js +37 -50
- package/src/components/resources/ClaimResponse/ClaimResponse.js +8 -1
- package/src/components/resources/ClaimResponse/ClaimResponse.stories.js +42 -52
- package/src/components/resources/Condition/Condition.js +8 -1
- package/src/components/resources/Condition/Condition.stories.js +47 -62
- package/src/components/resources/Coverage/Coverage.js +8 -1
- package/src/components/resources/Coverage/Coverage.stories.js +38 -50
- package/src/components/resources/Device/Device.js +8 -1
- package/src/components/resources/Device/Device.stories.js +40 -52
- package/src/components/resources/DiagnosticReport/DiagnosticReport.js +2 -0
- package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +38 -50
- package/src/components/resources/DocumentReference/DocumentReference.js +2 -0
- package/src/components/resources/DocumentReference/DocumentReference.stories.js +25 -29
- package/src/components/resources/Encounter/Encounter.js +8 -1
- package/src/components/resources/Encounter/Encounter.stories.js +43 -59
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +2 -0
- 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.js +2 -0
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +23 -29
- package/src/components/resources/Generic/Generic.js +2 -1
- package/src/components/resources/Generic/Generic.stories.js +21 -12
- package/src/components/resources/Goal/Goal.js +8 -1
- package/src/components/resources/Goal/Goal.stories.js +35 -49
- package/src/components/resources/Immunization/Immunization.js +8 -1
- package/src/components/resources/Immunization/Immunization.stories.js +38 -51
- package/src/components/resources/List/List.js +2 -0
- package/src/components/resources/List/List.stories.js +66 -70
- package/src/components/resources/Location/Location.js +2 -1
- package/src/components/resources/Location/Location.stories.js +23 -18
- package/src/components/resources/Medication/Medication.js +8 -1
- package/src/components/resources/Medication/Medication.stories.js +42 -64
- package/src/components/resources/MedicationAdministration/MedicationAdministration.js +2 -0
- package/src/components/resources/MedicationAdministration/MedicationAdministration.stories.js +32 -46
- package/src/components/resources/MedicationDispense/MedicationDispense.js +2 -0
- package/src/components/resources/MedicationDispense/MedicationDispense.stories.js +39 -57
- package/src/components/resources/MedicationKnowledge/MedicationKnowledge.js +2 -0
- package/src/components/resources/MedicationKnowledge/MedicationKnowledge.stories.js +49 -58
- package/src/components/resources/MedicationOrder/MedicationOrder.js +2 -1
- package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +11 -4
- package/src/components/resources/MedicationRequest/MedicationRequest.js +7 -1
- package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +27 -30
- package/src/components/resources/MedicationStatement/MedicationStatement.js +2 -0
- package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +32 -46
- package/src/components/resources/Observation/Observation.js +2 -1
- package/src/components/resources/Observation/Observation.stories.js +39 -33
- package/src/components/resources/Observation/ObservationGraph.js +1 -1
- package/src/components/resources/Organization/Organization.js +8 -1
- package/src/components/resources/Organization/Organization.stories.js +40 -52
- package/src/components/resources/Patient/Patient.js +2 -0
- package/src/components/resources/Patient/Patient.stories.js +36 -28
- package/src/components/resources/Practitioner/Practitioner.js +8 -1
- package/src/components/resources/Practitioner/Practitioner.stories.js +39 -52
- package/src/components/resources/PractitionerRole/PractitionerRole.js +2 -0
- package/src/components/resources/PractitionerRole/PractitionerRole.stories.js +43 -63
- package/src/components/resources/Procedure/Procedure.js +2 -1
- package/src/components/resources/Procedure/Procedure.stories.js +33 -25
- package/src/components/resources/Questionnaire/Questionnaire.js +8 -1
- package/src/components/resources/Questionnaire/Questionnaire.stories.js +47 -62
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.js +2 -0
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.stories.js +43 -63
- package/src/components/resources/ReferralRequest/ReferralRequest.js +8 -1
- package/src/components/resources/ReferralRequest/ReferralRequest.stories.js +20 -20
- package/src/components/resources/RelatedPerson/RelatedPerson.js +8 -1
- package/src/components/resources/RelatedPerson/RelatedPerson.stories.js +26 -30
- package/src/components/resources/ResearchStudy/ResearchStudy.js +8 -1
- package/src/components/resources/ResearchStudy/ResearchStudy.stories.js +17 -15
- package/src/components/resources/ResourceCategory/ResourceCategory.js +1 -1
- package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +40 -27
- package/src/components/supportedFhirResourceList.js +2 -0
- package/src/components/ui/index.js +27 -23
- package/src/style.scss +11 -0
- package/.storybook/addons.js +0 -1
- package/.storybook/config.js +0 -26
- package/.storybook/presets.js +0 -1
|
@@ -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,45 +1,36 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Children, cloneElement, useState } from 'react';
|
|
2
2
|
import CodeBlock from '../CodeBlock';
|
|
3
3
|
import './ResourceContainer.css';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
super(props);
|
|
8
|
-
this.state = {
|
|
9
|
-
jsonOpen:
|
|
10
|
-
typeof this.props.jsonOpen === 'undefined'
|
|
11
|
-
? false
|
|
12
|
-
: this.props.jsonOpen,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
5
|
+
const ResourceContainer = ({ fhirResource, children, jsonOpen }) => {
|
|
6
|
+
const [openJson, setOpenJson] = useState(jsonOpen ?? false);
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<div className="fhir-container__ResourceContainer__card">
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</div>
|
|
8
|
+
return (
|
|
9
|
+
<div className="fhir-container__ResourceContainer__card">
|
|
10
|
+
<div className="fhir-container__ResourceContainer__card-body">
|
|
11
|
+
{Children.map(children, child => {
|
|
12
|
+
return cloneElement(
|
|
13
|
+
child,
|
|
14
|
+
{
|
|
15
|
+
rawOnClick: () => {
|
|
16
|
+
setOpenJson(!openJson);
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
null,
|
|
20
|
+
);
|
|
21
|
+
})}
|
|
22
|
+
<div
|
|
23
|
+
className={
|
|
24
|
+
openJson
|
|
25
|
+
? 'fhir-container__ResourceContainer__json--visible'
|
|
26
|
+
: 'fhir-container__ResourceContainer__json--hidden'
|
|
27
|
+
}
|
|
28
|
+
>
|
|
29
|
+
<CodeBlock code={fhirResource} />
|
|
39
30
|
</div>
|
|
40
31
|
</div>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
44
35
|
|
|
45
36
|
export default ResourceContainer;
|
|
@@ -1,37 +1,61 @@
|
|
|
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';
|
|
6
|
+
import Generic from '../../resources/Generic';
|
|
6
7
|
|
|
7
8
|
import example1 from '../../../fixtures/dstu2/resources/encounter/example.json';
|
|
8
9
|
import fhirVersions from '../../../components/resources/fhirResourceVersions';
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
title: 'ResourceContainer',
|
|
13
|
+
component: ResourceContainer,
|
|
14
|
+
argTypes: {
|
|
15
|
+
...defaultArgTypes,
|
|
16
|
+
children: {
|
|
17
|
+
table: {
|
|
18
|
+
disable: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
12
22
|
};
|
|
13
23
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
const Template = args => <ResourceContainer {...args} />;
|
|
25
|
+
|
|
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
|
+
};
|
|
37
|
+
|
|
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} />,
|
|
25
52
|
};
|
|
26
53
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<Encounter {...props} />
|
|
35
|
-
</ResourceContainer>
|
|
36
|
-
);
|
|
54
|
+
const propsWithoutVersion = {
|
|
55
|
+
fhirResource: example1,
|
|
56
|
+
};
|
|
57
|
+
export const VisualizationWithoutFhirVersion = Template.bind({});
|
|
58
|
+
VisualizationWithoutFhirVersion.args = {
|
|
59
|
+
...propsWithoutVersion,
|
|
60
|
+
children: <Encounter {...propsWithoutVersion} />,
|
|
37
61
|
};
|
|
@@ -71,7 +71,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const AdverseEvent = ({
|
|
74
|
+
const AdverseEvent = ({
|
|
75
|
+
fhirResource,
|
|
76
|
+
fhirVersion,
|
|
77
|
+
fhirIcons,
|
|
78
|
+
onClick,
|
|
79
|
+
rawOnClick,
|
|
80
|
+
}) => {
|
|
75
81
|
let fhirResourceData = {};
|
|
76
82
|
try {
|
|
77
83
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -165,6 +171,7 @@ const AdverseEvent = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
|
|
|
165
171
|
</Body>
|
|
166
172
|
}
|
|
167
173
|
onClick={onClick}
|
|
174
|
+
rawOnClick={rawOnClick}
|
|
168
175
|
/>
|
|
169
176
|
</Root>
|
|
170
177
|
);
|
|
@@ -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
|
};
|
|
@@ -128,6 +128,7 @@ const AllergyIntolerance = ({
|
|
|
128
128
|
fhirVersion,
|
|
129
129
|
fhirIcons,
|
|
130
130
|
onClick,
|
|
131
|
+
rawOnClick,
|
|
131
132
|
}) => {
|
|
132
133
|
let fhirResourceData = {};
|
|
133
134
|
try {
|
|
@@ -237,6 +238,7 @@ const AllergyIntolerance = ({
|
|
|
237
238
|
}
|
|
238
239
|
bodyContent={<Body tableData={tableData} />}
|
|
239
240
|
onClick={onClick}
|
|
241
|
+
rawOnClick={rawOnClick}
|
|
240
242
|
/>
|
|
241
243
|
</Root>
|
|
242
244
|
);
|
|
@@ -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
|
};
|
|
@@ -144,7 +144,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
const Appointment = ({
|
|
147
|
+
const Appointment = ({
|
|
148
|
+
fhirResource,
|
|
149
|
+
fhirVersion,
|
|
150
|
+
fhirIcons,
|
|
151
|
+
onClick,
|
|
152
|
+
rawOnClick,
|
|
153
|
+
}) => {
|
|
148
154
|
const {
|
|
149
155
|
description,
|
|
150
156
|
status,
|
|
@@ -254,6 +260,7 @@ const Appointment = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
|
|
|
254
260
|
</Body>
|
|
255
261
|
}
|
|
256
262
|
onClick={onClick}
|
|
263
|
+
rawOnClick={rawOnClick}
|
|
257
264
|
/>
|
|
258
265
|
</Root>
|
|
259
266
|
);
|