- Create a reusable component for backend API integration
- How the UI component will call the reusable component to retrieve the data
- All the backend API integration is coded in this API slice - https://codesandbox.io/s/muqhwj....
- I use the method -
getResourcesEntries
for getting ALL kinds of resources (other than Patient record) and also do transformation from backend process API to experience API for the Summary View (I moved the included patient resources into respective patient data resource egCondition
under the element "_includedPatient
", so that it is easier for UI to render the data). - The second method is
getResourceDetail
which is to get the detail payload of the specific record for any given type of resource for the Detail View
- The UI layout is implemented in these two files
- Summary View - https://codesandbox.io/s/muqhwj....
- Detail View - https://codesandbox.io/s/muqhwj....
- Add new record type and corresponding menu item name in this file - https://codesandbox.io/s/muqhwj?file=/src/app/Navbar.js
- Add/update data elements to be shown for the corresponding record type - update function
resourceSummaryElements
in this file - https://codesandbox.io/s/muqhwj... - Also you need to point your own FHIR server, please modify the server setting in the fhirAPISlice.js - https://codesandbox.io/s/muqhwj?file=/src/api/fhirApiSlice.js
Happy coding and have fun!