fhir-react 0.3.9 → 0.3.12
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 +17 -1
- package/build/index.js +9 -9
- package/package.json +5 -4
- package/src/components/containers/Accordion/Accordion.js +8 -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.js +2 -0
- package/src/components/resources/AdverseEvent/AdverseEvent.stories.js +17 -19
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +4 -0
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +46 -70
- package/src/components/resources/Appointment/Appointment.js +2 -0
- 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 +3 -0
- package/src/components/resources/CarePlan/CarePlan.stories.js +44 -54
- package/src/components/resources/CareTeam/CareTeam.js +2 -0
- package/src/components/resources/CareTeam/CareTeam.stories.js +22 -28
- package/src/components/resources/Claim/Claim.js +3 -0
- package/src/components/resources/Claim/Claim.stories.js +37 -50
- package/src/components/resources/ClaimResponse/ClaimResponse.js +2 -0
- package/src/components/resources/ClaimResponse/ClaimResponse.stories.js +42 -52
- package/src/components/resources/Condition/Condition.js +2 -0
- package/src/components/resources/Condition/Condition.stories.js +47 -62
- package/src/components/resources/Coverage/Coverage.js +3 -0
- package/src/components/resources/Coverage/Coverage.stories.js +38 -50
- package/src/components/resources/Device/Device.js +3 -0
- 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 +2 -0
- package/src/components/resources/Encounter/Encounter.stories.js +43 -59
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +18 -3
- 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 +8 -1
- package/src/components/resources/Generic/Generic.stories.js +21 -12
- package/src/components/resources/Goal/Goal.js +2 -0
- package/src/components/resources/Goal/Goal.stories.js +35 -49
- package/src/components/resources/Immunization/Immunization.js +2 -0
- 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 +8 -1
- package/src/components/resources/Location/Location.stories.js +23 -18
- package/src/components/resources/Medication/Medication.js +2 -0
- package/src/components/resources/Medication/Medication.stories.js +42 -64
- package/src/components/resources/MedicationAdministration/MedicationAdministration.js +4 -2
- 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 +8 -1
- package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +11 -4
- package/src/components/resources/MedicationRequest/MedicationRequest.js +2 -0
- 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 +8 -1
- package/src/components/resources/Observation/Observation.stories.js +39 -33
- package/src/components/resources/Organization/Organization.js +2 -0
- 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 +4 -0
- 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 +8 -1
- package/src/components/resources/Procedure/Procedure.stories.js +33 -25
- package/src/components/resources/Questionnaire/Questionnaire.js +2 -0
- 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 +2 -0
- package/src/components/resources/ReferralRequest/ReferralRequest.stories.js +20 -20
- package/src/components/resources/RelatedPerson/RelatedPerson.js +2 -0
- package/src/components/resources/RelatedPerson/RelatedPerson.stories.js +26 -30
- package/src/components/resources/ResearchStudy/ResearchStudy.js +2 -0
- package/src/components/resources/ResearchStudy/ResearchStudy.stories.js +17 -15
- package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +40 -27
- package/src/components/supportedFhirResourceList.js +2 -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
|
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
|
};
|
|
@@ -6,7 +6,7 @@ import Accordion from '../../containers/Accordion/Accordion';
|
|
|
6
6
|
import { Body, Header } from '../../ui';
|
|
7
7
|
|
|
8
8
|
const Binary = props => {
|
|
9
|
-
const { fhirResource, fhirIcons, rawOnClick } = props;
|
|
9
|
+
const { fhirResource, fhirIcons, rawOnClick, customId } = props;
|
|
10
10
|
|
|
11
11
|
const loadBinaryFile = () => {
|
|
12
12
|
switch (fhirResource.contentType) {
|
|
@@ -38,6 +38,7 @@ const Binary = props => {
|
|
|
38
38
|
}
|
|
39
39
|
bodyContent={<Body>{loadBinaryFile()}</Body>}
|
|
40
40
|
rawOnClick={rawOnClick}
|
|
41
|
+
customId={customId}
|
|
41
42
|
/>
|
|
42
43
|
</div>
|
|
43
44
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Binary from './Binary';
|
|
5
5
|
|
|
@@ -13,34 +13,40 @@ import BinaryIcon from '../../../assets/containers/Binary/binary.svg';
|
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
title: 'Binary',
|
|
16
|
+
component: Binary,
|
|
17
|
+
argTypes: {
|
|
18
|
+
...defaultArgTypes,
|
|
19
|
+
},
|
|
16
20
|
};
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
22
|
+
const Template = args => <Binary {...args} />;
|
|
23
|
+
|
|
24
|
+
export const PdfDSTU2 = Template.bind({});
|
|
25
|
+
PdfDSTU2.args = {
|
|
26
|
+
fhirResource: dstu2ExamplePdf,
|
|
27
|
+
fhirIcons: require('../../../assets/containers/Binary/binary.svg'),
|
|
26
28
|
};
|
|
27
29
|
|
|
28
|
-
export const JpegDSTU2 = ()
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
export const JpegDSTU2 = Template.bind({});
|
|
31
|
+
JpegDSTU2.args = {
|
|
32
|
+
fhirResource: dstu2ExampleJpeg,
|
|
33
|
+
fhirIcons: BinaryIcon,
|
|
31
34
|
};
|
|
32
35
|
|
|
33
|
-
export const PdfSTU3 = ()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
export const PdfSTU3 = Template.bind({});
|
|
37
|
+
PdfSTU3.args = {
|
|
38
|
+
fhirResource: stu3ExamplePdf,
|
|
39
|
+
fhirIcons: false,
|
|
36
40
|
};
|
|
37
41
|
|
|
38
|
-
export const JpegSTU3 = ()
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
export const JpegSTU3 = Template.bind({});
|
|
43
|
+
JpegSTU3.args = {
|
|
44
|
+
fhirResource: stu3ExampleJpeg,
|
|
45
|
+
fhirIcons: 'random text',
|
|
41
46
|
};
|
|
42
47
|
|
|
43
|
-
export const JsonSTU3 = ()
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
export const JsonSTU3 = Template.bind({});
|
|
49
|
+
JsonSTU3.args = {
|
|
50
|
+
fhirResource: stu3ExampleJson,
|
|
51
|
+
fhirIcons: fhirIcons,
|
|
46
52
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Bundle from './Bundle';
|
|
5
5
|
|
|
@@ -19,77 +19,87 @@ import fhirVersions from '../fhirResourceVersions';
|
|
|
19
19
|
|
|
20
20
|
export default {
|
|
21
21
|
title: 'Bundle',
|
|
22
|
+
component: Bundle,
|
|
23
|
+
argTypes: {
|
|
24
|
+
...defaultArgTypes,
|
|
25
|
+
},
|
|
22
26
|
};
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
const Template = args => <Bundle {...args} />;
|
|
29
|
+
|
|
30
|
+
export const Example1OfDSTU2 = Template.bind({});
|
|
31
|
+
Example1OfDSTU2.args = {
|
|
32
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
33
|
+
fhirResource: dstu2Example1,
|
|
29
34
|
};
|
|
30
35
|
|
|
31
|
-
export const Example2OfDSTU2 = ()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
);
|
|
36
|
+
export const Example2OfDSTU2 = Template.bind({});
|
|
37
|
+
Example2OfDSTU2.args = {
|
|
38
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
39
|
+
fhirResource: dstu2Example2,
|
|
36
40
|
};
|
|
37
41
|
|
|
38
|
-
export const Example3OfDSTU2 = ()
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
42
|
+
export const Example3OfDSTU2 = Template.bind({});
|
|
43
|
+
Example3OfDSTU2.args = {
|
|
44
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
45
|
+
fhirResource: dstu2Example3,
|
|
43
46
|
};
|
|
44
47
|
|
|
45
|
-
export const Example4OfDSTU2 = ()
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
);
|
|
48
|
+
export const Example4OfDSTU2 = Template.bind({});
|
|
49
|
+
Example4OfDSTU2.args = {
|
|
50
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
51
|
+
fhirResource: dstu2Example4,
|
|
50
52
|
};
|
|
51
53
|
|
|
52
|
-
export const Example1OfSTU3 = ()
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
export const Example1OfSTU3 = Template.bind({});
|
|
55
|
+
Example1OfSTU3.args = {
|
|
56
|
+
fhirVersion: fhirVersions.STU3,
|
|
57
|
+
fhirResource: stu3Example1,
|
|
55
58
|
};
|
|
56
59
|
|
|
57
|
-
export const Example2OfSTU3 = ()
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
61
|
+
Example2OfSTU3.args = {
|
|
62
|
+
fhirVersion: fhirVersions.STU3,
|
|
63
|
+
fhirResource: stu3Example2,
|
|
60
64
|
};
|
|
61
65
|
|
|
62
|
-
export const Example3OfSTU3 = ()
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
export const Example3OfSTU3 = Template.bind({});
|
|
67
|
+
Example3OfSTU3.args = {
|
|
68
|
+
fhirVersion: fhirVersions.STU3,
|
|
69
|
+
fhirResource: stu3Example3,
|
|
65
70
|
};
|
|
66
71
|
|
|
67
|
-
export const Example4OfSTU3 = ()
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
export const Example4OfSTU3 = Template.bind({});
|
|
73
|
+
Example4OfSTU3.args = {
|
|
74
|
+
fhirVersion: fhirVersions.STU3,
|
|
75
|
+
fhirResource: stu3Example4,
|
|
70
76
|
};
|
|
71
77
|
|
|
72
|
-
export const Example1OfR4 = ()
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
export const Example1OfR4 = Template.bind({});
|
|
79
|
+
Example1OfR4.args = {
|
|
80
|
+
fhirVersion: fhirVersions.R4,
|
|
81
|
+
fhirResource: r4Example1,
|
|
75
82
|
};
|
|
76
83
|
|
|
77
|
-
export const Example2OfR4 = ()
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
export const Example2OfR4 = Template.bind({});
|
|
85
|
+
Example2OfR4.args = {
|
|
86
|
+
fhirVersion: fhirVersions.R4,
|
|
87
|
+
fhirResource: r4Example2,
|
|
80
88
|
};
|
|
81
89
|
|
|
82
|
-
export const Example3OfR4 = ()
|
|
83
|
-
|
|
84
|
-
|
|
90
|
+
export const Example3OfR4 = Template.bind({});
|
|
91
|
+
Example3OfR4.args = {
|
|
92
|
+
fhirVersion: fhirVersions.R4,
|
|
93
|
+
fhirResource: r4Example3,
|
|
85
94
|
};
|
|
86
95
|
|
|
87
|
-
export const Example4OfR4 = ()
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
export const Example4OfR4 = Template.bind({});
|
|
97
|
+
Example4OfR4.args = {
|
|
98
|
+
fhirVersion: fhirVersions.R4,
|
|
99
|
+
fhirResource: r4Example4,
|
|
90
100
|
};
|
|
91
101
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
export const ExampleWithoutFHIRVersionProperty = Template.bind({});
|
|
103
|
+
ExampleWithoutFHIRVersionProperty.args = {
|
|
104
|
+
fhirResource: stu3Example2,
|
|
105
|
+
};
|
|
@@ -75,6 +75,7 @@ const dstu2DTO = fhirResource => {
|
|
|
75
75
|
hasActivity,
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
|
+
|
|
78
79
|
const stu3DTO = fhirResource => {
|
|
79
80
|
let activity = _get(fhirResource, 'activity');
|
|
80
81
|
const hasActivity = Array.isArray(activity);
|
|
@@ -168,6 +169,7 @@ const CarePlan = ({
|
|
|
168
169
|
fhirIcons,
|
|
169
170
|
onClick,
|
|
170
171
|
rawOnClick,
|
|
172
|
+
customId,
|
|
171
173
|
}) => {
|
|
172
174
|
let fhirResourceData = {};
|
|
173
175
|
try {
|
|
@@ -312,6 +314,7 @@ const CarePlan = ({
|
|
|
312
314
|
}
|
|
313
315
|
onClick={onClick}
|
|
314
316
|
rawOnClick={rawOnClick}
|
|
317
|
+
customId={customId}
|
|
315
318
|
/>
|
|
316
319
|
</Root>
|
|
317
320
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import fhirVersions from '../fhirResourceVersions';
|
|
3
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
4
|
|
|
4
5
|
import CarePlan from './CarePlan';
|
|
5
6
|
|
|
@@ -9,73 +10,62 @@ import example2CarePlanSTU3 from '../../../fixtures/stu3/resources/carePlan/exam
|
|
|
9
10
|
import weightLossCarePlanR4 from '../../../fixtures/r4/resources/carePlan/weightLossPlan.json';
|
|
10
11
|
import pregnancyCarePlanR4 from '../../../fixtures/r4/resources/carePlan/pregnancyPlan.json';
|
|
11
12
|
import heartOperationCarePlanR4 from '../../../fixtures/r4/resources/carePlan/heartOperationPlan.json';
|
|
12
|
-
|
|
13
|
+
|
|
13
14
|
import CarePlanIcon from '../../../assets/containers/CarePlan/care-plan.svg';
|
|
14
15
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
15
16
|
|
|
16
|
-
export default {
|
|
17
|
+
export default {
|
|
18
|
+
title: 'CarePlan',
|
|
19
|
+
component: CarePlan,
|
|
20
|
+
argTypes: {
|
|
21
|
+
...defaultArgTypes,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const Template = args => <CarePlan {...args} />;
|
|
17
26
|
|
|
18
|
-
export const DefaultVisualizationDSTU2 = ()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fhirResource={fhirResource}
|
|
24
|
-
fhirIcons={require('../../../assets/containers/CarePlan/care-plan.svg')}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
28
|
+
DefaultVisualizationDSTU2.args = {
|
|
29
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
30
|
+
fhirResource: exampleCarePlanDSTU2,
|
|
31
|
+
fhirIcons: require('../../../assets/containers/CarePlan/care-plan.svg'),
|
|
27
32
|
};
|
|
28
33
|
|
|
29
|
-
export const ExampleCarePlanSTU3 = ()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
fhirResource={fhirResource}
|
|
35
|
-
fhirIcons={CarePlanIcon}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
34
|
+
export const ExampleCarePlanSTU3 = Template.bind({});
|
|
35
|
+
ExampleCarePlanSTU3.args = {
|
|
36
|
+
fhirVersion: fhirVersions.STU3,
|
|
37
|
+
fhirResource: exampleCarePlanSTU3,
|
|
38
|
+
fhirIcons: CarePlanIcon,
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
export const Example2CarePlanSTU3 = ()
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
fhirResource={fhirResource}
|
|
46
|
-
fhirIcons={fhirIcons}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
41
|
+
export const Example2CarePlanSTU3 = Template.bind({});
|
|
42
|
+
Example2CarePlanSTU3.args = {
|
|
43
|
+
fhirVersion: fhirVersions.STU3,
|
|
44
|
+
fhirResource: example2CarePlanSTU3,
|
|
45
|
+
fhirIcons: fhirIcons,
|
|
49
46
|
};
|
|
50
47
|
|
|
51
|
-
export const WeightLossCarePlanR4 = ()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
fhirResource={fhirResource}
|
|
57
|
-
fhirIcons={false}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
48
|
+
export const WeightLossCarePlanR4 = Template.bind({});
|
|
49
|
+
WeightLossCarePlanR4.args = {
|
|
50
|
+
fhirVersion: fhirVersions.R4,
|
|
51
|
+
fhirResource: weightLossCarePlanR4,
|
|
52
|
+
fhirIcons: false,
|
|
60
53
|
};
|
|
61
54
|
|
|
62
|
-
export const PregnancyCarePlanR4 = ()
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
fhirResource={fhirResource}
|
|
68
|
-
fhirIcons={'random text'}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
55
|
+
export const PregnancyCarePlanR4 = Template.bind({});
|
|
56
|
+
PregnancyCarePlanR4.args = {
|
|
57
|
+
fhirVersion: fhirVersions.R4,
|
|
58
|
+
fhirResource: pregnancyCarePlanR4,
|
|
59
|
+
fhirIcons: 'random text',
|
|
71
60
|
};
|
|
72
61
|
|
|
73
|
-
export const HeartOperatioCarePlanR4 = ()
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
export const HeartOperatioCarePlanR4 = Template.bind({});
|
|
63
|
+
HeartOperatioCarePlanR4.args = {
|
|
64
|
+
fhirVersion: fhirVersions.R4,
|
|
65
|
+
fhirResource: heartOperationCarePlanR4,
|
|
76
66
|
};
|
|
77
67
|
|
|
78
|
-
export const ExampleWithoutFhirVersionProperty = ()
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
export const ExampleWithoutFhirVersionProperty = Template.bind({});
|
|
69
|
+
ExampleWithoutFhirVersionProperty.args = {
|
|
70
|
+
fhirResource: example2CarePlanSTU3,
|
|
81
71
|
};
|
|
@@ -89,6 +89,7 @@ const CareTeam = ({
|
|
|
89
89
|
fhirIcons,
|
|
90
90
|
onClick,
|
|
91
91
|
rawOnClick,
|
|
92
|
+
customId,
|
|
92
93
|
}) => {
|
|
93
94
|
const {
|
|
94
95
|
name,
|
|
@@ -174,6 +175,7 @@ const CareTeam = ({
|
|
|
174
175
|
}
|
|
175
176
|
onClick={onClick}
|
|
176
177
|
rawOnClick={rawOnClick}
|
|
178
|
+
customId={customId}
|
|
177
179
|
/>
|
|
178
180
|
</Root>
|
|
179
181
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import CareTeam from './CareTeam';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -12,37 +12,31 @@ import CareTeamIcon from '../../../assets/containers/CareTeam/care-team.svg';
|
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
title: 'CareTeam',
|
|
15
|
+
component: CareTeam,
|
|
16
|
+
argTypes: {
|
|
17
|
+
...defaultArgTypes,
|
|
18
|
+
},
|
|
15
19
|
};
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
21
|
+
const Template = args => <CareTeam {...args} />;
|
|
22
|
+
|
|
23
|
+
export const ExampleSTU3 = Template.bind({});
|
|
24
|
+
ExampleSTU3.args = {
|
|
25
|
+
fhirVersion: fhirVersions.STU3,
|
|
26
|
+
fhirResource: example_STU3,
|
|
27
|
+
fhirIcons: CareTeamIcon,
|
|
26
28
|
};
|
|
27
29
|
|
|
28
|
-
export const Example2OfSTU3 = ()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
fhirVersion={fhirVersions.STU3}
|
|
34
|
-
fhirIcons={fhirIcons}
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
30
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
31
|
+
Example2OfSTU3.args = {
|
|
32
|
+
fhirVersion: fhirVersions.STU3,
|
|
33
|
+
fhirResource: example2_STU3,
|
|
34
|
+
fhirIcons: fhirIcons,
|
|
37
35
|
};
|
|
38
36
|
|
|
39
|
-
export const ExampleR4 = ()
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
fhirVersion={fhirVersions.R4}
|
|
45
|
-
fhirIcons={false}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
37
|
+
export const ExampleR4 = Template.bind({});
|
|
38
|
+
ExampleR4.args = {
|
|
39
|
+
fhirVersion: fhirVersions.R4,
|
|
40
|
+
fhirResource: example_R4,
|
|
41
|
+
fhirIcons: false,
|
|
48
42
|
};
|
|
@@ -105,6 +105,7 @@ const dstu2DTO = fhirResource => {
|
|
|
105
105
|
items,
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
+
|
|
108
109
|
const stu3DTO = fhirResource => {
|
|
109
110
|
const status = _get(fhirResource, 'status');
|
|
110
111
|
const typeCoding = _get(fhirResource, 'type.coding[0]');
|
|
@@ -304,6 +305,7 @@ const Claim = ({
|
|
|
304
305
|
fhirIcons,
|
|
305
306
|
onClick,
|
|
306
307
|
rawOnClick,
|
|
308
|
+
customId,
|
|
307
309
|
}) => {
|
|
308
310
|
let fhirResourceData = {};
|
|
309
311
|
try {
|
|
@@ -489,6 +491,7 @@ const Claim = ({
|
|
|
489
491
|
}
|
|
490
492
|
onClick={onClick}
|
|
491
493
|
rawOnClick={rawOnClick}
|
|
494
|
+
customId={customId}
|
|
492
495
|
/>
|
|
493
496
|
</Root>
|
|
494
497
|
);
|