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.
- package/README.md +85 -2
- package/build/bootstrap-reboot.min.css +8 -2
- package/build/index.js +7 -14
- package/build/style.css +4 -5
- package/package.json +1 -1
- package/src/assets/containers/Binary/binary.svg +9 -0
- package/src/assets/containers/{Medication/medication.svg → MedicationOrder/medication-order.svg} +0 -0
- package/src/assets/containers/MedicationRequest/medication-request.svg +5 -0
- package/src/assets/containers/Patient/patient.svg +6 -0
- package/src/assets/containers/ResourceCategory/{resource-placeholder.svg → resource-category.svg} +0 -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 +86 -77
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +12 -1
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.test.js +71 -0
- 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 +30 -20
- package/src/components/resources/Binary/Binary.stories.js +12 -5
- package/src/components/resources/Binary/Binary.test.js +67 -0
- package/src/components/resources/CarePlan/CarePlan.js +111 -96
- package/src/components/resources/CarePlan/CarePlan.stories.js +31 -5
- package/src/components/resources/CarePlan/CarePlan.test.js +74 -2
- package/src/components/resources/CarePlan/CarePlanActivity.js +6 -2
- package/src/components/resources/Condition/Condition.js +1 -3
- 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/Device/Device.stories.js +33 -5
- package/src/components/resources/Device/Device.test.js +72 -0
- package/src/components/resources/DiagnosticReport/DiagnosticReport.js +53 -43
- package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +8 -1
- package/src/components/resources/DiagnosticReport/DiagnosticReport.test.js +71 -0
- package/src/components/resources/DocumentReference/DocumentReference.js +101 -65
- package/src/components/resources/DocumentReference/DocumentReference.stories.js +5 -0
- package/src/components/resources/DocumentReference/DocumentReference.test.js +71 -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 +5 -0
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.test.js +72 -0
- package/src/components/resources/Goal/Goal.js +103 -85
- package/src/components/resources/Goal/Goal.stories.js +38 -7
- package/src/components/resources/Goal/Goal.test.js +70 -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/Medication/Medication.test.js +1 -1
- package/src/components/resources/MedicationKnowledge/MedicationKnowledge.js +1 -1
- package/src/components/resources/MedicationOrder/MedicationOrder.js +45 -28
- package/src/components/resources/MedicationOrder/MedicationOrder.test.js +67 -0
- package/src/components/resources/MedicationRequest/MedicationRequest.js +64 -44
- package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +21 -5
- package/src/components/resources/MedicationRequest/MedicationRequest.test.js +67 -0
- 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 +66 -118
- package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +7 -0
- package/src/components/resources/MedicationStatement/MedicationStatement.test.js +103 -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 +7 -8
- package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +13 -2
- package/src/components/resources/ResourceCategory/ResourceCategory.test.js +77 -18
- package/src/components/ui/bootstrap-reboot.min.css +8 -2
- package/src/components/ui/index.js +44 -25
- package/src/fixtures/example-icons.jsx +74 -22
- package/src/fixtures/r4/resources/explanationOfBenefit/c4bbExample.json +18 -2
- 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/src/components/resources/AllergyIntolerance/AllergyIntolerance.css +0 -4
- package/src/components/resources/CarePlan/CarePlan.css +0 -7
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://circleci.com/gh/1uphealth/fhir-react/tree/master)
|
|
2
|
-
[](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/
|
|
2
|
+
[](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/release-0-3-6/index.html)
|
|
3
3
|
|
|
4
4
|
# fhir-react
|
|
5
5
|
|
|
@@ -35,7 +35,90 @@ const MyComponent = () => {
|
|
|
35
35
|
};
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Optionally custom header icons could be passed as `fhirIcons` props
|
|
38
|
+
Optionally custom header icons could be passed as `fhirIcons` props in few different way:
|
|
39
|
+
|
|
40
|
+
1. As a URL
|
|
41
|
+
```jsx
|
|
42
|
+
const MyComponent = () => {
|
|
43
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
44
|
+
return (
|
|
45
|
+
<FhirResource
|
|
46
|
+
fhirResource={fhirResource}
|
|
47
|
+
fhirVersion={fhirVersions.R4}
|
|
48
|
+
fhirIcons="https://www.gravatar.com/avatar/?s=50&r=any&default=identicon&forcedefault=1"
|
|
49
|
+
withCarinBBProfile
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
````
|
|
54
|
+
2. As a ```<img>``` element
|
|
55
|
+
```jsx
|
|
56
|
+
const MyComponent = () => {
|
|
57
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
58
|
+
return (
|
|
59
|
+
<FhirResource
|
|
60
|
+
fhirResource={fhirResource}
|
|
61
|
+
fhirVersion={fhirVersions.R4}
|
|
62
|
+
fhirIcons={<img
|
|
63
|
+
src={require('./dstu2/resources/condition/condition.svg')}
|
|
64
|
+
alt="header icon"
|
|
65
|
+
/>}
|
|
66
|
+
withCarinBBProfile
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
````
|
|
71
|
+
|
|
72
|
+
3. As a React src from import
|
|
73
|
+
````jsx
|
|
74
|
+
import EncounterIcon from '../../../assets/containers/Encounter/encounter.svg';
|
|
75
|
+
|
|
76
|
+
const MyComponent = () => {
|
|
77
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
78
|
+
return (
|
|
79
|
+
<FhirResource
|
|
80
|
+
fhirResource={fhirResource}
|
|
81
|
+
fhirVersion={fhirVersions.R4}
|
|
82
|
+
fhirIcons={EncounterIcon}
|
|
83
|
+
withCarinBBProfile
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
````
|
|
88
|
+
or
|
|
89
|
+
````jsx
|
|
90
|
+
const MyComponent = () => {
|
|
91
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
92
|
+
return (
|
|
93
|
+
<FhirResource
|
|
94
|
+
fhirResource={fhirResource}
|
|
95
|
+
fhirVersion={fhirVersions.R4}
|
|
96
|
+
fhirIcons={require('./dstu2/resources/condition/condition.svg')}
|
|
97
|
+
withCarinBBProfile
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
````
|
|
102
|
+
|
|
103
|
+
4. As a ``false`` value to display the placeholder
|
|
104
|
+
````jsx
|
|
105
|
+
const MyComponent = () => {
|
|
106
|
+
const fhirResource = JSON.parse(fhirResourceAsJsonString);
|
|
107
|
+
return (
|
|
108
|
+
<FhirResource
|
|
109
|
+
fhirResource={fhirResource}
|
|
110
|
+
fhirVersion={fhirVersions.R4}
|
|
111
|
+
fhirIcons={false}
|
|
112
|
+
withCarinBBProfile
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
````
|
|
117
|
+
5. Without a `fhirIcons` props
|
|
118
|
+
The resource icon if it exists or a placeholder will be displayed.
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
6. As the resources object with resource type as the key and image URL or DOM node as the value
|
|
39
122
|
|
|
40
123
|
```jsx
|
|
41
124
|
import React from 'react';
|
|
@@ -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
|
|