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.
Files changed (44) hide show
  1. package/build/bootstrap-reboot.min.css +8 -2
  2. package/build/index.js +7 -7
  3. package/build/style.css +4 -5
  4. package/package.json +1 -1
  5. package/src/assets/containers/Binary/binary.svg +9 -0
  6. package/src/components/containers/Accordion/Accordion.js +10 -9
  7. package/src/components/datatypes/Annotation/Annotation.js +4 -4
  8. package/src/components/datatypes/CodeableConcept/CodeableConcept.css +4 -1
  9. package/src/components/datatypes/Coding/Coding.css +0 -1
  10. package/src/components/datatypes/Reference/Reference.css +3 -0
  11. package/src/components/datatypes/Reference/Reference.js +2 -0
  12. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +87 -76
  13. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +11 -1
  14. package/src/components/resources/Binary/Binary.js +31 -20
  15. package/src/components/resources/Binary/Binary.stories.js +6 -5
  16. package/src/components/resources/CarePlan/CarePlan.js +111 -96
  17. package/src/components/resources/CarePlan/CarePlan.test.js +2 -2
  18. package/src/components/resources/CarePlan/CarePlanActivity.js +6 -2
  19. package/src/components/resources/Device/Device.js +54 -34
  20. package/src/components/resources/DiagnosticReport/DiagnosticReport.js +53 -43
  21. package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +7 -1
  22. package/src/components/resources/DocumentReference/DocumentReference.js +101 -65
  23. package/src/components/resources/DocumentReference/DocumentReference.stories.js +4 -0
  24. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +47 -38
  25. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +4 -0
  26. package/src/components/resources/Goal/Goal.js +104 -85
  27. package/src/components/resources/Goal/Goal.stories.js +37 -7
  28. package/src/components/resources/Goal/Goal.test.js +1 -3
  29. package/src/components/resources/MedicationOrder/MedicationOrder.js +45 -28
  30. package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +2 -1
  31. package/src/components/resources/MedicationRequest/MedicationRequest.js +65 -43
  32. package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +16 -5
  33. package/src/components/resources/MedicationStatement/MedicationDetails.js +52 -0
  34. package/src/components/resources/MedicationStatement/MedicationDosage.js +46 -0
  35. package/src/components/resources/MedicationStatement/MedicationStatement.js +65 -118
  36. package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +6 -0
  37. package/src/components/resources/MedicationStatement/MedicationStatement.test.js +31 -6
  38. package/src/components/ui/bootstrap-reboot.min.css +8 -2
  39. package/src/components/ui/index.js +11 -0
  40. package/src/fixtures/example-icons.jsx +7 -0
  41. package/src/style.scss +1 -0
  42. package/src/utils/formatDate.js +6 -4
  43. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.css +0 -4
  44. 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('hasEffectivePeriod').textContent).toContain('from');
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('hasEffectivePeriod')).toHaveLength(0);
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
- expect(getByTestId('hasNote').textContent).toContain('occasional');
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('hasEffectivePeriod')).toHaveLength(0);
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
- expect(getByTestId('hasNote').textContent).toContain('occasional');
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: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
177
- 'Courier New', monospace;
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
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
 
3
3
  export default {
4
+ Binary: (
5
+ <img
6
+ className="header-icon__image"
7
+ src={require('../assets/containers/Binary/binary.svg')}
8
+ alt="binary"
9
+ />
10
+ ),
4
11
  Condition: (
5
12
  <img
6
13
  className="header-icon__image"
package/src/style.scss CHANGED
@@ -86,6 +86,7 @@ $enable-negative-margins: true;
86
86
  width: auto;
87
87
  @include media-breakpoint-up(sm) {
88
88
  width: 130px;
89
+ min-width: 130px;
89
90
  }
90
91
  }
91
92
 
@@ -1,7 +1,6 @@
1
1
  export const formatDate = (date, locale) => {
2
2
  const rawDate = new Date(date);
3
- const usDate = rawDate.toLocaleDateString(locale, whichOptions(date));
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
  };
@@ -1,4 +0,0 @@
1
- .fhir-resource__AllergyIntolerance__grouping {
2
- display: flex;
3
- align-items: center;
4
- }
@@ -1,7 +0,0 @@
1
- .fhir-resource__CarePlan__activity {
2
- margin-bottom: 0.5rem;
3
- }
4
-
5
- .fhir-resource__CarePlan__activity-title {
6
- font-weight: bold;
7
- }