fhir-react 0.2.3 → 0.3.2
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/.github/workflows/publish_npmjs.yml +20 -0
- package/.storybook/config.js +9 -3
- package/.storybook/presets.js +1 -0
- package/.storybook/preview-head.html +4 -0
- package/README.md +48 -4
- package/build/bootstrap-reboot.min.css +2 -22
- package/build/index.js +38 -3
- package/build/style.css +31 -459
- package/package.json +15 -5
- package/src/assets/common/chevron-right.svg +3 -0
- package/src/assets/containers/AllergyIntolerance/allergy-intolerance.svg +9 -0
- package/src/assets/containers/Appointment/appointment.svg +14 -0
- package/src/assets/containers/CarePlan/care-plan.svg +10 -0
- package/src/assets/containers/CareTeam/care-team.svg +10 -0
- package/src/assets/containers/Claim/claim.svg +6 -0
- package/src/assets/containers/ClaimResponse/claim-response.svg +7 -0
- package/src/assets/containers/Condition/condition.svg +11 -0
- package/src/assets/containers/Device/device.svg +8 -0
- package/src/assets/containers/DiagnosticReport/diagnostic-report.svg +14 -0
- package/src/assets/containers/DocumentReference/document-reference.svg +10 -0
- package/src/assets/containers/Encounter/encounter.svg +10 -0
- package/src/assets/containers/ExplanationOfBenefit/explanation-of-benefit.svg +3 -0
- package/src/assets/containers/FamilyMemberHistory/family-member-history.svg +7 -0
- package/src/assets/containers/Goal/goal.svg +11 -0
- package/src/assets/containers/Immunization/immunization.svg +7 -0
- package/src/assets/containers/List/list.svg +3 -0
- package/src/assets/containers/Location/location.svg +4 -0
- package/src/assets/containers/Medication/medication.svg +5 -0
- package/src/assets/containers/MedicationAdministration/medication-administration.svg +6 -0
- package/src/assets/containers/MedicationKnowledge/medication-knowledge.svg +11 -0
- package/src/assets/containers/MedicationStatement/medication-statement.svg +5 -0
- package/src/assets/containers/Observation/observation.svg +12 -0
- package/src/assets/containers/Practitioner/practitioner.svg +5 -0
- package/src/assets/containers/Procedure/procedure.svg +9 -0
- package/src/assets/containers/Questionnaire/questionnaire.svg +6 -0
- package/src/assets/containers/QuestionnaireResponse/questionnaire-response.svg +6 -0
- package/src/assets/containers/QustionnaireResponse/questionnaire-response.svg +6 -0
- package/src/assets/containers/ResearchStudy/research-study.svg +9 -0
- package/src/assets/containers/ResourceCategory/resource-placeholder.svg +3 -0
- package/src/components/containers/Accordion/Accordion.js +80 -0
- package/src/components/containers/Accordion/Accordion.stories.js +76 -0
- package/src/components/containers/Accordion/index.js +3 -0
- package/src/components/containers/ResourceContainer/ResourceContainer.css +0 -1
- package/src/components/containers/ResourceContainer/ResourceContainer.js +1 -1
- package/src/components/datatypes/AccountBalance/AccountBalance.js +33 -0
- package/src/components/datatypes/AccountBalance/index.js +3 -0
- package/src/components/datatypes/Annotation/Annotation.js +1 -1
- package/src/components/datatypes/Coding/Coding.js +1 -1
- package/src/components/datatypes/Date/Date.js +14 -4
- package/src/components/datatypes/DatePeriod/DatePeriod.js +38 -0
- package/src/components/datatypes/DatePeriod/index.js +3 -0
- package/src/components/datatypes/HeaderIcon/HeaderIcon.js +31 -0
- package/src/components/datatypes/HeaderIcon/index.js +3 -0
- package/src/components/datatypes/HumanName/HumanName.js +6 -21
- package/src/components/datatypes/Reference/Reference.js +3 -6
- package/src/components/resources/AdverseEvent/AdverseEvent.test.js +2 -2
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.test.js +4 -4
- package/src/components/resources/Appointment/Appointment.js +91 -65
- package/src/components/resources/Appointment/Appointment.test.js +3 -3
- package/src/components/resources/Bundle/Bundle.js +2 -2
- package/src/components/resources/Bundle/Bundle.stories.js +78 -12
- package/src/components/resources/Bundle/Bundle.test.js +3 -0
- package/src/components/resources/CarePlan/CarePlan.test.js +4 -4
- package/src/components/resources/CareTeam/CareTeam.js +13 -14
- package/src/components/resources/CareTeam/CareTeam.test.js +4 -4
- package/src/components/resources/Claim/Claim.test.js +6 -6
- package/src/components/resources/ClaimResponse/ClaimResponse.test.js +6 -6
- package/src/components/resources/Condition/Condition.js +64 -47
- package/src/components/resources/Condition/Condition.stories.js +41 -8
- package/src/components/resources/Condition/Condition.test.js +20 -14
- package/src/components/resources/DiagnosticReport/DiagnosticReport.test.js +5 -7
- package/src/components/resources/DocumentReference/DocumentReference.js +1 -1
- package/src/components/resources/DocumentReference/DocumentReference.test.js +3 -3
- package/src/components/resources/Encounter/Encounter.js +66 -36
- package/src/components/resources/Encounter/EncounterParticipants.js +2 -2
- package/src/components/resources/ExplanationOfBenefit/CareTeam.js +2 -2
- package/src/components/resources/ExplanationOfBenefit/Diagnosis.js +31 -5
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +272 -201
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +12 -0
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +96 -62
- package/src/components/resources/ExplanationOfBenefit/Items.js +2 -2
- package/src/components/resources/ExplanationOfBenefit/PriceLabel.js +20 -0
- package/src/components/resources/ExplanationOfBenefit/Related.js +3 -3
- package/src/components/resources/ExplanationOfBenefit/SupportingInfo.js +14 -3
- package/src/components/resources/ExplanationOfBenefit/TotalGraph.js +68 -0
- package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.js +89 -0
- package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.stories.js +78 -0
- package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.test.js +51 -0
- package/src/components/resources/ExplanationOfBenefitGraph/index.js +3 -0
- package/src/components/resources/Goal/Goal.test.js +1 -1
- package/src/components/resources/Immunization/Immunization.js +125 -94
- package/src/components/resources/Immunization/Immunization.stories.js +23 -4
- package/src/components/resources/Immunization/Immunization.test.js +17 -12
- package/src/components/resources/List/List.test.js +3 -3
- package/src/components/resources/MedicationAdministration/MedicationAdministration.test.js +7 -7
- package/src/components/resources/MedicationDispense/MedicationDispense.test.js +2 -2
- package/src/components/resources/MedicationRequest/MedicationRequest.test.js +4 -4
- package/src/components/resources/Observation/Observation.js +72 -54
- package/src/components/resources/Observation/Observation.test.js +6 -18
- package/src/components/resources/Observation/ObservationGraph.js +159 -55
- package/src/components/resources/Observation/ObservationGraph.test.js +47 -26
- package/src/components/resources/Patient/Patient.js +77 -87
- package/src/components/resources/Patient/Patient.test.js +1 -1
- package/src/components/resources/Practitioner/Practitioner.js +80 -60
- package/src/components/resources/Practitioner/Practitioner.test.js +4 -4
- package/src/components/resources/Procedure/Procedure.js +99 -87
- package/src/components/resources/Procedure/Procedure.stories.js +8 -6
- package/src/components/resources/Procedure/Procedure.test.js +11 -8
- package/src/components/resources/Questionnaire/Questionnaire.test.js +3 -3
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.test.js +5 -5
- package/src/components/resources/ReferralRequest/ReferralRequest.test.js +2 -2
- package/src/components/resources/ResearchStudy/ResearchStudy.test.js +1 -1
- package/src/components/resources/ResourceCategory/ResourceCategory.js +55 -0
- package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +29 -0
- package/src/components/resources/ResourceCategory/ResourceCategory.test.js +101 -0
- package/src/components/resources/ResourceCategory/index.js +3 -0
- package/src/components/supportedFhirResourceList.js +2 -0
- package/src/components/ui/_header.scss +3 -0
- package/src/components/ui/bootstrap-reboot.min.css +2 -22
- package/src/components/ui/index.js +191 -29
- package/src/constants/badge-status.jsx +98 -0
- package/src/fixtures/dstu2/resources/condition/condition.svg +35 -0
- package/src/fixtures/dstu2/resources/immunization/immunization.svg +10 -0
- package/src/fixtures/example-icons.jsx +169 -0
- package/src/fixtures/r4/resources/explanationOfBenefit/c4bbExtendedDiagnosis.json +446 -0
- package/src/index.js +7 -1
- package/src/style.scss +176 -0
- package/src/utils/formatDate.js +21 -0
- package/src/utils/formatDate.test.js +22 -0
- package/src/utils/getBadgeColor.js +6 -0
- package/src/utils/getBadgeColor.test.js +14 -0
- package/src/utils/isUrl.js +9 -0
- package/src/utils/isUrl.test.js +12 -0
- package/src/utils.js +7 -0
- package/webpack.config.js +10 -1
- package/src/components/datatypes/HumanName/HumanName.css +0 -15
- package/src/components/datatypes/Reference/Reference.css +0 -8
- package/src/components/resources/Observation/ObservationGraph.css +0 -51
- package/src/components/resources/Patient/Patient.css +0 -19
- package/src/components/ui/index.css +0 -123
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Publish Package to npmjs
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [created]
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v2
|
|
10
|
+
# Setup .npmrc file to publish to npm
|
|
11
|
+
- uses: actions/setup-node@v2
|
|
12
|
+
with:
|
|
13
|
+
node-version: '16.x'
|
|
14
|
+
registry-url: 'https://registry.npmjs.org'
|
|
15
|
+
- run: npm ci
|
|
16
|
+
- run: npm run build
|
|
17
|
+
- run: npm run test
|
|
18
|
+
- run: npm publish
|
|
19
|
+
env:
|
|
20
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
|
package/.storybook/config.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { configure, addParameters, addDecorator } from '@storybook/react';
|
|
2
|
-
import { withKnobs } from '@storybook/addon-knobs';
|
|
3
|
-
|
|
4
1
|
import '../src/components/ui/bootstrap-reboot.min.css';
|
|
5
2
|
import '../src/style.css';
|
|
3
|
+
import '../src/style.scss';
|
|
4
|
+
|
|
5
|
+
import { addDecorator, addParameters, configure } from '@storybook/react';
|
|
6
|
+
|
|
7
|
+
import { withKnobs } from '@storybook/addon-knobs';
|
|
8
|
+
|
|
9
|
+
if (typeof document !== 'undefined') {
|
|
10
|
+
require('bootstrap/dist/js/bootstrap.min.js');
|
|
11
|
+
}
|
|
6
12
|
|
|
7
13
|
addParameters({
|
|
8
14
|
options: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = ['@storybook/preset-scss'];
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://circleci.com/gh/1uphealth/fhir-react/tree/master)
|
|
2
|
-
[](
|
|
2
|
+
[](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/fhir-react-next/index.html)
|
|
3
3
|
|
|
4
4
|
# fhir-react
|
|
5
5
|
|
|
@@ -28,12 +28,34 @@ const MyComponent = () => {
|
|
|
28
28
|
<FhirResource
|
|
29
29
|
fhirResource={fhirResource}
|
|
30
30
|
fhirVersion={fhirVersions.R4}
|
|
31
|
+
fhirIcons={fhirIcons}
|
|
31
32
|
withCarinBBProfile
|
|
32
33
|
/>
|
|
33
34
|
);
|
|
34
35
|
};
|
|
35
36
|
```
|
|
36
37
|
|
|
38
|
+
Optionally custom header icons could be passed as `fhirIcons` props. The shape of the passed object should be as in example below with resource type as the key and image url or DOM node as the value:
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
41
|
+
import React from 'react';
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
Condition: (
|
|
45
|
+
<img
|
|
46
|
+
src={require('./dstu2/resources/condition/condition.svg')}
|
|
47
|
+
alt="header icon"
|
|
48
|
+
/>
|
|
49
|
+
),
|
|
50
|
+
Immunization: (
|
|
51
|
+
<img
|
|
52
|
+
src={require('./dstu2/resources/immunization/immunization.svg')}
|
|
53
|
+
alt="header icon"
|
|
54
|
+
/>
|
|
55
|
+
),
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
37
59
|
### `FhirResource` component props
|
|
38
60
|
|
|
39
61
|
| Prop | Type | Default | Description |
|
|
@@ -94,6 +116,30 @@ const MyComponent = () => {
|
|
|
94
116
|
| `ReferralRequest` | ✅ | ✅ | _N/A_ |
|
|
95
117
|
| `ResearchStudy` | _N/A_ | ✅ | ✅ |
|
|
96
118
|
|
|
119
|
+
### Styles update `v0.3`
|
|
120
|
+
|
|
121
|
+
The 0.3 version of the FHIR React Component library introduces the bootstrap Accordion component as the base of each available resource which provides any data. The RWD support is provided for each component.
|
|
122
|
+
|
|
123
|
+
All of the changes can be tracked by viewing the current version of the [storybook](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/fhir-react-next/index.html?path=/story/condition--default-visualization-dstu-2).
|
|
124
|
+
|
|
125
|
+
### Available resources `v0.3`
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
| Resource | DSTU2 | STU3 | R4 | Carin BB Profile | DaVinci PDex |
|
|
129
|
+
| -------------------------- | :---: | :---: | :---: | :--------------: | ------------ |
|
|
130
|
+
| `Appointment` | ✅ | ✅ | ✅ |
|
|
131
|
+
| `Condition` | ✅ | ✅ | ✅ |
|
|
132
|
+
| `Encounter` | ✅ | ✅ | ✅ |
|
|
133
|
+
| `ExplanationOfBenefit` | ✅ | ✅ | ✅ | ✅ |
|
|
134
|
+
| `Immunization` | ✅ | ✅ | ✅ |
|
|
135
|
+
| `Observation` | ✅ | ✅ | ✅ |
|
|
136
|
+
| `Patient` | ✅ | ✅ | ✅ |
|
|
137
|
+
| `Practitioner` | ✅ | ✅ | ✅ |
|
|
138
|
+
| `Procedure` | ✅ | ✅ | ✅ |
|
|
139
|
+
|
|
140
|
+
The update does not change the datasets which components are able to handle. It means that user can display the same particulars as in the previous version of the specific component.
|
|
141
|
+
|
|
142
|
+
|
|
97
143
|
### Styles
|
|
98
144
|
|
|
99
145
|
Optional CSS styles are provided with this library. They are split into two files:
|
|
@@ -150,9 +196,7 @@ npm run build
|
|
|
150
196
|
|
|
151
197
|
### Publish to NPM Registry
|
|
152
198
|
|
|
153
|
-
|
|
154
|
-
npm publish
|
|
155
|
-
```
|
|
199
|
+
To publish, [create a new release in GitHub](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
|
|
156
200
|
|
|
157
201
|
### Storybook for the changes
|
|
158
202
|
|
|
@@ -14,23 +14,9 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.fhir-resource {
|
|
17
|
-
font-family:
|
|
18
|
-
-apple-system,
|
|
19
|
-
BlinkMacSystemFont,
|
|
20
|
-
'Segoe UI',
|
|
21
|
-
Roboto,
|
|
22
|
-
'Helvetica Neue',
|
|
23
|
-
Arial,
|
|
24
|
-
'Noto Sans',
|
|
25
|
-
sans-serif,
|
|
26
|
-
'Apple Color Emoji',
|
|
27
|
-
'Segoe UI Emoji',
|
|
28
|
-
'Segoe UI Symbol',
|
|
29
|
-
'Noto Color Emoji';
|
|
30
17
|
font-size: 1rem;
|
|
31
18
|
font-weight: 400;
|
|
32
19
|
line-height: 1.5;
|
|
33
|
-
color: #212529;
|
|
34
20
|
background-color: #fff;
|
|
35
21
|
-webkit-text-size-adjust: 100%;
|
|
36
22
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -187,14 +173,8 @@ sup {
|
|
|
187
173
|
.fhir-resource kbd,
|
|
188
174
|
.fhir-resource pre,
|
|
189
175
|
.fhir-resource samp {
|
|
190
|
-
font-family:
|
|
191
|
-
|
|
192
|
-
Menlo,
|
|
193
|
-
Monaco,
|
|
194
|
-
Consolas,
|
|
195
|
-
'Liberation Mono',
|
|
196
|
-
'Courier New',
|
|
197
|
-
monospace;
|
|
176
|
+
font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
|
|
177
|
+
'Courier New', monospace;
|
|
198
178
|
font-size: 1em;
|
|
199
179
|
}
|
|
200
180
|
|