fhir-react 0.3.8 → 0.3.9

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 (51) hide show
  1. package/README.md +1 -1
  2. package/build/index.js +8 -8
  3. package/build/style.css +2 -2
  4. package/package.json +1 -1
  5. package/src/components/containers/Accordion/Accordion.js +24 -1
  6. package/src/components/containers/ResourceContainer/ResourceContainer.css +4 -0
  7. package/src/components/containers/ResourceContainer/ResourceContainer.js +28 -37
  8. package/src/components/containers/ResourceContainer/ResourceContainer.stories.js +23 -1
  9. package/src/components/resources/AdverseEvent/AdverseEvent.js +8 -1
  10. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +2 -0
  11. package/src/components/resources/Appointment/Appointment.js +8 -1
  12. package/src/components/resources/Binary/Binary.js +2 -1
  13. package/src/components/resources/CarePlan/CarePlan.js +8 -1
  14. package/src/components/resources/CareTeam/CareTeam.js +8 -1
  15. package/src/components/resources/Claim/Claim.js +8 -1
  16. package/src/components/resources/ClaimResponse/ClaimResponse.js +8 -1
  17. package/src/components/resources/Condition/Condition.js +8 -1
  18. package/src/components/resources/Coverage/Coverage.js +8 -1
  19. package/src/components/resources/Device/Device.js +8 -1
  20. package/src/components/resources/DiagnosticReport/DiagnosticReport.js +2 -0
  21. package/src/components/resources/DocumentReference/DocumentReference.js +2 -0
  22. package/src/components/resources/Encounter/Encounter.js +8 -1
  23. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +2 -0
  24. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +2 -0
  25. package/src/components/resources/Generic/Generic.js +2 -1
  26. package/src/components/resources/Goal/Goal.js +8 -1
  27. package/src/components/resources/Immunization/Immunization.js +8 -1
  28. package/src/components/resources/List/List.js +2 -0
  29. package/src/components/resources/Location/Location.js +2 -1
  30. package/src/components/resources/Medication/Medication.js +8 -1
  31. package/src/components/resources/MedicationAdministration/MedicationAdministration.js +2 -0
  32. package/src/components/resources/MedicationDispense/MedicationDispense.js +2 -0
  33. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.js +2 -0
  34. package/src/components/resources/MedicationOrder/MedicationOrder.js +2 -1
  35. package/src/components/resources/MedicationRequest/MedicationRequest.js +7 -1
  36. package/src/components/resources/MedicationStatement/MedicationStatement.js +2 -0
  37. package/src/components/resources/Observation/Observation.js +2 -1
  38. package/src/components/resources/Observation/ObservationGraph.js +1 -1
  39. package/src/components/resources/Organization/Organization.js +8 -1
  40. package/src/components/resources/Patient/Patient.js +2 -0
  41. package/src/components/resources/Practitioner/Practitioner.js +8 -1
  42. package/src/components/resources/PractitionerRole/PractitionerRole.js +2 -0
  43. package/src/components/resources/Procedure/Procedure.js +2 -1
  44. package/src/components/resources/Questionnaire/Questionnaire.js +8 -1
  45. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.js +2 -0
  46. package/src/components/resources/ReferralRequest/ReferralRequest.js +8 -1
  47. package/src/components/resources/RelatedPerson/RelatedPerson.js +8 -1
  48. package/src/components/resources/ResearchStudy/ResearchStudy.js +8 -1
  49. package/src/components/resources/ResourceCategory/ResourceCategory.js +1 -1
  50. package/src/components/ui/index.js +27 -23
  51. package/src/style.scss +11 -0
@@ -14,7 +14,7 @@ import _has from 'lodash/has';
14
14
  import { isNotEmptyArray } from '../../../utils';
15
15
  import { Value } from '../../ui';
16
16
 
17
- const Procedure = ({ fhirResource, fhirIcons, onClick }) => {
17
+ const Procedure = ({ fhirResource, fhirIcons, onClick, rawOnClick }) => {
18
18
  const display =
19
19
  _get(fhirResource, 'code.coding[0].display') ||
20
20
  _get(fhirResource, 'code.text');
@@ -125,6 +125,7 @@ const Procedure = ({ fhirResource, fhirIcons, onClick }) => {
125
125
  }
126
126
  bodyContent={<Body tableData={tableData} />}
127
127
  onClick={onClick}
128
+ rawOnClick={rawOnClick}
128
129
  />
129
130
  </Root>
130
131
  );
@@ -75,7 +75,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
75
75
  }
