This SMART on FHIR application calculates the PADUA Risk Score for Venous Thromboembolism (VTE) based on patient data fetched from an EHR system. The app automatically pulls relevant information from FHIR resources and calculates the risk score. If necessary, users can manually input missing data.
- Fetch patient data from FHIR server (via SMART on FHIR).
- Automatically deduce PADUA risk factors from FHIR resources (e.g., problems list, medications).
- Allow manual input for missing or unavailable data.
- Display the calculated PADUA risk score with clinical guidance similar to MDCalc.
- User-friendly interface built with React.
Before you run the app, make sure you have the following:
- Node.js and npm installed on your machine.
- You can download and install Node.js from https://nodejs.org/.
- An active SMART on FHIR environment and credentials to register the app with a client ID.
- You can use the SMART sandbox at http://launch.smarthealthit.org for testing.
- Familiarity with React and JavaScript.
Follow these steps to run the app on your local machine:
git clone https://github.com/aahmed98/padua.git
cd padua
In your project directory, run the following command to install the necessary dependencies:
npm install
You need to set up the SMART on FHIR app by registering it with a client ID and configuring the authorization settings. For testing purposes, you can use the SMART sandbox.
- Configure your
clientId
andredirectUri
* in the React components:- In
Launch.js
, theclientId
should match the one registered with your SMART on FHIR environment. - The
redirectUri
will point to your local server (e.g.,http://localhost:3000/app
).
- In
*Skip setting clientId
if you are querying public (i.e. sandbox) FHIR servers.
- Launch the authorization flow from the
Launch
component:- The
Launch
component triggers the SMART on FHIR authorization flow and redirects the user back to theApp
after successful authentication.
- The
Use the following command to start a local development server:
npm start
This will start the app on http://localhost:3000
.
You can now launch the app using the SMART Sandbox or an actual EHR system.
To test the app with the SMART sandbox:
- Go to http://launch.smarthealthit.org.
- Type
http://localhost:3000/
into the App's Launch URL. - Click Launch. This will initiate the SMART on FHIR authorization flow.
- Once the patient is selected and the authorization process is completed, the app will load with the patient's data.
Once the patient is authorized and data is fetched, the app will attempt to automatically extract the following PADUA risk factors:
- Active Cancer
- Previous VTE (Excluding superficial vein thrombosis)
- Reduced Mobility
- Already Known Thrombophilic Condition
- Recent Trauma/Surgery
- Elderly Age (≥70 years)
- Heart/Respiratory Failure
- Acute MI/Ischemic Stroke
- Acute Infection/Rheumatologic Disorder
- Obesity (BMI ≥30)
- Ongoing Hormonal Treatment
If any of these are not available from the FHIR resources, you will be prompted to manually input the data.
For each risk factor, there will be a field where:
- If data is available from FHIR resources, it is pre-filled.
- If data is missing, you can manually input the value (e.g., "Yes" or "No" for each factor).
The app will calculate the PADUA score based on the provided inputs and display the result, along with clinical guidance similar to how MDCalc presents risk scores.
src/index.js
: The entry point for the app, which sets up routing between theLaunch
andApp
components.src/Launch.js
: Component that initiates the SMART on FHIR authorization flow.src/App.js
: Main React component that handles the user interface and PADUA score calculation.src/utils/fhirUtils.js
: Utility functions for fetching data from the FHIR server and extracting relevant risk factors.src/utils/codes.js
: List of codes for each risk factor used to calculated PADUA.
If you wish to contribute to this project or make changes:
- Fork the repository.
- Make changes in your fork.
- Submit a pull request with a detailed description of your changes.
The codes.js
file contains a list of codes (SNOMED, ICD10, RxNorm) used to check for the existence of certain conditions in the FHIR resources. You can modify these lists to add or remove codes as needed. These codes are essential for determining the presence of various risk factors in the patient's medical records.
If you encounter issues, here are some things to check:
- Ensure your SMART on FHIR environment is properly set up.
- Verify the
clientId
andredirectUri
in theLaunch.js
andApp.js
components. - Check the console for errors related to missing data or authorization issues.
If you need further assistance, feel free to open an issue on the GitHub repository!
This project is licensed under the MIT License - see the LICENSE file for details.