This repository contains an HTML application for calculating hold time, implemented in VS Code. Below are the steps to understand and run the application.
- Clone the repository:
git clone hhttps://github.com/jimhitt/HoldTimeCalculator.git
This project provides a web-based solution for calculating the appropriate hold time for anticoagulant and antiplatelet medications before a procedure. I used a published anticoagulation reference sheet and ChatGPT to write a web-based application. I am not experienced in writing CCS or JavaScript code, and ChatGPT was indispensable for accomplishing that goal. The following summarizes the iterative steps taken to develop and enhance the solution with the help of the LLM.
- Prompt: I presented a PDF summarizing hold times for various medications and asked for a web-based solution.
- Solution: The LLM provided an initial HTML and JavaScript code iteration to create a web-based Anticoagulant Hold Time Calculator.
- Prompt: In a new session, I presented the initial code, which had bugs and did not work as expected.
- Solution: The LLM debugged the code, ensuring it correctly handled date calculations and user input validation.
- Prompt: Asked to alphabetize the list of medications and change the selection to radio buttons, ensuring only one selection is allowed.
- Solution: Modified the HTML to use radio buttons and alphabetized the medications list.
- Prompt: Asked to include the hold time in parentheses next to each medication name in the radio buttons.
- Solution: Updated the radio button labels to include the hold time in parentheses.
- Prompt: Asked to add a reference to the original PDF and today's date below the header, and include a disclaimer at the bottom.
- Solution: Added the reference and disclaimer in the HTML.
- Prompt: Asked to include the antiplatelet agents clopidogrel, prasugrel, and ticagrelor.
- Solution: Added these agents to the medications list with their respective hold times.
- Prompt: Asked to display the hold time in both hours and days for any hold time greater than 24 hours.
- Solution: Modified the display format to show both hours and days.
- Prompt: Asked to make the form more visually appealing.
- Solution: Added CSS styles to enhance the appearance of the form, including background, padding, borders, and hover effects.
- Prompt: Asked to create a simpler data table for medications and use it to generate the radio buttons dynamically to improve the process of editing the hold times or adjusting the medication list.
- Solution: Created a data table with medications and hold times and updated the JavaScript to generate the options dynamically.
- Prompt: Asked to use checkboxes instead of radio buttons to allow multiple selections and generate multiple stop times.
- Solution: Changed the input type to checkboxes and updated the JavaScript to handle multiple selections.
- Prompt: Asked to remove the separate text box for the procedure hour and include it in a single datetime field.
- Solution: Replaced the date and hour inputs with a single
datetime-local
input and updated the JavaScript accordingly.
- Prompt: Asked to expand the container size that holds the list of medications to make most or all of them visible.
- Solution: Adjusted the CSS to increase the
max-height
of the container and ensure it is scrollable if necessary.
The final implementation includes:
- A single
datetime-local
input for procedure date and time. - Dynamically generated checkbox options for medications.
- Enhanced visual styling.
- Comprehensive handling of multiple medication selections and their respective hold times.
This iterative process allowed us to refine and enhance the functionality and user experience of the Anticoagulant Hold Time Calculator.