fhir-react 0.3.2 → 0.3.6

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 (95) hide show
  1. package/README.md +85 -2
  2. package/build/bootstrap-reboot.min.css +8 -2
  3. package/build/index.js +7 -14
  4. package/build/style.css +4 -5
  5. package/package.json +1 -1
  6. package/src/assets/containers/Binary/binary.svg +9 -0
  7. package/src/assets/containers/{Medication/medication.svg → MedicationOrder/medication-order.svg} +0 -0
  8. package/src/assets/containers/MedicationRequest/medication-request.svg +5 -0
  9. package/src/assets/containers/Patient/patient.svg +6 -0
  10. package/src/assets/containers/ResourceCategory/{resource-placeholder.svg → resource-category.svg} +0 -0
  11. package/src/components/containers/Accordion/Accordion.js +17 -12
  12. package/src/components/datatypes/Annotation/Annotation.js +4 -4
  13. package/src/components/datatypes/CodeableConcept/CodeableConcept.css +4 -1
  14. package/src/components/datatypes/Coding/Coding.css +0 -1
  15. package/src/components/datatypes/HeaderIcon/HeaderIcon.js +67 -22
  16. package/src/components/datatypes/Reference/Reference.css +3 -0
  17. package/src/components/datatypes/Reference/Reference.js +2 -0
  18. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +86 -77
  19. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +12 -1
  20. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.test.js +71 -0
  21. package/src/components/resources/Appointment/Appointment.js +3 -3
  22. package/src/components/resources/Appointment/Appointment.stories.js +28 -5
  23. package/src/components/resources/Appointment/Appointment.test.js +72 -0
  24. package/src/components/resources/Binary/Binary.js +30 -20
  25. package/src/components/resources/Binary/Binary.stories.js +12 -5
  26. package/src/components/resources/Binary/Binary.test.js +67 -0
  27. package/src/components/resources/CarePlan/CarePlan.js +111 -96
  28. package/src/components/resources/CarePlan/CarePlan.stories.js +31 -5
  29. package/src/components/resources/CarePlan/CarePlan.test.js +74 -2
  30. package/src/components/resources/CarePlan/CarePlanActivity.js +6 -2
  31. package/src/components/resources/Condition/Condition.js +1 -3
  32. package/src/components/resources/Condition/Condition.stories.js +9 -19
  33. package/src/components/resources/Condition/Condition.test.js +71 -1
  34. package/src/components/resources/Device/Device.js +54 -34
  35. package/src/components/resources/Device/Device.stories.js +33 -5
  36. package/src/components/resources/Device/Device.test.js +72 -0
  37. package/src/components/resources/DiagnosticReport/DiagnosticReport.js +53 -43
  38. package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +8 -1
  39. package/src/components/resources/DiagnosticReport/DiagnosticReport.test.js +71 -0
  40. package/src/components/resources/DocumentReference/DocumentReference.js +101 -65
  41. package/src/components/resources/DocumentReference/DocumentReference.stories.js +5 -0
  42. package/src/components/resources/DocumentReference/DocumentReference.test.js +71 -0
  43. package/src/components/resources/Encounter/Encounter.js +3 -4
  44. package/src/components/resources/Encounter/Encounter.stories.js +27 -5
  45. package/src/components/resources/Encounter/Encounter.test.js +72 -0
  46. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +26 -10
  47. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +8 -0
  48. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +80 -3
  49. package/src/components/resources/ExplanationOfBenefit/SupportingInfo.js +21 -6
  50. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +47 -38
  51. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +5 -0
  52. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.test.js +72 -0
  53. package/src/components/resources/Goal/Goal.js +103 -85
  54. package/src/components/resources/Goal/Goal.stories.js +38 -7
  55. package/src/components/resources/Goal/Goal.test.js +70 -3
  56. package/src/components/resources/Immunization/Immunization.js +1 -2
  57. package/src/components/resources/Immunization/Immunization.stories.js +6 -9
  58. package/src/components/resources/Immunization/Immunization.test.js +71 -1
  59. package/src/components/resources/Medication/Medication.test.js +1 -1
  60. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.js +1 -1
  61. package/src/components/resources/MedicationOrder/MedicationOrder.js +45 -28
  62. package/src/components/resources/MedicationOrder/MedicationOrder.test.js +67 -0
  63. package/src/components/resources/MedicationRequest/MedicationRequest.js +64 -44
  64. package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +21 -5
  65. package/src/components/resources/MedicationRequest/MedicationRequest.test.js +67 -0
  66. package/src/components/resources/MedicationStatement/MedicationDetails.js +52 -0
  67. package/src/components/resources/MedicationStatement/MedicationDosage.js +46 -0
  68. package/src/components/resources/MedicationStatement/MedicationStatement.js +66 -118
  69. package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +7 -0
  70. package/src/components/resources/MedicationStatement/MedicationStatement.test.js +103 -6
  71. package/src/components/resources/Observation/Observation.js +3 -3
  72. package/src/components/resources/Observation/Observation.stories.js +14 -5
  73. package/src/components/resources/Observation/Observation.test.js +67 -0
  74. package/src/components/resources/Patient/Patient.js +9 -6
  75. package/src/components/resources/Patient/Patient.stories.js +12 -5
  76. package/src/components/resources/Patient/Patient.test.js +67 -0
  77. package/src/components/resources/Practitioner/Practitioner.js +3 -13
  78. package/src/components/resources/Practitioner/Practitioner.stories.js +19 -3
  79. package/src/components/resources/Practitioner/Practitioner.test.js +72 -0
  80. package/src/components/resources/Procedure/Procedure.js +1 -2
  81. package/src/components/resources/Procedure/Procedure.stories.js +11 -5
  82. package/src/components/resources/Procedure/Procedure.test.js +71 -1
  83. package/src/components/resources/ResourceCategory/ResourceCategory.js +7 -8
  84. package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +13 -2
  85. package/src/components/resources/ResourceCategory/ResourceCategory.test.js +77 -18
  86. package/src/components/ui/bootstrap-reboot.min.css +8 -2
  87. package/src/components/ui/index.js +44 -25
  88. package/src/fixtures/example-icons.jsx +74 -22
  89. package/src/fixtures/r4/resources/explanationOfBenefit/c4bbExample.json +18 -2
  90. package/src/style.scss +1 -0
  91. package/src/utils/convertCamelCaseToSentence.js +9 -0
  92. package/src/utils/convertCamelCaseToSentence.test.js +9 -0
  93. package/src/utils/formatDate.js +6 -4
  94. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.css +0 -4
  95. package/src/components/resources/CarePlan/CarePlan.css +0 -7
