Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TI Script Updates #1648

Merged
merged 11 commits into from
Dec 13, 2024
Merged
3 changes: 2 additions & 1 deletion scripts/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ RS_HOME="/path/to/prime-reportstream"
RS_LCL_API_URL="http://localhost:7071"
RS_STG_API_URL="https://staging.prime.cdc.gov:443"
RS_PRD_API_URL="https://prime.cdc.gov:443"
TI_LCL_API_URL="http://host.docker.internal:8080"
TI_LCL_API_URL="http://localhost:8080"
TI_DOCKER_LCL_API_URL_RS_CONFIG="http://host.docker.internal:8080"
TI_STG_API_URL="https://cdcti-stg-api.azurewebsites.net:443"
TI_PRD_API_URL="https://cdcti-prd-api.azurewebsites.net:443"

Expand Down
33 changes: 29 additions & 4 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
# Scripts
- [Setup](#setup)
- [Available Scripts](#available-scripts)
saquino0827 marked this conversation as resolved.
Show resolved Hide resolved
- [submit.sh](#submitsh)
- [Requirements](#requirements)
- [Usage](#usage)
- [rs.sh](#rssh)
- [Requirements](#requirements-1)
- [Usage](#usage-1)
- [Examples](#examples)
- [ti.sh](#tish)
- [Requirements](#requirements-2)
- [Usage](#usage-2)
- [Examples](#examples-1)
- [ucsd.sh](#ucsdsh)
- [Requirements](#requirements-3)
- [Before running the script](#before-running-the-script)
- [Usage](#usage-3)
- [setup/update-examples-snapshots.sh](#setupupdate-examples-snapshotssh)
- [Requirements](#requirements-4)
- [Usage](#usage-4)
- [setup/setup-reportstream.sh](#setupsetup-reportstreamsh)
- [Requirements](#requirements-5)
- [Usage](#usage-5)
- [lib/common.sh](#libcommonsh)
- [lib/submission-utils.sh](#libsubmission-utilssh)
- [Resources](#resources)

## Setup

Follow the instructions below to load the environments variables required for these scripts
Follow the instructions below to load the environments variables required for these scripts.
ReportStream and Trusted Intermediary must be running locally before running any scripts.

1. Copy `.env.template` to `.env`
```
Expand Down Expand Up @@ -209,7 +234,7 @@ Sends all the HL7 files with `_0_initial_message.hl7` suffix in the `/examples`

### setup/setup-reportstream.sh

Setup script for ReportStream
Setup script for ReportStream.

#### Requirements

Expand Down
14 changes: 12 additions & 2 deletions scripts/setup/setup-reportstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ echo "Resetting the database and loading the baseline settings..."
./gradlew reloadTables
./gradlew reloadSettings

# Update RS Configuration for the TI API based on docker or gradle
# PS: Logic to determine to use gradle vs docker needs updating
# The logic needs to check if BOTH TI and RS are running in docker, otherwise it should use localhost:8080
saquino0827 marked this conversation as resolved.
Show resolved Hide resolved
LOCAL_DOCKER_IMAGE_NAME=$(docker ps --filter "name=trusted-intermediary-router-1" | grep trusted-intermediary-router-1)
saquino0827 marked this conversation as resolved.
Show resolved Hide resolved
if [[ ! -z $LOCAL_DOCKER_IMAGE_NAME ]]; then
ti_api_url=${TI_LCL_API_URL}
else
ti_api_url=${TI_DOCKER_LCL_API_URL_RS_CONFIG}
fi

# Need to CD to prime-router to run the prime CLI
cd "prime-router" || exit

Expand All @@ -41,8 +51,8 @@ yq eval '.[0].receivers[] |= (
)' -i "settings/STLTs/Flexion/flexion.yml"

echo "Updating local URL and host in transport settings..."
sed -i '' "s|__TI_API_URL__|${TI_LCL_API_URL}|g" "settings/STLTs/Flexion/flexion.yml"
sed -i '' "s|__TI_API_HOST__|$(extract_host_from_url "${TI_LCL_API_URL}")|g" "settings/STLTs/Flexion/flexion.yml"
sed -i '' "s|__TI_API_URL__|${ti_api_url}|g" "settings/STLTs/Flexion/flexion.yml"
sed -i '' "s|__TI_API_HOST__|$(extract_host_from_url "${ti_api_url}")|g" "settings/STLTs/Flexion/flexion.yml"

echo "Updating transport settings in partner org files..."
for file in "settings/STLTs/CA/ucsd.yml" "settings/STLTs/LA/la-ochsner.yml" "settings/STLTs/LA/la-phl.yml"; do
Expand Down
Loading