fhir-react 0.3.7 → 0.3.8

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 (138) hide show
  1. package/.circleci/config.yml +1 -1
  2. package/.eslintrc +10 -1
  3. package/.stylelintrc +6 -2
  4. package/README.md +19 -1
  5. package/build/index.js +15 -11
  6. package/build/style.css +7 -7
  7. package/package.json +55 -54
  8. package/src/assets/containers/AdverseEvent/adverse-event.svg +6 -0
  9. package/src/assets/containers/Generic/generic.svg +3 -0
  10. package/src/assets/containers/MedicationDispense/medication-dispense.svg +5 -0
  11. package/src/assets/containers/PractitionerRole/practitioner-role.svg +5 -0
  12. package/src/assets/containers/ReferralRequest/referral-request.svg +8 -0
  13. package/src/assets/containers/RelatedPerson/related-person.svg +6 -0
  14. package/src/components/containers/Accordion/Accordion.js +21 -13
  15. package/src/components/datatypes/CodeableConcept/CodeableConcept.js +6 -3
  16. package/src/components/datatypes/Coding/Coding.js +7 -3
  17. package/src/components/datatypes/Reference/Reference.js +7 -5
  18. package/src/components/datatypes/Telecom/Telecom.js +2 -3
  19. package/src/components/resources/AdverseEvent/AdverseEvent.js +81 -42
  20. package/src/components/resources/AdverseEvent/AdverseEvent.stories.js +12 -2
  21. package/src/components/resources/AdverseEvent/AdverseEvent.test.js +109 -2
  22. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +7 -1
  23. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.test.js +36 -1
  24. package/src/components/resources/Appointment/Appointment.js +2 -1
  25. package/src/components/resources/Appointment/Appointment.test.js +36 -1
  26. package/src/components/resources/Bundle/Bundle.css +7 -0
  27. package/src/components/resources/Bundle/Bundle.js +15 -11
  28. package/src/components/resources/Bundle/Bundle.stories.js +12 -78
  29. package/src/components/resources/Bundle/Bundle.test.js +0 -3
  30. package/src/components/resources/CarePlan/CarePlan.js +2 -1
  31. package/src/components/resources/CarePlan/CarePlan.test.js +42 -6
  32. package/src/components/resources/CareTeam/CareTeam.js +72 -50
  33. package/src/components/resources/CareTeam/CareTeam.stories.js +20 -3
  34. package/src/components/resources/CareTeam/CareTeam.test.js +109 -1
  35. package/src/components/resources/CareTeam/CareTeamParticipants.js +1 -1
  36. package/src/components/resources/Claim/Claim.js +2 -1
  37. package/src/components/resources/Claim/Claim.test.js +32 -1
  38. package/src/components/resources/ClaimResponse/AddedItem.js +61 -11
  39. package/src/components/resources/ClaimResponse/AddedItems.js +5 -9
  40. package/src/components/resources/ClaimResponse/ClaimResponse.js +137 -83
  41. package/src/components/resources/ClaimResponse/ClaimResponse.stories.js +15 -2
  42. package/src/components/resources/ClaimResponse/ClaimResponse.test.js +112 -1
  43. package/src/components/resources/ClaimResponse/Item.js +44 -9
  44. package/src/components/resources/ClaimResponse/Items.js +5 -4
  45. package/src/components/resources/Condition/Condition.js +3 -3
  46. package/src/components/resources/Condition/Condition.test.js +37 -4
  47. package/src/components/resources/Coverage/Coverage.js +2 -1
  48. package/src/components/resources/Coverage/Coverage.test.js +36 -1
  49. package/src/components/resources/Device/Device.js +2 -1
  50. package/src/components/resources/Device/Device.test.js +36 -1
  51. package/src/components/resources/DiagnosticReport/DiagnosticReport.js +7 -2
  52. package/src/components/resources/DiagnosticReport/DiagnosticReport.test.js +36 -1
  53. package/src/components/resources/DocumentReference/DocumentReference.js +7 -2
  54. package/src/components/resources/DocumentReference/DocumentReference.test.js +42 -1
  55. package/src/components/resources/Encounter/Encounter.js +2 -1
  56. package/src/components/resources/Encounter/Encounter.test.js +36 -1
  57. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +2 -0
  58. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +38 -1
  59. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +7 -2
  60. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.test.js +36 -1
  61. package/src/components/resources/Generic/Generic.js +20 -7
  62. package/src/components/resources/Generic/Generic.stories.js +2 -1
  63. package/src/components/resources/Generic/Generic.test.js +26 -7
  64. package/src/components/resources/Goal/Goal.js +2 -3
  65. package/src/components/resources/Goal/Goal.test.js +32 -1
  66. package/src/components/resources/Immunization/Immunization.js +2 -2
  67. package/src/components/resources/Immunization/Immunization.test.js +36 -1
  68. package/src/components/resources/List/DrugTierDefinitionExtension.js +79 -35
  69. package/src/components/resources/List/Entries.js +3 -3
  70. package/src/components/resources/List/List.js +135 -88
  71. package/src/components/resources/List/List.stories.js +38 -5
  72. package/src/components/resources/List/List.test.js +105 -1
  73. package/src/components/resources/Location/Location.js +65 -47
  74. package/src/components/resources/Location/Location.stories.js +11 -4
  75. package/src/components/resources/Location/Location.test.js +106 -4
  76. package/src/components/resources/Medication/Medication.js +2 -1
  77. package/src/components/resources/Medication/Medication.test.js +36 -1
  78. package/src/components/resources/MedicationAdministration/MedicationAdministration.js +86 -62
  79. package/src/components/resources/MedicationAdministration/MedicationAdministration.stories.js +7 -0
  80. package/src/components/resources/MedicationAdministration/MedicationAdministration.test.js +117 -1
  81. package/src/components/resources/MedicationDispense/DosageInstruction.js +25 -0
  82. package/src/components/resources/MedicationDispense/MedicationDispense.js +68 -68
  83. package/src/components/resources/MedicationDispense/MedicationDispense.stories.js +7 -0
  84. package/src/components/resources/MedicationDispense/MedicationDispense.test.js +108 -1
  85. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.js +115 -66
  86. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.stories.js +6 -0
  87. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.test.js +110 -1
  88. package/src/components/resources/MedicationOrder/MedicationOrder.js +2 -3
  89. package/src/components/resources/MedicationOrder/MedicationOrder.test.js +35 -4
  90. package/src/components/resources/MedicationRequest/MedicationRequest.js +2 -1
  91. package/src/components/resources/MedicationRequest/MedicationRequest.test.js +33 -4
  92. package/src/components/resources/MedicationStatement/MedicationStatement.js +7 -2
  93. package/src/components/resources/MedicationStatement/MedicationStatement.test.js +36 -1
  94. package/src/components/resources/Observation/Observation.js +2 -1
  95. package/src/components/resources/Observation/Observation.test.js +30 -1
  96. package/src/components/resources/Organization/Organization.js +3 -2
  97. package/src/components/resources/Organization/Organization.test.js +36 -1
  98. package/src/components/resources/Patient/Patient.js +2 -0
  99. package/src/components/resources/Patient/Patient.test.js +31 -2
  100. package/src/components/resources/Practitioner/Practitioner.js +2 -1
  101. package/src/components/resources/Practitioner/Practitioner.test.js +36 -1
  102. package/src/components/resources/PractitionerRole/PractitionerRole.js +50 -29
  103. package/src/components/resources/PractitionerRole/PractitionerRole.stories.js +7 -0
  104. package/src/components/resources/PractitionerRole/PractitionerRole.test.js +108 -1
  105. package/src/components/resources/Procedure/Procedure.js +2 -2
  106. package/src/components/resources/Procedure/Procedure.test.js +30 -1
  107. package/src/components/resources/Questionnaire/Group.js +53 -0
  108. package/src/components/resources/Questionnaire/Items.js +45 -0
  109. package/src/components/resources/Questionnaire/Questionnaire.css +24 -5
  110. package/src/components/resources/Questionnaire/Questionnaire.js +31 -170
  111. package/src/components/resources/Questionnaire/Questionnaire.stories.js +8 -0
  112. package/src/components/resources/Questionnaire/Questionnaire.test.js +194 -15
  113. package/src/components/resources/Questionnaire/Questions.js +40 -0
  114. package/src/components/resources/Questionnaire/getQuestionText.js +20 -0
  115. package/src/components/resources/QuestionnaireResponse/Answers.js +59 -0
  116. package/src/components/resources/QuestionnaireResponse/Group.js +70 -0
  117. package/src/components/resources/QuestionnaireResponse/Items.js +45 -0
  118. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.css +33 -8
  119. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.js +52 -236
  120. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.stories.js +8 -0
  121. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.test.js +38 -3
  122. package/src/components/resources/QuestionnaireResponse/Questions.js +43 -0
  123. package/src/components/resources/QuestionnaireResponse/getQuestionText.js +22 -0
  124. package/src/components/resources/ReferralRequest/ReferralRequest.js +65 -40
  125. package/src/components/resources/ReferralRequest/ReferralRequest.test.js +111 -11
  126. package/src/components/resources/RelatedPerson/RelatedPerson.js +151 -0
  127. package/src/components/resources/RelatedPerson/RelatedPerson.stories.js +46 -0
  128. package/src/components/resources/RelatedPerson/RelatedPerson.test.js +156 -0
  129. package/src/components/resources/RelatedPerson/index.js +3 -0
  130. package/src/components/resources/ResearchStudy/ResearchStudy.js +160 -130
  131. package/src/components/resources/ResearchStudy/ResearchStudy.stories.js +2 -0
  132. package/src/components/resources/ResearchStudy/ResearchStudy.test.js +108 -1
  133. package/src/components/ui/index.js +22 -9
  134. package/src/fixtures/dstu2/resources/relatedPerson/example1.json +79 -0
  135. package/src/fixtures/example-icons.jsx +42 -0
  136. package/src/fixtures/r4/resources/relatedPerson/example1.json +64 -0
  137. package/src/fixtures/stu3/resources/relatedPerson/example1.json +43 -0
  138. package/src/style.scss +3 -1
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "fhir-react",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "React component library for displaying FHIR Resources ",
5
5
  "main": "build/index.js",