@@ -1,169 +1,221 @@
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="germ"
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="syringe"
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="block diagram"
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="doctor avatar"
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
- alt="sneezing emoji"
43
+ alt="allergy intolerance"
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="calendar"
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
- alt="note with a heart"
57
+ alt="care plan"
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
- alt="computer rack"
85
+ alt="device"
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
- alt="note with shapes"
92
+ alt="diagnostic report"
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
- alt="hand holding a note"
99
+ alt="document reference"
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="conversation between two individuals"
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="percentage sign"
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
- alt="parent and child"
120
+ alt="family member history"
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
- alt="arrow hits bullseye"
127
+ alt="goal"
104
128
  />
105
129
  ),
106
130
  List: (
107
- <img src={require('../assets/containers/List/list.svg')} alt="checklist" />
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
- Medication: (
144
+ MedicationOrder: (
116
145
  <img
117
- src={require('../assets/containers/Medication/medication.svg')}
118
- alt="some pills"
146
+ className="header-icon__image"
147
+ src={require('../assets/containers/MedicationOrder/medication-order.svg')}
148
+ alt="medication order"
149
+ />
150
+ ),
151
+ MedicationRequest: (
152
+ <img
153
+ className="header-icon__image"
154
+ src={require('../assets/containers/MedicationRequest/medication-request.svg')}
155
+ alt="medication request"
119
156
  />
120
157
  ),
121
158
  MedicationAdministration: (
122
159
  <img
160
+ className="header-icon__image"
123
161
  src={require('../assets/containers/MedicationAdministration/medication-administration.svg')}
124
162
  alt="pill gets swallowed"
125
163
  />
126
164
  ),
127
165
  MedicationKnowledge: (
128
166
  <img
167
+ className="header-icon__image"
129
168
  src={require('../assets/containers/MedicationKnowledge/medication-knowledge.svg')}
130
169
  alt="pill database"
131
170
  />
132
171
  ),
133
172
  MedicationStatement: (
134
173
  <img
174
+ className="header-icon__image"
135
175
  src={require('../assets/containers/MedicationStatement/medication-statement.svg')}
136
- alt="note with symmetrical cross"
176
+ alt="medication statement"
137
177
  />
138
178
  ),
139
179
  Observation: (
140
180
  <img
181
+ className="header-icon__image"
141
182
  src={require('../assets/containers/Observation/observation.svg')}
142
- alt="hospital bed"
183
+ alt="observation"
143
184
  />
144
185
  ),
145
186
  Questionnaire: (
146
187
  <img
188
+ className="header-icon__image"
147
189
  src={require('../assets/containers/Questionnaire/questionnaire.svg')}
148
190
  alt="clipboard and pen"
149
191
  />
150
192
  ),
151
193
  QuestionnaireResponse: (
152
194
  <img
195
+ className="header-icon__image"
153
196
  src={require('../assets/containers/QuestionnaireResponse/questionnaire-response.svg')}
154
197
  alt="clipboard and return arrow"
155
198
  />
156
199
  ),
157
200
  ResearchStudy: (
158
201
  <img
202
+ className="header-icon__image"
159
203
  src={require('../assets/containers/ResearchStudy/research-study.svg')}
160
204
  alt="finger pointing something in a book"
161
205
  />
162
206
  ),
163
207
  ResourceCategory: (
164
208
  <img
165
- src={require('../assets/containers/ResourceCategory/resource-placeholder.svg')}
166
- alt="header icon"
209
+ className="header-icon__image"
210
+ src={require('../assets/containers/ResourceCategory/resource-category.svg')}
211
+ alt="resource category"
212
+ />
213
+ ),
214
+ Patient: (
215
+ <img
216
+ className="header-icon__image"
217
+ src={require('../assets/containers/Patient/patient.svg')}
218
+ alt="patient"
167
219
  />
168
220
  ),
169
221
  };
@@ -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
- "code": "clmrecvddate"
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/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
 
@@ -0,0 +1,9 @@
1
+ import _trim from 'lodash/trim';
2
+
3
+ export const convertCamelCaseToSentence = word => {
4
+ const result = word && word.replace(/([A-Z])/g, ' $1');
5
+ return (
6
+ result &&
7
+ _trim(result.charAt(0).toUpperCase() + result.slice(1)).toLowerCase()
8
+ );
9
+ };
@@ -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
+ });
@@ -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
- }