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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fhir-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "React component library for displaying FHIR Resources ",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"@nivo/core": "^0.78.0",
|
|
11
11
|
"@nivo/pie": "^0.78.0",
|
|
12
12
|
"@popperjs/core": "^2.11.2",
|
|
13
|
+
"@storybook/addons": "^6.4.22",
|
|
13
14
|
"bootstrap": "^5.1.3",
|
|
14
15
|
"dompurify": "^2.3.6",
|
|
15
16
|
"lodash": "^4.17.21",
|
|
@@ -82,10 +83,10 @@
|
|
|
82
83
|
"@babel/polyfill": "^7.0.0",
|
|
83
84
|
"@babel/preset-env": "^7.16.11",
|
|
84
85
|
"@babel/preset-react": "^7.16.7",
|
|
85
|
-
"@storybook/addon-
|
|
86
|
+
"@storybook/addon-controls": "^6.4.22",
|
|
86
87
|
"@storybook/preset-scss": "^1.0.3",
|
|
87
|
-
"@storybook/react": "^
|
|
88
|
-
"@storybook/storybook-deployer": "^2.8.
|
|
88
|
+
"@storybook/react": "^6.4.22",
|
|
89
|
+
"@storybook/storybook-deployer": "^2.8.11",
|
|
89
90
|
"@testing-library/react": "^12.1.4",
|
|
90
91
|
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
|
91
92
|
"@typescript-eslint/parser": "^5.14.0",
|
|
@@ -6,12 +6,16 @@ const CHEVRON_DOWN_COLOR = '#6f83a9';
|
|
|
6
6
|
const CHEVRON_UP_COLOR = '#2a6fd7';
|
|
7
7
|
|
|
8
8
|
const Accordion = props => {
|
|
9
|
-
const { headerContent, bodyContent, onClick, rawOnClick } = props;
|
|
9
|
+
const { headerContent, bodyContent, onClick, rawOnClick, customId } = props;
|
|
10
10
|
const [rotate, setRotate] = useState(false);
|
|
11
11
|
const handleAccordionClick = () => setRotate(!rotate);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
const accordionIdText = `accordion-type-${headerContent.props.resourceName ||
|
|
14
|
+
'default'}-`;
|
|
15
|
+
const accordionId =
|
|
16
|
+
typeof customId === 'number'
|
|
17
|
+
? `${accordionIdText}${customId}`
|
|
18
|
+
: uniqueId(accordionIdText);
|
|
15
19
|
|
|
16
20
|
const isAccordionOpenable = () => {
|
|
17
21
|
if (bodyContent) {
|
|
@@ -1,76 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import _get from 'lodash/get';
|
|
3
|
+
|
|
1
4
|
import { BadgeSecondary, Body, MissingValue, Title, Value } from '../../ui';
|
|
2
5
|
|
|
3
6
|
import Accordion from './Accordion';
|
|
4
7
|
import Annotation from '../../datatypes/Annotation';
|
|
5
8
|
import Date from '../../datatypes/Date';
|
|
6
|
-
import Procedure from '../../resources/Procedure/Procedure';
|
|
7
|
-
import React from 'react';
|
|
8
9
|
import Reference from '../../datatypes/Reference';
|
|
9
|
-
import
|
|
10
|
+
import Procedure from '../../resources/Procedure/Procedure';
|
|
11
|
+
|
|
10
12
|
import example1 from '../../../fixtures/dstu2/resources/procedure/example1.json';
|
|
11
|
-
import fhirIcons from '../../../fixtures/example-icons';
|
|
12
|
-
import { object } from '@storybook/addon-knobs';
|
|
13
13
|
import stu3Example1 from '../../../fixtures/stu3/resources/procedure/example1.json';
|
|
14
|
+
import fhirIcons from '../../../fixtures/example-icons';
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
title: 'Accordion',
|
|
18
|
+
component: Accordion,
|
|
19
|
+
argTypes: {
|
|
20
|
+
headerContent: {
|
|
21
|
+
table: {
|
|
22
|
+
disable: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
bodyContent: {
|
|
26
|
+
table: {
|
|
27
|
+
disable: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
17
31
|
};
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
const fhirResource = object('Resource', stu3Example1);
|
|
21
|
-
const title =
|
|
22
|
-
_get(fhirResource, 'code.coding[0].display') ||
|
|
23
|
-
_get(fhirResource, 'code.text');
|
|
24
|
-
const performedDateTime = _get(fhirResource, 'performedDateTime');
|
|
25
|
-
const performer = _get(fhirResource, 'performer', []);
|
|
26
|
-
const locationReference = _get(fhirResource, 'location[0]');
|
|
27
|
-
const reasonCode = _get(fhirResource, 'reasonCode', []);
|
|
28
|
-
const note = _get(fhirResource, 'note', []);
|
|
33
|
+
const Template = args => <Accordion {...args} />;
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
const DefaultVisualizationFhirResource = stu3Example1;
|
|
36
|
+
export const DefaultVisualization = Template.bind({});
|
|
37
|
+
DefaultVisualization.args = {
|
|
38
|
+
headerContent: (
|
|
39
|
+
<div className="">
|
|
40
|
+
<Title>
|
|
41
|
+
{_get(DefaultVisualizationFhirResource, 'code.coding[0].display') ||
|
|
42
|
+
_get(DefaultVisualizationFhirResource, 'code.text')}
|
|
43
|
+
</Title>
|
|
44
|
+
<div className="pb-3" />
|
|
45
|
+
<BadgeSecondary data-testid="performedDateTime">
|
|
46
|
+
<Date
|
|
47
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'performedDateTime')}
|
|
48
|
+
/>
|
|
49
|
+
</BadgeSecondary>
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
bodyContent: (
|
|
53
|
+
<Body>
|
|
54
|
+
<Value label="Performed by">
|
|
55
|
+
{_get(DefaultVisualizationFhirResource, 'performer', []).map(
|
|
56
|
+
(item, i) => (
|
|
57
|
+
<div key={`item-${i}`}>
|
|
58
|
+
{_get(item, 'actor.display', <MissingValue />)}
|
|
59
|
+
</div>
|
|
60
|
+
),
|
|
61
|
+
)}
|
|
62
|
+
</Value>
|
|
63
|
+
<Value label="Location" data-testid="location">
|
|
64
|
+
<Reference
|
|
65
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'location[0]')}
|
|
66
|
+
/>
|
|
67
|
+
</Value>
|
|
68
|
+
<Value label="Reason" data-testid="hasReasonCode">
|
|
69
|
+
<Annotation
|
|
70
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'reasonCode', [])}
|
|
71
|
+
/>
|
|
72
|
+
</Value>
|
|
73
|
+
<Value label="Notes" data-testid="hasNote">
|
|
74
|
+
<Annotation
|
|
75
|
+
fhirData={_get(DefaultVisualizationFhirResource, 'note', [])}
|
|
76
|
+
/>
|
|
77
|
+
</Value>
|
|
78
|
+
</Body>
|
|
79
|
+
),
|
|
63
80
|
};
|
|
64
81
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
82
|
+
const ProcedureVisualizationFhirResource = example1;
|
|
83
|
+
export const ProcedureVisualization = Template.bind({});
|
|
84
|
+
ProcedureVisualization.args = {
|
|
85
|
+
headerContent: <div className="" />,
|
|
86
|
+
bodyContent: (
|
|
87
|
+
<Procedure
|
|
88
|
+
fhirResource={ProcedureVisualizationFhirResource}
|
|
89
|
+
fhirIcons={fhirIcons}
|
|
74
90
|
/>
|
|
75
|
-
)
|
|
91
|
+
),
|
|
76
92
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import ResourceContainer from './ResourceContainer';
|
|
5
5
|
import Encounter from '../../../components/resources/Encounter';
|
|
@@ -10,50 +10,52 @@ import fhirVersions from '../../../components/resources/fhirResourceVersions';
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
title: 'ResourceContainer',
|
|
13
|
+
component: ResourceContainer,
|
|
14
|
+
argTypes: {
|
|
15
|
+
...defaultArgTypes,
|
|
16
|
+
children: {
|
|
17
|
+
table: {
|
|
18
|
+
disable: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
13
22
|
};
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
const fhirResource = object('Resource', example1);
|
|
17
|
-
const props = {
|
|
18
|
-
fhirVersion: fhirVersions.DSTU2,
|
|
19
|
-
fhirResource: fhirResource,
|
|
20
|
-
};
|
|
21
|
-
return (
|
|
22
|
-
<ResourceContainer {...props}>
|
|
23
|
-
<Encounter {...props} />
|
|
24
|
-
</ResourceContainer>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const DefaultVisualizationWithRawButtonVisibleOutsideAccordion = () => {
|
|
29
|
-
const exampleResource = {
|
|
30
|
-
resourceType: 'UnknownResource',
|
|
31
|
-
id: '12345',
|
|
32
|
-
code: {
|
|
33
|
-
text: 'Resource code text',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
24
|
+
const Template = args => <ResourceContainer {...args} />;
|
|
36
25
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
const propsRawInsideAccordion = {
|
|
27
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
28
|
+
fhirResource: example1,
|
|
29
|
+
};
|
|
30
|
+
export const DefaultVisualizationWithRawButtonHiddenInsideAccordion = Template.bind(
|
|
31
|
+
{},
|
|
32
|
+
);
|
|
33
|
+
DefaultVisualizationWithRawButtonHiddenInsideAccordion.args = {
|
|
34
|
+
...propsRawInsideAccordion,
|
|
35
|
+
children: <Encounter {...propsRawInsideAccordion} />,
|
|
36
|
+
};
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
const exampleResource = {
|
|
39
|
+
resourceType: 'UnknownResource',
|
|
40
|
+
id: '12345',
|
|
41
|
+
code: {
|
|
42
|
+
text: 'Resource code text',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
const propsRawOutsideAccordion = { fhirResource: exampleResource };
|
|
46
|
+
export const DefaultVisualizationWithRawButtonVisibleOutsideAccordion = Template.bind(
|
|
47
|
+
{},
|
|
48
|
+
);
|
|
49
|
+
DefaultVisualizationWithRawButtonVisibleOutsideAccordion.args = {
|
|
50
|
+
...propsRawOutsideAccordion,
|
|
51
|
+
children: <Generic {...propsRawOutsideAccordion} />,
|
|
47
52
|
};
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<Encounter {...props} />
|
|
57
|
-
</ResourceContainer>
|
|
58
|
-
);
|
|
54
|
+
const propsWithoutVersion = {
|
|
55
|
+
fhirResource: example1,
|
|
56
|
+
};
|
|
57
|
+
export const VisualizationWithoutFhirVersion = Template.bind({});
|
|
58
|
+
VisualizationWithoutFhirVersion.args = {
|
|
59
|
+
...propsWithoutVersion,
|
|
60
|
+
children: <Encounter {...propsWithoutVersion} />,
|
|
59
61
|
};
|
|
@@ -77,6 +77,7 @@ const AdverseEvent = ({
|
|
|
77
77
|
fhirIcons,
|
|
78
78
|
onClick,
|
|
79
79
|
rawOnClick,
|
|
80
|
+
customId,
|
|
80
81
|
}) => {
|
|
81
82
|
let fhirResourceData = {};
|
|
82
83
|
try {
|
|
@@ -172,6 +173,7 @@ const AdverseEvent = ({
|
|
|
172
173
|
}
|
|
173
174
|
onClick={onClick}
|
|
174
175
|
rawOnClick={rawOnClick}
|
|
176
|
+
customId={customId}
|
|
175
177
|
/>
|
|
176
178
|
</Root>
|
|
177
179
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import AdverseEvent from './AdverseEvent';
|
|
5
5
|
import fhirVersions from '../fhirResourceVersions';
|
|
@@ -11,26 +11,24 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
13
|
title: 'AdverseEvent',
|
|
14
|
+
component: AdverseEvent,
|
|
15
|
+
argTypes: {
|
|
16
|
+
...defaultArgTypes,
|
|
17
|
+
},
|
|
14
18
|
};
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
20
|
+
const Template = args => <AdverseEvent {...args} />;
|
|
21
|
+
|
|
22
|
+
export const DefaultVisualizationSTU3 = Template.bind({});
|
|
23
|
+
DefaultVisualizationSTU3.args = {
|
|
24
|
+
fhirVersion: fhirVersions.STU3,
|
|
25
|
+
fhirResource: stu3Example1,
|
|
26
|
+
fhirIcons: fhirIcons,
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
export const Example1ofR4 = ()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
fhirVersion={fhirVersions.R4}
|
|
33
|
-
fhirIcons={false}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
29
|
+
export const Example1ofR4 = Template.bind({});
|
|
30
|
+
Example1ofR4.args = {
|
|
31
|
+
fhirVersion: fhirVersions.R4,
|
|
32
|
+
fhirResource: r4Example1,
|
|
33
|
+
fhirIcons: false,
|
|
36
34
|
};
|
|
@@ -51,6 +51,7 @@ const dstu2DTO = fhirResource => {
|
|
|
51
51
|
asserter,
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
+
|
|
54
55
|
const stu3DTO = fhirResource => {
|
|
55
56
|
const title = _get(fhirResource, 'code.coding.0.display');
|
|
56
57
|
const status = _get(fhirResource, 'verificationStatus');
|
|
@@ -73,6 +74,7 @@ const stu3DTO = fhirResource => {
|
|
|
73
74
|
hasNote,
|
|
74
75
|
};
|
|
75
76
|
};
|
|
77
|
+
|
|
76
78
|
const r4DTO = fhirResource => {
|
|
77
79
|
const title = _get(fhirResource, 'code.coding.0.display');
|
|
78
80
|
const status = _get(fhirResource, 'verificationStatus.coding[0].display');
|
|
@@ -129,6 +131,7 @@ const AllergyIntolerance = ({
|
|
|
129
131
|
fhirIcons,
|
|
130
132
|
onClick,
|
|
131
133
|
rawOnClick,
|
|
134
|
+
customId,
|
|
132
135
|
}) => {
|
|
133
136
|
let fhirResourceData = {};
|
|
134
137
|
try {
|
|
@@ -239,6 +242,7 @@ const AllergyIntolerance = ({
|
|
|
239
242
|
bodyContent={<Body tableData={tableData} />}
|
|
240
243
|
onClick={onClick}
|
|
241
244
|
rawOnClick={rawOnClick}
|
|
245
|
+
customId={customId}
|
|
242
246
|
/>
|
|
243
247
|
</Root>
|
|
244
248
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultArgTypes } from '../../defaultArgTypes';
|
|
3
3
|
|
|
4
4
|
import AllergyIntolerance from './AllergyIntolerance';
|
|
5
5
|
|
|
@@ -14,88 +14,64 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
14
14
|
import fhirVersions from '../fhirResourceVersions';
|
|
15
15
|
import AllergyIntoleranceIcon from '../../../assets/containers/AllergyIntolerance/allergy-intolerance.svg';
|
|
16
16
|
|
|
17
|
-
export default {
|
|
17
|
+
export default {
|
|
18
|
+
title: 'AllergyIntolerance',
|
|
19
|
+
component: AllergyIntolerance,
|
|
20
|
+
argTypes: {
|
|
21
|
+
...defaultArgTypes,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const Template = args => <AllergyIntolerance {...args} />;
|
|
18
26
|
|
|
19
|
-
export const DefaultVisualizationDSTU2 = ()
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
fhirResource={fhirResource}
|
|
25
|
-
fhirIcons={require('../../../assets/containers/AllergyIntolerance/allergy-intolerance.svg')}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
27
|
+
export const DefaultVisualizationDSTU2 = Template.bind({});
|
|
28
|
+
DefaultVisualizationDSTU2.args = {
|
|
29
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
30
|
+
fhirResource: exampleAllergyIntoleranceDSTU2,
|
|
31
|
+
fhirIcons: require('../../../assets/containers/AllergyIntolerance/allergy-intolerance.svg'),
|
|
28
32
|
};
|
|
29
33
|
|
|
30
|
-
export const Example2ofDSTU2 = ()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fhirResource={fhirResource}
|
|
36
|
-
fhirIcons={AllergyIntoleranceIcon}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
34
|
+
export const Example2ofDSTU2 = Template.bind({});
|
|
35
|
+
Example2ofDSTU2.args = {
|
|
36
|
+
fhirVersion: fhirVersions.DSTU2,
|
|
37
|
+
fhirResource: example2AllergyIntoleranceDSTU2,
|
|
38
|
+
fhirIcons: AllergyIntoleranceIcon,
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
export const ExampleDiagnosticReportSTU3 = ()
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
fhirResource={fhirResource}
|
|
47
|
-
fhirIcons={fhirIcons}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
41
|
+
export const ExampleDiagnosticReportSTU3 = Template.bind({});
|
|
42
|
+
ExampleDiagnosticReportSTU3.args = {
|
|
43
|
+
fhirVersion: fhirVersions.STU3,
|
|
44
|
+
fhirResource: exampleAllergyIntoleranceSTU3,
|
|
45
|
+
fhirIcons: fhirIcons,
|
|
50
46
|
};
|
|
51
47
|
|
|
52
|
-
export const Example2DiagnosticReportSTU3 = ()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
fhirResource={fhirResource}
|
|
58
|
-
fhirIcons={false}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
48
|
+
export const Example2DiagnosticReportSTU3 = Template.bind({});
|
|
49
|
+
Example2DiagnosticReportSTU3.args = {
|
|
50
|
+
fhirVersion: fhirVersions.STU3,
|
|
51
|
+
fhirResource: example2AllergyIntoleranceSTU3,
|
|
52
|
+
fhirIcons: false,
|
|
61
53
|
};
|
|
62
54
|
|
|
63
|
-
export const Example1R4 = ()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
fhirResource={fhirResource}
|
|
69
|
-
fhirIcons={'random text'}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
55
|
+
export const Example1R4 = Template.bind({});
|
|
56
|
+
Example1R4.args = {
|
|
57
|
+
fhirVersion: fhirVersions.R4,
|
|
58
|
+
fhirResource: example1AllergyIntoleranceR4,
|
|
59
|
+
fhirIcons: 'random text',
|
|
72
60
|
};
|
|
73
61
|
|
|
74
|
-
export const Example2R4 = ()
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
fhirVersion={fhirVersions.R4}
|
|
79
|
-
fhirResource={fhirResource}
|
|
80
|
-
fhirIcons={fhirIcons}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
62
|
+
export const Example2R4 = Template.bind({});
|
|
63
|
+
Example2R4.args = {
|
|
64
|
+
fhirVersion: fhirVersions.R4,
|
|
65
|
+
fhirResource: example2AllergyIntoleranceR4,
|
|
83
66
|
};
|
|
84
67
|
|
|
85
|
-
export const Example3R4 = ()
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
fhirVersion={fhirVersions.R4}
|
|
90
|
-
fhirResource={fhirResource}
|
|
91
|
-
fhirIcons={fhirIcons}
|
|
92
|
-
/>
|
|
93
|
-
);
|
|
68
|
+
export const Example3R4 = Template.bind({});
|
|
69
|
+
Example3R4.args = {
|
|
70
|
+
fhirVersion: fhirVersions.R4,
|
|
71
|
+
fhirResource: example3AllergyIntoleranceR4,
|
|
94
72
|
};
|
|
95
73
|
|
|
96
|
-
export const ExampleWithoutFhirVersionProperty = ()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<AllergyIntolerance fhirResource={fhirResource} fhirIcons={fhirIcons} />
|
|
100
|
-
);
|
|
74
|
+
export const ExampleWithoutFhirVersionProperty = Template.bind({});
|
|
75
|
+
ExampleWithoutFhirVersionProperty.args = {
|
|
76
|
+
fhirResource: example2AllergyIntoleranceSTU3,
|
|
101
77
|
};
|
|
@@ -150,6 +150,7 @@ const Appointment = ({
|
|
|
150
150
|
fhirIcons,
|
|
151
151
|
onClick,
|
|
152
152
|
rawOnClick,
|
|
153
|
+
customId,
|
|
153
154
|
}) => {
|
|
154
155
|
const {
|
|
155
156
|
description,
|
|
@@ -261,6 +262,7 @@ const Appointment = ({
|
|
|
261
262
|
}
|
|
262
263
|
onClick={onClick}
|
|
263
264
|
rawOnClick={rawOnClick}
|
|
265
|
+
customId={customId}
|
|
264
266
|
/>
|
|
265
267
|
</Root>
|
|
266
268
|
);
|