fhir-react 0.3.13 → 1.0.1

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/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "fhir-react",
3
- "version": "0.3.13",
3
+ "version": "1.0.1",
4
4
  "description": "React component library for displaying FHIR Resources ",
5
5
  "main": "build/index.js",
6
6
  "peerDependencies": {
7
- "react": "^17.0.2"
7
+ "react": "^18.2.0"
8
8
  },
9
9
  "dependencies": {
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
+ "@storybook/addons": "^6.5.13",
14
14
  "bootstrap": "^5.1.3",
15
15
  "dompurify": "^2.3.6",
16
16
  "lodash": "^4.17.21",
@@ -18,7 +18,7 @@
18
18
  "md5": "^2.3.0",
19
19
  "pretty-bytes": "^5.6.0",
20
20
  "prop-types": "^15.8.1",
21
- "react": "^17.0.2",
21
+ "react": "^18.2.0",
22
22
  "svg-url-loader": "^7.1.1"
23
23
  },
24
24
  "scripts": {
@@ -58,7 +58,7 @@
58
58
  "material",
59
59
  "ui"
60
60
  ],
61
- "license": "CC-BY-NC-SA-4.0",
61
+ "license": "MIT",
62
62
  "devDependencies": {
63
63
  "@babel/cli": "^7.17.6",
64
64
  "@babel/core": "^7.17.5",
@@ -83,11 +83,11 @@
83
83
  "@babel/polyfill": "^7.0.0",
84
84
  "@babel/preset-env": "^7.16.11",
85
85
  "@babel/preset-react": "^7.16.7",
86
- "@storybook/addon-controls": "^6.4.22",
86
+ "@storybook/addon-controls": "^6.5.13",
87
87
  "@storybook/preset-scss": "^1.0.3",
88
- "@storybook/react": "^6.4.22",
89
- "@storybook/storybook-deployer": "^2.8.11",
90
- "@testing-library/react": "^12.1.4",
88
+ "@storybook/react": "^6.5.13",
89
+ "@storybook/storybook-deployer": "^2.8.16",
90
+ "@testing-library/react": "^13.4.0",
91
91
  "@typescript-eslint/eslint-plugin": "^5.14.0",
92
92
  "@typescript-eslint/parser": "^5.14.0",
93
93
  "babel-eslint": "^10.0.3",
@@ -108,9 +108,9 @@
108
108
  "eslint-plugin-react-hooks": "^4.3.0",
109
109
  "jest": "^24.9.0",
110
110
  "mini-css-extract-plugin": "^1.6.2",
111
- "npm-check-updates": "^12.5.2",
111
+ "npm-check-updates": "^16.7.9",
112
112
  "prettier": "1.19.1",
113
- "react-dom": "^17.0.2",
113
+ "react-dom": "^18.2.0",
114
114
  "sass": "^1.49.9",
115
115
  "sass-loader": "^10.2.0",
116
116
  "style-loader": "^2.0.0",
@@ -18,6 +18,7 @@ import {
18
18
  } from '../../ui';
19
19
  import Reference from '../../datatypes/Reference';
20
20
  import { getResourceDate } from '../../../utils/getResourceDate';
21
+ import Annotation from "../../datatypes/Annotation";
21
22
 
22
23
  const Observation = ({
23
24
  fhirResource,
@@ -50,6 +51,9 @@ const Observation = ({
50
51
  let valueQuantityValueNumber = valueQuantityValue;
51
52
 
52
53
  const subject = _get(fhirResource, 'subject');
54
+ const note = _get(fhirResource, 'note');
55
+ const hasNote = Array.isArray(note);
56
+
53
57
  const tableData = [
54
58
  {
55
59
  label: 'Issued on',
@@ -71,6 +75,12 @@ const Observation = ({
71
75
  )),
72
76
  status: !_isEmpty(valueCodeableConceptCoding),
73
77
  },
78
+ {
79
+ label: 'Notes',
80
+ testId: 'hasNote',
81
+ data: hasNote && <Annotation fhirData={note} />,
82
+ status: hasNote,
83
+ },
74
84
  ];
75
85
 
76
86
  const observationDatesPaths = [
@@ -132,6 +132,7 @@ describe('should render component correctly', () => {
132
132
  expect(getByTestId('issuedOn').textContent).toEqual('05/18/2016');
133
133
  expect(getByTestId('subject').textContent).toContain('Patient/infant');
134
134
  expect(queryByText(/373066001/g)).not.toBeNull();
135
+ expect(getByTestId('hasNote').textContent).toContain('Was exposed to second-hand smoke.');
135
136
  });
136
137
 
137
138
  test('should display not rounded value', () => {
@@ -46,5 +46,10 @@
46
46
  }
47
47
  ],
48
48
  "text": "YES"
49
- }
49
+ },
50
+ "note": [
51
+ {
52
+ "text": "Was exposed to second-hand smoke."
53
+ }
54
+ ]
50
55
  }