- FhirResource Component: Renders the provided FHIR resource in a visually appealing format.
- Customizable Header Icons: Allows users to customize header icons in various ways, including passing a URL, an
<img> element, a React src from import, or a false value to display a placeholder.
- Resource Icon Display: Displays the resource icon, if available, or a placeholder if not provided.
- Overriding Default Accordion Functionality: Users can override the default Accordion function by passing a custom function to the onClick variable.
- Assigning Accordion IDs: Users can assign a number to be added at the end of the Accordion ID. If no number is provided, the library uses the lodash uniqueId function by default.
- Props for FhirResource Component: The FhirResource component accepts several props, including fhirResource (the FHIR resource to be rendered), fhirVersion (the FHIR resource version), withCarinBBProfile (to use the Carin BB profile extension), withDaVinciPDex (to use the DaVinci Payer Data Exchange profile extension), and thorough (to determine if all array items and supported attributes should be displayed).
To install the fhir-react package, follow these steps:
- Open your terminal and navigate to the desired directory for your project.
- Run the following command to install the package via npm:
npm install fhir-react
The fhir-react package provides a React component library for displaying FHIR data. It offers features such as flexible customization options, resource icon display, and the ability to override default functionality. By using the FhirResource component and its props, users can easily render FHIR resources in their React applications.