fhir-react 0.2.4 → 0.3.3

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 (138) hide show
  1. package/.github/workflows/publish_npmjs.yml +20 -0
  2. package/.storybook/config.js +9 -3
  3. package/.storybook/presets.js +1 -0
  4. package/.storybook/preview-head.html +4 -0
  5. package/README.md +48 -4
  6. package/build/bootstrap-reboot.min.css +2 -22
  7. package/build/index.js +38 -3
  8. package/build/style.css +31 -459
  9. package/package.json +15 -5
  10. package/src/assets/common/chevron-right.svg +3 -0
  11. package/src/assets/containers/AllergyIntolerance/allergy-intolerance.svg +9 -0
  12. package/src/assets/containers/Appointment/appointment.svg +14 -0
  13. package/src/assets/containers/CarePlan/care-plan.svg +10 -0
  14. package/src/assets/containers/CareTeam/care-team.svg +10 -0
  15. package/src/assets/containers/Claim/claim.svg +6 -0
  16. package/src/assets/containers/ClaimResponse/claim-response.svg +7 -0
  17. package/src/assets/containers/Condition/condition.svg +11 -0
  18. package/src/assets/containers/Device/device.svg +8 -0
  19. package/src/assets/containers/DiagnosticReport/diagnostic-report.svg +14 -0
  20. package/src/assets/containers/DocumentReference/document-reference.svg +10 -0
  21. package/src/assets/containers/Encounter/encounter.svg +10 -0
  22. package/src/assets/containers/ExplanationOfBenefit/explanation-of-benefit.svg +3 -0
  23. package/src/assets/containers/FamilyMemberHistory/family-member-history.svg +7 -0
  24. package/src/assets/containers/Goal/goal.svg +11 -0
  25. package/src/assets/containers/Immunization/immunization.svg +7 -0
  26. package/src/assets/containers/List/list.svg +3 -0
  27. package/src/assets/containers/Location/location.svg +4 -0
  28. package/src/assets/containers/Medication/medication.svg +5 -0
  29. package/src/assets/containers/MedicationAdministration/medication-administration.svg +6 -0
  30. package/src/assets/containers/MedicationKnowledge/medication-knowledge.svg +11 -0
  31. package/src/assets/containers/MedicationStatement/medication-statement.svg +5 -0
  32. package/src/assets/containers/Observation/observation.svg +12 -0
  33. package/src/assets/containers/Practitioner/practitioner.svg +5 -0
  34. package/src/assets/containers/Procedure/procedure.svg +9 -0
  35. package/src/assets/containers/Questionnaire/questionnaire.svg +6 -0
  36. package/src/assets/containers/QuestionnaireResponse/questionnaire-response.svg +6 -0
  37. package/src/assets/containers/QustionnaireResponse/questionnaire-response.svg +6 -0
  38. package/src/assets/containers/ResearchStudy/research-study.svg +9 -0
  39. package/src/assets/containers/ResourceCategory/resource-placeholder.svg +3 -0
  40. package/src/components/containers/Accordion/Accordion.js +80 -0
  41. package/src/components/containers/Accordion/Accordion.stories.js +76 -0
  42. package/src/components/containers/Accordion/index.js +3 -0
  43. package/src/components/containers/ResourceContainer/ResourceContainer.css +0 -1
  44. package/src/components/containers/ResourceContainer/ResourceContainer.js +1 -1
  45. package/src/components/datatypes/AccountBalance/AccountBalance.js +33 -0
  46. package/src/components/datatypes/AccountBalance/index.js +3 -0
  47. package/src/components/datatypes/Annotation/Annotation.js +1 -1
  48. package/src/components/datatypes/Date/Date.js +14 -4
  49. package/src/components/datatypes/DatePeriod/DatePeriod.js +38 -0
  50. package/src/components/datatypes/DatePeriod/index.js +3 -0
  51. package/src/components/datatypes/HeaderIcon/HeaderIcon.js +31 -0
  52. package/src/components/datatypes/HeaderIcon/index.js +3 -0
  53. package/src/components/datatypes/HumanName/HumanName.js +6 -21
  54. package/src/components/datatypes/Reference/Reference.js +3 -6
  55. package/src/components/resources/AdverseEvent/AdverseEvent.test.js +2 -2
  56. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.test.js +4 -4
  57. package/src/components/resources/Appointment/Appointment.js +91 -65
  58. package/src/components/resources/Appointment/Appointment.test.js +3 -3
  59. package/src/components/resources/Bundle/Bundle.js +2 -2
  60. package/src/components/resources/Bundle/Bundle.stories.js +78 -12
  61. package/src/components/resources/Bundle/Bundle.test.js +3 -0
  62. package/src/components/resources/CarePlan/CarePlan.test.js +4 -4
  63. package/src/components/resources/CareTeam/CareTeam.js +13 -14
  64. package/src/components/resources/CareTeam/CareTeam.test.js +4 -4
  65. package/src/components/resources/Claim/Claim.test.js +6 -6
  66. package/src/components/resources/ClaimResponse/ClaimResponse.test.js +6 -6
  67. package/src/components/resources/Condition/Condition.js +64 -47
  68. package/src/components/resources/Condition/Condition.stories.js +41 -8
  69. package/src/components/resources/Condition/Condition.test.js +20 -14
  70. package/src/components/resources/DiagnosticReport/DiagnosticReport.test.js +5 -7
  71. package/src/components/resources/DocumentReference/DocumentReference.js +1 -1
  72. package/src/components/resources/DocumentReference/DocumentReference.test.js +3 -3
  73. package/src/components/resources/Encounter/Encounter.js +66 -36
  74. package/src/components/resources/Encounter/EncounterParticipants.js +2 -2
  75. package/src/components/resources/ExplanationOfBenefit/CareTeam.js +2 -2
  76. package/src/components/resources/ExplanationOfBenefit/Diagnosis.js +15 -5
  77. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +285 -203
  78. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +86 -64
  79. package/src/components/resources/ExplanationOfBenefit/Items.js +2 -2
  80. package/src/components/resources/ExplanationOfBenefit/PriceLabel.js +20 -0
  81. package/src/components/resources/ExplanationOfBenefit/Related.js +3 -3
  82. package/src/components/resources/ExplanationOfBenefit/SupportingInfo.js +32 -6
  83. package/src/components/resources/ExplanationOfBenefit/TotalGraph.js +68 -0
  84. package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.js +89 -0
  85. package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.stories.js +78 -0
  86. package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.test.js +51 -0
  87. package/src/components/resources/ExplanationOfBenefitGraph/index.js +3 -0
  88. package/src/components/resources/Goal/Goal.test.js +1 -1
  89. package/src/components/resources/Immunization/Immunization.js +125 -94
  90. package/src/components/resources/Immunization/Immunization.stories.js +23 -4
  91. package/src/components/resources/Immunization/Immunization.test.js +17 -12
  92. package/src/components/resources/List/List.test.js +3 -3
  93. package/src/components/resources/MedicationAdministration/MedicationAdministration.test.js +7 -7
  94. package/src/components/resources/MedicationDispense/MedicationDispense.test.js +2 -2
  95. package/src/components/resources/MedicationRequest/MedicationRequest.test.js +4 -4
  96. package/src/components/resources/Observation/Observation.js +72 -54
  97. package/src/components/resources/Observation/Observation.test.js +6 -18
  98. package/src/components/resources/Observation/ObservationGraph.js +159 -55
  99. package/src/components/resources/Observation/ObservationGraph.test.js +47 -26
  100. package/src/components/resources/Patient/Patient.js +77 -87
  101. package/src/components/resources/Patient/Patient.test.js +1 -1
  102. package/src/components/resources/Practitioner/Practitioner.js +80 -60
  103. package/src/components/resources/Practitioner/Practitioner.test.js +4 -4
  104. package/src/components/resources/Procedure/Procedure.js +99 -87
  105. package/src/components/resources/Procedure/Procedure.stories.js +8 -6
  106. package/src/components/resources/Procedure/Procedure.test.js +11 -8
  107. package/src/components/resources/Questionnaire/Questionnaire.test.js +3 -3
  108. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.test.js +5 -5
  109. package/src/components/resources/ReferralRequest/ReferralRequest.test.js +2 -2
  110. package/src/components/resources/ResearchStudy/ResearchStudy.test.js +1 -1
  111. package/src/components/resources/ResourceCategory/ResourceCategory.js +55 -0
  112. package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +29 -0
  113. package/src/components/resources/ResourceCategory/ResourceCategory.test.js +101 -0
  114. package/src/components/resources/ResourceCategory/index.js +3 -0
  115. package/src/components/supportedFhirResourceList.js +2 -0
  116. package/src/components/ui/_header.scss +3 -0
  117. package/src/components/ui/bootstrap-reboot.min.css +2 -22
  118. package/src/components/ui/index.js +191 -29
  119. package/src/constants/badge-status.jsx +98 -0
  120. package/src/fixtures/dstu2/resources/condition/condition.svg +35 -0
  121. package/src/fixtures/dstu2/resources/immunization/immunization.svg +10 -0
  122. package/src/fixtures/example-icons.jsx +169 -0
  123. package/src/fixtures/r4/resources/explanationOfBenefit/c4bbExample.json +18 -2
  124. package/src/index.js +7 -1
  125. package/src/style.scss +176 -0
  126. package/src/utils/formatDate.js +21 -0
  127. package/src/utils/formatDate.test.js +22 -0
  128. package/src/utils/getBadgeColor.js +6 -0
  129. package/src/utils/getBadgeColor.test.js +14 -0
  130. package/src/utils/isUrl.js +9 -0
  131. package/src/utils/isUrl.test.js +12 -0
  132. package/src/utils.js +7 -0
  133. package/webpack.config.js +10 -1
  134. package/src/components/datatypes/HumanName/HumanName.css +0 -15
  135. package/src/components/datatypes/Reference/Reference.css +0 -8
  136. package/src/components/resources/Observation/ObservationGraph.css +0 -51
  137. package/src/components/resources/Patient/Patient.css +0 -19
  138. package/src/components/ui/index.css +0 -123