6
6
  "peerDependencies": {
7
- "react": "^17.0.1"
7
+ "react": "^17.0.2"
8
8
  },
9
9
  "dependencies": {
10
- "@nivo/core": "^0.74.0",
11
- "@nivo/pie": "^0.74.0",
12
- "@popperjs/core": "^2.10.2",
13
- "bootstrap": "^5.1.1",
14
- "dompurify": "^2.0.7",
15
- "lodash": "^4.17.15",
16
- "marked": "^0.8.0",
17
- "md5": "^2.2.1",
18
- "pretty-bytes": "^5.3.0",
19
- "prop-types": "^15.7.2",
20
- "react": "^17.0.1",
10
+ "@nivo/core": "^0.78.0",
11
+ "@nivo/pie": "^0.78.0",
12
+ "@popperjs/core": "^2.11.2",
13
+ "bootstrap": "^5.1.3",
14
+ "dompurify": "^2.3.6",
15
+ "lodash": "^4.17.21",
16
+ "marked": "^3.0.8",
17
+ "md5": "^2.3.0",
18
+ "pretty-bytes": "^5.6.0",
19
+ "prop-types": "^15.8.1",
20
+ "react": "^17.0.2",
21
21
  "svg-url-loader": "^7.1.1"
22
22
  },
23
23
  "scripts": {
@@ -59,61 +59,62 @@
59
59
  ],
