Files
melissa-export-tools/Create Test Environment.bat
2026-04-23 21:37:32 -05:00

52 lines
1.7 KiB
Batchfile

@echo off
setlocal
REM === TEST ENVIRONMENT SETUP ===
REM Creates a sample folder structure to test the rename/move script.
REM Run this to reset back to a clean baseline at any time.
set "TESTROOT=%~dp0TEST"
echo Resetting test environment at %TESTROOT%...
echo.
REM Wipe and recreate the test root
if exist "%TESTROOT%" (
rd /s /q "%TESTROOT%"
echo Cleared existing test folder.
)
REM === CREATE PATIENT FOLDERS ===
REM Each has Patient\Export\ with an EXPORT.txt and some .tif files
for %%p in (Patient001 Patient002 Patient003) do (
mkdir "%TESTROOT%\%%p\Patient\Export"
echo.> "%TESTROOT%\%%p\Patient\Export\EXPORT.txt"
echo.> "%TESTROOT%\%%p\Patient\Export\1000001.tif"
echo.> "%TESTROOT%\%%p\Patient\Export\1000002.tif"
echo.> "%TESTROOT%\%%p\Patient\Export\1000003.tif"
echo Created: %%p
)
REM === CREATE AN ARCHIVE FOLDER (should be skipped by the main script) ===
mkdir "%TESTROOT%\Patient004\Patient\Export\archive"
echo.> "%TESTROOT%\Patient004\Patient\Export\archive\EXPORT.txt"
echo.> "%TESTROOT%\Patient004\Patient\Export\archive\1000001.tif"
echo Created: Patient004 (archive folder - should be skipped)
REM === CREATE A PT STMT FOLDER (should also be skipped) ===
mkdir "%TESTROOT%\Patient005\Patient\Export\PT STMT_20260101"
echo.> "%TESTROOT%\Patient005\Patient\Export\PT STMT_20260101\EXPORT.txt"
echo.> "%TESTROOT%\Patient005\Patient\Export\PT STMT_20260101\1000001.tif"
echo Created: Patient005 (PT STMT folder - should be skipped)
echo.
echo Done. Test environment ready at:
echo %TESTROOT%
echo.
echo To test the rename script, copy "Rename and Move PT STMT.bat" into:
echo %TESTROOT%
echo and run it from there.
echo.
pause