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
|
|
|
4
4
|
import ReferralRequest from './ReferralRequest';
|
|
5
5
|
|
|
@@ -9,29 +9,29 @@ import fhirVersions from '../fhirResourceVersions';
|
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
title: 'ReferralRequest',
|
|
12
|
+
component: ReferralRequest,
|
|
13
|
+
argTypes: {
|
|
14
|
+
...defaultArgTypes,
|
|
15
|
+
},
|
|
12
16
|
};
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
);
|
|
18
|
+
const Template = args => <ReferralRequest {...args} />;
|
|
19
|
+
|
|
20
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
21
|
+
DefaultVisualizationDSTU2.args = {
|
|
22
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
23
|
+
fhirResource: dstu2Example1,
|
|
24
|
+
fhirIcons: require('../../../assets/containers/ReferralRequest/referral-request.svg'),
|
|
22
25
|
};
|
|
23
26
|
|
|
24
|
-
export const ExampleOfSTU3 = ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
fhirResource={fhirResource}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
27
|
+
export const ExampleOfSTU3 = Template.bind({});
|
|
28
|
+
ExampleOfSTU3.args = {
|
|
29
|
+
fhirVersion: fhirVersions.STU3,
|
|
30
|
+
fhirResource: stu3Example1,
|
|
31
|
+
fhirIcons: false,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export const ExampleWithoutFhirVersionProperty = ()
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
export const ExampleWithoutFhirVersionProperty = Template.bind({});
|
|
35
|
+
ExampleWithoutFhirVersionProperty.args = {
|
|
36
|
+
fhirResource: stu3Example1,
|
|
37
37
|
};
|
|
@@ -73,6 +73,7 @@ const RelatedPerson = ({
|
|
|
73
73
|
fhirIcons,
|
|
74
74
|
onClick,
|
|
75
75
|
rawOnClick,
|
|
76
|
+
customId,
|
|
76
77
|
}) => {
|
|
77
78
|
let fhirResourceData = {};
|
|
78
79
|
try {
|
|
@@ -146,6 +147,7 @@ const RelatedPerson = ({
|
|
|
146
147
|
bodyContent={<Body tableData={tableData} />}
|
|
147
148
|
onClick={onClick}
|
|
148
149
|
rawOnClick={rawOnClick}
|
|
150
|
+
customId={customId}
|
|
149
151
|
/>
|
|
150
152
|
</Root>
|
|
151
153
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import RelatedPerson from './RelatedPerson';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -10,37 +10,33 @@ import exampleR4 from '../../../fixtures/r4/resources/relatedPerson/example1.jso
|
|
|
10
10
|
|
|
11
11
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
12
12
|
|
|
13
|
-
export default {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
fhirResource={fhirResource}
|
|
20
|
-
fhirVersion={fhirVersions.DSTU2}
|
|
21
|
-
fhirIcons={fhirIcons}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Coverage/RelatedPerson',
|
|
15
|
+
component: RelatedPerson,
|
|
16
|
+
argTypes: {
|
|
17
|
+
...defaultArgTypes,
|
|
18
|
+
},
|
|
24
19
|
};
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
const Template = args => <RelatedPerson {...args} />;
|
|
22
|
+
|
|
23
|
+
export const ExampleDSTU2 = Template.bind({});
|
|
24
|
+
ExampleDSTU2.args = {
|
|
25
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
26
|
+
fhirResource: exampleDSTU2,
|
|
27
|
+
fhirIcons: fhirIcons,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const ExampleSTU3 = Template.bind({});
|
|
31
|
+
ExampleSTU3.args = {
|
|
32
|
+
fhirVersion: fhirVersions.STU3,
|
|
33
|
+
fhirResource: exampleSTU3,
|
|
34
|
+
fhirIcons: false,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
export const ExampleR4 = ()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
fhirVersion={fhirVersions.R4}
|
|
43
|
-
fhirIcons={'random text'}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
37
|
+
export const ExampleR4 = Template.bind({});
|
|
38
|
+
ExampleR4.args = {
|
|
39
|
+
fhirVersion: fhirVersions.R4,
|
|
40
|
+
fhirResource: exampleR4,
|
|
41
|
+
fhirIcons: 'random text',
|
|
46
42
|
};
|
|
@@ -100,6 +100,7 @@ const ResearchStudy = ({
|
|
|
100
100
|
fhirIcons,
|
|
101
101
|
onClick,
|
|
102
102
|
rawOnClick,
|
|
103
|
+
customId,
|
|
103
104
|
}) => {
|
|
104
105
|
let fhirResourceData = {};
|
|
105
106
|
try {
|
|
@@ -296,6 +297,7 @@ const ResearchStudy = ({
|
|
|
296
297
|
bodyContent={<Body tableData={tableData} />}
|
|
297
298
|
onClick={onClick}
|
|
298
299
|
rawOnClick={rawOnClick}
|
|
300
|
+
customId={customId}
|
|
299
301
|
/>
|
|
300
302
|
</Root>
|
|
301
303
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import ResearchStudy from './ResearchStudy';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -10,22 +10,24 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
title: 'ResearchStudy',
|
|
13
|
+
component: ResearchStudy,
|
|
14
|
+
argTypes: {
|
|
15
|
+
...defaultArgTypes,
|
|
16
|
+
},
|
|
13
17
|
};
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
19
|
+
const Template = args => <ResearchStudy {...args} />;
|
|
20
|
+
|
|
21
|
+
export const ExampleOfSTU3 = Template.bind({});
|
|
22
|
+
ExampleOfSTU3.args = {
|
|
23
|
+
fhirVersion: fhirVersions.STU3,
|
|
24
|
+
fhirResource: stu3Example1,
|
|
25
|
+
fhirIcons: fhirIcons,
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
export const ExampleOfR4 = ()
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export const ExampleOfR4 = Template.bind({});
|
|
29
|
+
ExampleOfR4.args = {
|
|
30
|
+
fhirVersion: fhirVersions.R4,
|
|
31
|
+
fhirResource: r4Example1,
|
|
32
|
+
fhirIcons: false,
|
|
31
33
|
};
|
|
@@ -1,40 +1,53 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
|
+
|
|
2
4
|
import ResourceCategory from './ResourceCategory';
|
|
3
5
|
import fhirIcons from '../../../fixtures/example-icons';
|
|
4
6
|
import ResourceCategoryIcon from '../../../assets/containers/ResourceCategory/resource-category.svg';
|
|
5
7
|
|
|
6
|
-
export default {
|
|
8
|
+
export default {
|
|
9
|
+
title: 'ResourceCategory',
|
|
10
|
+
component: ResourceCategory,
|
|
11
|
+
argTypes: {
|
|
12
|
+
...defaultArgTypes,
|
|
13
|
+
itemsCount: {
|
|
14
|
+
table: {
|
|
15
|
+
disable: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
title: {
|
|
19
|
+
table: {
|
|
20
|
+
disable: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Template = args => <ResourceCategory {...args} />;
|
|
7
27
|
|
|
8
|
-
export const ExampleWithAllProperties = ()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
fhirIcons={require('../../../assets/containers/ResourceCategory/resource-category.svg')}
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
28
|
+
export const ExampleWithAllProperties = Template.bind({});
|
|
29
|
+
ExampleWithAllProperties.args = {
|
|
30
|
+
itemsCount: 41,
|
|
31
|
+
title: 'Resource name',
|
|
32
|
+
fhirIcons: require('../../../assets/containers/ResourceCategory/resource-category.svg'),
|
|
16
33
|
};
|
|
17
34
|
|
|
18
|
-
export const ExampleWith1Item = ()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fhirIcons={ResourceCategoryIcon}
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
35
|
+
export const ExampleWith1Item = Template.bind({});
|
|
36
|
+
ExampleWith1Item.args = {
|
|
37
|
+
itemsCount: '1',
|
|
38
|
+
title: 'Resource name',
|
|
39
|
+
fhirIcons: ResourceCategoryIcon,
|
|
26
40
|
};
|
|
27
41
|
|
|
28
|
-
export const ExampleWithoutItemsCount = ()
|
|
29
|
-
|
|
42
|
+
export const ExampleWithoutItemsCount = Template.bind({});
|
|
43
|
+
ExampleWithoutItemsCount.args = {
|
|
44
|
+
title: 'Resource name',
|
|
45
|
+
fhirIcons: fhirIcons,
|
|
30
46
|
};
|
|
31
47
|
|
|
32
|
-
export const ExampleWith1ItemAndDisableIcon = ()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fhirIcons={false}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
48
|
+
export const ExampleWith1ItemAndDisableIcon = Template.bind({});
|
|
49
|
+
ExampleWith1ItemAndDisableIcon.args = {
|
|
50
|
+
itemsCount: '1',
|
|
51
|
+
title: 'Resource name',
|
|
52
|
+
fhirIcons: false,
|
|
40
53
|
};
|
|
@@ -36,6 +36,7 @@ import MedicationAdministration from './resources/MedicationAdministration';
|
|
|
36
36
|
import Questionnaire from './resources/Questionnaire';
|
|
37
37
|
import QuestionnaireResponse from './resources/QuestionnaireResponse';
|
|
38
38
|
import ReferralRequest from './resources/ReferralRequest';
|
|
39
|
+
import RelatedPerson from './resources/RelatedPerson';
|
|
39
40
|
import ResearchStudy from './resources/ResearchStudy';
|
|
40
41
|
import ResourceCategory from './resources/ResourceCategory';
|
|
41
42
|
|
|
@@ -78,6 +79,7 @@ export {
|
|
|
78
79
|
Questionnaire,
|
|
79
80
|
QuestionnaireResponse,
|
|
80
81
|
ReferralRequest,
|
|
82
|
+
RelatedPerson,
|
|
81
83
|
ResearchStudy,
|
|
82
84
|
ResourceCategory,
|
|
83
85
|
};
|
package/.storybook/addons.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@storybook/addon-knobs/register';
|
package/.storybook/config.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import '../src/components/ui/bootstrap-reboot.min.css';
|
|
2
|
-
import '../src/style.css';
|
|
3
|
-
import '../src/style.scss';
|
|
4
|
-
|
|
5
|
-
import { addDecorator, addParameters, configure } from '@storybook/react';
|
|
6
|
-
|
|
7
|
-
import { withKnobs } from '@storybook/addon-knobs';
|
|
8
|
-
|
|
9
|
-
if (typeof document !== 'undefined') {
|
|
10
|
-
require('bootstrap/dist/js/bootstrap.min.js');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
addParameters({
|
|
14
|
-
options: {
|
|
15
|
-
name: 'FHIR-REACT storybook',
|
|
16
|
-
showRoots: true,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
addDecorator(
|
|
21
|
-
withKnobs({
|
|
22
|
-
escapeHTML: false,
|
|
23
|
-
}),
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
configure(require.context('../src', true, /\.stories\.js$/), module);
|
package/.storybook/presets.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = ['@storybook/preset-scss'];
|