2026-04-23 21:10:03 -05:00
2026-04-23 21:10:03 -05:00

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:

  1. Renames export.txtPT STMT_YYYYMMDD.txt
  2. Creates a new subfolder named PT STMT_YYYYMMDD
  3. Moves the renamed .txt file into that subfolder
  4. Moves all .tif files 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

  1. Open Rename and Move PT STMT.bat in Notepad
  2. Set the ROOT variable to your actual folder path:
    set "ROOT=C:\Users\Melissa\Documents\Patients"
    
  3. Save and double-click to run

Notes

  • Uses pushd/popd to work around Windows' 260-character path length limit
  • Safe to re-run — mkdir for the dated folder will silently skip if it already exists
  • Date format is YYYYMMDD (e.g. 20260423)
S
Description
Automation scripts for Melissa export workflow
Readme 36 KiB
Languages
Batchfile 100%