fhir-react 0.3.1 → 0.3.2
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 +1 -1
- package/build/index.js +8 -8
- package/build/style.css +27 -239
- package/package.json +3 -2
- package/src/components/resources/Condition/Condition.js +2 -1
- package/src/components/resources/Immunization/Immunization.js +1 -1
- package/src/components/resources/Procedure/Procedure.js +1 -1
- package/src/components/resources/ResourceCategory/ResourceCategory.js +2 -3
- package/src/components/resources/ResourceCategory/ResourceCategory.test.js +1 -1
- package/src/components/supportedFhirResourceList.js +2 -0
- package/src/fixtures/example-icons.jsx +1 -1
- package/src/index.js +1 -0
- package/webpack.config.js +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fhir-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "React component library for displaying FHIR Resources ",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"md5": "^2.2.1",
|
|
18
18
|
"pretty-bytes": "^5.3.0",
|
|
19
19
|
"prop-types": "^15.7.2",
|
|
20
|
-
"react": "^17.0.1"
|
|
20
|
+
"react": "^17.0.1",
|
|
21
|
+
"svg-url-loader": "^7.1.1"
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
24
|
"test": "NODE_ENV=test jest",
|
|
@@ -101,7 +101,8 @@ function Condition(props) {
|
|
|
101
101
|
dateRecorded,
|
|
102
102
|
} = resourceDTO(fhirVersion, fhirResource);
|
|
103
103
|
|
|
104
|
-
const headerIcon = fhirIcons[_get(fhirResource, 'resourceType')];
|
|
104
|
+
const headerIcon = fhirIcons && fhirIcons[_get(fhirResource, 'resourceType')];
|
|
105
|
+
|
|
105
106
|
const tableData = [
|
|
106
107
|
{
|
|
107
108
|
label: 'Asserted by',
|
|
@@ -125,7 +125,7 @@ const Immunization = props => {
|
|
|
125
125
|
note,
|
|
126
126
|
} = resourceDTO(fhirVersion, fhirResource);
|
|
127
127
|
|
|
128
|
-
const headerIcon = fhirIcons[_get(fhirResource, 'resourceType')];
|
|
128
|
+
const headerIcon = fhirIcons && fhirIcons[_get(fhirResource, 'resourceType')];
|
|
129
129
|
const tableData = [
|
|
130
130
|
{
|
|
131
131
|
label: 'Manufacturer Text',
|
|
@@ -37,7 +37,7 @@ const Procedure = props => {
|
|
|
37
37
|
const note = _get(fhirResource, 'note', []);
|
|
38
38
|
const outcome = _get(fhirResource, 'outcome');
|
|
39
39
|
|
|
40
|
-
const headerIcon = fhirIcons[_get(fhirResource, 'resourceType')];
|
|
40
|
+
const headerIcon = fhirIcons && fhirIcons[_get(fhirResource, 'resourceType')];
|
|
41
41
|
const tableData = [
|
|
42
42
|
{
|
|
43
43
|
label: 'Identification',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Root, Title } from '../../ui';
|
|
2
|
-
import ChevronRight from '../../../assets/common/chevron-right.svg';
|
|
3
2
|
import HeaderIcon from '../../datatypes/HeaderIcon';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
@@ -13,7 +12,7 @@ const ResourceCategory = props => {
|
|
|
13
12
|
const getItemsCountLabel = () =>
|
|
14
13
|
`${parsedItemsCount} ${parsedItemsCount === 1 ? 'item' : 'items'}`;
|
|
15
14
|
|
|
16
|
-
const headerIcon = fhirIcons['
|
|
15
|
+
const headerIcon = fhirIcons && fhirIcons['ResourceCategory'];
|
|
17
16
|
const parsedItemsCount = parseNumber(itemsCount);
|
|
18
17
|
|
|
19
18
|
return (
|
|
@@ -38,7 +37,7 @@ const ResourceCategory = props => {
|
|
|
38
37
|
</div>
|
|
39
38
|
)}
|
|
40
39
|
<img
|
|
41
|
-
src={
|
|
40
|
+
src={require('../../../assets/common/chevron-right.svg')}
|
|
42
41
|
alt="chevron"
|
|
43
42
|
style={{ height: 28, width: 28 }}
|
|
44
43
|
/>
|
|
@@ -5,7 +5,7 @@ import fhirIcons from '../../../fixtures/example-icons';
|
|
|
5
5
|
import ResourceCategory from './ResourceCategory';
|
|
6
6
|
|
|
7
7
|
describe('should render ResourceCategory component properly', () => {
|
|
8
|
-
const placeholderResource = fhirIcons['
|
|
8
|
+
const placeholderResource = fhirIcons['ResourceCategory'].props;
|
|
9
9
|
|
|
10
10
|
it('should render ResourceCategory component with icon and itemsCount > 1 correctly', () => {
|
|
11
11
|
const defaultProps = {
|
|
@@ -37,6 +37,7 @@ import Questionnaire from './resources/Questionnaire';
|
|
|
37
37
|
import QuestionnaireResponse from './resources/QuestionnaireResponse';
|
|
38
38
|
import ReferralRequest from './resources/ReferralRequest';
|
|
39
39
|
import ResearchStudy from './resources/ResearchStudy';
|
|
40
|
+
import ResourceCategory from './resources/ResourceCategory';
|
|
40
41
|
|
|
41
42
|
export {
|
|
42
43
|
Appointment,
|
|
@@ -78,4 +79,5 @@ export {
|
|
|
78
79
|
QuestionnaireResponse,
|
|
79
80
|
ReferralRequest,
|
|
80
81
|
ResearchStudy,
|
|
82
|
+
ResourceCategory,
|
|
81
83
|
};
|
package/src/index.js
CHANGED
package/webpack.config.js
CHANGED
|
@@ -25,7 +25,7 @@ module.exports = {
|
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
test: /\.css$/,
|
|
28
|
+
test: /\.(css|scss)$/,
|
|
29
29
|
exclude: path.resolve(
|
|
30
30
|
__dirname,
|
|
31
31
|
'src/components/ui/bootstrap-reboot.min.css',
|
|
@@ -35,6 +35,15 @@ module.exports = {
|
|
|
35
35
|
loader: MiniCssExtractPlugin.loader,
|
|
36
36
|
},
|
|
37
37
|
'css-loader',
|
|
38
|
+
'sass-loader',
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
test: /\.svg$/,
|
|
43
|
+
use: [
|
|
44
|
+
{
|
|
45
|
+
loader: 'svg-url-loader',
|
|
46
|
+
},
|
|
38
47
|
],
|
|
39
48
|
},
|
|
40
49
|
],
|