1.4 KiB
1.4 KiB
melissa-export-tools
Automation scripts for Melissa's patient export workflow.
Rename and Move PT STMT.bat
Scans a root folder for patient export directories, renames export.txt with today's date, and moves it along with all .tif files into a new dated subfolder.
What It Does
For every folder found under the root that contains an export.txt:
- Renames
export.txt→PT STMT_YYYYMMDD.txt - Creates a new subfolder named
PT STMT_YYYYMMDD - Moves the renamed
.txtfile into that subfolder - Moves all
.tiffiles in the same folder into that subfolder
Expected Folder Structure
ROOT\
<patient_id>\
Patient\
Export\
export.txt ← renamed and moved
1000001.tif ← moved
1000002.tif ← moved
After running:
ROOT\
<patient_id>\
Patient\
Export\
PT STMT_20260423\
PT STMT_20260423.txt
1000001.tif
1000002.tif
Setup
- Open
Rename and Move PT STMT.batin Notepad - Set the
ROOTvariable to your actual folder path:set "ROOT=C:\Users\Melissa\Documents\Patients" - Save and double-click to run
Notes
- Uses
pushd/popdto work around Windows' 260-character path length limit - Safe to re-run —
mkdirfor the dated folder will silently skip if it already exists - Date format is
YYYYMMDD(e.g.20260423)