# CTM Document Builder

Proprietary internal app/tool used to build documents for Canada TravelMED appointments.

# Instruction Manager

Welcome to the **Instruction Manager**! This screen acts as your digital catalog for creating, viewing, and updating standard boilerplate instructions for vaccines.

These instructions are automatically saved and used behind the scenes to help build official documentation later on, ensuring your paperwork is always consistent, accurate, and up-to-date.

### How the Screen is Laid Out (TODO: replace with snapshot)

The screen is split into two halves:

1. **The Left Side (Create Form):** Where you type up and add brand-new vaccine instructions to your system.
2. **The Right Side (Saved Entries / Edit Panel):** A running list of every vaccine instruction currently saved in your database.

```
+-------------------------------------------------------------------------+
|                          Instruction Manager                            |
+----------------------------------------+--------------------------------+
| LEFT SIDE: Add New Instructions        | RIGHT SIDE: Your Saved Catalog |
|                                        |                                |
|  1. Type the Vaccine Name              |  * Click a name to view it.     |
|  2. Write the details in the editor    |  * Click "Edit" to change it.   |
|  3. Click "Save"                       |  * Click "Delete" to remove it. |
+----------------------------------------+--------------------------------+
| Tip: You can always press the "Escape" key on your keyboard to instantly  |
| close any pop-up window or confirmation box.                            |
+-------------------------------------------------------------------------+

```

### How to Use the Interface

#### 1. Adding a New Vaccine Instruction

To add a brand-new guideline to your system:

- **Step 1:** Go to the input box on the left and type in the **Vaccine** name.
- **Step 2:** Use the **Rich Text Editor** box below it to write out your instructions. You can format your text here just like a standard word processor (adding bold text, lists, etc.).
- **Step 3:** Click the purple **Save** button. The form will instantly clear out, and your new entry will appear in the list on the right side of the screen.

<p class="callout info">**Note:** The "Save" button will stay grayed-out until you have typed both a vaccine name and an instruction.</p>

#### 2. Viewing a Saved Instruction

If you want to read through the full text of an instruction you previously wrote:

- Look at the list on the right side of the screen.
- Click directly on the **Vaccine Name**.
- A large window will pop up in the middle of the screen displaying the complete text. When you are finished reading, click **Close** or press the `Escape` key on your keyboard to dismiss it.

#### 3. Editing an Existing Entry

If guidelines change and you need to update a vaccine's name or text:

- Find the item in the list and click its gray **Edit** button.
- The entire right panel will temporarily change into an edit station for that specific record.
- **To change the instruction text:** Simply modify the text directly inside the editor box.
- **To change the vaccine name:** Click directly on the vaccine's title string. It will transform into a text box allowing you to rename it.
- **Saving your changes:** Click **Save changes**. If you change your mind and don't want to make any updates, simply click **Cancel** to go back to your normal list.

<p class="callout info">Note: The "Save changes" button will only let you click it if you have actually changed something. If you haven't typed anything new, it will remain locked.</p>

#### 4. Deleting an Entry

If a vaccine is no longer in use and you need to purge it from the system:

- Click the red **Delete** button next to that item in the list.
- A safety pop-up window will appear asking you to confirm that you want to remove it.
- Click **DELETE** to permanently erase it, or click **Cancel** if you clicked it by mistake.

### Quick Shortcuts &amp; Tips

- **The Escape Key:** Whenever you have a pop-up window open (like the delete confirmation or the full instruction viewer), you can instantly close it by hitting the **`Esc`** key on your physical keyboard.
- **Timestamps:** Underneath each vaccine name in the list, you can see a small date and time stamp showing exactly when that instruction was last modified so you can track how fresh the information is.

# Vaccination Record Builder

The **Vaccination Record Builder** is your primary workspace for assembling a patient's immunization history into a professional, printable PDF document. You can type in details manually, arrange the order of the table, or even import a previously made PDF to quickly update it.

### How the Screen is Laid Out (TODO: snapshot)

The screen is organized into a **Data Entry Side** and a **Live Preview Side**:

1. **The Left Side (Data Entry Workspaces):** Contains the forms where you type in the patient's information, add separate vaccination events (rows), and write down customized clinical notes.
2. **The Right Side (Row List Preview):** Displays a running checklist of every vaccination you have added to the current record. This list shows exactly how the information will look and how it will be ordered on the final document.

```
+-------------------------------------------------------------------------+
|                           Vaccination Record                            |
+----------------------------------------+--------------------------------+
| LEFT SIDE: Data Entry & Forms          | RIGHT SIDE: Live Table Preview |
|                                        |                                |
|  [Patient Details Form]                |  This shows exactly how rows   |
|  - Name, DOB, Last Updated Date        |  will appear on the final PDF. |
|                                        |                                |
|  [Add Vaccination Form]  [Notes Form]  |   * Item 1 (Top of PDF)        |
|  - Disease, Lot, Brand   - Footnotes   |   * Item 2                     |
|                                        |                                |
|  [Import PDF]     [Export PDF]         |  Use arrows to change order!   |
+----------------------------------------+--------------------------------+

```

### Step-by-Step Instructions

#### Step 1: Fill Out the Patient's Details

At the top left of the screen, complete the core information for the patient:

- Type the **Patient Name**.
- Enter their **Date of Birth** using the date selector.
- The **Last Update** box will automatically set itself to today's date, but you can change it manually if needed.

<p class="callout info">**Note:** You must fill out all three of these boxes before the system will allow you to export the final PDF document.</p>

