From 5c335fe289cb5f452622b06f64c218f6c22d19d5 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Tue, 7 Nov 2023 10:36:23 -0500 Subject: [PATCH] update documentation for updating state programs --- docs/technical-design/howto-update-state-programs.md | 2 +- scripts/import-programs.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/technical-design/howto-update-state-programs.md b/docs/technical-design/howto-update-state-programs.md index 24a33b1b3b..2b769c6adb 100644 --- a/docs/technical-design/howto-update-state-programs.md +++ b/docs/technical-design/howto-update-state-programs.md @@ -11,6 +11,6 @@ The source of truth for that file comes from a CSV maintained by product and des 1. Download the latest version of csv from google docs when prompted by product/design. 2. Run the script following the command listed in the `import-programs.ts`. -3. Overwrite existing state programs JSON with the new output. Your usage of the script will likely look something like this: `cd scripts && yarn tsc && node import-programs.js ~/Desktop/State\ programs,\ population,\ and\ nicknames.csv > ../services/app-web/src/common-code/data/statePrograms.json` +3. Overwrite existing state programs JSON with the new output. Your usage of the script will likely look something like this: `cd scripts && yarn tsc && node import-programs.js path/to/data.csv > ../services/app-web/src/common-code/data/statePrograms.json` 4. Double check the diff. It's important not to delete any programs that have already been used for a submission because although programs are not in the database, we still store references to the program ID in postgres as if they are stable. Also, we want to be sure we are only changing programs expected to change. 5. Make a PR to update the statePrograms file in the codebase diff --git a/scripts/import-programs.ts b/scripts/import-programs.ts index 6b76d8755d..519ae35c2e 100644 --- a/scripts/import-programs.ts +++ b/scripts/import-programs.ts @@ -2,13 +2,16 @@ This script is used to generate a list of MC-Review state programs. To read more about this script and why it's used see "How to update state programs" technical design docs. To run: - yarn tsc && node ./import-programs.js path/to/data.csv + yarn tsc && node ./import-programs.js path/to/data.csv > ../services/app-web/src/common-code/data/statePrograms.json The input file is expected to be a valid CSV with at least the following columns: 1 State (two-character state code, uppercase) 2 Program (full program name) 3 Nickname (acronym or abbreviation e.g. "CME") +Documentation for this script can be found here: +https://github.com/Enterprise-CMCS/managed-care-review/blob/main/docs/technical-design/howto-update-state-programs.md + Additional columns aren't used and should be ignored. */