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,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import FamilyMemberHistory from './FamilyMemberHistory';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -12,38 +12,32 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
12
12
|
import FamilyMemberHistoryIcon from '../../../assets/containers/FamilyMemberHistory/family-member-history.svg';
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
title: 'FamilyMemberHistory',
|
|
15
|
+
title: 'Coverage/FamilyMemberHistory',
|
|
16
|
+
component: FamilyMemberHistory,
|
|
17
|
+
argTypes: {
|
|
18
|
+
...defaultArgTypes,
|
|
19
|
+
},
|
|
16
20
|
};
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
22
|
+
const Template = args => <FamilyMemberHistory {...args} />;
|
|
23
|
+
|
|
24
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
25
|
+
DefaultVisualizationDSTU2.args = {
|
|
26
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
27
|
+
fhirResource: example1DSTU2,
|
|
28
|
+
fhirIcons: require('../../../assets/containers/FamilyMemberHistory/family-member-history.svg'),
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
export const Example1OfSTU3 = ()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
fhirResource={fhirResource}
|
|
35
|
-
fhirIcons={FamilyMemberHistoryIcon}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
31
|
+
export const Example1OfSTU3 = Template.bind({});
|
|
32
|
+
Example1OfSTU3.args = {
|
|
33
|
+
fhirVersion: fhirVersions.STU3,
|
|
34
|
+
fhirResource: example1STU3,
|
|
35
|
+
fhirIcons: FamilyMemberHistoryIcon,
|
|
38
36
|
};
|
|
39
37
|
|
|
40
|
-
export const Example2OfSTU3 = ()
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
fhirResource={fhirResource}
|
|
46
|
-
fhirIcons={fhirIcons}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
38
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
39
|
+
Example2OfSTU3.args = {
|
|
40
|
+
fhirVersion: fhirVersions.STU3,
|
|
41
|
+
fhirResource: example2STU3,
|
|
42
|
+
fhirIcons: fhirIcons,
|
|
49
43
|
};
|
|
@@ -4,7 +4,7 @@ import _get from 'lodash/get';
|
|
|
4
4
|
import { Root, Header } from '../../ui';
|
|
5
5
|
import Accordion from '../../containers/Accordion';
|
|
6
6
|
|
|
7
|
-
const Generic = ({ fhirResource, fhirIcons, onClick }) => {
|
|
7
|
+
const Generic = ({ fhirResource, fhirIcons, onClick, rawOnClick }) => {
|
|
8
8
|
const title = fhirResource
|
|
9
9
|
? `${fhirResource.resourceType}/${fhirResource.id}`
|
|
10
10
|
: `Unknown Resource`;
|
|
@@ -30,6 +30,7 @@ const Generic = ({ fhirResource, fhirIcons, onClick }) => {
|
|
|
30
30
|
/>
|
|
31
31
|
}
|
|
32
32
|
onClick={onClick}
|
|
33
|
+
rawOnClick={rawOnClick}
|
|
33
34
|
/>
|
|
34
35
|
</Root>
|
|
35
36
|
);
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Generic from './Generic';
|
|
5
5
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
6
6
|
|
|
7
|
-
export default {
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Generic',
|
|
9
|
+
component: Generic,
|
|
10
|
+
argTypes: {
|
|
11
|
+
...defaultArgTypes,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const Template = args => <Generic {...args} />;
|
|
8
16
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const exampleResource = {
|
|
18
|
+
resourceType: 'UnknownResource',
|
|
19
|
+
id: '12345',
|
|
20
|
+
code: {
|
|
21
|
+
text: 'Resource code text',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export const DefaultVisualization = Template.bind({});
|
|
25
|
+
DefaultVisualization.args = {
|
|
26
|
+
fhirResource: exampleResource,
|
|
27
|
+
fhirIcons: fhirIcons,
|
|
19
28
|
};
|
|
@@ -99,7 +99,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
const Goal = ({
|
|
102
|
+
const Goal = ({
|
|
103
|
+
fhirResource,
|
|
104
|
+
fhirVersion,
|
|
105
|
+
fhirIcons,
|
|
106
|
+
onClick,
|
|
107
|
+
rawOnClick,
|
|
108
|
+
}) => {
|
|
103
109
|
let fhirResourceData = {};
|
|
104
110
|
try {
|
|
105
111
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -228,6 +234,7 @@ const Goal = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
|
|
|
228
234
|
}
|
|
229
235
|
bodyContent={<Body tableData={tableData} />}
|
|
230
236
|
onClick={onClick}
|
|
237
|
+
rawOnClick={rawOnClick}
|
|
231
238
|
/>
|
|
232
239
|
</Root>
|
|
233
240
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Goal from './Goal';
|
|
5
5
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
@@ -13,64 +13,50 @@ import GoalIcon from '../../../assets/containers/Goal/goal.svg';
|
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
title: 'Goal',
|
|
16
|
+
component: Goal,
|
|
17
|
+
argTypes: {
|
|
18
|
+
...defaultArgTypes,
|
|
19
|
+
},
|
|
16
20
|
};
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
22
|
+
const Template = args => <Goal {...args} />;
|
|
23
|
+
|
|
24
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
25
|
+
DefaultVisualizationDSTU2.args = {
|
|
26
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
27
|
+
fhirResource: dstu2Example1,
|
|
28
|
+
fhirIcons: require('../../../assets/containers/Goal/goal.svg'),
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
export const Example2OfDSTU2 = ()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
fhirResource={fhirResource}
|
|
35
|
-
fhirIcons={GoalIcon}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
31
|
+
export const Example2OfDSTU2 = Template.bind({});
|
|
32
|
+
Example2OfDSTU2.args = {
|
|
33
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
34
|
+
fhirResource: dstu2Example2,
|
|
35
|
+
fhirIcons: GoalIcon,
|
|
38
36
|
};
|
|
39
37
|
|
|
40
|
-
export const ExampleOfSTU3 = ()
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
fhirResource={fhirResource}
|
|
46
|
-
fhirIcons={fhirIcons}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
38
|
+
export const ExampleOfSTU3 = Template.bind({});
|
|
39
|
+
ExampleOfSTU3.args = {
|
|
40
|
+
fhirVersion: fhirVersions.STU3,
|
|
41
|
+
fhirResource: stu3Example1,
|
|
42
|
+
fhirIcons: fhirIcons,
|
|
49
43
|
};
|
|
50
44
|
|
|
51
|
-
export const Example1OfR4 = ()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
fhirResource={fhirResource}
|
|
57
|
-
fhirIcons={false}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
45
|
+
export const Example1OfR4 = Template.bind({});
|
|
46
|
+
Example1OfR4.args = {
|
|
47
|
+
fhirVersion: fhirVersions.R4,
|
|
48
|
+
fhirResource: r4Example1,
|
|
49
|
+
fhirIcons: false,
|
|
60
50
|
};
|
|
61
51
|
|
|
62
|
-
export const Example2OfR4 = ()
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
fhirResource={fhirResource}
|
|
68
|
-
fhirIcons={'random text'}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
52
|
+
export const Example2OfR4 = Template.bind({});
|
|
53
|
+
Example2OfR4.args = {
|
|
54
|
+
fhirVersion: fhirVersions.R4,
|
|
55
|
+
fhirResource: r4Example2,
|
|
56
|
+
fhirIcons: 'random text',
|
|
71
57
|
};
|
|
72
58
|
|
|
73
|
-
export const ExampleWithoutFhirVersionProperty = ()
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
export const ExampleWithoutFhirVersionProperty = Template.bind({});
|
|
60
|
+
ExampleWithoutFhirVersionProperty.args = {
|
|
61
|
+
fhirResource: stu3Example1,
|
|
76
62
|
};
|
|
@@ -103,7 +103,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
const Immunization = ({
|
|
106
|
+
const Immunization = ({
|
|
107
|
+
fhirVersion,
|
|
108
|
+
fhirResource,
|
|
109
|
+
fhirIcons,
|
|
110
|
+
onClick,
|
|
111
|
+
rawOnClick,
|
|
112
|
+
}) => {
|
|
107
113
|
const {
|
|
108
114
|
title,
|
|
109
115
|
status,
|
|
@@ -241,6 +247,7 @@ const Immunization = ({ fhirVersion, fhirResource, fhirIcons, onClick }) => {
|
|
|
241
247
|
}
|
|
242
248
|
bodyContent={<Body tableData={tableData} />}
|
|
243
249
|
onClick={onClick}
|
|
250
|
+
rawOnClick={rawOnClick}
|
|
244
251
|
/>
|
|
245
252
|
</Root>
|
|
246
253
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Immunization from './Immunization';
|
|
5
5
|
|
|
@@ -15,64 +15,51 @@ import ImmunizationIcon from '../../../assets/containers/Immunization/immunizati
|
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
title: 'Immunization',
|
|
18
|
+
component: Immunization,
|
|
19
|
+
argTypes: {
|
|
20
|
+
...defaultArgTypes,
|
|
21
|
+
},
|
|
18
22
|
};
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
24
|
+
const Template = args => <Immunization {...args} />;
|
|
25
|
+
|
|
26
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
27
|
+
DefaultVisualizationDSTU2.args = {
|
|
28
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
29
|
+
fhirResource: example1,
|
|
30
|
+
fhirIcons: require('../../../assets/containers/Immunization/immunization.svg'),
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
export const Example2OfDSTU2 = ()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
37
|
-
fhirIcons={ImmunizationIcon}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
33
|
+
export const Example2OfDSTU2 = Template.bind({});
|
|
34
|
+
Example2OfDSTU2.args = {
|
|
35
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
36
|
+
fhirResource: example2,
|
|
37
|
+
fhirIcons: ImmunizationIcon,
|
|
40
38
|
};
|
|
41
39
|
|
|
42
|
-
export const ExampleSTU3 = ()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
fhirVersion={fhirVersions.STU3}
|
|
48
|
-
fhirIcons={fhirIcons}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
40
|
+
export const ExampleSTU3 = Template.bind({});
|
|
41
|
+
ExampleSTU3.args = {
|
|
42
|
+
fhirVersion: fhirVersions.STU3,
|
|
43
|
+
fhirResource: stu3Example,
|
|
44
|
+
fhirIcons: fhirIcons,
|
|
51
45
|
};
|
|
52
46
|
|
|
53
|
-
export const Example1R4 = ()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
fhirVersion={fhirVersions.R4}
|
|
59
|
-
fhirIcons={false}
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
47
|
+
export const Example1R4 = Template.bind({});
|
|
48
|
+
Example1R4.args = {
|
|
49
|
+
fhirVersion: fhirVersions.R4,
|
|
50
|
+
fhirResource: r4Example1,
|
|
51
|
+
fhirIcons: false,
|
|
62
52
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
fhirIcons={'random text'}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
53
|
+
|
|
54
|
+
export const Example2R4 = Template.bind({});
|
|
55
|
+
Example2R4.args = {
|
|
56
|
+
fhirVersion: fhirVersions.R4,
|
|
57
|
+
fhirResource: r4Example2,
|
|
58
|
+
fhirIcons: 'random text',
|
|
72
59
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
|
|
61
|
+
export const Example3R4 = Template.bind({});
|
|
62
|
+
Example3R4.args = {
|
|
63
|
+
fhirVersion: fhirVersions.R4,
|
|
64
|
+
fhirResource: r4Example3,
|
|
78
65
|
};
|
|
@@ -131,6 +131,7 @@ const List = ({
|
|
|
131
131
|
withDaVinciPDex = false,
|
|
132
132
|
fhirIcons,
|
|
133
133
|
onClick,
|
|
134
|
+
rawOnClick,
|
|
134
135
|
}) => {
|
|
135
136
|
let fhirResourceData = {};
|
|
136
137
|
try {
|
|
@@ -291,6 +292,7 @@ const List = ({
|
|
|
291
292
|
</Body>
|
|
292
293
|
}
|
|
293
294
|
onClick={onClick}
|
|
295
|
+
rawOnClick={rawOnClick}
|
|
294
296
|
/>
|
|
295
297
|
</Root>
|
|
296
298
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import List from './List';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -19,90 +19,86 @@ import ListIcon from '../../../assets/containers/List/list.svg';
|
|
|
19
19
|
|
|
20
20
|
export default {
|
|
21
21
|
title: 'List',
|
|
22
|
+
component: List,
|
|
23
|
+
argTypes: {
|
|
24
|
+
...defaultArgTypes,
|
|
25
|
+
withDaVinciPDex: {
|
|
26
|
+
table: {
|
|
27
|
+
disable: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
22
31
|
};
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
+
const Template = args => <List {...args} />;
|
|
34
|
+
|
|
35
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
36
|
+
DefaultVisualizationDSTU2.args = {
|
|
37
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
38
|
+
fhirResource: example1Dstu2,
|
|
39
|
+
fhirIcons: require('../../../assets/containers/List/list.svg'),
|
|
33
40
|
};
|
|
34
41
|
|
|
35
|
-
export const Example2DSTU2 = ()
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
fhirResource={fhirResource}
|
|
41
|
-
fhirIcons={ListIcon}
|
|
42
|
-
/>
|
|
43
|
-
);
|
|
42
|
+
export const Example2DSTU2 = Template.bind({});
|
|
43
|
+
Example2DSTU2.args = {
|
|
44
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
45
|
+
fhirResource: example2Dstu2,
|
|
46
|
+
fhirIcons: ListIcon,
|
|
44
47
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
fhirIcons={fhirIcons}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
48
|
+
|
|
49
|
+
export const Example3DSTU2 = Template.bind({});
|
|
50
|
+
Example3DSTU2.args = {
|
|
51
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
52
|
+
fhirResource: example3Dstu2,
|
|
53
|
+
fhirIcons: fhirIcons,
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export const DefaultVisualizationSTU3 = ()
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
fhirResource={fhirResource}
|
|
62
|
-
fhirIcons={false}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
56
|
+
export const DefaultVisualizationSTU3 = Template.bind({});
|
|
57
|
+
DefaultVisualizationSTU3.args = {
|
|
58
|
+
fhirVersion: fhirVersions.STU3,
|
|
59
|
+
fhirResource: example1Stu3,
|
|
60
|
+
fhirIcons: false,
|
|
65
61
|
};
|
|
66
62
|
|
|
67
|
-
export const Example2STU3 = ()
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
fhirResource={fhirResource}
|
|
73
|
-
fhirIcons={'random text'}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
63
|
+
export const Example2STU3 = Template.bind({});
|
|
64
|
+
Example2STU3.args = {
|
|
65
|
+
fhirVersion: fhirVersions.STU3,
|
|
66
|
+
fhirResource: example2Stu3,
|
|
67
|
+
fhirIcons: 'random text',
|
|
76
68
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
|
|
70
|
+
export const Example3STU3 = Template.bind({});
|
|
71
|
+
Example3STU3.args = {
|
|
72
|
+
fhirVersion: fhirVersions.STU3,
|
|
73
|
+
fhirResource: example3Stu3,
|
|
80
74
|
};
|
|
81
75
|
|
|
82
|
-
export const DefaultVisualizationR4 = ()
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
export const DefaultVisualizationR4 = Template.bind({});
|
|
77
|
+
DefaultVisualizationR4.args = {
|
|
78
|
+
fhirVersion: fhirVersions.R4,
|
|
79
|
+
fhirResource: example1R4,
|
|
85
80
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
|
|
82
|
+
export const ExampleR4WithoutDaVinciPDex = Template.bind({});
|
|
83
|
+
ExampleR4WithoutDaVinciPDex.args = {
|
|
84
|
+
fhirVersion: fhirVersions.R4,
|
|
85
|
+
fhirResource: example2R4,
|
|
89
86
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
withDaVinciPDex
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
87
|
+
|
|
88
|
+
export const ExampleR4WithDaVinciPDex = Template.bind({});
|
|
89
|
+
ExampleR4WithDaVinciPDex.args = {
|
|
90
|
+
fhirVersion: fhirVersions.R4,
|
|
91
|
+
fhirResource: example2R4,
|
|
92
|
+
withDaVinciPDex: true,
|
|
99
93
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
|
|
95
|
+
export const Example2R4 = Template.bind({});
|
|
96
|
+
Example2R4.args = {
|
|
97
|
+
fhirVersion: fhirVersions.R4,
|
|
98
|
+
fhirResource: example3R4,
|
|
103
99
|
};
|
|
104
100
|
|
|
105
|
-
export const ExampleWithoutFHIRVersionProperty = ()
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
export const ExampleWithoutFHIRVersionProperty = Template.bind({});
|
|
102
|
+
ExampleWithoutFHIRVersionProperty.args = {
|
|
103
|
+
fhirResource: example3R4,
|
|
108
104
|
};
|
|
@@ -9,7 +9,7 @@ import CodeableConcept from '../../datatypes/CodeableConcept';
|
|
|
9
9
|
import Reference from '../../datatypes/Reference';
|
|
10
10
|
import Accordion from '../../containers/Accordion';
|
|
11
11
|
|
|
12
|
-
const Location = ({ fhirResource, fhirIcons, onClick }) => {
|
|
12
|
+
const Location = ({ fhirResource, fhirIcons, onClick, rawOnClick }) => {
|
|
13
13
|
const name = _get(fhirResource, 'name');
|
|
14
14
|
const status = _get(fhirResource, 'status');
|
|
15
15
|
const description = _get(fhirResource, 'description');
|
|
@@ -82,6 +82,7 @@ const Location = ({ fhirResource, fhirIcons, onClick }) => {
|
|
|
82
82
|
}
|
|
83
83
|
bodyContent={<Body tableData={tableData} />}
|
|
84
84
|
onClick={onClick}
|
|
85
|
+
rawOnClick={rawOnClick}
|
|
85
86
|
/>
|
|
86
87
|
</Root>
|
|
87
88
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Location from './Location';
|
|
5
5
|
|
|
@@ -12,29 +12,34 @@ import LocationIcon from '../../../assets/containers/Location/location.svg';
|
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
title: 'Location',
|
|
15
|
+
component: Location,
|
|
16
|
+
argTypes: {
|
|
17
|
+
...defaultArgTypes,
|
|
18
|
+
},
|
|
15
19
|
};
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
21
|
+
const Template = args => <Location {...args} />;
|
|
22
|
+
|
|
23
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
24
|
+
DefaultVisualizationDSTU2.args = {
|
|
25
|
+
fhirResource: dstu2Example1,
|
|
26
|
+
fhirIcons: require('../../../assets/containers/Location/location.svg'),
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
export const ExampleOfSTU3 = ()
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
export const ExampleOfSTU3 = Template.bind({});
|
|
30
|
+
ExampleOfSTU3.args = {
|
|
31
|
+
fhirResource: stu3Example1,
|
|
32
|
+
fhirIcons: LocationIcon,
|
|
30
33
|
};
|
|
31
34
|
|
|
32
|
-
export const Example1OfR4 = ()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
export const Example1OfR4 = Template.bind({});
|
|
36
|
+
Example1OfR4.args = {
|
|
37
|
+
fhirResource: r4Example1,
|
|
38
|
+
fhirIcons: fhirIcons,
|
|
35
39
|
};
|
|
36
40
|
|
|
37
|
-
export const Example2OfR4 = ()
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
export const Example2OfR4 = Template.bind({});
|
|
42
|
+
Example2OfR4.args = {
|
|
43
|
+
fhirResource: r4Example2,
|
|
44
|
+
fhirIcons: false,
|
|
40
45
|
};
|
|
@@ -162,7 +162,13 @@ const Ingredient = props => {
|
|
|
162
162
|
);
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
const Medication = ({
|
|
165
|
+
const Medication = ({
|
|
166
|
+
fhirResource,
|
|
167
|
+
fhirVersion,
|
|
168
|
+
fhirIcons,
|
|
169
|
+
onClick,
|
|
170
|
+
rawOnClick,
|
|
171
|
+
}) => {
|
|
166
172
|
let fhirResourceData = {};
|
|
167
173
|
try {
|
|
168
174
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -274,6 +280,7 @@ const Medication = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
|
|
|
274
280
|
</Body>
|
|
275
281
|
}
|
|
276
282
|
onClick={onClick}
|
|
283
|
+
rawOnClick={rawOnClick}
|
|
277
284
|
/>
|
|
278
285
|
</Root>
|
|
279
286
|
);
|