fhir-react 0.3.4 → 0.3.5
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/build/bootstrap-reboot.min.css +8 -2
- package/build/index.js +7 -7
- package/build/style.css +4 -5
- package/package.json +1 -1
- package/src/assets/containers/Binary/binary.svg +9 -0
- package/src/components/containers/Accordion/Accordion.js +10 -9
- package/src/components/datatypes/Annotation/Annotation.js +4 -4
- package/src/components/datatypes/CodeableConcept/CodeableConcept.css +4 -1
- package/src/components/datatypes/Coding/Coding.css +0 -1
- package/src/components/datatypes/Reference/Reference.css +3 -0
- package/src/components/datatypes/Reference/Reference.js +2 -0
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +87 -76
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +11 -1
- package/src/components/resources/Binary/Binary.js +31 -20
- package/src/components/resources/Binary/Binary.stories.js +6 -5
- package/src/components/resources/CarePlan/CarePlan.js +111 -96
- package/src/components/resources/CarePlan/CarePlan.test.js +2 -2
- package/src/components/resources/CarePlan/CarePlanActivity.js +6 -2
- package/src/components/resources/Device/Device.js +54 -34
- package/src/components/resources/DiagnosticReport/DiagnosticReport.js +53 -43
- package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +7 -1
- package/src/components/resources/DocumentReference/DocumentReference.js +101 -65
- package/src/components/resources/DocumentReference/DocumentReference.stories.js +4 -0
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +47 -38
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +4 -0
- package/src/components/resources/Goal/Goal.js +104 -85
- package/src/components/resources/Goal/Goal.stories.js +37 -7
- package/src/components/resources/Goal/Goal.test.js +1 -3
- package/src/components/resources/MedicationOrder/MedicationOrder.js +45 -28
- package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +2 -1
- package/src/components/resources/MedicationRequest/MedicationRequest.js +65 -43
- package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +16 -5
- package/src/components/resources/MedicationStatement/MedicationDetails.js +52 -0
- package/src/components/resources/MedicationStatement/MedicationDosage.js +46 -0
- package/src/components/resources/MedicationStatement/MedicationStatement.js +65 -118
- package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +6 -0
- package/src/components/resources/MedicationStatement/MedicationStatement.test.js +31 -6
- package/src/components/ui/bootstrap-reboot.min.css +8 -2
- package/src/components/ui/index.js +11 -0
- package/src/fixtures/example-icons.jsx +7 -0
- package/src/style.scss +1 -0
- package/src/utils/formatDate.js +6 -4
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.css +0 -4
- package/src/components/resources/CarePlan/CarePlan.css +0 -7
|
@@ -19,7 +19,7 @@ describe('should render MedicationStatement component correctly', () => {
|
|
|
19
19
|
expect(getByTestId('title').textContent).toContain(
|
|
20
20
|
'amphetamine-dextroamphetamine',
|
|
21
21
|
);
|
|
22
|
-
expect(getByTestId('
|
|
22
|
+
expect(getByTestId('startDate').textContent).toContain('4/19/2016');
|
|
23
23
|
expect(queryByTestId('medicationReference')).toBeNull();
|
|
24
24
|
|
|
25
25
|
expect(getByTestId('dosageInstruction').textContent).toContain(
|
|
@@ -32,19 +32,35 @@ describe('should render MedicationStatement component correctly', () => {
|
|
|
32
32
|
fhirResource: stu3Example,
|
|
33
33
|
fhirVersion: fhirVersions.STU3,
|
|
34
34
|
};
|
|
35
|
-
const { getByTestId, queryAllByTestId } = render(
|
|
35
|
+
const { getByTestId, queryAllByTestId, queryByTestId } = render(
|
|
36
36
|
<MedicationStatement {...defaultProps} />,
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
expect(getByTestId('title').textContent).toEqual('Medication Statement');
|
|
40
|
-
expect(queryAllByTestId('
|
|
40
|
+
expect(queryAllByTestId('startDate')).toHaveLength(0);
|
|
41
|
+
expect(queryAllByTestId('endDate')).toHaveLength(0);
|
|
41
42
|
|
|
42
43
|
expect(getByTestId('dosageInstruction').textContent).toContain(
|
|
43
44
|
'1-2 tablets once daily',
|
|
44
45
|
);
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
const ingredients = queryAllByTestId('ingredient-item').map(
|
|
48
|
+
x => x.textContent,
|
|
49
|
+
);
|
|
50
|
+
expect(ingredients).toHaveLength(2);
|
|
51
|
+
expect(ingredients).toEqual([
|
|
52
|
+
'Acetaminophen 500 MG',
|
|
53
|
+
'Diphenhydramine Hydrochloride 25 mg',
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
expect(getByTestId('dosageInstruction').textContent).toContain(
|
|
57
|
+
'1-2 tablets once daily at bedtime as needed for restless legs',
|
|
58
|
+
);
|
|
47
59
|
|
|
60
|
+
expect(queryByTestId('medicationReference').textContent).toContain(
|
|
61
|
+
'#med0309',
|
|
62
|
+
);
|
|
63
|
+
expect(getByTestId('hasNote').textContent).toContain('occasional');
|
|
48
64
|
expect(getByTestId('hasReasonCode').textContent).toContain('Legs');
|
|
49
65
|
});
|
|
50
66
|
|
|
@@ -58,14 +74,23 @@ describe('should render MedicationStatement component correctly', () => {
|
|
|
58
74
|
);
|
|
59
75
|
|
|
60
76
|
expect(getByTestId('title').textContent).toEqual('Medication Statement');
|
|
61
|
-
expect(queryAllByTestId('
|
|
77
|
+
expect(queryAllByTestId('startDate')).toHaveLength(0);
|
|
78
|
+
expect(queryAllByTestId('endDate')).toHaveLength(0);
|
|
62
79
|
|
|
63
80
|
expect(getByTestId('dosageInstruction').textContent).toContain(
|
|
64
81
|
'1-2 tablets once daily',
|
|
65
82
|
);
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
const ingredients = queryAllByTestId('ingredient-item').map(
|
|
85
|
+
x => x.textContent,
|
|
86
|
+
);
|
|
87
|
+
expect(ingredients).toHaveLength(2);
|
|
88
|
+
expect(ingredients).toEqual([
|
|
89
|
+
'Acetaminophen 500 MG',
|
|
90
|
+
'Diphenhydramine Hydrochloride 25 mg',
|
|
91
|
+
]);
|
|
68
92
|
|
|
93
|
+
expect(getByTestId('hasNote').textContent).toContain('occasional');
|
|
69
94
|
expect(getByTestId('hasReasonCode').textContent).toContain('Legs');
|
|
70
95
|
expect(getByTestId('medicationReference').textContent).toContain(
|
|
71
96
|
'#med0309',
|
|
@@ -173,8 +173,14 @@ sup {
|
|
|
173
173
|
.fhir-resource kbd,
|
|
174
174
|
.fhir-resource pre,
|
|
175
175
|
.fhir-resource samp {
|
|
176
|
-
font-family:
|
|
177
|
-
|
|
176
|
+
font-family:
|
|
177
|
+
SFMono-Regular,
|
|
178
|
+
Menlo,
|
|
179
|
+
Monaco,
|
|
180
|
+
Consolas,
|
|
181
|
+
'Liberation Mono',
|
|
182
|
+
'Courier New',
|
|
183
|
+
monospace;
|
|
178
184
|
font-size: 1em;
|
|
179
185
|
}
|
|
180
186
|
|
|
@@ -225,6 +225,17 @@ export const MissingValue = () => (
|
|
|
225
225
|
<span className="fhir-ui__MissingValue">-</span>
|
|
226
226
|
);
|
|
227
227
|
|
|
228
|
+
export const ValueSectionItem = props => {
|
|
229
|
+
return (
|
|
230
|
+
<div className="d-flex flex-column flex-sm-row my-2">
|
|
231
|
+
<div className="dataTable__value-label ps-0">
|
|
232
|
+
<Label>{props.label}</Label>
|
|
233
|
+
</div>
|
|
234
|
+
<Data data-testid={props['data-testid']}>{props.children}</Data>
|
|
235
|
+
</div>
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
|
|
228
239
|
export const NotEnoughData = props => (
|
|
229
240
|
<div data-testid={props['data-testid']} className="fhir-ui__NotEnoughData">
|
|
230
241
|
No additional data
|
package/src/style.scss
CHANGED
package/src/utils/formatDate.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export const formatDate = (date, locale) => {
|
|
2
2
|
const rawDate = new Date(date);
|
|
3
|
-
|
|
4
|
-
return usDate;
|
|
3
|
+
return rawDate.toLocaleDateString(locale, whichOptions(date));
|
|
5
4
|
};
|
|
6
5
|
|
|
7
6
|
const whichOptions = date => {
|
|
@@ -9,13 +8,16 @@ const whichOptions = date => {
|
|
|
9
8
|
const YEAR_MONTH_FORMAT = 'YYYY-MM';
|
|
10
9
|
|
|
11
10
|
if (date.length === YEAR_FORMAT.length) {
|
|
12
|
-
return { year: 'numeric' };
|
|
11
|
+
return { year: 'numeric', timeZone: 'UTC' };
|
|
13
12
|
}
|
|
14
13
|
if (date.length <= YEAR_MONTH_FORMAT.length) {
|
|
15
14
|
return {
|
|
16
15
|
year: 'numeric',
|
|
17
16
|
month: 'long',
|
|
17
|
+
timeZone: 'UTC',
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return {
|
|
21
|
+
timeZone: 'UTC',
|
|
22
|
+
};
|
|
21
23
|
};
|