60
60
  "license": "CC-BY-NC-SA-4.0",
61
61
  "devDependencies": {
62
- "@babel/cli": "^7.7.4",
63
- "@babel/core": "^7.0.0",
64
- "@babel/plugin-proposal-class-properties": "^7.0.0",
65
- "@babel/plugin-proposal-decorators": "^7.0.0",
66
- "@babel/plugin-proposal-do-expressions": "^7.0.0",
67
- "@babel/plugin-proposal-export-default-from": "^7.0.0",
68
- "@babel/plugin-proposal-export-namespace-from": "^7.0.0",
69
- "@babel/plugin-proposal-function-bind": "^7.0.0",
70
- "@babel/plugin-proposal-function-sent": "^7.0.0",
71
- "@babel/plugin-proposal-json-strings": "^7.0.0",
72
- "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
73
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
74
- "@babel/plugin-proposal-numeric-separator": "^7.0.0",
75
- "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
76
- "@babel/plugin-proposal-optional-chaining": "^7.0.0",
77
- "@babel/plugin-proposal-pipeline-operator": "^7.0.0",
78
- "@babel/plugin-proposal-throw-expressions": "^7.0.0",
79
- "@babel/plugin-syntax-dynamic-import": "^7.0.0",
80
- "@babel/plugin-syntax-import-meta": "^7.0.0",
81
- "@babel/plugin-transform-react-jsx": "^7.0.0",
62
+ "@babel/cli": "^7.17.6",
63
+ "@babel/core": "^7.17.5",
64
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
65
+ "@babel/plugin-proposal-decorators": "^7.17.2",
66
+ "@babel/plugin-proposal-do-expressions": "^7.16.7",
67
+ "@babel/plugin-proposal-export-default-from": "^7.16.7",
68
+ "@babel/plugin-proposal-export-namespace-from": "^7.16.7",
69
+ "@babel/plugin-proposal-function-bind": "^7.16.7",
70
+ "@babel/plugin-proposal-function-sent": "^7.16.7",
71
+ "@babel/plugin-proposal-json-strings": "^7.16.7",
72
+ "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7",
73
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
74
+ "@babel/plugin-proposal-numeric-separator": "^7.16.7",
75
+ "@babel/plugin-proposal-object-rest-spread": "^7.17.3",
76
+ "@babel/plugin-proposal-optional-chaining": "^7.16.7",
77
+ "@babel/plugin-proposal-pipeline-operator": "^7.17.6",
78
+ "@babel/plugin-proposal-throw-expressions": "^7.16.7",
79
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
80
+ "@babel/plugin-syntax-import-meta": "^7.10.4",
81
+ "@babel/plugin-transform-react-jsx": "^7.17.3",
82
82
  "@babel/polyfill": "^7.0.0",
83
- "@babel/preset-env": "^7.0.0",
84
- "@babel/preset-react": "^7.7.4",
83
+ "@babel/preset-env": "^7.16.11",
84
+ "@babel/preset-react": "^7.16.7",
85
85
  "@storybook/addon-knobs": "^5.2.8",
86
86
  "@storybook/preset-scss": "^1.0.3",
87
87
  "@storybook/react": "^5.2.8",
88
88
  "@storybook/storybook-deployer": "^2.8.1",
89
- "@testing-library/react": "^9.3.2",
90
- "@typescript-eslint/eslint-plugin": "^2.10.0",
91
- "@typescript-eslint/parser": "^2.10.0",
89
+ "@testing-library/react": "^12.1.4",
90
+ "@typescript-eslint/eslint-plugin": "^5.14.0",
91
+ "@typescript-eslint/parser": "^5.14.0",
92
92
  "babel-eslint": "^10.0.3",
93
93
  "babel-jest": "^24.9.0",
94
- "babel-loader": "^8.0.6",
94
+ "babel-loader": "^8.2.3",
95
95
  "babel-plugin-transform-imports": "^2.0.0",
96
- "copy-webpack-plugin": "^5.1.1",
96
+ "copy-webpack-plugin": "^5.1.2",
97
97
  "css-loader": "^3.6.0",
98
98
  "dedent": "^0.7.0",
99
- "eslint": "^6.7.2",
100
- "eslint-config-prettier": "^6.7.0",
101
- "eslint-config-react-app": "^5.0.2",
102
- "eslint-plugin-flowtype": "^3.13.0",
103
- "eslint-plugin-import": "^2.18.2",
104
- "eslint-plugin-jsx-a11y": "^6.2.3",
105
- "eslint-plugin-prettier": "^3.1.1",
106
- "eslint-plugin-react": "^7.17.0",
107
- "eslint-plugin-react-hooks": "^1.7.0",
99
+ "eslint": "^8.10.0",
100
+ "eslint-config-prettier": "^8.5.0",
101
+ "eslint-config-react-app": "^7.0.0",
102
+ "eslint-plugin-flowtype": "^8.0.3",
103
+ "eslint-plugin-import": "^2.25.4",
104
+ "eslint-plugin-jsx-a11y": "^6.5.1",
105
+ "eslint-plugin-prettier": "^4.0.0",
106
+ "eslint-plugin-react": "^7.29.3",
107
+ "eslint-plugin-react-hooks": "^4.3.0",
108
108
  "jest": "^24.9.0",
109
- "mini-css-extract-plugin": "^0.9.0",
109
+ "mini-css-extract-plugin": "^1.6.2",
110
+ "npm-check-updates": "^12.5.2",
110
111
  "prettier": "1.19.1",
111
- "react-dom": "^16.12.0",
112
- "sass": "^1.42.1",
112
+ "react-dom": "^17.0.2",
113
+ "sass": "^1.49.9",
113
114
  "sass-loader": "^10.2.0",
114
115
  "style-loader": "^2.0.0",
115
- "stylelint": "^13.0.0",
116
- "stylelint-config-standard": "^19.0.0",
116
+ "stylelint": "^14.5.3",
117
+ "stylelint-config-standard": "^25.0.0",
117
118
  "webpack": "^4.41.2",
118
119
  "webpack-cli": "^3.3.10"
119
120
  }
