fhir-react 0.2.2 → 0.3.1
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 +41 -13
- package/build/bootstrap-reboot.min.css +2 -22
- package/build/index.js +38 -3
- package/build/style.css +11 -227
- package/package.json +13 -4
- 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 +63 -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 +79 -97
- package/src/components/resources/Patient/Patient.test.js +10 -10
- 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 +56 -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/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 +6 -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/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,12 @@
|
|
|
1
|
+
import { isUrl } from './isUrl';
|
|
2
|
+
|
|
3
|
+
describe('isUrl function', () => {
|
|
4
|
+
it('should return true if passed a valid Url', () => {
|
|
5
|
+
const str = 'https://placekeanu.com/24/24';
|
|
6
|
+
expect(isUrl(str)).toBeTruthy();
|
|
7
|
+
});
|
|
8
|
+
it('should return false if passed an invalid Url', () => {
|
|
9
|
+
const str = '<div><img/><p>test</p><div>';
|
|
10
|
+
expect(isUrl(str)).toBeFalsy();
|
|
11
|
+
});
|
|
12
|
+
});
|
package/src/utils.js
CHANGED
|
@@ -6,3 +6,10 @@ export function toTrimedFixedNumber(number, digits = 4) {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const isNotEmptyArray = data => Array.isArray(data) && data.length > 0;
|
|
9
|
+
|
|
10
|
+
export const parseValueIntoMonetaryValueOfGivenCurrency = (value, currency) => {
|
|
11
|
+
return new Intl.NumberFormat('en-US', {
|
|
12
|
+
style: 'currency',
|
|
13
|
+
currency: currency,
|
|
14
|
+
}).format(Math.round(value * 100) / 100);
|
|
15
|
+
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* HumanName */
|
|
2
|
-
.fhir-datatype__HumanName__not-primary-block {
|
|
3
|
-
font-weight: 700;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.fhir-datatype__HumanName__Header--primary {
|
|
7
|
-
margin-bottom: 0;
|
|
8
|
-
font-weight: 500;
|
|
9
|
-
line-height: 1.2;
|
|
10
|
-
font-size: 1.5rem;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.fhir-datatype__HumanName__use-block {
|
|
14
|
-
margin-left: 3px;
|
|
15
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
.fhir-resource__ObservationGraph {
|
|
2
|
-
margin: 0.5rem 0;
|
|
3
|
-
position: relative;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.fhir-resource__ObservationGraph__value-wrapper {
|
|
7
|
-
position: relative;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.fhir-resource__ObservationGraph__value-actual {
|
|
11
|
-
display: inline-block;
|
|
12
|
-
font-size: 1.5rem;
|
|
13
|
-
font-weight: bold;
|
|
14
|
-
margin: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.fhir-resource__ObservationGraph__value-unit {
|
|
18
|
-
display: inline-block;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.fhir-resource__ObservationGraph__progress {
|
|
22
|
-
display: flex;
|
|
23
|
-
height: 1rem;
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
font-size: 0.75rem;
|
|
26
|
-
background-color: #e9ecef;
|
|
27
|
-
border-radius: 0.25rem;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.fhir-resource__ObservationGraph__progress-value {
|
|
31
|
-
opacity: 0.5;
|
|
32
|
-
width: 12px;
|
|
33
|
-
height: 12px;
|
|
34
|
-
margin-top: 2px;
|
|
35
|
-
position: absolute;
|
|
36
|
-
background-color: #007bff;
|
|
37
|
-
border-radius: 50%;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.fhir-resource__ObservationGraph__progress-bar--outside-range {
|
|
41
|
-
color: #6c757d;
|
|
42
|
-
background-color: transparent;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
white-space: nowrap;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.fhir-resource__ObservationGraph__progress-bar--inside-range {
|
|
50
|
-
background-color: #0003;
|
|
51
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.fhir-resource__Patient__patientContact-relationship {
|
|
2
|
-
font-weight: 700;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.fhir-resource__Patient__patient-avatar {
|
|
6
|
-
border: 4px solid #fff;
|
|
7
|
-
border-radius: 50%;
|
|
8
|
-
margin-right: 10px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.fhir-resource__Patient__patient-block {
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: baseline;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.fhir-resource__Patient__BirthDate-block {
|
|
17
|
-
font-weight: 700;
|
|
18
|
-
color: #6c757d;
|
|
19
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
.fhir-ui__Header {
|
|
2
|
-
width: 100%;
|
|
3
|
-
margin-bottom: 10px;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-wrap: wrap;
|
|
6
|
-
align-items: center;
|
|
7
|
-
word-break: break-word;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.fhir-ui__Title {
|
|
11
|
-
margin-right: 10px;
|
|
12
|
-
margin-bottom: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.fhir-ui__Badge {
|
|
16
|
-
margin-right: 10px;
|
|
17
|
-
display: inline-block;
|
|
18
|
-
padding: 0.25em 0.4em;
|
|
19
|
-
font-size: 75%;
|
|
20
|
-
font-weight: 700;
|
|
21
|
-
line-height: 1;
|
|
22
|
-
color: #fff;
|
|
23
|
-
text-align: center;
|
|
24
|
-
white-space: nowrap;
|
|
25
|
-
vertical-align: baseline;
|
|
26
|
-
border-radius: 3px;
|
|
27
|
-
background-color: #6c757d;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.fhir-ui__BadgeSecondary {
|
|
31
|
-
margin-right: 10px;
|
|
32
|
-
display: inline-block;
|
|
33
|
-
padding: 0.25em 0.4em;
|
|
34
|
-
font-size: 75%;
|
|
35
|
-
font-weight: 700;
|
|
36
|
-
line-height: 1;
|
|
37
|
-
text-align: center;
|
|
38
|
-
white-space: nowrap;
|
|
39
|
-
vertical-align: baseline;
|
|
40
|
-
border-radius: 3px;
|
|
41
|
-
background-color: #f8f9fa;
|
|
42
|
-
color: #000;
|
|
43
|
-
overflow: auto;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.fhir-ui__Value {
|
|
47
|
-
display: flex;
|
|
48
|
-
margin-bottom: 5px;
|
|
49
|
-
font-size: 90%;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.fhir-ui__Value :not(.fhir-ui__Value-label) {
|
|
53
|
-
word-break: break-all;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.fhir-ui__Value-label {
|
|
57
|
-
text-transform: uppercase;
|
|
58
|
-
font-weight: bold;
|
|
59
|
-
color: #6c757d;
|
|
60
|
-
margin: 0 10px 0 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* Based on bootstrap striped-table */
|
|
64
|
-
.fhir-ui__Table {
|
|
65
|
-
width: 100%;
|
|
66
|
-
margin-bottom: 1rem;
|
|
67
|
-
color: #212529;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.fhir-ui__TableHeader,
|
|
71
|
-
.fhir-ui__TableCell {
|
|
72
|
-
padding: 0.4rem 0.75rem;
|
|
73
|
-
vertical-align: top;
|
|
74
|
-
border-top: 1px solid #dee2e6;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.fhir-ui__TableHeader {
|
|
78
|
-
vertical-align: bottom;
|
|
79
|
-
border-bottom: 2px solid #dee2e6;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.fhir-ui__TableHeader--expand {
|
|
83
|
-
width: 100%;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.fhir-ui__TableHeader--no-word-wrap {
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.fhir-ui__Table tbody + tbody {
|
|
91
|
-
border-top: 2px solid #dee2e6;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.fhir-ui__Table tbody .fhir-ui__TableRow:nth-of-type(odd) {
|
|
95
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.fhir-ui__ValueSection {
|
|
99
|
-
overflow: auto;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.fhir-ui__ValueSection-label {
|
|
103
|
-
margin-top: 5px;
|
|
104
|
-
font-size: 1.1em;
|
|
105
|
-
color: #6c757d;
|
|
106
|
-
text-transform: uppercase;
|
|
107
|
-
font-weight: 700;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.fhir-ui__ValueSection-body {
|
|
111
|
-
padding: 0 10px;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.fhir-ui__MissingValue {
|
|
115
|
-
font-weight: 700;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.fhir-ui__NotEnoughData {
|
|
119
|
-
background-color: rgba(0, 0, 0, 0.01);
|
|
120
|
-
padding: 5px 15px;
|
|
121
|
-
margin: 10px 0;
|
|
122
|
-
border: 1px solid rgba(0, 0, 0, 0.03);
|
|
123
|
-
}
|