76
76
  };
77
77
 
78
- const Questionnaire = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
78
+ const Questionnaire = ({
79
+ fhirResource,
80
+ fhirVersion,
81
+ fhirIcons,
82
+ onClick,
83
+ rawOnClick,
84
+ }) => {
79
85
  let fhirResourceData = {};
80
86
 
81
87
  try {
@@ -114,6 +120,7 @@ const Questionnaire = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
114
120
  </Body>
115
121
  }
116
122
  onClick={onClick}
123
+ rawOnClick={rawOnClick}
117
124
  />
118
125
  </Root>
119
126
  );
@@ -76,6 +76,7 @@ const QuestionnaireResponse = ({
76
76
  fhirVersion,
77
77
  fhirIcons,
78
78
  onClick,
79
+ rawOnClick,
79
80
  }) => {
80
81
  let fhirResourceData = {};
81
82
 
@@ -139,6 +140,7 @@ const QuestionnaireResponse = ({
139
140
  </Body>
140
141
  }
141
142
  onClick={onClick}
143
+ rawOnClick={rawOnClick}
142
144
  />
143
145
  </Root>
144
146
  );
@@ -70,7 +70,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
70
70
  }
71
71
  };
72
72
 
73
- const ReferralRequest = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
73
+ const ReferralRequest = ({
74
+ fhirResource,
75
+ fhirVersion,
76
+ fhirIcons,
77
+ onClick,
78
+ rawOnClick,
79
+ }) => {
74
80
  let fhirResourceData = {};
75
81
  try {
76
82
  fhirResourceData = resourceDTO(fhirVersion, fhirResource);
@@ -150,6 +156,7 @@ const ReferralRequest = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
150
156
  </Body>
151
157
  }
152
158
  onClick={onClick}
159
+ rawOnClick={rawOnClick}
153
160
  />
154
161
  </Root>
155
162
  );
@@ -67,7 +67,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
67
67
  }
68
68
  };
69
69
 
70
- const RelatedPerson = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
70
+ const RelatedPerson = ({
71
+ fhirResource,
72
+ fhirVersion,
73
+ fhirIcons,
74
+ onClick,
75
+ rawOnClick,
76
+ }) => {
71
77
  let fhirResourceData = {};
72
78
  try {
73
79
  fhirResourceData = resourceDTO(fhirVersion, fhirResource);
@@ -139,6 +145,7 @@ const RelatedPerson = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
139
145
  }
140
146
  bodyContent={<Body tableData={tableData} />}
141
147
  onClick={onClick}
148
+ rawOnClick={rawOnClick}
142
149
  />
143
150
  </Root>
144
151
  );
@@ -94,7 +94,13 @@ const resourceDTO = (fhirVersion, fhirResource) => {
94
94
  }
95
95
  };
96
96
 
97
- const ResearchStudy = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
97
+ const ResearchStudy = ({
98
+ fhirResource,
99
+ fhirVersion,
100
+ fhirIcons,
101
+ onClick,
102
+ rawOnClick,
103
+ }) => {
98
104
  let fhirResourceData = {};
99
105
  try {
100
106
  fhirResourceData = resourceDTO(fhirVersion, fhirResource);
@@ -289,6 +295,7 @@ const ResearchStudy = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
289
295
  }
290
296
  bodyContent={<Body tableData={tableData} />}
291
297
  onClick={onClick}
298
+ rawOnClick={rawOnClick}
292
299
  />
293
300
  </Root>
294
301
  );