@@ -0,0 +1,6 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 12C0 8.27247 0 6.4087 0.608964 4.93853C1.42092 2.97831 2.97831 1.42092 4.93853 0.608964C6.4087 0 8.27247 0 12 0C15.7275 0 17.5913 0 19.0615 0.608964C21.0217 1.42092 22.5791 2.97831 23.391 4.93853C24 6.4087 24 8.27247 24 12C24 15.7275 24 17.5913 23.391 19.0615C22.5791 21.0217 21.0217 22.5791 19.0615 23.391C17.5913 24 15.7275 24 12 24C8.27247 24 6.4087 24 4.93853 23.391C2.97831 22.5791 1.42092 21.0217 0.608964 19.0615C0 17.5913 0 15.7275 0 12Z" fill="#F8F9FA"/>
3
+ <path d="M12 11C13.933 11 15.5 9.433 15.5 7.5C15.5 5.567 13.933 4 12 4C10.067 4 8.5 5.567 8.5 7.5C8.5 9.433 10.067 11 12 11Z" stroke="#3D8BFD" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M9.5 5C10.0015 5.63268 10.6029 6.13588 11.268 6.47953C11.9332 6.82317 12.6485 7.00019 13.3712 7C14.1033 7.00035 14.8277 6.81885 15.5 6.46662" stroke="#3D8BFD" stroke-linejoin="round"/>
5
+ <path d="M4 20C4 18.1435 4.84285 16.363 6.34315 15.0503C7.84344 13.7375 9.87827 13 12 13C14.1217 13 16.1566 13.7375 17.6569 15.0503C19.1571 16.363 20 18.1435 20 20" stroke="#3D8BFD" stroke-linecap="round" stroke-linejoin="round"/>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M15.9726 5.24759C15.9726 5.09345 15.9419 5.09345 15.8803 5.09345H9.23274C9.17119 5.09345 9.14041 5.06262 9.14041 5.00096V0.592486C9.14041 0.530829 9.10964 0.5 9.04809 0.5H6.95533C6.89378 0.5 6.863 0.530829 6.863 0.592486V11.8141C6.863 11.8757 6.89378 11.9066 6.95533 11.9066H9.04809C9.10964 11.9066 9.14041 11.8757 9.14041 11.8141V7.46724C9.14041 7.40559 9.17119 7.37476 9.23274 7.37476H13.6029C13.6645 7.37476 13.6952 7.40559 13.6952 7.46724V9.56358C13.6952 9.62524 13.6645 9.65607 13.6029 9.65607H11.5102C11.4486 9.65607 11.4178 9.6869 11.4178 9.74855V14.1262C11.4178 14.1879 11.387 14.2187 11.3255 14.2187H4.67792C4.61637 14.2187 4.5856 14.1879 4.5856 14.1262V5.18593C4.5856 5.12428 4.55482 5.09345 4.49327 5.09345L0 5.06262V7.34393H2.18508C2.24663 7.34393 2.27741 7.37476 2.27741 7.43642V16.4075C2.27741 16.4692 2.30819 16.5 2.36974 16.5H13.6029C13.6645 16.5 13.6952 16.4692 13.6952 16.4075V16.4383V12.0607C13.6952 11.9682 13.726 11.9374 13.7876 11.9374H15.8495C15.8495 11.9374 15.9111 11.9374 15.9726 11.8757C16.0342 11.8449 15.9726 5.24759 15.9726 5.24759Z" fill="#3D8BFD"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.52175 9.0435C7.01904 9.0435 9.0435 7.01904 9.0435 4.52175C9.0435 2.02446 7.01904 0 4.52175 0C2.02446 0 0 2.02446 0 4.52175C0 7.01904 2.02446 9.0435 4.52175 9.0435Z" fill="#FD7E14"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.6396 15.0832C11.0525 15.6702 10.2563 16.0001 9.42605 16.0001C8.5958 16.0001 7.79956 15.6702 7.21248 15.0832C6.62541 14.4961 6.29559 13.6998 6.29559 12.8696C6.29559 12.0394 6.62541 11.2431 7.21248 10.656L8.58067 9.28784L8.58071 9.28788L13.0078 13.715L11.6396 15.0832ZM10.656 7.21254L9.28778 8.58073L9.28782 8.58077L13.7149 13.0079L15.0831 11.6397C15.6702 11.0526 16 10.2564 16 9.42611C16 8.59587 15.6702 7.79962 15.0831 7.21254C14.496 6.62547 13.6998 6.29565 12.8695 6.29565C12.0393 6.29565 11.243 6.62547 10.656 7.21254ZM12.6279 8.21057C12.8683 8.16276 13.1175 8.18732 13.344 8.28116C13.5991 8.38687 13.8916 8.26576 13.9973 8.01065C14.103 7.75554 13.9819 7.46304 13.7268 7.35733C13.3176 7.18776 12.8672 7.14338 12.4328 7.22979C11.9984 7.3162 11.5993 7.52952 11.2861 7.84278C11.0909 8.03806 11.0909 8.35464 11.2862 8.54988C11.4815 8.74512 11.7981 8.74509 11.9933 8.5498C12.1666 8.37645 12.3875 8.25839 12.6279 8.21057Z" fill="#FEB272"/>
4
+ <rect x="1" y="4" width="7" height="1" rx="0.5" fill="white"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.74782 12.3321C3.36587 12.5582 3.11111 12.9647 3.11111 13.4286C3.11111 14.1387 3.70804 14.7143 4.44444 14.7143C5.18084 14.7143 5.77778 14.1387 5.77778 13.4286C5.77778 12.7754 5.27271 12.236 4.61862 12.1537C4.60404 12.1034 4.58884 12.0454 4.57338 11.9803C4.52013 11.7559 4.46933 11.4714 4.43151 11.1791C4.3936 10.8862 4.37009 10.5959 4.36853 10.3589C4.36796 10.2721 4.3704 10.1964 4.37538 10.1329C4.54636 10.0856 4.71782 10.043 4.88889 10.0054C5.08502 9.96233 5.20111 10.1856 5.29516 10.3665C5.30827 10.3917 5.32093 10.416 5.33333 10.4387H7.13951C7.54653 10.4386 7.74773 10.4387 7.95124 10.4387C8.15004 10.4388 8.35138 10.4388 8.74893 10.4387H10.5552C10.6567 10.2529 10.8876 9.95633 11.1111 10.0054C11.3495 10.0578 11.5887 10.1199 11.8262 10.191L11.8247 10.1917C11.8242 10.1907 11.8242 10.1908 11.8248 10.1923C11.8268 10.1983 11.8366 10.2263 11.8463 10.2871C11.8574 10.3563 11.8651 10.4462 11.8682 10.5544C11.8745 10.7706 11.862 11.0333 11.8354 11.298C11.8088 11.5624 11.7694 11.8184 11.7249 12.0205C11.7151 12.0652 11.7053 12.106 11.6956 12.1429H11.1111C10.9428 12.1429 10.7889 12.2346 10.7136 12.3798L10.2692 13.2369C10.2383 13.2964 10.2222 13.3621 10.2222 13.4286V14.2857C10.2222 14.5224 10.4212 14.7143 10.6667 14.7143H11.5556V13.8571H11.1111V13.5298L11.3858 13H12.6142L12.8889 13.5298V13.8571H12.4444V14.7143H13.3333C13.5788 14.7143 13.7778 14.5224 13.7778 14.2857V13.4286C13.7778 13.3621 13.7617 13.2964 13.7308 13.2369L13.2864 12.3798C13.2111 12.2346 13.0572 12.1429 12.8889 12.1429H12.6064C12.6538 11.9146 12.6933 11.6478 12.7201 11.3806C12.7492 11.0917 12.7644 10.7919 12.7568 10.5304L12.7564 10.5186C14.5287 11.2407 16 12.4283 16 13.6728V16H0V13.6728C0 12.3733 1.60441 11.1357 3.48044 10.4256C3.48551 10.692 3.51169 10.9935 3.54942 11.2852C3.59018 11.6001 3.64573 11.9137 3.70693 12.1715C3.72004 12.2268 3.73369 12.2806 3.74782 12.3321ZM4.44444 13.8634C4.68373 13.8634 4.88889 13.6747 4.88889 13.4286C4.88889 13.1825 4.68373 12.9937 4.44444 12.9937C4.20516 12.9937 4 13.1825 4 13.4286C4 13.6747 4.20516 13.8634 4.44444 13.8634Z" fill="#0D6EFD"/>
3
+ <circle cx="8" cy="4.5" r="4" fill="white" stroke="#0D6EFD"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.78711 0.580775C6.44054 0.211042 7.19561 0 7.99998 0C10.2885 0 12.178 1.70828 12.4628 3.91922C11.8094 4.28896 11.0543 4.5 10.25 4.5C7.96149 4.5 6.072 2.79172 5.78711 0.580775Z" fill="#0D6EFD"/>
5
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="24" height="24" rx="4" fill="white"/>
3
+ <rect x="4" y="4" width="12" height="16" rx="1" fill="#D63384"/>
4
+ <path d="M6 7H14" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M6 10H11" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M6 13H10" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
7
+ <path d="M17.7141 13.9H17.7143H18.8571C19.3009 13.9 19.7213 14.0853 20.0273 14.4066C20.3325 14.7271 20.5 15.1568 20.5 15.6C20.5 15.8841 20.3928 16.1611 20.1947 16.3691C20.1166 16.4511 20.0267 16.5198 19.9286 16.5729V17.4C19.9286 17.6841 19.8213 17.9611 19.6233 18.1691C19.4244 18.3779 19.1494 18.5 18.8571 18.5H13.1429C12.8506 18.5 12.5756 18.3779 12.3767 18.1691C12.1787 17.9611 12.0714 17.6841 12.0714 17.4V16.5729C11.9733 16.5198 11.8834 16.4511 11.8053 16.3691C11.6072 16.1611 11.5 15.8841 11.5 15.6C11.5 15.1568 11.6675 14.7271 11.9727 14.4066C12.2787 14.0853 12.6991 13.9 13.1429 13.9H14.2857H14.2859C14.4454 13.9001 14.6037 13.835 14.7256 13.7106C14.8481 13.5855 14.9235 13.4104 14.9287 13.221C14.9314 13.1048 14.9076 12.9905 14.8603 12.8877L15.3145 12.6787L14.8603 12.8877C14.813 12.785 14.7443 12.698 14.6616 12.6325C14.2906 12.3401 14.0203 11.9358 13.8844 11.4793C13.7486 11.0227 13.753 10.5334 13.8971 10.0795L14.3519 10.2239L13.8971 10.0795C14.0413 9.6254 14.3192 9.22616 14.6959 8.94107C15.073 8.65567 15.5293 8.5 16 8.5C16.4707 8.5 16.927 8.65567 17.3041 8.94107C17.6808 9.22616 17.9587 9.6254 18.1029 10.0795C18.247 10.5334 18.2514 11.0227 18.1156 11.4793C17.9797 11.936 17.7092 12.3405 17.3379 12.6328L17.3377 12.633C17.255 12.6981 17.1861 12.7848 17.1389 12.8875C17.0917 12.9902 17.0681 13.1045 17.0712 13.2206L17.7141 13.9ZM17.7141 13.9C17.5546 13.9001 17.3964 13.8351 17.2745 13.7107M17.7141 13.9L17.2745 13.7107M17.2745 13.7107C17.1519 13.5856 17.0764 13.4103 17.0712 13.2208L17.2745 13.7107Z" fill="#E685B5" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
8
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 12C0 8.27247 0 6.4087 0.608964 4.93853C1.42092 2.97831 2.97831 1.42092 4.93853 0.608964C6.4087 0 8.27247 0 12 0C15.7275 0 17.5913 0 19.0615 0.608964C21.0217 1.42092 22.5791 2.97831 23.391 4.93853C24 6.4087 24 8.27247 24 12C24 15.7275 24 17.5913 23.391 19.0615C22.5791 21.0217 21.0217 22.5791 19.0615 23.391C17.5913 24 15.7275 24 12 24C8.27247 24 6.4087 24 4.93853 23.391C2.97831 22.5791 1.42092 21.0217 0.608964 19.0615C0 17.5913 0 15.7275 0 12Z" fill="#F8F9FA"/>
3
+ <path d="M12 11C13.933 11 15.5 9.433 15.5 7.5C15.5 5.567 13.933 4 12 4C10.067 4 8.5 5.567 8.5 7.5C8.5 9.433 10.067 11 12 11Z" stroke="#3D8BFD" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M9.5 5C10.0015 5.63268 10.6029 6.13588 11.268 6.47953C11.9332 6.82317 12.6485 7.00019 13.3712 7C14.1033 7.00035 14.8277 6.81885 15.5 6.46662" stroke="#3D8BFD" stroke-linejoin="round"/>
5
+ <path d="M4 20C4 18.1435 4.84285 16.363 6.34315 15.0503C7.84344 13.7375 9.87827 13 12 13C14.1217 13 16.1566 13.7375 17.6569 15.0503C19.1571 16.363 20 18.1435 20 20" stroke="#3D8BFD" stroke-linecap="round" stroke-linejoin="round"/>
6
+ </svg>
@@ -6,7 +6,7 @@ const CHEVRON_DOWN_COLOR = '#6f83a9';
6
6
  const CHEVRON_UP_COLOR = '#2a6fd7';