#### Step 2: Add Individual Vaccination Rows

To log a specific immunization event:

1. Under **Add vaccination row**, select the target **Disease** from the dropdown menu.
2. Fill in the specific details: **Date** given, the **Product brand**, the **Lot Number**, and the medical **Provider**.
3. Click the purple **Add to list** button.
4. The vaccine information will instantly clear from the form and jump over to the preview table on the right side of the screen.

<p class="callout success"> ***Tips for Row Entry:*** The "Add to list" button will remain grayed out until every single field in the row form has been filled in.  
  
There is a maximum limit of rows you can add to a single document. If you hit this cap, the system will prevent you from adding more.</p>

#### Step 3: Organize and Reorder the History Table

Take a look at the **Row List** on the right side of the screen. The final PDF will print these entries in the exact order you see them here.

- **Move Items Up or Down:** Click the **Up Arrow** or **Down Arrow** icons on any row to change its position in the list.
- **Remove an Error:** Click the red **Trash Can** icon to permanently delete a row from the list.

#### Step 4: Add Custom Footer Notes

At the bottom left, use the **Notes** box to write down any extra details you want featured at the bottom of the record (such as next-dose reminders, clinic contact details, or specific waivers).

#### Step 5: Generate and Save your PDF

When the record is completely finished:

1. Make sure the patient details are complete and at least one vaccination row is listed.
2. Click the purple **Export PDF** button at the bottom of the screen.
3. The application will fetch your clinic's official logo, compile your data, and open your computer's standard "Save As" window.
4. Choose where you want to save the document on your computer and hit save!

### Time-Saving Feature: Importing an Existing PDF

If a patient returns to your clinic for a new booster shot, you do not need to re-type their entire history from scratch!

1. Click the gray **Import PDF** button at the bottom left.
2. Select a previously generated vaccination PDF file from your computer.
3. The system will read the file and automatically fill in the patient's name, birthday, notes, and all past vaccination rows.
4. *Safety Note:* If you have already started typing fresh info into the workspace, a pop-up window will ask if you are sure you want to replace your current text with the imported file's data.

# Instructions

The **Instructions** workspace allows you to quickly pull standard vaccine guidelines from your library, arrange them in any order you like, and make one-time custom edits before printing them out as a clean, unified PDF document for your patient.

Any edits you make here **only affect the current document**—the master copy stored safely in your main library will remain completely unchanged.

### How the Screen is Laid Out

The workspace is organized into a **Three-Part Screen Layout**:

1. **The Left Sidebar (Library):** A scrollable list of all master vaccines available in your clinic's database.
2. **The Middle Column (Canvas):** Your active project workbench showing the current list of vaccines you have chosen to compile for the printout.
3. **The Right Column (Preview / Live Editor):** A live reading panel showing how the instructions look. When editing, this panel turns into an active word processor.

```
+-------------------------------------------------------------------------+
|                          Instructions Workspace                         |
+-------------------+-----------------------------------------------------+
| LEFT: Library     | MAIN WORKSPACE: Canvas & Live Preview Panel         |
|                   |  [ Download PDF ]                                   |
|  * Master List    |  +-------------------------+--------------------+  |
|    of Vaccines    |  | Canvas (Middle)         | Preview (Right)    |  |
|                   |  |                         |                    |  |
|  (Click an item   |  |  * Selected Vaccine 1   | Displays the full  |  |
|   to send it to   |  |  * Selected Vaccine 2   | instructions.      |  |
|   the Canvas)     |  |                         | Turns into editor  |  |
|                   |  |   (Reorder or edit it)  | when customizing!  |  |
+-------------------+--+-------------------------+--------------------+  |
+-------------------------------------------------------------------------+

```

### Step-by-Step Instructions

#### Step 1: Select Vaccines from your Library

Look at the **Library** panel on the far left.

- Scroll through and **click directly on any vaccine** you want to hand out to the patient.
- Each time you click a vaccine, it will pop over to the **Canvas** column in the middle of the screen.

#### Step 2: Organize the Layout Order

Look at the **Canvas** column in the middle of the screen. The PDF will display the instructions in the exact top-to-bottom sequence you build here.

- **Shift Items Up or Down:** Click the **Up Arrow** or **Down Arrow** icons on any item to swap its position in the list.
- **Remove an Item:** Click the red **Trash Can** icon to remove that vaccine from your current document layout.

#### Step 3: Customize Text for This Document Only

If you need to make an ad-hoc change for a specific patient scenario (e.g., overriding a standard timeline or tailoring notes to a specific health history):

1. In the middle Canvas column, find the vaccine row you want to adjust and click its **Pencil (Edit)** icon.
2. The **Preview** pane on the right will instantly switch into a text editor displaying that vaccine's text.
3. Modify the text inside the text editor box as needed.
4. **To Lock In Changes:** Click the purple **Lock** button at the bottom right. This saves the edits to this document project.
5. **To Undo Your Changes:** Click the gray **Cancel** button. This will erase your temporary text and instantly restore the instruction back to the standard version from your library.

#### Step 4: Download and Save the Final PDF

Once your list is ordered correctly and any custom edits are locked into place:

1. Ensure your Canvas is not empty.
2. Click the purple **Download PDF** button at the top of the workspace.
3. The application automatically appends your facility's logo and the standard business address header (101- 444 Concession St, Hamilton, ON) to the top of the template.
4. Your computer's native file saving window will open up. Choose your local folder destination, name the file, and click save!