@@ -15,7 +15,7 @@ const ResourceCategory = ({ title, itemsCount, fhirIcons }) => {
15
15
  <Root name="ResourceCategory">
16
16
  <button
17
17
  type="button"
18
- className="btn d-flex align-items-center justify-content-between w-100 py-4 px-4 bg-white"
18
+ className="btn d-flex align-items-center justify-content-between w-100 px-md-4 py-md-4 bg-white"
19
19
  >
20
20
  <div className="d-flex gap-2">
21
21
  <Header
@@ -32,7 +32,7 @@ export const Header = ({
32
32
  isAccordionOpenable ? 'header__title-row' : ''
33
33
  } d-flex w-100 flex-column flex-sm-row`}
34
34
  >
35
- <div className="d-flex">
35
+ <div className="d-flex align-items-center">
36
36
  {!isNoIcon && (
37
37
  <div
38
38
  className={`fhir-ui__${resourceName}-Header__icon d-flex align-items-center flex-shrink-1 m-half me-2`}
@@ -52,30 +52,34 @@ export const Header = ({
52
52
  </div>
53
53
  </div>
54
54
 
55
- <div
56
- 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}`}
57
- >
58
- {prefixBadge && <div className="me-3">{prefixBadge}</div>}
59
- <div className="d-flex">
60
- {badges}
61
- {additionalBadge && (
62
- <div className="ms-3">{additionalBadge}</div>
63
- )}
55
+ {(prefixBadge || badges || additionalBadge) && (
56
+ <div
57
+ className={`fhir-ui__${resourceName}-Header__badges 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}`}
58
+ >
59
+ {prefixBadge && <div className="me-3">{prefixBadge}</div>}
60
+ <div className="d-flex align-items-center">
61
+ {badges}
62
+ {additionalBadge && (
63
+ <div className="ms-3">{additionalBadge}</div>
64
+ )}
65
+ </div>
64
66
  </div>
65
- </div>
67
+ )}
66
68
  </div>
67
- <div
68
- className={`fhir-ui__${resourceName}-Header__additional-content w-100 justify-content-start d-flex ${
69
- additionalContent ? ' pt-2' : ''
70
- }`}
71
- >
72
- {additionalContent}
69
+ {(additionalContent || rightAdditionalContent) && (
73
70
  <div
74
- className={`fhir-ui__${resourceName}-Header__rightAdditionalContent justify-content-end ${rightItemsClass}`}
71
+ className={`fhir-ui__${resourceName}-Header__additional-content w-100 justify-content-start d-flex ${
72
+ additionalContent ? ' pt-2' : ''
73
+ }`}
75
74
  >
76
- {rightAdditionalContent}
75
+ {additionalContent}
76
+ <div
77
+ className={`fhir-ui__${resourceName}-Header__rightAdditionalContent justify-content-md-end mx-0 ${rightItemsClass}`}
78
+ >
79
+ {rightAdditionalContent}
80
+ </div>
77
81
  </div>
78
- </div>
82
+ )}
79
83
  </div>
80
84
  )}
81
85
  </>
@@ -84,7 +88,7 @@ export const Header = ({
84
88
 
85
89
  export const Title = props => (
86
90
  <h4
87
- className={`fhir-ui__Title fw-bold fs-4 lh-base mb-0 w-90 title-width-sm ${
91
+ className={`fhir-ui__Title fw-bold lh-base mb-0 text-break d-flex ${
88
92
  props.capitalize ? 'text-capitalize' : ''
89
93
  }`}
90
94
  data-testid={props['data-testid'] || 'title'}
@@ -96,7 +100,7 @@ export const Title = props => (
96
100
  export const Badge = props => {
97
101
  return (
98
102
  <small
99
- className={`fhir-ui__Badge text-capitalize d-flex align-items-center mx-1 px-2 py-1 rounded-1 fw-bold ${getBadgeColor(
103
+ className={`fhir-ui__Badge text-capitalize d-flex align-items-center px-2 py-1 rounded-1 fw-bold ${getBadgeColor(
100
104
  props,
101
105
  )}`}
102
106
  data-testid={props['data-testid']}
@@ -108,7 +112,7 @@ export const Badge = props => {
108
112
 
109
113
  export const BadgeSecondary = props => (
110
114
  <small
111
- className={`fhir-ui__BadgeSecondary px-2 py-1 rounded-1 fw-bold ${getBadgeColor(
115
+ className={`fhir-ui__BadgeSecondary px-2 py-1 rounded-1 fw-bold d-flex align-items-center ${getBadgeColor(
112
116
  props,
113
117
  )}`}
114
118
  data-testid={props['data-testid']}
package/src/style.scss CHANGED
@@ -106,6 +106,17 @@ $enable-negative-margins: true;
106
106
 
107
107
  .fhir-ui__Badge {
108
108
  width: fit-content;
109
+ margin: 0 4px;
110
+ @include media-breakpoint-down(sm) {
111
+ margin: 4px 0;
112
+ }
113
+ }
114
+
115
+ .fhir-ui__Title {
116
+ font-size: 1.125rem;
117
+ @include media-breakpoint-down(sm) {
118
+ font-size: 1rem !important;
119
+ }
109
120
  }
110
121
 
111
122
  .header__title-row {