fhir-react 0.3.3 → 0.3.4
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/README.md +85 -2
- package/build/index.js +7 -14
- package/package.json +1 -1
- package/src/assets/containers/Patient/patient.svg +6 -0
- package/src/components/containers/Accordion/Accordion.js +7 -3
- package/src/components/datatypes/HeaderIcon/HeaderIcon.js +67 -22
- package/src/components/resources/Appointment/Appointment.js +3 -3
- package/src/components/resources/Appointment/Appointment.stories.js +28 -5
- package/src/components/resources/Appointment/Appointment.test.js +72 -0
- package/src/components/resources/Condition/Condition.js +1 -3
- package/src/components/resources/Condition/Condition.stories.js +9 -19
- package/src/components/resources/Condition/Condition.test.js +71 -1
- package/src/components/resources/Encounter/Encounter.js +3 -4
- package/src/components/resources/Encounter/Encounter.stories.js +27 -5
- package/src/components/resources/Encounter/Encounter.test.js +72 -0
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +7 -2
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +8 -0
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +72 -0
- package/src/components/resources/Immunization/Immunization.js +1 -2
- package/src/components/resources/Immunization/Immunization.stories.js +6 -9
- package/src/components/resources/Immunization/Immunization.test.js +71 -1
- package/src/components/resources/Observation/Observation.js +3 -3
- package/src/components/resources/Observation/Observation.stories.js +14 -5
- package/src/components/resources/Observation/Observation.test.js +67 -0
- package/src/components/resources/Patient/Patient.js +9 -6
- package/src/components/resources/Patient/Patient.stories.js +12 -5
- package/src/components/resources/Patient/Patient.test.js +67 -0
- package/src/components/resources/Practitioner/Practitioner.js +3 -13
- package/src/components/resources/Practitioner/Practitioner.stories.js +19 -3
- package/src/components/resources/Practitioner/Practitioner.test.js +72 -0
- package/src/components/resources/Procedure/Procedure.js +1 -2
- package/src/components/resources/Procedure/Procedure.stories.js +11 -5
- package/src/components/resources/Procedure/Procedure.test.js +71 -1
- package/src/components/resources/ResourceCategory/ResourceCategory.js +5 -1
- package/src/components/ui/index.js +33 -25
- package/src/fixtures/example-icons.jsx +47 -9
- package/src/utils/convertCamelCaseToSentence.js +9 -0
- package/src/utils/convertCamelCaseToSentence.test.js +9 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://circleci.com/gh/1uphealth/fhir-react/tree/master)
|
|
2
|
-
[](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/
|
|
2
|
+
[](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/release-0-3-4/index.html)
|
|
3
3
|
|
|
4
4
|
# fhir-react
|
|
5
5
|
|
|
@@ -35,7 +35,90 @@ const MyComponent = () => {
|
|
|
35
35
|
};
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Optionally custom header icons could be passed as `fhirIcons` props
|
|
38
|
+
Optionally custom header icons could be passed as `fhirIcons` props in few different way:
|
|
39
|
+
|
|
40
|
+
1. As a URL
|
|
41
|
+
```jsx
|
|
42
|
+
const MyComponent = () => {
|
|
43
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
44
|
+
return (
|
|
45
|
+
<FhirResource
|
|
46
|
+
fhirResource={fhirResource}
|
|
47
|
+
fhirVersion={fhirVersions.R4}
|
|
48
|
+
fhirIcons="https://www.gravatar.com/avatar/?s=50&r=any&default=identicon&forcedefault=1"
|
|
49
|
+
withCarinBBProfile
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
````
|
|
54
|
+
2. As a ```<img>``` element
|
|
55
|
+
```jsx
|
|
56
|
+
const MyComponent = () => {
|
|
57
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
58
|
+
return (
|
|
59
|
+
<FhirResource
|
|
60
|
+
fhirResource={fhirResource}
|
|
61
|
+
fhirVersion={fhirVersions.R4}
|
|
62
|
+
fhirIcons={<img
|
|
63
|
+
src={require('./dstu2/resources/condition/condition.svg')}
|
|
64
|
+
alt="header icon"
|
|
65
|
+
/>}
|
|
66
|
+
withCarinBBProfile
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
````
|
|
71
|
+
|
|
72
|
+
3. As a React src from import
|
|
73
|
+
````jsx
|
|
74
|
+
import EncounterIcon from '../../../assets/containers/Encounter/encounter.svg';
|
|
75
|
+
|
|
76
|
+
const MyComponent = () => {
|
|
77
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
78
|
+
return (
|
|
79
|
+
<FhirResource
|
|
80
|
+
fhirResource={fhirResource}
|
|
81
|
+
fhirVersion={fhirVersions.R4}
|
|
82
|
+
fhirIcons={EncounterIcon}
|
|
83
|
+
withCarinBBProfile
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
````
|
|
88
|
+
or
|
|
89
|
+
````jsx
|
|
90
|
+
const MyComponent = () => {
|
|
91
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
92
|
+
return (
|
|
93
|
+
<FhirResource
|
|
94
|
+
fhirResource={fhirResource}
|
|
95
|
+
fhirVersion={fhirVersions.R4}
|
|
96
|
+
fhirIcons={require('./dstu2/resources/condition/condition.svg')}
|
|
97
|
+
withCarinBBProfile
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
````
|
|
102
|
+
|
|
103
|
+
4. As a ``false`` value to display the placeholder
|
|
104
|
+
````jsx
|
|
105
|
+
const MyComponent = () => {
|
|
106
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
107
|
+
return (
|
|
108
|
+
<FhirResource
|
|
109
|
+
fhirResource={fhirResource}
|
|
110
|
+
fhirVersion={fhirVersions.R4}
|
|
111
|
+
fhirIcons={false}
|
|
112
|
+
withCarinBBProfile
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
````
|
|
117
|
+
5. Without a `fhirIcons` props
|
|
118
|
+
The resource icon if it exists or a placeholder will be displayed.
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
6. As the resources object with resource type as the key and image URL or DOM node as the value
|
|
39
122
|
|
|
40
123
|
```jsx
|
|
41
124
|
import React from 'react';
|