fhir-react 0.3.1 → 0.3.5

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 (83) hide show
  1. package/README.md +85 -2
  2. package/build/bootstrap-reboot.min.css +8 -2
  3. package/build/index.js +7 -14
  4. package/build/style.css +26 -239
  5. package/package.json +3 -2
  6. package/src/assets/containers/Binary/binary.svg +9 -0
  7. package/src/assets/containers/Patient/patient.svg +6 -0
  8. package/src/components/containers/Accordion/Accordion.js +17 -12
  9. package/src/components/datatypes/Annotation/Annotation.js +4 -4
  10. package/src/components/datatypes/CodeableConcept/CodeableConcept.css +4 -1
  11. package/src/components/datatypes/Coding/Coding.css +0 -1
  12. package/src/components/datatypes/HeaderIcon/HeaderIcon.js +67 -22
  13. package/src/components/datatypes/Reference/Reference.css +3 -0
  14. package/src/components/datatypes/Reference/Reference.js +2 -0
  15. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +87 -76
  16. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +11 -1
  17. package/src/components/resources/Appointment/Appointment.js +3 -3
  18. package/src/components/resources/Appointment/Appointment.stories.js +28 -5
  19. package/src/components/resources/Appointment/Appointment.test.js +72 -0
  20. package/src/components/resources/Binary/Binary.js +31 -20
  21. package/src/components/resources/Binary/Binary.stories.js +6 -5
  22. package/src/components/resources/CarePlan/CarePlan.js +111 -96
  23. package/src/components/resources/CarePlan/CarePlan.test.js +2 -2
  24. package/src/components/resources/CarePlan/CarePlanActivity.js +6 -2
  25. package/src/components/resources/Condition/Condition.js +1 -2
  26. package/src/components/resources/Condition/Condition.stories.js +9 -19
  27. package/src/components/resources/Condition/Condition.test.js +71 -1
  28. package/src/components/resources/Device/Device.js +54 -34
  29. package/src/components/resources/DiagnosticReport/DiagnosticReport.js +53 -43
  30. package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +7 -1
  31. package/src/components/resources/DocumentReference/DocumentReference.js +101 -65
  32. package/src/components/resources/DocumentReference/DocumentReference.stories.js +4 -0
  33. package/src/components/resources/Encounter/Encounter.js +3 -4
  34. package/src/components/resources/Encounter/Encounter.stories.js +27 -5
  35. package/src/components/resources/Encounter/Encounter.test.js +72 -0
  36. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +26 -10
  37. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +8 -0
  38. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +80 -3
  39. package/src/components/resources/ExplanationOfBenefit/SupportingInfo.js +21 -6
  40. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +47 -38
  41. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +4 -0
  42. package/src/components/resources/Goal/Goal.js +104 -85
  43. package/src/components/resources/Goal/Goal.stories.js +37 -7
  44. package/src/components/resources/Goal/Goal.test.js +1 -3
  45. package/src/components/resources/Immunization/Immunization.js +1 -2
  46. package/src/components/resources/Immunization/Immunization.stories.js +6 -9
  47. package/src/components/resources/Immunization/Immunization.test.js +71 -1
  48. package/src/components/resources/MedicationOrder/MedicationOrder.js +45 -28
  49. package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +2 -1
  50. package/src/components/resources/MedicationRequest/MedicationRequest.js +65 -43
  51. package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +16 -5
  52. package/src/components/resources/MedicationStatement/MedicationDetails.js +52 -0
  53. package/src/components/resources/MedicationStatement/MedicationDosage.js +46 -0
  54. package/src/components/resources/MedicationStatement/MedicationStatement.js +65 -118
  55. package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +6 -0
  56. package/src/components/resources/MedicationStatement/MedicationStatement.test.js +31 -6
  57. package/src/components/resources/Observation/Observation.js +3 -3
  58. package/src/components/resources/Observation/Observation.stories.js +14 -5
  59. package/src/components/resources/Observation/Observation.test.js +67 -0
  60. package/src/components/resources/Patient/Patient.js +9 -6
  61. package/src/components/resources/Patient/Patient.stories.js +12 -5
  62. package/src/components/resources/Patient/Patient.test.js +67 -0
  63. package/src/components/resources/Practitioner/Practitioner.js +3 -13
  64. package/src/components/resources/Practitioner/Practitioner.stories.js +19 -3
  65. package/src/components/resources/Practitioner/Practitioner.test.js +72 -0
  66. package/src/components/resources/Procedure/Procedure.js +1 -2
  67. package/src/components/resources/Procedure/Procedure.stories.js +11 -5
  68. package/src/components/resources/Procedure/Procedure.test.js +71 -1
  69. package/src/components/resources/ResourceCategory/ResourceCategory.js +6 -3
  70. package/src/components/resources/ResourceCategory/ResourceCategory.test.js +1 -1
  71. package/src/components/supportedFhirResourceList.js +2 -0
  72. package/src/components/ui/bootstrap-reboot.min.css +8 -2
  73. package/src/components/ui/index.js +44 -25
  74. package/src/fixtures/example-icons.jsx +55 -10
  75. package/src/fixtures/r4/resources/explanationOfBenefit/c4bbExample.json +18 -2
  76. package/src/index.js +1 -0
  77. package/src/style.scss +1 -0
  78. package/src/utils/convertCamelCaseToSentence.js +9 -0
  79. package/src/utils/convertCamelCaseToSentence.test.js +9 -0
  80. package/src/utils/formatDate.js +6 -4
  81. package/webpack.config.js +10 -1
  82. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.css +0 -4
  83. package/src/components/resources/CarePlan/CarePlan.css +0 -7
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![CircleCI](https://circleci.com/gh/1uphealth/fhir-react/tree/master.svg?style=svg)](https://circleci.com/gh/1uphealth/fhir-react/tree/master)
2
- [![Storybook](https://github.com/storybookjs/brand/raw/master/badge/badge-storybook.svg?sanitize=true)](http://storybook-fhir-react-lib.s3-website-us-east-1.amazonaws.com/)
2
+ [![Storybook](https://github.com/storybookjs/brand/raw/master/badge/badge-storybook.svg?sanitize=true)](https://fhir-react-lib-test-storybook.s3.amazonaws.com/branch/release-0-3-4/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. 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:
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: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
177
- 'Courier New', monospace;
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