Rename insurance_path config key to tiff_path (insurance_path still accepted)

Renamed in engine.ps1, both EXAMPLE configs, and the README. Existing
entity.json/practice.json files using insurance_path keep working - the
engine copies it to tiff_path after the merge when tiff_path isn't set.
This commit is contained in:
2026-07-05 20:15:29 -05:00
parent ef046e8b7b
commit 1c452d2802
4 changed files with 16 additions and 10 deletions
+8 -2
View File
@@ -247,6 +247,12 @@ foreach ($practice in $practices) {
$config = Merge-Config $entityConfig $override
if ($override) { Write-Debug "practice.json override loaded for $pracName" }
# tiff_path is the current name; insurance_path is accepted as a fallback
# so older config files keep working.
if ($config.ftps -and -not $config.ftps.PSObject.Properties["tiff_path"] -and $config.ftps.PSObject.Properties["insurance_path"]) {
$config.ftps | Add-Member -NotePropertyName "tiff_path" -NotePropertyValue $config.ftps.insurance_path
}
# -- Insurance + PT STMT -> FTPS -------------------------------------------
$dateDir = Join-Path $practice.FullName $today
if (-not (Test-Path $dateDir)) {
@@ -257,11 +263,11 @@ foreach ($practice in $practices) {
$ptStmts = $allInsuranceFiles | Where-Object { $_.Name -imatch 'pt[\s_]*stmt' }
$insFiles = $allInsuranceFiles | Where-Object { $_.Name -notmatch 'pt[\s_]*stmt' }
$insPath = Expand-Path $config.ftps.insurance_path $pracName
$insPath = Expand-Path $config.ftps.tiff_path $pracName
$pdfPath = Expand-Path $config.ftps.pdf_path $pracName
$insResult = @{ Ok = 0; Fail = 0 }
$missing = Get-MissingFields $config.ftps "ftps" @("host", "username", "password", "insurance_path", "pdf_path")
$missing = Get-MissingFields $config.ftps "ftps" @("host", "username", "password", "tiff_path", "pdf_path")
if (($insFiles.Count -gt 0 -or $ptStmts.Count -gt 0) -and $missing.Count -gt 0) {
Write-Host " CONFIG ERROR: entity.json is missing or has blank: $($missing -join ', ')" -ForegroundColor Red
Write-Host " Check spelling of those keys in entity.json (and practice.json if present)." -ForegroundColor Yellow