7
7
 
8
8
  const Accordion = props => {
9
- const { headerContent, bodyContent } = props;
9
+ const { headerContent, bodyContent, onClick } = props;
10
10
  const [rotate, setRotate] = useState(false);
11
11
  const handleAccordionClick = () => setRotate(!rotate);
12
12
  const accordionId = uniqueId(
@@ -14,16 +14,18 @@ const Accordion = props => {
14
14
  );
15
15
 
16
16
  const isAccordionOpenable = () => {
17
- const tableDataCondition =
18
- bodyContent.props.tableData &&
19
- bodyContent.props.tableData.filter(x => 'data' in x && x.data).length > 0;
20
- const childrenCondition =
21
- bodyContent.props.children &&
22
- (bodyContent.props.children.length > 0 || bodyContent.props.children);
23
- if (tableDataCondition || childrenCondition) {
24
- return true;
17
+ if (bodyContent) {
18
+ const tableDataCondition =
19
+ bodyContent.props.tableData &&
20
+ bodyContent.props.tableData.filter(x => 'data' in x && x.data).length >
21
+ 0;
22
+ const childrenCondition =
23
+ bodyContent.props.children &&
24
+ (bodyContent.props.children.length > 0 || bodyContent.props.children);
25
+ if (tableDataCondition || childrenCondition) {
26
+ return true;
27
+ }
25
28
  }
26
-
27
29
  return false;
28
30
  };
29
31
 
@@ -55,16 +57,22 @@ const Accordion = props => {
55
57
  }`}
56
58
  type="button"
57
59
  data-bs-target={`#${accordionId}`}
58
- data-bs-toggle={isAccordionOpenable() ? 'collapse' : null}
60
+ data-bs-toggle={
61
+ isAccordionOpenable() && typeof onClick !== 'function'
62
+ ? 'collapse'
63
+ : null
64
+ }
59
65
  aria-controls={accordionId}
60
66
  aria-expanded="false"
61
- onClick={handleAccordionClick}
67
+ onClick={
68
+ typeof onClick === 'function' ? onClick : handleAccordionClick
69
+ }
62
70
  >
63
71
  <div className="fhir-container__Accordion__header-text d-flex w-100 justify-content-start position-relative">
64
72
  {React.cloneElement(headerContent, {
65
73
  isAccordionOpenable: isAccordionOpenable(),
66
74
  })}
67
- {getChevron()}
75
+ {typeof onClick !== 'function' && getChevron()}
68
76
  </div>
69
77
  </button>
70
78
  </div>
@@ -19,8 +19,7 @@ export const hasValue = data => {
19
19
  return false;
20
20
  };
21
21
 
22
- const CodeableConcept = props => {
23
- const { fhirData } = props;
22
+ const CodeableConcept = ({ fhirData, isCursive = false }) => {
24
23
  if (!_isObject(fhirData)) return null;
25
24
 
26
25
  const data = Array.isArray(fhirData) ? fhirData : [fhirData];
@@ -40,7 +39,11 @@ const CodeableConcept = props => {
40
39
  </span>
41
40
  )}
42
41
  {coding.map((codingData, j) => (
43
- <Coding key={`codingData-${j}`} fhirData={codingData} />
42
+ <Coding
43
+ key={`codingData-${j}`}
44
+ fhirData={codingData}
45
+ isCursive={isCursive}
46
+ />
44
47
  ))}
45
48
  </div>
46
49
  );
@@ -4,8 +4,7 @@ import _get from 'lodash/get';
4
4
 
5
5
  import './Coding.css';
6
6
 
7
- const Coding = props => {
8
- const { fhirData } = props;
7
+ const Coding = ({ fhirData, isCursive = false }) => {
9
8
  const display = _get(fhirData, 'display', '');
10
9
  const code = _get(fhirData, 'code', '');
11
10
  const system = _get(fhirData, 'system', '');
@@ -14,7 +13,12 @@ const Coding = props => {
14
13
  <div className="fhir-datatype__Coding">
15
14
  <span className="fhir-datatype__Coding__title">{display}</span>&nbsp;
16
15
  {hasAdditionalInfo && (
17
- <span className="fhir-datatype__Coding__code" title={system}>
16
+ <span
17
+ className={`${
18
+ isCursive ? 'fst-italic' : ''
19
+ } fhir-datatype__Coding__code`}
20
+ title={system}
21
+ >
18
22
  ({code || '?'})
19
23
  </span>
20
24
  )}
@@ -7,17 +7,19 @@ const Reference = props => {
7
7
  const { fhirData } = props;
8
8
  const display = _get(fhirData, 'display');
9
9
  const reference = _get(fhirData, 'reference', '');
10
+
10
11
  return (
11
12
  <div
12
13
  className="fhir-datatype__Reference d-inline-block"
13
14
  data-testid={props['data-testid']}
14
15
  >
15
16
  {display && <span className="mr-2 pe-1">{display}</span>}
16
- {reference.startsWith('http://') || reference.startsWith('https://') ? (
17
- <a href={reference}>{reference}</a>
18
- ) : (
19
- <span>{reference}</span>
20
- )}
17
+ {!display &&
18
+ (reference.startsWith('http://') || reference.startsWith('https://') ? (
19
+ <a href={reference}>{reference}</a>
20
+ ) : (
21
+ <span>{reference}</span>
22
+ ))}
21
23
  </div>
22
24
  );
23
25
  };
@@ -3,8 +3,7 @@ import _get from 'lodash/get';
3
3
 
4
4
  import './Telecom.css';
5
5
 
6
- const Telecom = props => {
7
- const { fhirData } = props;
6
+ const Telecom = ({ fhirData, noSystemData = false }) => {
8
7
  if (Array.isArray(fhirData)) {
9
8
  return (
10
9
  <div className="fhir-datatype__Telecom">
@@ -12,7 +11,7 @@ const Telecom = props => {
12
11
  const system = _get(item, 'system', '');
13
12
  return (
14
13
  <div className="fhir-datatype__Telecom__item" key={`phone-${i}`}>
15
- {system && (
14
+ {!noSystemData && system && (
16
15
  <span className="fhir-datatype__Telecom__item-label">
17
16
  {system}
18
17
  </span>
@@ -2,11 +2,19 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import _get from 'lodash/get';
4
4
  import fhirVersions from '../fhirResourceVersions';
5
- import { Root, Header, Title, Body, Value } from '../../ui';
5
+ import {
6
+ Root,
7
+ Header,
8
+ Body,
9
+ ValueSection,
10
+ ValueSectionItem,
11
+ Value,
12
+ } from '../../ui';
6
13
  import Reference from '../../datatypes/Reference';
7
14
  import Date from '../../datatypes/Date';
8
15
  import UnhandledResourceDataStructure from '../UnhandledResourceDataStructure';
9
16
  import CodeableConcept, { hasValue } from '../../datatypes/CodeableConcept';
17
+ import Accordion from '../../containers/Accordion';
10
18
 
11
19
  const commonDTO = fhirResource => {
12
20
  const subject = _get(fhirResource, 'subject');
@@ -63,8 +71,7 @@ const resourceDTO = (fhirVersion, fhirResource) => {
63
71
  }
64
72
  };
65
73
 
66
- const AdverseEvent = props => {
67
- const { fhirResource, fhirVersion } = props;
74
+ const AdverseEvent = ({ fhirResource, fhirVersion, fhirIcons, onClick }) => {
68
75
  let fhirResourceData = {};
69
76
  try {
70
77
  fhirResourceData = resourceDTO(fhirVersion, fhirResource);
@@ -86,47 +93,79 @@ const AdverseEvent = props => {
86
93
  hasEvent,
87
94
  } = fhirResourceData;
88
95
 
96
+ const tableData = [
97
+ {
98
+ label: 'Event',
99
+ testId: 'event',
100
+ data: hasEventType && <CodeableConcept fhirData={eventType} />,
101
+ status: hasEventType,
102
+ },
103
+ {
104
+ label: 'Event',
105
+ testId: 'event',
106
+ data: hasEvent && <CodeableConcept fhirData={event} />,
107
+ status: hasEvent,
108
+ },
109
+ {
110
+ label: 'Seriousness',
111
+ testId: 'hasSeriousness',
112
+ data: hasSeriousness && (
113
+ <CodeableConcept fhirData={seriousness} isCursive />
114
+ ),
115
+ status: hasSeriousness,
116
+ },
117
+ {
118
+ label: 'Actuality',
119
+ testId: 'actuality',
120
+ data: actuality,
121
+ status: actuality,
122
+ },
123
+ ];
124
+
89
125
  return (
90
126
  <Root name="AdverseEvent">
91
- <Header>
92
- {subject && (
93
- <Title>
94
- <Reference fhirData={subject} />
95
- </Title>
96
- )}
97
- </Header>
98
- <Body>
99
- {date && (
100
- <Value label="Date" data-testid="date">
101
- <Date fhirData={date} />
102
- </Value>
103
- )}
104
- {hasEventType && (
105
- <Value label="Type" data-testid="type">
106
- <CodeableConcept fhirData={eventType} />
107
- </Value>
108
- )}
109
- {hasEvent && (
110
- <Value label="Event" data-testid="event">
111
- <CodeableConcept fhirData={event} />
112
- </Value>
113
- )}
114
- {description && (
115
- <Value label="Description" data-testid="description">
116
- {description}
117
- </Value>
118
- )}
119
- {hasSeriousness && (
120
- <Value label="Seriousness" data-testid="hasSeriousness">
121
- <CodeableConcept fhirData={seriousness} />
122
- </Value>
123
- )}
124
- {actuality && (
125
- <Value label="Actuality" data-testid="actuality">
126
- {actuality}
127
- </Value>
128
- )}
129
- </Body>
127
+ <Accordion
128
+ headerContent={
129
+ <Header
130
+ resourceName={'AdverseEvent'}
131
+ title={subject && <Reference fhirData={subject} />}
132
+ icon={fhirIcons}
133
+ additionalContent={
134
+ date && (
135
+ <Value label="Date" data-testid="date">
136
+ <Date fhirData={date} isBlack />
137
+ </Value>
138
+ )
139
+ }
140
+ />
141
+ }
142
+ bodyContent={
143
+ <Body>
144
+ {description && (
145
+ <ValueSection
146
+ label="Comment"
147
+ data-testid="description"
148
+ marginBottom
149
+ >
150
+ <span className="text-secondary">{description}</span>
151
+ </ValueSection>
152
+ )}
153
+ {tableData.map(
154
+ (item, index) =>
155
+ item.status && (
156
+ <ValueSectionItem
157
+ key={`adverse-event-item-${index}`}
158
+ label={item.label}
159
+ data-testid={item.testId}
160
+ >
161
+ {item.data}
162
+ </ValueSectionItem>
163
+ ),
164
+ )}
165
+ </Body>
166
+ }
167
+ onClick={onClick}
168
+ />
130
169
  </Root>
131
170
  );
132
171
  };
@@ -7,6 +7,8 @@ import fhirVersions from '../fhirResourceVersions';
7
7
  import stu3Example1 from '../../../fixtures/stu3/resources/adverseEvent/example1.json';
8
8
  import r4Example1 from '../../../fixtures/r4/resources/adverseEvent/example1.json';
9
9
 
10
+ import fhirIcons from '../../../fixtures/example-icons';
11
+
10
12
  export default {
11
13
  title: 'AdverseEvent',
12
14
  };
@@ -14,13 +16,21 @@ export default {
14
16
  export const DefaultVisualizationSTU3 = () => {
15
17
  const fhirResource = object('Resource', stu3Example1);
16
18
  return (
17
- <AdverseEvent fhirResource={fhirResource} fhirVersion={fhirVersions.STU3} />
19
+ <AdverseEvent
20
+ fhirResource={fhirResource}
21
+ fhirVersion={fhirVersions.STU3}
22
+ fhirIcons={fhirIcons}
23
+ />
18
24
  );
19
25
  };
20
26
 
21
27
  export const Example1ofR4 = () => {
22
28
  const fhirResource = object('Resource', r4Example1);
23
29
  return (
24
- <AdverseEvent fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />
30
+ <AdverseEvent
31
+ fhirResource={fhirResource}
32
+ fhirVersion={fhirVersions.R4}
33
+ fhirIcons={false}
34
+ />
25
35
  );
26
36
  };