From 1c452d2802b651414261380623d8f705a8c37125 Mon Sep 17 00:00:00 2001 From: Brad Lance Date: Sun, 5 Jul 2026 20:15:29 -0500 Subject: [PATCH] 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. --- Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json | 2 +- Entities/EXAMPLE/entity.json | 2 +- README.md | 12 ++++++------ engine.ps1 | 10 ++++++++-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json b/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json index 037f74b..84ff891 100644 --- a/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json +++ b/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json @@ -4,7 +4,7 @@ "ftps": { "username": "practice-specific-username", "password": "practice-specific-password", - "insurance_path": "/{practice}/CustomInsuranceFolder", + "tiff_path": "/{practice}/CustomInsuranceFolder", "pdf_path": "/{practice}/CustomPdfFolder" }, diff --git a/Entities/EXAMPLE/entity.json b/Entities/EXAMPLE/entity.json index 7c90396..ec66e3b 100644 --- a/Entities/EXAMPLE/entity.json +++ b/Entities/EXAMPLE/entity.json @@ -8,7 +8,7 @@ "tls": true, "username": "shared-username", "password": "shared-password", - "insurance_path": "/{practice}/Insurance", + "tiff_path": "/{practice}/Insurance", "pdf_path": "/{practice}/PDF" }, diff --git a/README.md b/README.md index 66a6f4d..bbd35dc 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Common reasons to add a `practice.json`: - The practice's files need to go to a **different folder path** on the server than the standard `{practice}` pattern (e.g. the imaging vendor set it up with a different folder name, or a nonstandard structure) — override - `insurance_path`, `pdf_path`, and/or `patient_path` to whatever that + `tiff_path`, `pdf_path`, and/or `patient_path` to whatever that practice actually needs You can mix and match — e.g. override just `pdf_path` for one practice and @@ -92,7 +92,7 @@ leave its login and every other path alone. "tls": true, "username": "shared-username", "password": "shared-password", - "insurance_path": "/{practice}/Insurance", + "tiff_path": "/{practice}/Insurance", "pdf_path": "/{practice}/PDF" }, @@ -115,7 +115,7 @@ leave its login and every other path alone. | `ftps.tls` | Yes | `true` for FTPS (secure), `false` for plain FTP | | `ftps.username` | Yes | FTP username (shared across all practices) | | `ftps.password` | Yes | FTP password | -| `ftps.insurance_path` | Yes | Remote folder for insurance files — keep `{practice}` in it | +| `ftps.tiff_path` | Yes | Remote folder for insurance files — keep `{practice}` in it. (The older name `insurance_path` still works too) | | `ftps.pdf_path` | Yes | Remote folder for PT STMT files — keep `{practice}` in it | | `sftp.host` | Only if `insurance+patient` | SFTP server address | | `sftp.port` | No (defaults to 22) | SFTP port, only if not 22 | @@ -137,7 +137,7 @@ uploads and nothing archives for that practice until it's fixed. **Editing JSON — the rules that bite:** - Key names must match **exactly** (all lowercase, underscores): `host`, not - `hostname`; `username`, not `user`; `insurance_path`, not `insurancepath` + `hostname`; `username`, not `user`; `tiff_path`, not `tiffpath` - Every `"key": "value"` pair ends with a comma **except the last one in its block** — a missing or extra comma breaks the whole file - Keep values inside straight double quotes (`"`). Avoid editing in Word or @@ -159,7 +159,7 @@ If one practice needs a different login, a different folder path, or both: The field names are the same ones as `entity.json`, wrapped in the same `ftps` / `sftp` sections. A `practice.json` can also **add** a field that `entity.json` doesn't have at all — e.g. if `entity.json` has no -`insurance_path` because every practice's path is different, each practice's +`tiff_path` because every practice's path is different, each practice's `practice.json` can carry its own. Example — this practice only has its own PDF folder name, nothing else differs: @@ -188,7 +188,7 @@ Example — this practice has completely different remote folders for everything ```json { "ftps": { - "insurance_path": "/SpecialFolder/Claims", + "tiff_path": "/SpecialFolder/Claims", "pdf_path": "/SpecialFolder/Statements" }, "sftp": { diff --git a/engine.ps1 b/engine.ps1 index 5e5b95d..8285a12 100644 --- a/engine.ps1 +++ b/engine.ps1 @@ -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