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 Medication from './Medication';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -16,79 +16,57 @@ import MedicationIcon from '../../../assets/containers/Medication/medication.svg
|
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
title: 'Medication',
|
|
19
|
+
component: Medication,
|
|
20
|
+
argTypes: {
|
|
21
|
+
...defaultArgTypes,
|
|
22
|
+
},
|
|
19
23
|
};
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
25
|
+
const Template = args => <Medication {...args} />;
|
|
26
|
+
|
|
27
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
28
|
+
DefaultVisualizationDSTU2.args = {
|
|
29
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
30
|
+
fhirResource: dstu2Example1,
|
|
31
|
+
fhirIcons: require('../../../assets/containers/Medication/medication.svg'),
|
|
30
32
|
};
|
|
31
33
|
|
|
32
|
-
export const Example2OfDSTU2 = ()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fhirResource={fhirResource}
|
|
38
|
-
fhirIcons={MedicationIcon}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
34
|
+
export const Example2OfDSTU2 = Template.bind({});
|
|
35
|
+
Example2OfDSTU2.args = {
|
|
36
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
37
|
+
fhirResource: dstu2Example2,
|
|
38
|
+
fhirIcons: MedicationIcon,
|
|
41
39
|
};
|
|
42
40
|
|
|
43
|
-
export const Example1OfSTU3 = ()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
fhirResource={fhirResource}
|
|
49
|
-
fhirIcons={fhirIcons}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
41
|
+
export const Example1OfSTU3 = Template.bind({});
|
|
42
|
+
Example1OfSTU3.args = {
|
|
43
|
+
fhirVersion: fhirVersions.STU3,
|
|
44
|
+
fhirResource: stu3Example1,
|
|
45
|
+
fhirIcons: fhirIcons,
|
|
52
46
|
};
|
|
53
47
|
|
|
54
|
-
export const Example2OfSTU3 = ()
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
fhirResource={fhirResource}
|
|
60
|
-
fhirIcons={false}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
48
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
49
|
+
Example2OfSTU3.args = {
|
|
50
|
+
fhirVersion: fhirVersions.STU3,
|
|
51
|
+
fhirResource: stu3Example2,
|
|
52
|
+
fhirIcons: false,
|
|
63
53
|
};
|
|
64
54
|
|
|
65
|
-
export const Example1OfR4 = ()
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
fhirResource={fhirResource}
|
|
71
|
-
fhirIcons={'random text'}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
55
|
+
export const Example1OfR4 = Template.bind({});
|
|
56
|
+
Example1OfR4.args = {
|
|
57
|
+
fhirVersion: fhirVersions.R4,
|
|
58
|
+
fhirResource: r4Example1,
|
|
59
|
+
fhirIcons: 'random text',
|
|
74
60
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
fhirResource={fhirResource}
|
|
81
|
-
fhirIcons={fhirIcons}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
61
|
+
|
|
62
|
+
export const Example2OfR4 = Template.bind({});
|
|
63
|
+
Example2OfR4.args = {
|
|
64
|
+
fhirVersion: fhirVersions.R4,
|
|
65
|
+
fhirResource: r4Example2,
|
|
84
66
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
fhirResource={fhirResource}
|
|
91
|
-
fhirIcons={fhirIcons}
|
|
92
|
-
/>
|
|
93
|
-
);
|
|
67
|
+
|
|
68
|
+
export const Example3OfR4 = Template.bind({});
|
|
69
|
+
Example3OfR4.args = {
|
|
70
|
+
fhirVersion: fhirVersions.R4,
|
|
71
|
+
fhirResource: r4Example3,
|
|
94
72
|
};
|
|
@@ -115,6 +115,7 @@ const MedicationAdministration = ({
|
|
|
115
115
|
fhirVersion,
|
|
116
116
|
fhirIcons,
|
|
117
117
|
onClick,
|
|
118
|
+
rawOnClick,
|
|
118
119
|
}) => {
|
|
119
120
|
let fhirResourceData = {};
|
|
120
121
|
try {
|
|
@@ -213,6 +214,7 @@ const MedicationAdministration = ({
|
|
|
213
214
|
</Body>
|
|
214
215
|
}
|
|
215
216
|
onClick={onClick}
|
|
217
|
+
rawOnClick={rawOnClick}
|
|
216
218
|
/>
|
|
217
219
|
</Root>
|
|
218
220
|
);
|
package/src/components/resources/MedicationAdministration/MedicationAdministration.stories.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import MedicationAdministration from './MedicationAdministration';
|
|
5
5
|
|
|
@@ -14,59 +14,45 @@ import MedicationAdministrationIcon from '../../../assets/containers/MedicationA
|
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
title: 'MedicationAdministration',
|
|
17
|
+
component: MedicationAdministration,
|
|
18
|
+
argTypes: {
|
|
19
|
+
...defaultArgTypes,
|
|
20
|
+
},
|
|
17
21
|
};
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
23
|
+
const Template = args => <MedicationAdministration {...args} />;
|
|
24
|
+
|
|
25
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
26
|
+
DefaultVisualizationDSTU2.args = {
|
|
27
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
28
|
+
fhirResource: dstu2Example1,
|
|
29
|
+
fhirIcons: require('../../../assets/containers/MedicationAdministration/medication-administration.svg'),
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
export const ExampleOfSTU3 = ()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fhirResource={fhirResource}
|
|
36
|
-
fhirIcons={MedicationAdministrationIcon}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
32
|
+
export const ExampleOfSTU3 = Template.bind({});
|
|
33
|
+
ExampleOfSTU3.args = {
|
|
34
|
+
fhirVersion: fhirVersions.STU3,
|
|
35
|
+
fhirResource: stu3Example1,
|
|
36
|
+
fhirIcons: MedicationAdministrationIcon,
|
|
39
37
|
};
|
|
40
38
|
|
|
41
|
-
export const Example1OfR4 = ()
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
fhirResource={fhirResource}
|
|
47
|
-
fhirIcons={fhirIcons}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
39
|
+
export const Example1OfR4 = Template.bind({});
|
|
40
|
+
Example1OfR4.args = {
|
|
41
|
+
fhirVersion: fhirVersions.R4,
|
|
42
|
+
fhirResource: r4Example1,
|
|
43
|
+
fhirIcons: fhirIcons,
|
|
50
44
|
};
|
|
51
45
|
|
|
52
|
-
export const Example2OfR4 = ()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
fhirResource={fhirResource}
|
|
58
|
-
fhirIcons={false}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
46
|
+
export const Example2OfR4 = Template.bind({});
|
|
47
|
+
Example2OfR4.args = {
|
|
48
|
+
fhirVersion: fhirVersions.R4,
|
|
49
|
+
fhirResource: r4Example2,
|
|
50
|
+
fhirIcons: false,
|
|
61
51
|
};
|
|
62
52
|
|
|
63
|
-
export const Example3OfR4 = ()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
fhirResource={fhirResource}
|
|
69
|
-
fhirIcons={'random text'}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
53
|
+
export const Example3OfR4 = Template.bind({});
|
|
54
|
+
Example3OfR4.args = {
|
|
55
|
+
fhirVersion: fhirVersions.R4,
|
|
56
|
+
fhirResource: r4Example3,
|
|
57
|
+
fhirIcons: 'random text',
|
|
72
58
|
};
|
|
@@ -164,6 +164,7 @@ const MedicationDispense = ({
|
|
|
164
164
|
fhirVersion,
|
|
165
165
|
fhirIcons,
|
|
166
166
|
onClick,
|
|
167
|
+
rawOnClick,
|
|
167
168
|
}) => {
|
|
168
169
|
let fhirResourceData = {};
|
|
169
170
|
try {
|
|
@@ -243,6 +244,7 @@ const MedicationDispense = ({
|
|
|
243
244
|
</Body>
|
|
244
245
|
}
|
|
245
246
|
onClick={onClick}
|
|
247
|
+
rawOnClick={rawOnClick}
|
|
246
248
|
/>
|
|
247
249
|
</Root>
|
|
248
250
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import MedicationDispense from './MedicationDispense';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -15,74 +15,56 @@ import MedicationDispenseIcon from '../../../assets/containers/MedicationDispens
|
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
title: 'MedicationDispense',
|
|
18
|
+
component: MedicationDispense,
|
|
19
|
+
argTypes: {
|
|
20
|
+
...defaultArgTypes,
|
|
21
|
+
},
|
|
18
22
|
};
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
24
|
+
const Template = args => <MedicationDispense {...args} />;
|
|
25
|
+
|
|
26
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
27
|
+
DefaultVisualizationDSTU2.args = {
|
|
28
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
29
|
+
fhirResource: dstu2Example1,
|
|
30
|
+
fhirIcons: require('../../../assets/containers/MedicationDispense/medication-dispense.svg'),
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
export const Example2OfDSTU2 = ()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
37
|
-
fhirIcons={MedicationDispenseIcon}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
33
|
+
export const Example2OfDSTU2 = Template.bind({});
|
|
34
|
+
Example2OfDSTU2.args = {
|
|
35
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
36
|
+
fhirResource: dstu2Example2,
|
|
37
|
+
fhirIcons: MedicationDispenseIcon,
|
|
40
38
|
};
|
|
41
39
|
|
|
42
|
-
export const Example1OfSTU3 = ()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
fhirVersion={fhirVersions.STU3}
|
|
48
|
-
fhirIcons={fhirIcons}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
40
|
+
export const Example1OfSTU3 = Template.bind({});
|
|
41
|
+
Example1OfSTU3.args = {
|
|
42
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
43
|
+
fhirResource: stu3Example1,
|
|
44
|
+
fhirIcons: fhirIcons,
|
|
51
45
|
};
|
|
52
46
|
|
|
53
|
-
export const Example2OfSTU3 = ()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
fhirVersion={fhirVersions.STU3}
|
|
59
|
-
fhirIcons={false}
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
47
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
48
|
+
Example2OfSTU3.args = {
|
|
49
|
+
fhirVersion: fhirVersions.STU3,
|
|
50
|
+
fhirResource: stu3Example2,
|
|
51
|
+
fhirIcons: false,
|
|
62
52
|
};
|
|
63
53
|
|
|
64
|
-
export const Example1OfR4 = ()
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
fhirVersion={fhirVersions.R4}
|
|
70
|
-
fhirIcons={'random text'}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
54
|
+
export const Example1OfR4 = Template.bind({});
|
|
55
|
+
Example1OfR4.args = {
|
|
56
|
+
fhirVersion: fhirVersions.R4,
|
|
57
|
+
fhirResource: R4Example1,
|
|
58
|
+
fhirIcons: 'random text',
|
|
73
59
|
};
|
|
74
60
|
|
|
75
|
-
export const Example2OfR4 = ()
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
fhirResource={fhirResource}
|
|
80
|
-
fhirVersion={fhirVersions.R4}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
61
|
+
export const Example2OfR4 = Template.bind({});
|
|
62
|
+
Example2OfR4.args = {
|
|
63
|
+
fhirVersion: fhirVersions.R4,
|
|
64
|
+
fhirResource: R4Example2,
|
|
83
65
|
};
|
|
84
66
|
|
|
85
|
-
export const ExampleWithoutFhirVersionProperty = ()
|
|
86
|
-
|
|
87
|
-
|
|
67
|
+
export const ExampleWithoutFhirVersionProperty = Template.bind({});
|
|
68
|
+
ExampleWithoutFhirVersionProperty.args = {
|
|
69
|
+
fhirResource: stu3Example1,
|
|
88
70
|
};
|
|
@@ -109,6 +109,7 @@ const MedicationKnowledge = ({
|
|
|
109
109
|
withDaVinciPDex = false,
|
|
110
110
|
fhirIcons,
|
|
111
111
|
onClick,
|
|
112
|
+
rawOnClick,
|
|
112
113
|
}) => {
|
|
113
114
|
let fhirResourceData = {};
|
|
114
115
|
try {
|
|
@@ -252,6 +253,7 @@ const MedicationKnowledge = ({
|
|
|
252
253
|
</Body>
|
|
253
254
|
}
|
|
254
255
|
onClick={onClick}
|
|
256
|
+
rawOnClick={rawOnClick}
|
|
255
257
|
/>
|
|
256
258
|
</Root>
|
|
257
259
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import MedicationKnowledge from './MedicationKnowledge';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -13,72 +13,63 @@ import MedicationKnowledgeIcon from '../../../assets/containers/MedicationKnowle
|
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
title: 'MedicationKnowledge',
|
|
16
|
+
component: MedicationKnowledge,
|
|
17
|
+
argTypes: {
|
|
18
|
+
...defaultArgTypes,
|
|
19
|
+
withDaVinciPDex: {
|
|
20
|
+
table: {
|
|
21
|
+
disable: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
16
25
|
};
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
+
const Template = args => <MedicationKnowledge {...args} />;
|
|
28
|
+
|
|
29
|
+
export const DefaultVisualizationR4 = Template.bind({});
|
|
30
|
+
DefaultVisualizationR4.args = {
|
|
31
|
+
fhirVersion: fhirVersions.R4,
|
|
32
|
+
fhirResource: example1R4,
|
|
33
|
+
fhirIcons: require('../../../assets/containers/MedicationKnowledge/medication-knowledge.svg'),
|
|
27
34
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
fhirIcons={MedicationKnowledgeIcon}
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
35
|
+
|
|
36
|
+
export const ExampleR4WithoutDaVinciPDex = Template.bind({});
|
|
37
|
+
ExampleR4WithoutDaVinciPDex.args = {
|
|
38
|
+
fhirVersion: fhirVersions.R4,
|
|
39
|
+
fhirResource: example2R4,
|
|
40
|
+
fhirIcons: MedicationKnowledgeIcon,
|
|
37
41
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
fhirIcons={fhirIcons}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
42
|
+
|
|
43
|
+
export const ExampleR4WithDaVinciPDex = Template.bind({});
|
|
44
|
+
ExampleR4WithDaVinciPDex.args = {
|
|
45
|
+
fhirVersion: fhirVersions.R4,
|
|
46
|
+
fhirResource: example2R4,
|
|
47
|
+
fhirIcons: fhirIcons,
|
|
48
|
+
withDaVinciPDex: true,
|
|
48
49
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
50
|
+
|
|
51
|
+
export const Example2R4 = Template.bind({});
|
|
52
|
+
Example2R4.args = {
|
|
53
|
+
fhirVersion: fhirVersions.R4,
|
|
54
|
+
fhirResource: example3R4,
|
|
55
|
+
fhirIcons: false,
|
|
57
56
|
};
|
|
58
57
|
|
|
59
|
-
export const Example3R4WithDaVinciPDex = ()
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
withDaVinciPDex
|
|
66
|
-
fhirIcons={false}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
58
|
+
export const Example3R4WithDaVinciPDex = Template.bind({});
|
|
59
|
+
Example3R4WithDaVinciPDex.args = {
|
|
60
|
+
fhirVersion: fhirVersions.R4,
|
|
61
|
+
fhirResource: example4R4,
|
|
62
|
+
fhirIcons: 'random text',
|
|
63
|
+
withDaVinciPDex: true,
|
|
69
64
|
};
|
|
70
65
|
|
|
71
|
-
export const ExampleWithoutFHIRVersionProperty = ()
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
export const ExampleWithoutFHIRVersionProperty = Template.bind({});
|
|
67
|
+
ExampleWithoutFHIRVersionProperty.args = {
|
|
68
|
+
fhirResource: example3R4,
|
|
74
69
|
};
|
|
75
70
|
|
|
76
|
-
export const ExampleWithUnsupportedFHIRVersionProperty = ()
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
81
|
-
fhirResource={fhirResource}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
71
|
+
export const ExampleWithUnsupportedFHIRVersionProperty = Template.bind({});
|
|
72
|
+
ExampleWithUnsupportedFHIRVersionProperty.args = {
|
|
73
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
74
|
+
fhirResource: example4R4,
|
|
84
75
|
};
|
|
@@ -8,7 +8,7 @@ import Coding from '../../datatypes/Coding';
|
|
|
8
8
|
|
|
9
9
|
import { Root, Header, Body } from '../../ui';
|
|
10
10
|
|
|
11
|
-
const MedicationOrder = ({ fhirResource, fhirIcons, onClick }) => {
|
|
11
|
+
const MedicationOrder = ({ fhirResource, fhirIcons, onClick, rawOnClick }) => {
|
|
12
12
|
const medicationReference = _get(fhirResource, 'medicationReference');
|
|
13
13
|
const medicationCodeableConcept = _get(
|
|
14
14
|
fhirResource,
|
|
@@ -65,6 +65,7 @@ const MedicationOrder = ({ fhirResource, fhirIcons, onClick }) => {
|
|
|
65
65
|
}
|
|
66
66
|
bodyContent={<Body tableData={tableData} />}
|
|
67
67
|
onClick={onClick}
|
|
68
|
+
rawOnClick={rawOnClick}
|
|
68
69
|
/>
|
|
69
70
|
</Root>
|
|
70
71
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import MedicationOrder from './MedicationOrder';
|
|
5
5
|
|
|
@@ -7,9 +7,16 @@ import dstu2Example from '../../../fixtures/dstu2/resources/medicationOrder/exam
|
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: 'MedicationOrder',
|
|
10
|
+
component: MedicationOrder,
|
|
11
|
+
argTypes: {
|
|
12
|
+
...defaultArgTypes,
|
|
13
|
+
},
|
|
10
14
|
};
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
const Template = args => <MedicationOrder {...args} />;
|
|
17
|
+
|
|
18
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
19
|
+
DefaultVisualizationDSTU2.args = {
|
|
20
|
+
fhirResource: dstu2Example,
|
|
21
|
+
fhirIcons: require('../../../assets/containers/MedicationOrder/medication-order.svg'),
|
|
15
22
|
};
|
|
@@ -9,7 +9,12 @@ import Date from '../../datatypes/Date';
|
|
|
9
9
|
|
|
10
10
|
import { Root, Header, Body } from '../../ui';
|
|
11
11
|
|
|
12
|
-
const MedicationRequest = ({
|
|
12
|
+
const MedicationRequest = ({
|
|
13
|
+
fhirResource,
|
|
14
|
+
fhirIcons,
|
|
15
|
+
onClick,
|
|
16
|
+
rawOnClick,
|
|
17
|
+
}) => {
|
|
13
18
|
const medicationReference = _get(fhirResource, 'medicationReference');
|
|
14
19
|
const medicationCodeableConcept = _get(
|
|
15
20
|
fhirResource,
|
|
@@ -88,6 +93,7 @@ const MedicationRequest = ({ fhirResource, fhirIcons, onClick }) => {
|
|
|
88
93
|
}
|
|
89
94
|
bodyContent={<Body tableData={tableData} />}
|
|
90
95
|
onClick={onClick}
|
|
96
|
+
rawOnClick={rawOnClick}
|
|
91
97
|
/>
|
|
92
98
|
</Root>
|
|
93
99
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import MedicationRequest from './MedicationRequest';
|
|
5
5
|
|
|
@@ -13,43 +13,40 @@ import MedicationRequestIcon from '../../../assets/containers/MedicationRequest/
|
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
title: 'MedicationRequest',
|
|
16
|
+
component: MedicationRequest,
|
|
17
|
+
argTypes: {
|
|
18
|
+
...defaultArgTypes,
|
|
19
|
+
},
|
|
16
20
|
};
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
22
|
+
const Template = args => <MedicationRequest {...args} />;
|
|
23
|
+
|
|
24
|
+
export const DefaultVisualizationSTU3 = Template.bind({});
|
|
25
|
+
DefaultVisualizationSTU3.args = {
|
|
26
|
+
fhirResource: stu3Example1,
|
|
27
|
+
fhirIcons: require('../../../assets/containers/MedicationRequest/medication-request.svg'),
|
|
26
28
|
};
|
|
27
29
|
|
|
28
|
-
export const Example2OfSTU3 = ()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
fhirResource={fhirResource}
|
|
33
|
-
fhirIcons={MedicationRequestIcon}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
30
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
31
|
+
Example2OfSTU3.args = {
|
|
32
|
+
fhirResource: stu3Example2,
|
|
33
|
+
fhirIcons: MedicationRequestIcon,
|
|
36
34
|
};
|
|
37
35
|
|
|
38
|
-
export const Example1OfR4 = ()
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
36
|
+
export const Example1OfR4 = Template.bind({});
|
|
37
|
+
Example1OfR4.args = {
|
|
38
|
+
fhirResource: R4Example1,
|
|
39
|
+
fhirIcons: fhirIcons,
|
|
43
40
|
};
|
|
44
41
|
|
|
45
|
-
export const Example2OfR4 = ()
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
export const Example2OfR4 = Template.bind({});
|
|
43
|
+
Example2OfR4.args = {
|
|
44
|
+
fhirResource: R4Example2,
|
|
45
|
+
fhirIcons: false,
|
|
48
46
|
};
|
|
49
47
|
|
|
50
|
-
export const Example3OfR4 = ()
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
48
|
+
export const Example3OfR4 = Template.bind({});
|
|
49
|
+
Example3OfR4.args = {
|
|
50
|
+
fhirResource: R4Example3,
|
|
51
|
+
fhirIcons: 'random text',
|
|
55
52
|
};
|