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.
Files changed (95) hide show
  1. package/.storybook/main.js +5 -0
  2. package/.storybook/manager.js +6 -0
  3. package/.storybook/preview.js +56 -0
  4. package/README.md +17 -1
  5. package/build/index.js +9 -9
  6. package/package.json +5 -4
  7. package/src/components/containers/Accordion/Accordion.js +8 -4
  8. package/src/components/containers/Accordion/Accordion.stories.js +74 -58
  9. package/src/components/containers/ResourceContainer/ResourceContainer.stories.js +43 -41
  10. package/src/components/defaultArgTypes.js +12 -0
  11. package/src/components/resources/AdverseEvent/AdverseEvent.js +2 -0
  12. package/src/components/resources/AdverseEvent/AdverseEvent.stories.js +17 -19
  13. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +4 -0
  14. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +46 -70
  15. package/src/components/resources/Appointment/Appointment.js +2 -0
  16. package/src/components/resources/Appointment/Appointment.stories.js +51 -62
  17. package/src/components/resources/Binary/Binary.js +2 -1
  18. package/src/components/resources/Binary/Binary.stories.js +27 -21
  19. package/src/components/resources/Bundle/Bundle.stories.js +59 -49
  20. package/src/components/resources/CarePlan/CarePlan.js +3 -0
  21. package/src/components/resources/CarePlan/CarePlan.stories.js +44 -54
  22. package/src/components/resources/CareTeam/CareTeam.js +2 -0
  23. package/src/components/resources/CareTeam/CareTeam.stories.js +22 -28
  24. package/src/components/resources/Claim/Claim.js +3 -0
  25. package/src/components/resources/Claim/Claim.stories.js +37 -50
  26. package/src/components/resources/ClaimResponse/ClaimResponse.js +2 -0
  27. package/src/components/resources/ClaimResponse/ClaimResponse.stories.js +42 -52
  28. package/src/components/resources/Condition/Condition.js +2 -0
  29. package/src/components/resources/Condition/Condition.stories.js +47 -62
  30. package/src/components/resources/Coverage/Coverage.js +3 -0
  31. package/src/components/resources/Coverage/Coverage.stories.js +38 -50
  32. package/src/components/resources/Device/Device.js +3 -0
  33. package/src/components/resources/Device/Device.stories.js +40 -52
  34. package/src/components/resources/DiagnosticReport/DiagnosticReport.js +2 -0
  35. package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +38 -50
  36. package/src/components/resources/DocumentReference/DocumentReference.js +2 -0
  37. package/src/components/resources/DocumentReference/DocumentReference.stories.js +25 -29
  38. package/src/components/resources/Encounter/Encounter.js +2 -0
  39. package/src/components/resources/Encounter/Encounter.stories.js +43 -59
  40. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +18 -3
  41. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +53 -67
  42. package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.stories.js +74 -38
  43. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +2 -0
  44. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +23 -29
  45. package/src/components/resources/Generic/Generic.js +8 -1
  46. package/src/components/resources/Generic/Generic.stories.js +21 -12
  47. package/src/components/resources/Goal/Goal.js +2 -0
  48. package/src/components/resources/Goal/Goal.stories.js +35 -49
  49. package/src/components/resources/Immunization/Immunization.js +2 -0
  50. package/src/components/resources/Immunization/Immunization.stories.js +38 -51
  51. package/src/components/resources/List/List.js +2 -0
  52. package/src/components/resources/List/List.stories.js +66 -70
  53. package/src/components/resources/Location/Location.js +8 -1
  54. package/src/components/resources/Location/Location.stories.js +23 -18
  55. package/src/components/resources/Medication/Medication.js +2 -0
  56. package/src/components/resources/Medication/Medication.stories.js +42 -64
  57. package/src/components/resources/MedicationAdministration/MedicationAdministration.js +4 -2
  58. package/src/components/resources/MedicationAdministration/MedicationAdministration.stories.js +32 -46
  59. package/src/components/resources/MedicationDispense/MedicationDispense.js +2 -0
  60. package/src/components/resources/MedicationDispense/MedicationDispense.stories.js +39 -57
  61. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.js +2 -0
  62. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.stories.js +49 -58
  63. package/src/components/resources/MedicationOrder/MedicationOrder.js +8 -1
  64. package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +11 -4
  65. package/src/components/resources/MedicationRequest/MedicationRequest.js +2 -0
  66. package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +27 -30
  67. package/src/components/resources/MedicationStatement/MedicationStatement.js +2 -0
  68. package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +32 -46
  69. package/src/components/resources/Observation/Observation.js +8 -1
  70. package/src/components/resources/Observation/Observation.stories.js +39 -33
  71. package/src/components/resources/Organization/Organization.js +2 -0
  72. package/src/components/resources/Organization/Organization.stories.js +40 -52
  73. package/src/components/resources/Patient/Patient.js +2 -0
  74. package/src/components/resources/Patient/Patient.stories.js +36 -28
  75. package/src/components/resources/Practitioner/Practitioner.js +4 -0
  76. package/src/components/resources/Practitioner/Practitioner.stories.js +39 -52
  77. package/src/components/resources/PractitionerRole/PractitionerRole.js +2 -0
  78. package/src/components/resources/PractitionerRole/PractitionerRole.stories.js +43 -63
  79. package/src/components/resources/Procedure/Procedure.js +8 -1
  80. package/src/components/resources/Procedure/Procedure.stories.js +33 -25
  81. package/src/components/resources/Questionnaire/Questionnaire.js +2 -0
  82. package/src/components/resources/Questionnaire/Questionnaire.stories.js +47 -62
  83. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.js +2 -0
  84. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.stories.js +43 -63
  85. package/src/components/resources/ReferralRequest/ReferralRequest.js +2 -0
  86. package/src/components/resources/ReferralRequest/ReferralRequest.stories.js +20 -20
  87. package/src/components/resources/RelatedPerson/RelatedPerson.js +2 -0
  88. package/src/components/resources/RelatedPerson/RelatedPerson.stories.js +26 -30
  89. package/src/components/resources/ResearchStudy/ResearchStudy.js +2 -0
  90. package/src/components/resources/ResearchStudy/ResearchStudy.stories.js +17 -15
  91. package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +40 -27
  92. package/src/components/supportedFhirResourceList.js +2 -0
  93. package/.storybook/addons.js +0 -1
  94. package/.storybook/config.js +0 -26
  95. package/.storybook/presets.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { object } from '@storybook/addon-knobs';
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
- export const DefaultVisualizationDSTU2 = () => {
15
- const fhirResource = object('Resource', dstu2Example1);
16
- return (
17
- <ReferralRequest
18
- fhirVersion={fhirVersions.DSTU2}
19
- fhirResource={fhirResource}
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
- const fhirResource = object('Resource', stu3Example1);
26
- return (
27
- <ReferralRequest
28
- fhirVersion={fhirVersions.STU3}
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
- const fhirResource = object('Resource', stu3Example1);
36
- return <ReferralRequest fhirResource={fhirResource} />;
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 { object } from '@storybook/addon-knobs';
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 { title: 'RelatedPerson' };
14
-
15
- export const ExampleDSTU2 = () => {
16
- const fhirResource = object('Resource', exampleDSTU2);
17
- return (
18
- <RelatedPerson
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
- export const ExampleSTU3 = () => {
27
- const fhirResource = object('Resource', exampleSTU3);
28
- return (
29
- <RelatedPerson
30
- fhirResource={fhirResource}
31
- fhirVersion={fhirVersions.STU3}
32
- fhirIcons={false}
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
- const fhirResource = object('Resource', exampleR4);
39
- return (
40
- <RelatedPerson
41
- fhirResource={fhirResource}
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 { object } from '@storybook/addon-knobs';
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
- export const ExampleOfSTU3 = () => {
16
- const fhirResource = object('Resource', stu3Example1);
17
- return (
18
- <ResearchStudy
19
- fhirVersion={fhirVersions.STU3}
20
- fhirResource={fhirResource}
21
- fhirIcons={fhirIcons}
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
- const fhirResource = object('Resource', r4Example1);
28
- return (
29
- <ResearchStudy fhirVersion={fhirVersions.R4} fhirResource={fhirResource} />
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 { title: 'ResourceCategory' };
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
- return (
10
- <ResourceCategory
11
- itemsCount={41}
12
- title="Resource name"
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
- return (
20
- <ResourceCategory
21
- itemsCount={'1'}
22
- title="Resource name"
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
- return <ResourceCategory title="Resource name" fhirIcons={fhirIcons} />;
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
- return (
34
- <ResourceCategory
35
- itemsCount={'1'}
36
- title="Resource name"
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
  };
@@ -1 +0,0 @@
1
- import '@storybook/addon-knobs/register';
@@ -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);
@@ -1 +0,0 @@
1
- module.exports = ['@storybook/preset-scss'];