@@ -1,23 +1,16 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import { Badge, Body, Header, Root } from '../../ui';
3
2
 
4
- import Reference from '../../datatypes/Reference';
3
+ import Accordion from '../../containers/Accordion';
4
+ import Annotation from '../../datatypes/Annotation';
5
5
  import Coding from '../../datatypes/Coding';
6
+ import Date from '../../datatypes/Date';
7
+ import PropTypes from 'prop-types';
8
+ import React from 'react';
9
+ import Reference from '../../datatypes/Reference';
6
10
  import _get from 'lodash/get';
7
11
  import _has from 'lodash/has';
8
- import Date from '../../datatypes/Date';
9
- import Annotation from '../../datatypes/Annotation';
10
12
  import fhirVersions from '../fhirResourceVersions';
11
-
12
- import {
13
- Root,
14
- Header,
15
- Title,
16
- Badge,
17
- BadgeSecondary,
18
- Body,
19
- Value,
20
- } from '../../ui';
13
+ import { Value } from '../../ui';
21
14
 
22
15
  const commonDTO = fhirResource => {
23
16
  const title =
@@ -111,13 +104,11 @@ const resourceDTO = (fhirVersion, fhirResource) => {
111
104
  };
112
105
 
113
106
  const Immunization = props => {
114
- const { fhirVersion, fhirResource } = props;
115
-
107
+ const { fhirVersion, fhirResource, fhirIcons } = props;
116
108
  const {
117
109
  title,
118
110
  status,
119
111
  providedDate,
120
- reported,
121
112
  manufacturerText,
122
113
  hasLotNumber,
123
114
  lotNumber,
@@ -134,84 +125,124 @@ const Immunization = props => {
134
125
  note,
135
126
  } = resourceDTO(fhirVersion, fhirResource);
136
127
 
128
+ const headerIcon = fhirIcons && fhirIcons[_get(fhirResource, 'resourceType')];
129
+ const tableData = [
130
+ {
131
+ label: 'Manufacturer Text',
132
+ testId: '',
133
+ data: manufacturerText,
134
+ status: manufacturerText,
135
+ },
136
+ {
137
+ label: 'Manufacturer Text',
138
+ testId: 'lotNumber',
139
+ data: (
140
+ <>
141
+ {lotNumber}
142
+ {lotNumberExpirationDate && (
143
+ <span>
144
+ {' '}
145
+ expires on{' '}
146
+ <Date
147
+ testId="lotNumberExpirationDate"
148
+ fhirData={lotNumberExpirationDate}
149
+ isBlack
150
+ />
151
+ </span>
152
+ )}
153
+ </>
154
+ ),
155
+ status: hasLotNumber,
156
+ },
157
+ {
158
+ label: 'Dosage',
159
+ testId: 'doseQuantity',
160
+ data:
161
+ doseQuantity &&
162
+ [
163
+ _get(doseQuantity, 'value'),
164
+ _get(doseQuantity, 'unit') || _get(doseQuantity, 'code'),
165
+ ].join(' '),
166
+ status: hasDoseQuantity,
167
+ },
168
+ {
169
+ label: 'Patient',
170
+ testId: 'patient',
171
+ data: patient && <Reference fhirData={patient} />,
172
+ status: patient,
173
+ },
174
+ {
175
+ label: 'Requester',
176
+ testId: 'requester',
177
+ data: requester && <Reference fhirData={requester} />,
178
+ status: requester,
179
+ },
180
+ {
181
+ label: 'Performer',
182
+ testId: 'performer',
183
+ data: performer && <Reference fhirData={performer} />,
184
+ status: performer,
185
+ },
186
+ {
187
+ label: 'Note',
188
+ testId: 'note',
189
+ data: note && <Annotation fhirData={note} />,
190
+ status: note,
191
+ },
192
+ {
193
+ label: 'Route',
194
+ testId: 'route',
195
+ data: hasRoute && route && (
196
+ <>
197
+ {route.map((coding, i) => {
198
+ return (
199
+ <div key={`item-${i}`}>
200
+ <Coding fhirData={coding} />
201
+ </div>
202
+ );
203
+ })}
204
+ </>
205
+ ),
206
+ status: hasRoute,
207
+ },
208
+ {
209
+ label: 'Site',
210
+ testId: 'site',
211
+ data: hasSite && site && (
212
+ <>
213
+ {site.map((coding, i) => {
214
+ return (
215
+ <div key={`item-${i}`}>
216
+ <Coding fhirData={coding} />
217
+ </div>
218
+ );
219
+ })}
220
+ </>
221
+ ),
222
+ status: hasSite,
223
+ },
224
+ ];
225
+
137
226
  return (
138
227
  <Root name="Immunization">
139
- <Header>
140
- <Title data-testid="title">{title}</Title>
141
- {status && <Badge data-testid="status">{status}</Badge>}
142
- {providedDate && (
143
- <BadgeSecondary data-testid="providedDate">
144
- provided on <Date fhirData={providedDate} />
145
- {reported || ''}
146
- </BadgeSecondary>
147
- )}
148
- </Header>
149
- <Body>
150
- {manufacturerText && (
151
- <Value label="Manufacturer Text">{manufacturerText}</Value>
152
- )}
153
- {hasLotNumber && (
154
- <Value label="Lot number" data-testid="lotNumber">
155
- {lotNumber}
156
- {lotNumberExpirationDate && (
157
- <span data-testid="lotNumberExpirationDate">
158
- {' '}
159
- expires on {lotNumberExpirationDate}
160
- </span>
161
- )}
162
- </Value>
163
- )}
164
- {hasDoseQuantity && (
165
- <Value label="Dosage" data-testid="doseQuantity">
166
- <div>
167
- {_get(doseQuantity, 'value')} &nbsp;
168
- {_get(doseQuantity, 'unit') || _get(doseQuantity, 'code')}
169
- </div>
170
- </Value>
171
- )}
172
- {patient && (
173
- <Value label="Patient" data-testid="patient">
174
- <Reference fhirData={patient} />
175
- </Value>
176
- )}
177
- {requester && (
178
- <Value label="Requester" data-testid="requester">
179
- <Reference fhirData={requester} />
180
- </Value>
181
- )}
182
- {performer && (
183
- <Value label="Performer" data-testid="performer">
184
- <Reference fhirData={performer} />
185
- </Value>
186
- )}
187
- {note && (
188
- <Value label="Note" data-testid="note">
189
- <Annotation fhirData={note} />
190
- </Value>
191
- )}
192
- {hasRoute && (
193
- <Value label="Route" data-testid="route">
194
- {route.map((coding, i) => {
195
- return (
196
- <div key={`item-${i}`}>
197
- <Coding fhirData={coding} />
198
- </div>
199
- );
200
- })}
201
- </Value>
202
- )}
203
- {hasSite && (
204
- <Value label="Site" data-testid="site">
205
- {site.map((coding, i) => {
206
- return (
207
- <div key={`item-${i}`}>
208
- <Coding fhirData={coding} />
209
- </div>
210
- );
211
- })}
212
- </Value>
213
- )}
214
- </Body>
228
+ <Accordion
229
+ headerContent={
230
+ <Header
231
+ resourceName="Immunization"
232
+ additionalContent={
233
+ providedDate && (
234
+ <Value label="Start date" data-testid="headerStartDate">
235
+ <Date fhirData={providedDate} isBlack />
236
+ </Value>
237
+ )
238
+ }
239
+ badges={status && <Badge data-testid="status">{status}</Badge>}
240
+ icon={headerIcon}
241
+ title={title}
242
+ />
243
+ }
244
+ bodyContent={<Body tableData={tableData} />}
245
+ />
215
246
  </Root>
216
247
  );
217
248
  };
@@ -10,6 +10,7 @@ import stu3Example from '../../../fixtures/stu3/resources/immunization/example1.
10
10
  import r4Example1 from '../../../fixtures/r4/resources/immunization/example1.json';
11
11
  import r4Example2 from '../../../fixtures/r4/resources/immunization/example2.json';
12
12
  import r4Example3 from '../../../fixtures/r4/resources/immunization/example3.json';
13
+ import fhirIcons from '../../../fixtures/example-icons';
13
14
 
14
15
  export default {
15
16
  title: 'Immunization',
@@ -21,6 +22,7 @@ export const DefaultVisualizationDSTU2 = () => {
21
22
  <Immunization
22
23
  fhirResource={fhirResource}
23
24
  fhirVersion={fhirVersions.DSTU2}
25
+ fhirIcons={fhirIcons}
24
26
  />
25
27
  );
26
28
  };
@@ -31,6 +33,7 @@ export const Example2OfDSTU2 = () => {
31
33
  <Immunization
32
34
  fhirResource={fhirResource}
33
35
  fhirVersion={fhirVersions.DSTU2}
36
+ fhirIcons={fhirIcons}
34
37
  />
35
38
  );
36
39
  };
@@ -38,25 +41,41 @@ export const Example2OfDSTU2 = () => {
38
41
  export const ExampleSTU3 = () => {
39
42
  const fhirResource = object('Resource', stu3Example);
40
43
  return (
41
- <Immunization fhirResource={fhirResource} fhirVersion={fhirVersions.STU3} />
44
+ <Immunization
45
+ fhirResource={fhirResource}
46
+ fhirVersion={fhirVersions.STU3}
47
+ fhirIcons={fhirIcons}
48
+ />
42
49
  );
43
50
  };
44
51
 
45
52
  export const Example1R4 = () => {
46
53
  const fhirResource = object('Resource', r4Example1);
47
54
  return (
48
- <Immunization fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />
55
+ <Immunization
56
+ fhirResource={fhirResource}
57
+ fhirVersion={fhirVersions.R4}
58
+ fhirIcons={fhirIcons}
59
+ />
49
60
  );
50
61
  };
51
62
  export const Example2R4 = () => {
52
63
  const fhirResource = object('Resource', r4Example2);
53
64
  return (
54
- <Immunization fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />
65
+ <Immunization
66
+ fhirResource={fhirResource}
67
+ fhirVersion={fhirVersions.R4}
68
+ fhirIcons={fhirIcons}
69
+ />
55
70
  );
56
71
  };
57
72
  export const Example3R4 = () => {
58
73
  const fhirResource = object('Resource', r4Example3);
59
74
  return (
60
- <Immunization fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />
75
+ <Immunization
76
+ fhirResource={fhirResource}
77
+ fhirVersion={fhirVersions.R4}
78
+ fhirIcons={fhirIcons}
79
+ />
61
80
  );
62
81
  };
@@ -1,18 +1,20 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
-
4
- import fhirVersions from '../fhirResourceVersions';
5
1
  import Immunization from './Immunization';
2
+ import React from 'react';
6
3
  import dstu2Example from '../../../fixtures/dstu2/resources/immunization/example1.json';
7
- import stu3Example from '../../../fixtures/stu3/resources/immunization/example1.json';
4
+ import fhirVersions from '../fhirResourceVersions';
8
5
  import r4Example1 from '../../../fixtures/r4/resources/immunization/example1.json';
9
6
  import r4Example2 from '../../../fixtures/r4/resources/immunization/example2.json';
7
+ import { render } from '@testing-library/react';
8
+ import stu3Example from '../../../fixtures/stu3/resources/immunization/example1.json';
9
+
10
+ import fhirIcons from '../../../fixtures/example-icons';
10
11
 
11
12
  describe('should render Immunization component properly', () => {
12
13
  it('should render with DSTU2 source data', () => {
13
14
  const defaultProps = {
14
15
  fhirResource: dstu2Example,
15
16
  fhirVersion: fhirVersions.DSTU2,
17
+ fhirIcons: fhirIcons,
16
18
  };
17
19
 
18
20
  const { container, getByTestId } = render(
@@ -23,11 +25,11 @@ describe('should render Immunization component properly', () => {
23
25
 
24
26
  expect(getByTestId('title').textContent).toContain('Fluvax');
25
27
 
26
- expect(getByTestId('providedDate').textContent).toContain('on 2013-01-10');
28
+ expect(getByTestId('providedDate').textContent).toContain('1/10/2013');
27
29
 
28
30
  expect(getByTestId('lotNumber').textContent).toContain('AAJN11K');
29
31
  expect(getByTestId('lotNumberExpirationDate').textContent).toContain(
30
- '2015-02-15',
32
+ '2/15/2015',
31
33
  );
32
34
 
33
35
  expect(getByTestId('doseQuantity').textContent).toContain('5');
@@ -53,6 +55,7 @@ describe('should render Immunization component properly', () => {
53
55
  const defaultProps = {
54
56
  fhirResource: stu3Example,
55
57
  fhirVersion: fhirVersions.STU3,
58
+ fhirIcons: fhirIcons,
56
59
  };
57
60
 
58
61
  const { container, getByTestId } = render(
@@ -63,11 +66,11 @@ describe('should render Immunization component properly', () => {
63
66
 
64
67
  expect(getByTestId('title').textContent).toContain('Fluvax');
65
68
 
66
- expect(getByTestId('providedDate').textContent).toContain('on 2013-01-10');
69
+ expect(getByTestId('providedDate').textContent).toContain('1/10/2013');
67
70
 
68
71
  expect(getByTestId('lotNumber').textContent).toContain('AAJN11K');
69
72
  expect(getByTestId('lotNumberExpirationDate').textContent).toContain(
70
- '2015-02-15',
73
+ '2/15/2015',
71
74
  );
72
75
 
73
76
  expect(getByTestId('doseQuantity').textContent).toContain('5');
@@ -87,6 +90,7 @@ describe('should render Immunization component properly', () => {
87
90
  const defaultProps = {
88
91
  fhirResource: r4Example1,
89
92
  fhirVersion: fhirVersions.R4,
93
+ fhirIcons: fhirIcons,
90
94
  };
91
95
 
92
96
  const { container, getByTestId } = render(
@@ -97,11 +101,11 @@ describe('should render Immunization component properly', () => {
97
101
 
98
102
  expect(getByTestId('title').textContent).toContain('Fluvax');
99
103
 
100
- expect(getByTestId('providedDate').textContent).toContain('on 2013-01-10');
104
+ expect(getByTestId('providedDate').textContent).toContain('1/10/2013');
101
105
 
102
106
  expect(getByTestId('lotNumber').textContent).toContain('AAJN11K');
103
107
  expect(getByTestId('lotNumberExpirationDate').textContent).toContain(
104
- '2015-02-15',
108
+ '2/15/2015',
105
109
  );
106
110
 
107
111
  expect(getByTestId('doseQuantity').textContent).toContain('5');
@@ -121,6 +125,7 @@ describe('should render Immunization component properly', () => {
121
125
  const defaultProps = {
122
126
  fhirResource: r4Example2,
123
127
  fhirVersion: fhirVersions.R4,
128
+ fhirIcons: fhirIcons,
124
129
  };
125
130
 
126
131
  const { container, getByTestId, queryByTestId } = render(
@@ -131,7 +136,7 @@ describe('should render Immunization component properly', () => {
131
136
 
132
137
  expect(getByTestId('title').textContent).toContain('DTP');
133
138
 
134
- expect(getByTestId('providedDate').textContent).toContain('on 2013-01-10');
139
+ expect(getByTestId('providedDate').textContent).toContain('1/10/2013');
135
140
 
136
141
  expect(getByTestId('patient').textContent).toEqual('Patient/example');
137
142
 
@@ -25,7 +25,7 @@ describe('should render List component properly', () => {
25
25
  expect(getByTestId('identifier').textContent).toContain('23974652');
26
26
  expect(getByTestId('mode').textContent).toContain('changes');
27
27
  expect(getByTestId('subject').textContent).toContain('Patient/example');
28
- expect(getByTestId('date').textContent).toContain('2012-11-25');
28
+ expect(getByTestId('date').textContent).toContain('11/25/2012');
29
29
  expect(queryByTestId('code')).toBeNull();
30
30
  expect(getByTestId('source').textContent).toContain('Patient/example');
31
31
  expect(getByTestId('entries')).not.toBeNull();
@@ -45,7 +45,7 @@ describe('should render List component properly', () => {
45
45
 
46
46
  expect(getByTestId('identifier').textContent).toContain('test');
47
47
  expect(getByTestId('mode').textContent).toContain('snapshot');
48
- expect(getByTestId('date').textContent).toContain('2015-06-12');
48
+ expect(getByTestId('date').textContent).toContain('6/12/20');
49
49
  expect(getByTestId('entries')).not.toBeNull();
50
50
  expect(queryByTestId('usdfExtensions')).toBeNull();
51
51
  });
@@ -64,7 +64,7 @@ describe('should render List component properly', () => {
64
64
 
65
65
  expect(getByTestId('identifier').textContent).toContain('test');
66
66
  expect(getByTestId('mode').textContent).toContain('snapshot');
67
- expect(getByTestId('date').textContent).toContain('2015-06-12');
67
+ expect(getByTestId('date').textContent).toContain('6/12/2015');
68
68
  expect(getByTestId('entries')).not.toBeNull();
69
69
 
70
70
  expect(queryByTestId('usdfExtensions')).not.toBeNull();
@@ -30,9 +30,9 @@ describe('should render MedicationAdministration component properly', () => {
30
30
  'Practitioner/example',
31
31
  );
32
32
 
33
- expect(getByTestId('periodTimeStart').textContent).toEqual('2015-01-15');
33
+ expect(getByTestId('periodTimeStart').textContent).toEqual('1/15/2015');
34
34
 
35
- expect(getByTestId('periodTimeEnd').textContent).toEqual('2015-01-15');
35
+ expect(getByTestId('periodTimeEnd').textContent).toEqual('1/15/2015');
36
36
 
37
37
  expect(getByTestId('dosageRoute').textContent).toContain(
38
38
  'Intravenous route',
@@ -58,7 +58,7 @@ describe('should render MedicationAdministration component properly', () => {
58
58
 
59
59
  expect(getByTestId('practitioner').textContent).toContain('Patrick Pump');
60
60
 
61
- expect(getByTestId('periodTimeStart').textContent).toEqual('2015-01-15');
61
+ expect(getByTestId('periodTimeStart').textContent).toEqual('1/15/2015');
62
62
 
63
63
  expect(getByTestId('periodTimeEnd').textContent).toEqual('-');
64
64
 
@@ -83,8 +83,8 @@ describe('should render MedicationAdministration component properly', () => {
83
83
  expect(getByTestId('status').textContent).toContain('on-hold');
84
84
  expect(getByTestId('patient').textContent).toContain('Donald Duck');
85
85
  expect(queryByTestId('practitioner')).toBeNull();
86
- expect(getByTestId('periodTimeStart').textContent).toEqual('2015-01-15');
87
- expect(getByTestId('periodTimeEnd').textContent).toEqual('2015-01-15');
86
+ expect(getByTestId('periodTimeStart').textContent).toEqual('1/15/2015');
87
+ expect(getByTestId('periodTimeEnd').textContent).toEqual('1/15/2015');
88
88
  expect(getByTestId('dosageRoute').textContent).toContain('-');
89
89
  expect(getByTestId('dosageQuantity').textContent).toEqual('-');
90
90
  });
@@ -103,8 +103,8 @@ describe('should render MedicationAdministration component properly', () => {
103
103
  expect(getByTestId('status').textContent).toContain('completed');
104
104
  expect(getByTestId('patient').textContent).toContain('Donald Duck');
105
105
  expect(getByTestId('practitioner').textContent).toContain('Patrick Pump');
106
- expect(getByTestId('periodTimeStart').textContent).toEqual('2015-01-15');
107
- expect(getByTestId('periodTimeEnd').textContent).toEqual('2015-01-15');
106
+ expect(getByTestId('periodTimeStart').textContent).toEqual('1/15/2015');
107
+ expect(getByTestId('periodTimeEnd').textContent).toEqual('1/15/2015');
108
108
  expect(getByTestId('dosageRoute').textContent).toContain('Oral Route');
109
109
  expect(getByTestId('dosageQuantity').textContent).toEqual('2 TAB');
110
110
  });
@@ -21,7 +21,7 @@ describe('should render Device component properly', () => {
21
21
 
22
22
  expect(getByTestId('title').textContent).toEqual('prescribed medication');
23
23
  expect(getByTestId('typeCoding').textContent).toContain('Part Fill');
24
- expect(getByTestId('whenPrepared').textContent).toContain('2015-03-01');
24
+ expect(getByTestId('whenPrepared').textContent).toContain('3/1/2015');
25
25
  expect(getByTestId('hasDosageInstruction').textContent).toContain(
26
26
  'or after food',
27
27
  );
@@ -60,7 +60,7 @@ describe('should render Device component properly', () => {
60
60
  expect(container).not.toBeNull();
61
61
 
62
62
  expect(getByTestId('title').textContent).toContain('Novolog 100u/ml');
63
- expect(getByTestId('whenPrepared').textContent).toEqual('2015-01-15');
63
+ expect(getByTestId('whenPrepared').textContent).toEqual('1/15/2015');
64
64
  expect(
65
65
  within(getByTestId('hasDosageInstruction'))
66
66
  .queryAllByTestId('dosageTiming')
@@ -28,7 +28,7 @@ describe('should render MedicationRequest component properly', () => {
28
28
  'Take one tablet',
29
29
  );
30
30
  expect(getByTestId('requester').textContent).toContain('Patrick Pump');
31
- expect(getByTestId('created').textContent).toEqual('2015-03-01');
31
+ expect(getByTestId('created').textContent).toEqual('3/1/2015');
32
32
  expect(getByTestId('intent').textContent).toEqual('order');
33
33
  });
34
34
  it('should render with STU3 source data in which medicationReference key does not exist', () => {
@@ -59,7 +59,7 @@ describe('should render MedicationRequest component properly', () => {
59
59
  'Take one tablet',
60
60
  );
61
61
  expect(getByTestId('requester').textContent).toContain('Patrick Pump');
62
- expect(getByTestId('created').textContent).toEqual('2015-03-01');
62
+ expect(getByTestId('created').textContent).toEqual('3/1/2015');
63
63
  expect(getByTestId('intent').textContent).toEqual('order');
64
64
  });
65
65
 
@@ -79,7 +79,7 @@ describe('should render MedicationRequest component properly', () => {
79
79
  'Take 4 tablets daily',
80
80
  );
81
81
  expect(getByTestId('requester').textContent).toContain('Patrick Pump');
82
- expect(getByTestId('created').textContent).toEqual('2015-01-15');
82
+ expect(getByTestId('created').textContent).toEqual('1/15/2015');
83
83
  expect(getByTestId('intent').textContent).toEqual('order');
84
84
  });
85
85
 
@@ -101,7 +101,7 @@ describe('should render MedicationRequest component properly', () => {
101
101
  '6 mg PO daily for remission',
102
102
  );
103
103
  expect(getByTestId('requester').textContent).toContain('Patrick Pump');
104
- expect(getByTestId('created').textContent).toEqual('2015-01-15');
104
+ expect(getByTestId('created').textContent).toEqual('1/15/2015');
105
105
  expect(getByTestId('intent').textContent).toEqual('order');
106
106
  });
107
107
  });