fhir-react 0.3.1 → 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/README.md +85 -2
- package/build/bootstrap-reboot.min.css +8 -2
- package/build/index.js +7 -14
- package/build/style.css +26 -239
- package/package.json +3 -2
- package/src/assets/containers/Binary/binary.svg +9 -0
- package/src/assets/containers/Patient/patient.svg +6 -0
- package/src/components/containers/Accordion/Accordion.js +17 -12
- 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/HeaderIcon/HeaderIcon.js +67 -22
- 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/Appointment/Appointment.js +3 -3
- package/src/components/resources/Appointment/Appointment.stories.js +28 -5
- package/src/components/resources/Appointment/Appointment.test.js +72 -0
- 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/Condition/Condition.js +1 -2
- package/src/components/resources/Condition/Condition.stories.js +9 -19
- package/src/components/resources/Condition/Condition.test.js +71 -1
- 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/Encounter/Encounter.js +3 -4
- package/src/components/resources/Encounter/Encounter.stories.js +27 -5
- package/src/components/resources/Encounter/Encounter.test.js +72 -0
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +26 -10
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +8 -0
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +80 -3
- package/src/components/resources/ExplanationOfBenefit/SupportingInfo.js +21 -6
- 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/Immunization/Immunization.js +1 -2
- package/src/components/resources/Immunization/Immunization.stories.js +6 -9
- package/src/components/resources/Immunization/Immunization.test.js +71 -1
- 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/resources/Observation/Observation.js +3 -3
- package/src/components/resources/Observation/Observation.stories.js +14 -5
- package/src/components/resources/Observation/Observation.test.js +67 -0
- package/src/components/resources/Patient/Patient.js +9 -6
- package/src/components/resources/Patient/Patient.stories.js +12 -5
- package/src/components/resources/Patient/Patient.test.js +67 -0
- package/src/components/resources/Practitioner/Practitioner.js +3 -13
- package/src/components/resources/Practitioner/Practitioner.stories.js +19 -3
- package/src/components/resources/Practitioner/Practitioner.test.js +72 -0
- package/src/components/resources/Procedure/Procedure.js +1 -2
- package/src/components/resources/Procedure/Procedure.stories.js +11 -5
- package/src/components/resources/Procedure/Procedure.test.js +71 -1
- package/src/components/resources/ResourceCategory/ResourceCategory.js +6 -3
- package/src/components/resources/ResourceCategory/ResourceCategory.test.js +1 -1
- package/src/components/supportedFhirResourceList.js +2 -0
- package/src/components/ui/bootstrap-reboot.min.css +8 -2
- package/src/components/ui/index.js +44 -25
- package/src/fixtures/example-icons.jsx +55 -10
- package/src/fixtures/r4/resources/explanationOfBenefit/c4bbExample.json +18 -2
- package/src/index.js +1 -0
- package/src/style.scss +1 -0
- package/src/utils/convertCamelCaseToSentence.js +9 -0
- package/src/utils/convertCamelCaseToSentence.test.js +9 -0
- package/src/utils/formatDate.js +6 -4
- package/webpack.config.js +10 -1
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.css +0 -4
- package/src/components/resources/CarePlan/CarePlan.css +0 -7
|
@@ -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
|
};
|
|
@@ -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
|
|
|
@@ -3,62 +3,70 @@ import React from 'react';
|
|
|
3
3
|
import { getBadgeColor } from '../../utils/getBadgeColor';
|
|
4
4
|
import HeaderIcon from '../datatypes/HeaderIcon';
|
|
5
5
|
|
|
6
|
-
export const Header =
|
|
6
|
+
export const Header = ({
|
|
7
|
+
resourceName,
|
|
8
|
+
isAccordionOpenable,
|
|
9
|
+
icon,
|
|
10
|
+
titleTestID,
|
|
11
|
+
title,
|
|
12
|
+
prefixBadge,
|
|
13
|
+
badges,
|
|
14
|
+
additionalBadge,
|
|
15
|
+
additionalContent,
|
|
16
|
+
rightAdditionalContent,
|
|
17
|
+
children,
|
|
18
|
+
}) => {
|
|
7
19
|
const rightItemsClass = 'align-items-center flex-fill d-flex';
|
|
8
20
|
|
|
9
21
|
return (
|
|
10
22
|
<>
|
|
11
23
|
{// This condition was left due to fact, that to much changes in Header will generate many errors in tests. This condition will be removed after all changes have been made.
|
|
12
|
-
|
|
24
|
+
children || (
|
|
13
25
|
<div
|
|
14
|
-
className={`fhir-ui__${
|
|
26
|
+
className={`fhir-ui__${resourceName}-Header w-100 p-4 position-relative`}
|
|
15
27
|
>
|
|
16
28
|
<div
|
|
17
|
-
className={`fhir-ui__${
|
|
18
|
-
|
|
29
|
+
className={`fhir-ui__${resourceName}-Header__title-data ${
|
|
30
|
+
isAccordionOpenable ? 'header__title-row' : ''
|
|
19
31
|
} d-flex w-100 flex-column flex-sm-row`}
|
|
20
32
|
>
|
|
21
33
|
<div className="d-flex">
|
|
22
34
|
<div
|
|
23
|
-
className={`fhir-ui__${
|
|
35
|
+
className={`fhir-ui__${resourceName}-Header__icon d-flex align-items-center flex-shrink-1 m-half me-2`}
|
|
24
36
|
>
|
|
25
|
-
<HeaderIcon headerIcon={
|
|
37
|
+
<HeaderIcon headerIcon={icon} resourceName={resourceName} />
|
|
26
38
|
</div>
|
|
27
39
|
<div
|
|
28
|
-
className={`fhir-ui__${
|
|
40
|
+
className={`fhir-ui__${resourceName}-Header__title flex-fill text-start`}
|
|
29
41
|
>
|
|
30
|
-
<Title data-testid={
|
|
31
|
-
{
|
|
42
|
+
<Title data-testid={titleTestID || 'title'}>
|
|
43
|
+
{title || ''}
|
|
32
44
|
</Title>
|
|
33
45
|
</div>
|
|
34
46
|
</div>
|
|
35
47
|
|
|
36
48
|
<div
|
|
37
|
-
className={`fhir-ui__${
|
|
49
|
+
className={`fhir-ui__${resourceName}-Header__badges ps-1 ps-sm-2 mt-3 mt-sm-0 badges-max-width-sm flex-wrap flex-sm-nowrap justify-content-between justify-content-sm-end ${rightItemsClass}`}
|
|
38
50
|
>
|
|
39
|
-
{
|
|
40
|
-
<div className="me-3">{props.prefixBadge}</div>
|
|
41
|
-
)}
|
|
51
|
+
{prefixBadge && <div className="me-3">{prefixBadge}</div>}
|
|
42
52
|
<div className="d-flex">
|
|
43
|
-
{
|
|
44
|
-
{
|
|
45
|
-
<div className="ms-3">{
|
|
53
|
+
{badges}
|
|
54
|
+
{additionalBadge && (
|
|
55
|
+
<div className="ms-3">{additionalBadge}</div>
|
|
46
56
|
)}
|
|
47
57
|
</div>
|
|
48
58
|
</div>
|
|
49
59
|
</div>
|
|
50
60
|
<div
|
|
51
|
-
className={`fhir-ui__${
|
|
52
|
-
|
|
53
|
-
}-Header__additional-content w-100 justify-content-start d-flex ${
|
|
54
|
-
props.additionalContent ? ' pt-2' : ''
|
|
61
|
+
className={`fhir-ui__${resourceName}-Header__additional-content w-100 justify-content-start d-flex ${
|
|
62
|
+
additionalContent ? ' pt-2' : ''
|
|
55
63
|
}`}
|
|
56
64
|
>
|
|
57
|
-
{
|
|
65
|
+
{additionalContent}
|
|
58
66
|
<div
|
|
59
|
-
className={`fhir-ui__${
|
|
67
|
+
className={`fhir-ui__${resourceName}-Header__rightAdditionalContent justify-content-end ${rightItemsClass}`}
|
|
60
68
|
>
|
|
61
|
-
{
|
|
69
|
+
{rightAdditionalContent}
|
|
62
70
|
</div>
|
|
63
71
|
</div>
|
|
64
72
|
</div>
|
|
@@ -213,10 +221,21 @@ export const ValueSection = props => (
|
|
|
213
221
|
</div>
|
|
214
222
|
);
|
|
215
223
|
|
|
216
|
-
export const MissingValue =
|
|
224
|
+
export const MissingValue = () => (
|
|
217
225
|
<span className="fhir-ui__MissingValue">-</span>
|
|
218
226
|
);
|
|
219
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
|
+
|
|
220
239
|
export const NotEnoughData = props => (
|
|
221
240
|
<div data-testid={props['data-testid']} className="fhir-ui__NotEnoughData">
|
|
222
241
|
No additional data
|
|
@@ -1,169 +1,214 @@
|
|
|
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
|
|
13
|
+
className="header-icon__image"
|
|
6
14
|
src={require('../assets/containers/Condition/condition.svg')}
|
|
7
|
-
alt="
|
|
15
|
+
alt="condition"
|
|
8
16
|
/>
|
|
9
17
|
),
|
|
10
18
|
Immunization: (
|
|
11
19
|
<img
|
|
20
|
+
className="header-icon__image"
|
|
12
21
|
src={require('../assets/containers/Immunization/immunization.svg')}
|
|
13
|
-
alt="
|
|
22
|
+
alt="immunization"
|
|
14
23
|
/>
|
|
15
24
|
),
|
|
16
25
|
Procedure: (
|
|
17
26
|
<img
|
|
27
|
+
className="header-icon__image"
|
|
18
28
|
src={require('../assets/containers/Procedure/procedure.svg')}
|
|
19
|
-
alt="
|
|
29
|
+
alt="procedure"
|
|
20
30
|
/>
|
|
21
31
|
),
|
|
22
32
|
Practitioner: (
|
|
23
33
|
<img
|
|
34
|
+
className="header-icon__image"
|
|
24
35
|
src={require('../assets/containers/Practitioner/practitioner.svg')}
|
|
25
|
-
alt="
|
|
36
|
+
alt="practitioner"
|
|
26
37
|
/>
|
|
27
38
|
),
|
|
28
39
|
AllergyIntolerance: (
|
|
29
40
|
<img
|
|
41
|
+
className="header-icon__image"
|
|
30
42
|
src={require('../assets/containers/AllergyIntolerance/allergy-intolerance.svg')}
|
|
31
43
|
alt="sneezing emoji"
|
|
32
44
|
/>
|
|
33
45
|
),
|
|
34
46
|
Appointment: (
|
|
35
47
|
<img
|
|
48
|
+
className="header-icon__image"
|
|
36
49
|
src={require('../assets/containers/Appointment/appointment.svg')}
|
|
37
|
-
alt="
|
|
50
|
+
alt="appointment"
|
|
38
51
|
/>
|
|
39
52
|
),
|
|
40
53
|
CarePlan: (
|
|
41
54
|
<img
|
|
55
|
+
className="header-icon__image"
|
|
42
56
|
src={require('../assets/containers/CarePlan/care-plan.svg')}
|
|
43
57
|
alt="note with a heart"
|
|
44
58
|
/>
|
|
45
59
|
),
|
|
46
60
|
CareTeam: (
|
|
47
61
|
<img
|
|
62
|
+
className="header-icon__image"
|
|
48
63
|
src={require('../assets/containers/CareTeam/care-team.svg')}
|
|
49
64
|
alt="group of people"
|
|
50
65
|
/>
|
|
51
66
|
),
|
|
52
67
|
Claim: (
|
|
53
68
|
<img
|
|
69
|
+
className="header-icon__image"
|
|
54
70
|
src={require('../assets/containers/Claim/claim.svg')}
|
|
55
71
|
alt="clipboard with a symmetrical cross"
|
|
56
72
|
/>
|
|
57
73
|
),
|
|
58
74
|
ClaimResponse: (
|
|
59
75
|
<img
|
|
76
|
+
className="header-icon__image"
|
|
60
77
|
src={require('../assets/containers/ClaimResponse/claim-response.svg')}
|
|
61
78
|
alt="clipboard with a symmetrical cross and a return arrow"
|
|
62
79
|
/>
|
|
63
80
|
),
|
|
64
81
|
Device: (
|
|
65
82
|
<img
|
|
83
|
+
className="header-icon__image"
|
|
66
84
|
src={require('../assets/containers/Device/device.svg')}
|
|
67
85
|
alt="computer rack"
|
|
68
86
|
/>
|
|
69
87
|
),
|
|
70
88
|
DiagnosticReport: (
|
|
71
89
|
<img
|
|
90
|
+
className="header-icon__image"
|
|
72
91
|
src={require('../assets/containers/DiagnosticReport/diagnostic-report.svg')}
|
|
73
92
|
alt="note with shapes"
|
|
74
93
|
/>
|
|
75
94
|
),
|
|
76
95
|
DocumentReference: (
|
|
77
96
|
<img
|
|
97
|
+
className="header-icon__image"
|
|
78
98
|
src={require('../assets/containers/DocumentReference/document-reference.svg')}
|
|
79
99
|
alt="hand holding a note"
|
|
80
100
|
/>
|
|
81
101
|
),
|
|
82
102
|
Encounter: (
|
|
83
103
|
<img
|
|
104
|
+
className="header-icon__image"
|
|
84
105
|
src={require('../assets/containers/Encounter/encounter.svg')}
|
|
85
|
-
alt="
|
|
106
|
+
alt="encounter"
|
|
86
107
|
/>
|
|
87
108
|
),
|
|
88
109
|
ExplanationOfBenefit: (
|
|
89
110
|
<img
|
|
111
|
+
className="header-icon__image"
|
|
90
112
|
src={require('../assets/containers/ExplanationOfBenefit/explanation-of-benefit.svg')}
|
|
91
|
-
alt="
|
|
113
|
+
alt="explanation of benefit"
|
|
92
114
|
/>
|
|
93
115
|
),
|
|
94
116
|
FamilyMemberHistory: (
|
|
95
117
|
<img
|
|
118
|
+
className="header-icon__image"
|
|
96
119
|
src={require('../assets/containers/FamilyMemberHistory/family-member-history.svg')}
|
|
97
120
|
alt="parent and child"
|
|
98
121
|
/>
|
|
99
122
|
),
|
|
100
123
|
Goal: (
|
|
101
124
|
<img
|
|
125
|
+
className="header-icon__image"
|
|
102
126
|
src={require('../assets/containers/Goal/goal.svg')}
|
|
103
127
|
alt="arrow hits bullseye"
|
|
104
128
|
/>
|
|
105
129
|
),
|
|
106
130
|
List: (
|
|
107
|
-
<img
|
|
131
|
+
<img
|
|
132
|
+
className="header-icon__image"
|
|
133
|
+
src={require('../assets/containers/List/list.svg')}
|
|
134
|
+
alt="checklist"
|
|
135
|
+
/>
|
|
108
136
|
),
|
|
109
137
|
Location: (
|
|
110
138
|
<img
|
|
139
|
+
className="header-icon__image"
|
|
111
140
|
src={require('../assets/containers/Location/location.svg')}
|
|
112
141
|
alt="location marker"
|
|
113
142
|
/>
|
|
114
143
|
),
|
|
115
144
|
Medication: (
|
|
116
145
|
<img
|
|
146
|
+
className="header-icon__image"
|
|
117
147
|
src={require('../assets/containers/Medication/medication.svg')}
|
|
118
148
|
alt="some pills"
|
|
119
149
|
/>
|
|
120
150
|
),
|
|
121
151
|
MedicationAdministration: (
|
|
122
152
|
<img
|
|
153
|
+
className="header-icon__image"
|
|
123
154
|
src={require('../assets/containers/MedicationAdministration/medication-administration.svg')}
|
|
124
155
|
alt="pill gets swallowed"
|
|
125
156
|
/>
|
|
126
157
|
),
|
|
127
158
|
MedicationKnowledge: (
|
|
128
159
|
<img
|
|
160
|
+
className="header-icon__image"
|
|
129
161
|
src={require('../assets/containers/MedicationKnowledge/medication-knowledge.svg')}
|
|
130
162
|
alt="pill database"
|
|
131
163
|
/>
|
|
132
164
|
),
|
|
133
165
|
MedicationStatement: (
|
|
134
166
|
<img
|
|
167
|
+
className="header-icon__image"
|
|
135
168
|
src={require('../assets/containers/MedicationStatement/medication-statement.svg')}
|
|
136
169
|
alt="note with symmetrical cross"
|
|
137
170
|
/>
|
|
138
171
|
),
|
|
139
172
|
Observation: (
|
|
140
173
|
<img
|
|
174
|
+
className="header-icon__image"
|
|
141
175
|
src={require('../assets/containers/Observation/observation.svg')}
|
|
142
|
-
alt="
|
|
176
|
+
alt="observation"
|
|
143
177
|
/>
|
|
144
178
|
),
|
|
145
179
|
Questionnaire: (
|
|
146
180
|
<img
|
|
181
|
+
className="header-icon__image"
|
|
147
182
|
src={require('../assets/containers/Questionnaire/questionnaire.svg')}
|
|
148
183
|
alt="clipboard and pen"
|
|
149
184
|
/>
|
|
150
185
|
),
|
|
151
186
|
QuestionnaireResponse: (
|
|
152
187
|
<img
|
|
188
|
+
className="header-icon__image"
|
|
153
189
|
src={require('../assets/containers/QuestionnaireResponse/questionnaire-response.svg')}
|
|
154
190
|
alt="clipboard and return arrow"
|
|
155
191
|
/>
|
|
156
192
|
),
|
|
157
193
|
ResearchStudy: (
|
|
158
194
|
<img
|
|
195
|
+
className="header-icon__image"
|
|
159
196
|
src={require('../assets/containers/ResearchStudy/research-study.svg')}
|
|
160
197
|
alt="finger pointing something in a book"
|
|
161
198
|
/>
|
|
162
199
|
),
|
|
163
|
-
|
|
200
|
+
ResourceCategory: (
|
|
164
201
|
<img
|
|
202
|
+
className="header-icon__image"
|
|
165
203
|
src={require('../assets/containers/ResourceCategory/resource-placeholder.svg')}
|
|
166
204
|
alt="header icon"
|
|
167
205
|
/>
|
|
168
206
|
),
|
|
207
|
+
Patient: (
|
|
208
|
+
<img
|
|
209
|
+
className="header-icon__image"
|
|
210
|
+
src={require('../assets/containers/Patient/patient.svg')}
|
|
211
|
+
alt="patient"
|
|
212
|
+
/>
|
|
213
|
+
),
|
|
169
214
|
};
|
|
@@ -148,13 +148,29 @@
|
|
|
148
148
|
"category": {
|
|
149
149
|
"coding": [
|
|
150
150
|
{
|
|
151
|
+
"code": "clmrecvddate",
|
|
151
152
|
"system": "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType",
|
|
152
|
-
"
|
|
153
|
+
"display": "Claim Received Date"
|
|
153
154
|
}
|
|
154
155
|
]
|
|
155
156
|
},
|
|
156
157
|
"timingDate": "2017-01-05"
|
|
157
|
-
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"sequence": 2,
|
|
161
|
+
"category": {
|
|
162
|
+
"coding": [
|
|
163
|
+
{
|
|
164
|
+
"code": "dayssupply",
|
|
165
|
+
"system": "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType",
|
|
166
|
+
"display": "Days Supply"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"valueQuantity": {
|
|
171
|
+
"value": 30
|
|
172
|
+
}
|
|
173
|
+
}
|
|
158
174
|
],
|
|
159
175
|
"diagnosis": [
|
|
160
176
|
{
|
package/src/index.js
CHANGED
package/src/style.scss
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { convertCamelCaseToSentence } from './convertCamelCaseToSentence';
|
|
2
|
+
|
|
3
|
+
describe('convertCamelCaseToSentence function ', () => {
|
|
4
|
+
it('should return sentence', () => {
|
|
5
|
+
expect(convertCamelCaseToSentence('CamelCaseToSentence')).toEqual(
|
|
6
|
+
'camel case to sentence',
|
|
7
|
+
);
|
|
8
|
+
});
|
|
9
|
+
});
|
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
|
};
|
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
|
],
|