Repository navigation
PRD \ Save File View Design Doc
Design Document (First Draft - Revised per Feedback) Last updated: 2025-04-26
The SaveFileView in EZLogger replicates and improves upon the functionality of the legacy EZLogger VBA Save form.
It allows the user to Move or Copy the active Word document into a structured folder system based on patient information, report type, and report date.
The feature ensures all forensic reports follow a consistent file naming and storage convention, enabling easier search, retrieval, and SharePoint integration.
- The user fills out required fields (patient information, report type, report date).
- The user selects either:
- Move (relocate and delete the old file), or
- Copy (create a new file and leave the original untouched).
- The user clicks ShowPathBtn:
- System generates the expected save path and filename.
- Displays the generated path in
NewFileNameTxtBlk. - Copies the folder name (patient name) to clipboard for ease of navigation.
- The user clicks SaveBtn:
- System opens a Save As dialog, prefilled with the generated filename and folder.
- If user confirms save:
- New file is saved.
- (Move only) Old file is deleted if possible.
- Document properties are updated (e.g., Unique ID).
- Confirmation message is shown.
- If user cancels Save As:
- No further action is taken.
| Control Name | Purpose |
|---|---|
MoveOptBtn |
Selects Move operation. |
CopyOptBtn |
Selects Copy operation. |
ShowPathBtn |
Generates and displays the proposed full save path and filename. |
SaveBtn |
Opens Save As dialog to complete the save process. |
NewFileNameTxtBlk |
Displays the generated full save path. |
ReportTypeCbo |
User selects the report type (preloaded from config). |
ReportDateTxt |
User enters or selects report date. |
PatientNameTxtBlk |
Displays patient's name pulled from document properties. |
Note: Control abbreviations follow standard: Txt, Cbo, Btn, Opt, TxtBlk.
SaveFileView requires valid paths loaded from local_user_config.json:
| Config Key | Purpose |
|---|---|
sp_filepath.user_forensic_library |
Root folder for Copy operation. |
sp_filepath.all_penal_codes |
Root folder for Move operation. |
If these values are missing:
- Warn the user to recreate their config file.
- Prevent proceeding with Save operation.
- On form load:
- Read
local_user_config.json. - Store move and copy root paths in memory.
- Read
- Validate that either Move or Copy option is selected.
- Build the full save path using:
<Root Path>\\<First Letter of Patient Lastname>\\<Patient Name> <Report Type> <Report Date>.docx
- Display the path in
NewFileNameTxtBlk. - Copy the folder name (patient name) to clipboard using
ClipboardHelper.
- Validate that either Move or Copy option is selected.
- Open Save As dialog:
- Initial folder set to root path (Move/Copy path).
- Filename pre-filled.
- If user saves:
- Save the file.
- (If Move) Attempt to delete original file.
- Update Word document properties (e.g., Unique ID).
- Show confirmation message (different for Move vs Copy).
- If user cancels:
- Exit quietly with no action.
Generated filename format:
<Patient Name> <Report Type> <Report Date>.docx
Example:
SMITH, John Progress Report 2025-04-26.docx
-
Patient Name: Taken from Word document property
Patient Name. -
Report Type: Selected from
ReportTypeCbo. -
Report Date: Entered by user in
ReportDateTxt. -
Extension: Always
.docx(auto-correct.docif needed).
| Situation | Handling |
|---|---|
| Move/Copy option not selected | Show warning message. Prevent further steps. |
| Paths missing from config | Show critical warning. User must recreate config. |
| Old file locked and cannot delete | Show warning but allow new file to remain saved. |
| Save As canceled | Exit quietly with no action. |
| Clipboard copy fails | Log internal error; allow user to continue. |
-
ClipboardHelpermodule: For copying patient folder names to clipboard. -
ConfigPathHelpermodule: For loading local config paths. -
DocumentPropertyHelpermodule: For reading and writing Word document properties. -
CustomMsgBoxcontrol: For displaying user-friendly messages.
None planned for MVP.
Autosave and save logs will not be implemented. Dynamic folder picking is supported inherently through the Save As dialog.