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 Claim from './Claim';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -15,65 +15,52 @@ import ClaimIcon from '../../../assets/containers/Claim/claim.svg';
|
|
|
15
15
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
|
-
title: 'Claim',
|
|
18
|
+
title: 'ExplanationOfBenefit/Claim',
|
|
19
|
+
component: Claim,
|
|
20
|
+
argTypes: {
|
|
21
|
+
...defaultArgTypes,
|
|
22
|
+
},
|
|
19
23
|
};
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
25
|
+
const Template = args => <Claim {...args} />;
|
|
26
|
+
|
|
27
|
+
export const ExampleOfDSTU2 = Template.bind({});
|
|
28
|
+
ExampleOfDSTU2.args = {
|
|
29
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
30
|
+
fhirResource: dstu2Example1,
|
|
31
|
+
fhirIcons: require('../../../assets/containers/Claim/claim.svg'),
|
|
30
32
|
};
|
|
31
33
|
|
|
32
|
-
export const ExampleOfSTU3 = ()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fhirResource={fhirResource}
|
|
38
|
-
fhirIcons={ClaimIcon}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
34
|
+
export const ExampleOfSTU3 = Template.bind({});
|
|
35
|
+
ExampleOfSTU3.args = {
|
|
36
|
+
fhirVersion: fhirVersions.STU3,
|
|
37
|
+
fhirResource: stu3Example1,
|
|
38
|
+
fhirIcons: ClaimIcon,
|
|
41
39
|
};
|
|
42
40
|
|
|
43
|
-
export const Example2OfSTU3 = ()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
fhirResource={fhirResource}
|
|
49
|
-
fhirIcons={fhirIcons}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
41
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
42
|
+
Example2OfSTU3.args = {
|
|
43
|
+
fhirVersion: fhirVersions.STU3,
|
|
44
|
+
fhirResource: stu3Example2,
|
|
45
|
+
fhirIcons: fhirIcons,
|
|
52
46
|
};
|
|
53
47
|
|
|
54
|
-
export const Example3OfSTU3 = ()
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
fhirResource={fhirResource}
|
|
60
|
-
fhirIcons={false}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
48
|
+
export const Example3OfSTU3 = Template.bind({});
|
|
49
|
+
Example3OfSTU3.args = {
|
|
50
|
+
fhirVersion: fhirVersions.STU3,
|
|
51
|
+
fhirResource: stu3Example3,
|
|
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
61
|
|
|
76
|
-
export const Example2OfR4 = ()
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
export const Example2OfR4 = Template.bind({});
|
|
63
|
+
Example2OfR4.args = {
|
|
64
|
+
fhirVersion: fhirVersions.R4,
|
|
65
|
+
fhirResource: r4Example2,
|
|
79
66
|
};
|
|
@@ -285,7 +285,13 @@ const hasPaymentInfo = payment => {
|
|
|
285
285
|
return Object.values(payment).filter(item => item).length > 0;
|
|
286
286
|
};
|
|
287
287
|
|
|
288
|
-
const ClaimResponse = ({
|
|
288
|
+
const ClaimResponse = ({
|
|
289
|
+
fhirVersion,
|
|
290
|
+
fhirResource,
|
|
291
|
+
fhirIcons,
|
|
292
|
+
onClick,
|
|
293
|
+
rawOnClick,
|
|
294
|
+
}) => {
|
|
289
295
|
let fhirResourceData = {};
|
|
290
296
|
try {
|
|
291
297
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -449,6 +455,7 @@ const ClaimResponse = ({ fhirVersion, fhirResource, fhirIcons, onClick }) => {
|
|
|
449
455
|
</Body>
|
|
450
456
|
}
|
|
451
457
|
onClick={onClick}
|
|
458
|
+
rawOnClick={rawOnClick}
|
|
452
459
|
/>
|
|
453
460
|
</Root>
|
|
454
461
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import fhirVersions from '../fhirResourceVersions';
|
|
5
5
|
import ClaimResponse from './ClaimResponse';
|
|
@@ -13,63 +13,53 @@ import example3ClaimResponseR4 from '../../../fixtures/r4/resources/claimRespons
|
|
|
13
13
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
14
14
|
import ClaimResponseIcon from '../../../assets/containers/ClaimResponse/claim-response.svg';
|
|
15
15
|
|
|
16
|
-
export default {
|
|
16
|
+
export default {
|
|
17
|
+
title: 'ExplanationOfBenefit/ClaimResponse',
|
|
18
|
+
component: ClaimResponse,
|
|
19
|
+
argTypes: {
|
|
20
|
+
...defaultArgTypes,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const Template = args => <ClaimResponse {...args} />;
|
|
17
25
|
|
|
18
|
-
export const ExampleDSTU2 = ()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
24
|
-
fhirIcons={require('../../../assets/containers/ClaimResponse/claim-response.svg')}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
26
|
+
export const ExampleDSTU2 = Template.bind({});
|
|
27
|
+
ExampleDSTU2.args = {
|
|
28
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
29
|
+
fhirResource: exampleClaimResponseDSTU2,
|
|
30
|
+
fhirIcons: require('../../../assets/containers/ClaimResponse/claim-response.svg'),
|
|
27
31
|
};
|
|
28
32
|
|
|
29
|
-
export const Example1OfSTU3 = ()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
fhirVersion={fhirVersions.STU3}
|
|
35
|
-
fhirIcons={ClaimResponseIcon}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
33
|
+
export const Example1OfSTU3 = Template.bind({});
|
|
34
|
+
Example1OfSTU3.args = {
|
|
35
|
+
fhirVersion: fhirVersions.STU3,
|
|
36
|
+
fhirResource: exampleClaimResponseSTU3,
|
|
37
|
+
fhirIcons: ClaimResponseIcon,
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
fhirIcons={fhirIcons}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
39
|
+
|
|
40
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
41
|
+
Example2OfSTU3.args = {
|
|
42
|
+
fhirVersion: fhirVersions.STU3,
|
|
43
|
+
fhirResource: example2ClaimResponseSTU3,
|
|
44
|
+
fhirIcons: fhirIcons,
|
|
48
45
|
};
|
|
49
46
|
|
|
50
|
-
export const Example1OfR4 = ()
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
fhirVersion={fhirVersions.R4}
|
|
56
|
-
fhirIcons={false}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
47
|
+
export const Example1OfR4 = Template.bind({});
|
|
48
|
+
Example1OfR4.args = {
|
|
49
|
+
fhirVersion: fhirVersions.R4,
|
|
50
|
+
fhirResource: example1ClaimResponseR4,
|
|
51
|
+
fhirIcons: false,
|
|
59
52
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
fhirIcons={'random text'}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
53
|
+
|
|
54
|
+
export const Example2OfR4 = Template.bind({});
|
|
55
|
+
Example2OfR4.args = {
|
|
56
|
+
fhirVersion: fhirVersions.R4,
|
|
57
|
+
fhirResource: example2ClaimResponseR4,
|
|
58
|
+
fhirIcons: 'random text',
|
|
69
59
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
|
|
61
|
+
export const Example3OfR4 = Template.bind({});
|
|
62
|
+
Example3OfR4.args = {
|
|
63
|
+
fhirVersion: fhirVersions.R4,
|
|
64
|
+
fhirResource: example3ClaimResponseR4,
|
|
75
65
|
};
|
|
@@ -87,7 +87,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
const Condition = ({
|
|
90
|
+
const Condition = ({
|
|
91
|
+
fhirResource,
|
|
92
|
+
fhirVersion,
|
|
93
|
+
fhirIcons,
|
|
94
|
+
onClick,
|
|
95
|
+
rawOnClick,
|
|
96
|
+
}) => {
|
|
91
97
|
const {
|
|
92
98
|
codeText,
|
|
93
99
|
severityText,
|
|
@@ -157,6 +163,7 @@ const Condition = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
|
|
|
157
163
|
}
|
|
158
164
|
bodyContent={<Body tableData={tableData} />}
|
|
159
165
|
onClick={onClick}
|
|
166
|
+
rawOnClick={rawOnClick}
|
|
160
167
|
/>
|
|
161
168
|
</Root>
|
|
162
169
|
);
|
|
@@ -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 Condition from './Condition';
|
|
@@ -18,80 +18,65 @@ import example3ConditionR4 from '../../../fixtures/r4/resources/condition/exampl
|
|
|
18
18
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
19
19
|
import ConditionIcon from '../../../assets/containers/Condition/condition.svg';
|
|
20
20
|
|
|
21
|
-
export default {
|
|
21
|
+
export default {
|
|
22
|
+
title: 'Condition',
|
|
23
|
+
component: Condition,
|
|
24
|
+
argTypes: {
|
|
25
|
+
...defaultArgTypes,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const Template = args => <Condition {...args} />;
|
|
22
30
|
|
|
23
|
-
export const DefaultVisualizationDSTU2 = ()
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
29
|
-
fhirIcons={require('../../../assets/containers/Condition/condition.svg')}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
31
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
32
|
+
DefaultVisualizationDSTU2.args = {
|
|
33
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
34
|
+
fhirResource: exampleConditionSeverity,
|
|
35
|
+
fhirIcons: require('../../../assets/containers/Condition/condition.svg'),
|
|
32
36
|
};
|
|
33
37
|
|
|
34
|
-
export const ExampleWithoutSeverityDSTU2 = ()
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
40
|
-
fhirIcons={ConditionIcon}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
38
|
+
export const ExampleWithoutSeverityDSTU2 = Template.bind({});
|
|
39
|
+
ExampleWithoutSeverityDSTU2.args = {
|
|
40
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
41
|
+
fhirResource: exampleCondition,
|
|
42
|
+
fhirIcons: ConditionIcon,
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
export const Example3OfDSTU2 = ()
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
51
|
-
fhirIcons={fhirIcons}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
45
|
+
export const Example3OfDSTU2 = Template.bind({});
|
|
46
|
+
Example3OfDSTU2.args = {
|
|
47
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
48
|
+
fhirResource: example3Condition,
|
|
49
|
+
fhirIcons: fhirIcons,
|
|
54
50
|
};
|
|
55
51
|
|
|
56
|
-
export const ExampleWithoutSeveritySTU3 = ()
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
fhirVersion={fhirVersions.STU3}
|
|
62
|
-
fhirIcons={false}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
52
|
+
export const ExampleWithoutSeveritySTU3 = Template.bind({});
|
|
53
|
+
ExampleWithoutSeveritySTU3.args = {
|
|
54
|
+
fhirVersion: fhirVersions.STU3,
|
|
55
|
+
fhirResource: exampleConditionSTU3,
|
|
56
|
+
fhirIcons: false,
|
|
65
57
|
};
|
|
66
58
|
|
|
67
|
-
export const ExampleWithSeveritySTU3 = ()
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
fhirVersion={fhirVersions.STU3}
|
|
73
|
-
fhirIcons={'random text'}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
59
|
+
export const ExampleWithSeveritySTU3 = Template.bind({});
|
|
60
|
+
ExampleWithSeveritySTU3.args = {
|
|
61
|
+
fhirVersion: fhirVersions.STU3,
|
|
62
|
+
fhirResource: exampleConditionSeveritySTU3,
|
|
63
|
+
fhirIcons: 'random text',
|
|
76
64
|
};
|
|
77
65
|
|
|
78
|
-
export const Example1ofR4 = ()
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
);
|
|
66
|
+
export const Example1ofR4 = Template.bind({});
|
|
67
|
+
Example1ofR4.args = {
|
|
68
|
+
fhirVersion: fhirVersions.R4,
|
|
69
|
+
fhirResource: example1ConditionR4,
|
|
83
70
|
};
|
|
84
71
|
|
|
85
|
-
export const Example2ofR4 = ()
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
);
|
|
72
|
+
export const Example2ofR4 = Template.bind({});
|
|
73
|
+
Example2ofR4.args = {
|
|
74
|
+
fhirVersion: fhirVersions.R4,
|
|
75
|
+
fhirResource: example2ConditionR4,
|
|
90
76
|
};
|
|
91
77
|
|
|
92
|
-
export const Example3ofR4 = ()
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
78
|
+
export const Example3ofR4 = Template.bind({});
|
|
79
|
+
Example3ofR4.args = {
|
|
80
|
+
fhirVersion: fhirVersions.R4,
|
|
81
|
+
fhirResource: example3ConditionR4,
|
|
97
82
|
};
|
|
@@ -114,7 +114,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const Coverage = ({
|
|
117
|
+
const Coverage = ({
|
|
118
|
+
fhirResource,
|
|
119
|
+
fhirVersion,
|
|
120
|
+
fhirIcons,
|
|
121
|
+
onClick,
|
|
122
|
+
rawOnClick,
|
|
123
|
+
}) => {
|
|
118
124
|
let fhirResourceData = {};
|
|
119
125
|
try {
|
|
120
126
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -233,6 +239,7 @@ const Coverage = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
|
|
|
233
239
|
}
|
|
234
240
|
bodyContent={<Body tableData={tableData} />}
|
|
235
241
|
onClick={onClick}
|
|
242
|
+
rawOnClick={rawOnClick}
|
|
236
243
|
/>
|
|
237
244
|
</Root>
|
|
238
245
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Coverage from './Coverage';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -12,64 +12,52 @@ import example2CoverageR4 from '../../../fixtures/r4/resources/coverage/example2
|
|
|
12
12
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
13
13
|
import CoverageIcon from '../../../assets/containers/Coverage/coverage.svg';
|
|
14
14
|
|
|
15
|
-
export default {
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Coverage',
|
|
17
|
+
component: Coverage,
|
|
18
|
+
argTypes: {
|
|
19
|
+
...defaultArgTypes,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Template = args => <Coverage {...args} />;
|
|
16
24
|
|
|
17
|
-
export const DefaultVisualizationDSTU2 = ()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
fhirResource={fhirResource}
|
|
23
|
-
fhirIcons={require('../../../assets/containers/Coverage/coverage.svg')}
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
25
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
26
|
+
DefaultVisualizationDSTU2.args = {
|
|
27
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
28
|
+
fhirResource: exampleCoverageDstu2,
|
|
29
|
+
fhirIcons: require('../../../assets/containers/Coverage/coverage.svg'),
|
|
26
30
|
};
|
|
27
31
|
|
|
28
|
-
export const ExampleOfSTU3 = ()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
fhirResource={fhirResource}
|
|
34
|
-
fhirIcons={CoverageIcon}
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
32
|
+
export const ExampleOfSTU3 = Template.bind({});
|
|
33
|
+
ExampleOfSTU3.args = {
|
|
34
|
+
fhirVersion: fhirVersions.STU3,
|
|
35
|
+
fhirResource: exampleCoverageStu3,
|
|
36
|
+
fhirIcons: CoverageIcon,
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
export const Example2OfSTU3 = ()
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
fhirResource={fhirResource}
|
|
45
|
-
fhirIcons={fhirIcons}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
39
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
40
|
+
Example2OfSTU3.args = {
|
|
41
|
+
fhirVersion: fhirVersions.STU3,
|
|
42
|
+
fhirResource: example2CoverageStu3,
|
|
43
|
+
fhirIcons: fhirIcons,
|
|
48
44
|
};
|
|
49
45
|
|
|
50
|
-
export const ExampleOfR4 = ()
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
fhirVersion={fhirVersions.R4}
|
|
56
|
-
fhirIcons={false}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
46
|
+
export const ExampleOfR4 = Template.bind({});
|
|
47
|
+
ExampleOfR4.args = {
|
|
48
|
+
fhirVersion: fhirVersions.R4,
|
|
49
|
+
fhirResource: exampleCoverageR4,
|
|
50
|
+
fhirIcons: false,
|
|
59
51
|
};
|
|
60
52
|
|
|
61
|
-
export const Example2OfR4 = ()
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
fhirVersion={fhirVersions.R4}
|
|
67
|
-
fhirIcons={'random text'}
|
|
68
|
-
/>
|
|
69
|
-
);
|
|
53
|
+
export const Example2OfR4 = Template.bind({});
|
|
54
|
+
Example2OfR4.args = {
|
|
55
|
+
fhirVersion: fhirVersions.R4,
|
|
56
|
+
fhirResource: example2CoverageR4,
|
|
57
|
+
fhirIcons: 'random text',
|
|
70
58
|
};
|
|
71
59
|
|
|
72
|
-
export const ExampleWithoutFhirVersionProperty = ()
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
export const ExampleWithoutFhirVersionProperty = Template.bind({});
|
|
61
|
+
ExampleWithoutFhirVersionProperty.args = {
|
|
62
|
+
fhirResource: exampleCoverageStu3,
|
|
75
63
|
};
|
|
@@ -102,7 +102,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
const Device = ({
|
|
105
|
+
const Device = ({
|
|
106
|
+
fhirResource,
|
|
107
|
+
fhirVersion,
|
|
108
|
+
fhirIcons,
|
|
109
|
+
onClick,
|
|
110
|
+
rawOnClick,
|
|
111
|
+
}) => {
|
|
106
112
|
let fhirResourceData = {};
|
|
107
113
|
try {
|
|
108
114
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -179,6 +185,7 @@ const Device = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
|
|
|
179
185
|
</Body>
|
|
180
186
|
}
|
|
181
187
|
onClick={onClick}
|
|
188
|
+
rawOnClick={rawOnClick}
|
|
182
189
|
/>
|
|
183
190
|
</Root>
|
|
184
191
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import Device from './Device';
|
|
5
5
|
|
|
@@ -15,68 +15,56 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
title: 'Device',
|
|
18
|
+
component: Device,
|
|
19
|
+
argTypes: {
|
|
20
|
+
...defaultArgTypes,
|
|
21
|
+
},
|
|
18
22
|
};
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
24
|
+
const Template = args => <Device {...args} />;
|
|
25
|
+
|
|
26
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
27
|
+
DefaultVisualizationDSTU2.args = {
|
|
28
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
29
|
+
fhirResource: dstu2Example1,
|
|
30
|
+
fhirIcons: require('../../../assets/containers/Device/device.svg'),
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
export const ExampleOfDSTU2 = ()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
37
|
-
fhirIcons={DeviceIcon}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
33
|
+
export const ExampleOfDSTU2 = Template.bind({});
|
|
34
|
+
ExampleOfDSTU2.args = {
|
|
35
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
36
|
+
fhirResource: dstu2Example2,
|
|
37
|
+
fhirIcons: DeviceIcon,
|
|
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.STU3,
|
|
43
|
+
fhirResource: stu3Example1,
|
|
44
|
+
fhirIcons: fhirIcons,
|
|
51
45
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
fhirIcons={false}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
46
|
+
|
|
47
|
+
export const Example2OfSTU3 = Template.bind({});
|
|
48
|
+
Example2OfSTU3.args = {
|
|
49
|
+
fhirVersion: fhirVersions.STU3,
|
|
50
|
+
fhirResource: stu3Example2,
|
|
51
|
+
fhirIcons: false,
|
|
61
52
|
};
|
|
62
53
|
|
|
63
|
-
export const Example1OfR4 = ()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
fhirVersion={fhirVersions.R4}
|
|
69
|
-
fhirIcons={'random text'}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
54
|
+
export const Example1OfR4 = Template.bind({});
|
|
55
|
+
Example1OfR4.args = {
|
|
56
|
+
fhirVersion: fhirVersions.R4,
|
|
57
|
+
fhirResource: r4Example1,
|
|
58
|
+
fhirIcons: 'random text',
|
|
72
59
|
};
|
|
73
60
|
|
|
74
|
-
export const Example2OfR4 = ()
|
|
75
|
-
|
|
76
|
-
|
|
61
|
+
export const Example2OfR4 = Template.bind({});
|
|
62
|
+
Example2OfR4.args = {
|
|
63
|
+
fhirVersion: fhirVersions.R4,
|
|
64
|
+
fhirResource: r4Example2,
|
|
77
65
|
};
|
|
78
66
|
|
|
79
|
-
export const ExampleWithoutFHIRVersionProperty = ()
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
export const ExampleWithoutFHIRVersionProperty = Template.bind({});
|
|
68
|
+
ExampleWithoutFHIRVersionProperty.args = {
|
|
69
|
+
fhirResource: stu3Example2,
|
|
82
70
|
};
|