diff --git a/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json b/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json index 8f2f81f..037f74b 100644 --- a/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json +++ b/Entities/EXAMPLE/Export1/PRACTICE_NAME/practice.json @@ -1,13 +1,16 @@ { - "_comment": "Only create this file if this practice has its own FTP login. Delete any section you don't need to override.", + "_comment": "Only create this file if this practice needs something different from entity.json. Delete any line/section you don't need to override — only what's listed here gets changed, everything else still comes from entity.json.", "ftps": { "username": "practice-specific-username", - "password": "practice-specific-password" + "password": "practice-specific-password", + "insurance_path": "/{practice}/CustomInsuranceFolder", + "pdf_path": "/{practice}/CustomPdfFolder" }, "sftp": { "username": "practice-specific-username", - "password": "practice-specific-password" + "password": "practice-specific-password", + "patient_path": "/{practice}/CustomPatientFolder" } } diff --git a/README.md b/README.md index 547944f..a7571ae 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,32 @@ Entities\ --- -## Setting up a new entity +## The two config files + +There are two JSON files, and they work together — one sets the defaults for +the whole entity, the other overrides just what's different for one practice. + +- **`entity.json`** — lives in the entity folder (e.g. `Entities\CAMBS\entity.json`). + Required. This is the default server info used by every practice under that + entity: which server, which login, which folder paths. +- **`practice.json`** — lives inside one practice's folder (e.g. + `Entities\CAMBS\Export1\AJMAT\practice.json`). Optional — only add it if a + practice needs something *different* from `entity.json`. Whatever fields you + put in here replace the matching field from `entity.json` for that practice + only; anything you leave out still comes from `entity.json`. + +Common reasons to add a `practice.json`: +- The practice has its own separate FTP/SFTP login instead of the shared one +- 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 + practice actually needs + +You can mix and match — e.g. override just `pdf_path` for one practice and +leave its login and every other path alone. + +### `entity.json` 1. Create a folder under `Entities\` with the entity name (e.g. `Entities\CAMBS\`) 2. Copy `run.bat` into it @@ -71,15 +96,41 @@ Entities\ 4. Create the `Export1\` folder and a subfolder for each practice inside the entity folder +`{practice}` in any path gets automatically replaced with that practice's +folder name — so one `entity.json` can serve every practice as long as they +all follow the same folder-naming pattern on the server. + --- -## Setting up a practice with its own FTP login +## `practice.json` — overriding one practice -If one practice has its own FTP username/password (different from the entity default): +If one practice needs a different login, a different folder path, or both: 1. Create a `practice.json` file inside that practice's folder 2. Copy from `Entities\EXAMPLE\Export1\PRACTICE_NAME\practice.json` -3. Fill in only the username and password that differ — everything else comes from entity.json +3. Delete every line you *don't* need to change — keep only the fields that + differ for this practice. Everything you delete falls back to `entity.json`. + +Example — this practice only has its own PDF folder name, nothing else differs: + +```json +{ + "ftps": { + "pdf_path": "/{practice}/PDF_Statements_Custom" + } +} +``` + +Example — this practice has its own SFTP login but uses the same paths as everyone else: + +```json +{ + "sftp": { + "username": "ajmat-sftp-user", + "password": "ajmat-sftp-pass" + } +} +``` ---