generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chores/additional-code-coverage
- Loading branch information
Showing
19 changed files
with
140 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
client= | ||
audience=https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token | ||
secret=/path/to/ucsd-epic-private-key.pem | ||
root=$CDCTI_HOME/examples/CA/ | ||
fpath="$1" | ||
shift | ||
|
||
hurl \ | ||
--variable fpath=$fpath \ | ||
--file-root $root \ | ||
--variable jwt=$(jwt encode --exp='+5min' --jti $(uuidgen) --alg RS256 -k $client -i $client -s $client -a $audience --no-iat -S @$secret) \ | ||
results.hurl \ | ||
$@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Epic/UCSD Hurl Script | ||
|
||
## Before running the script | ||
|
||
- Add the `client` id to `.hrl` | ||
- Update the `secret` variable path | ||
|
||
## Usage | ||
|
||
`./hrl <HL7_FILE_NAME>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# curl -H 'Content-Type: application/x-www-form-urlencoded' --data 'client_assertion=$(jwt encode --exp=+5min --jti $(uuidgen) --alg RS256 -k $client -i $client -s $client -a https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token --no-iat -S @/path/to/ucsd-epic-private-key.pem)' --data 'client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer' --data 'grant_type=client_credentials' 'https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token' | ||
POST https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token | ||
Content-Type: application/x-www-form-urlencoded | ||
[FormParams] | ||
client_assertion: {{jwt}} | ||
client_assertion_type: urn:ietf:params:oauth:client-assertion-type:jwt-bearer | ||
grant_type: client_credentials | ||
|
||
HTTP 200 | ||
|
||
[Captures] | ||
token: jsonpath "$['access_token']" | ||
|
||
# curl -H 'Content-Type: application/hl7-v2' -H 'Authorization: Bearer $token' --data-binary '@/path/to/oru.hl7' 'https://epicproxy-np.et0502.epichosted.com/CDPH_NBGS_TST/api/epic/2015/EDI/HTTP/HL7v2/910377' | ||
POST https://epicproxy-np.et0502.epichosted.com/CDPH_NBGS_TST/api/epic/2015/EDI/HTTP/HL7v2/910377 | ||
Content-Type: application/hl7-v2 | ||
Authorization: Bearer {{token}} | ||
file,{{fpath}}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script loads the ETOR organization settings and adds the public keys for the senders. | ||
# NOTE: Remember to run this script inside the prime-router directory of the prime-reportstream codebase | ||
# Make sure to add a CDCTI_HOME environment variable pointing to the trusted-intermediary directory | ||
# export CDCTI_HOME="/path/to/trusted-intermediary" | ||
# You'll also need to set the path to the keys if running in a non-local environment | ||
|
||
env=${1:-"local"} | ||
|
||
if [ "$env" = "local" ]; then | ||
flexion_key="$CDCTI_HOME/mock_credentials/organization-trusted-intermediary-public-key-local.pem" | ||
# al_phl_key="/path/to/organization-al-phl-public-key-local.pem" | ||
# oracle_rln_key="/path/to/organization-oracle-rln-public-key-local.pem" | ||
# ca_phl_key="/path/to/organization-ca-phl-public-key-local.pem" | ||
# la_phl_key="/path/to/organization-la-phl-public-key-local.pem" | ||
# la_ochsner_key="/path/to/organization-la-ochsner-public-key-local.pem" | ||
elif [ "$env" = "staging" ]; then | ||
# flexion_key="/path/to/organization-trusted-intermediary-public-key-staging.pem" | ||
# al_phl_key="/path/to/organization-al-phl-public-key-staging.pem" | ||
# oracle_rln_key="/path/to/organization-oracle-rln-public-key-staging.pem" | ||
# ca_phl_key="/path/to/organization-ca-phl-public-key-staging.pem" | ||
# la_phl_key="/path/to/organization-la-phl-public-key-staging.pem" | ||
# la_ochsner_key="/path/to/organization-la-ochsner-public-key-staging.pem" | ||
elif [ "$env" = "prod" ]; then | ||
# flexion_key="/path/to/organization-trusted-intermediary-public-key-prod.pem" | ||
# al_phl_key="/path/to/organization-al-phl-public-key-prod.pem" | ||
# oracle_rln_key="/path/to/organization-oracle-rln-public-key-prod.pem" | ||
# ca_phl_key="/path/to/organization-ca-phl-public-key-prod.pem" | ||
# la_phl_key="/path/to/organization-la-phl-public-key-prod.pem" | ||
# la_ochsner_key="/path/to/organization-la-ochsner-public-key-prod.pem" | ||
else | ||
echo "Unknown environment: $env" | ||
exit 1 | ||
fi | ||
|
||
## Flexion | ||
./prime multiple-settings set -s -e $env -i ./settings/STLTs/Flexion/flexion.yml | ||
./prime organization addkey -e $env --public-key $flexion_key --scope "flexion.*.report" --orgName flexion --kid flexion.etor-service-sender --doit | ||
./prime organization addkey -e $env --public-key $flexion_key --scope "flexion.*.report" --orgName flexion --kid flexion.simulated-hospital --doit | ||
./prime organization addkey -e $env --public-key $flexion_key --scope "flexion.*.report" --orgName flexion --kid flexion.simulated-lab --doit | ||
|
||
## AL | ||
./prime multiple-settings set -s -e $env -i ./settings/STLTs/AL/al-phl.yml | ||
# ./prime organization addkey -e $env --public-key $al_phl_key --scope "al-phl.*.report" --orgName al-phl --kid al-phl.etor-nbs-results --doit | ||
./prime multiple-settings set -e $env -s -i ./settings/STLTs/Oracle/oracle-rln.yml | ||
# ./prime organization addkey -e $env --public-key $oracle_rln_key --scope "oracle-rln.*.report" --orgName oracle-rln --kid oracle-rln.etor-nbs-orders --doit | ||
|
||
## CA | ||
./prime multiple-settings set -s -e $env -i ./settings/STLTs/CA/ucsd.yml | ||
./prime multiple-settings set -s -e $env -i ./settings/STLTs/CA/ca-phl.yml | ||
# ./prime organization addkey -e $env --public-key $ca_phl_key --scope "ca-phl.*.report" --orgName ca-phl --kid ca-phl.etor-nbs-results --doit | ||
|
||
## LA | ||
./prime multiple-settings set -s -e $env -i ./settings/STLTs/LA/la-phl.yml | ||
# ./prime organization addkey -e $env --public-key $la_phl_key --scope "la-phl.*.report" --orgName la-phl --kid la-phl.etor-nbs-results --doit | ||
./prime multiple-settings set -s -e $env -i ./settings/STLTs/LA/la-ochsner.yml | ||
# ./prime organization addkey -e $env --public-key $la_ochsner_key --scope "la-ochsner.*.report" --orgName la-ochsner --kid la-ochsner.etor-nbs-orders --doit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script resets the database and loads the baseline settings. | ||
# NOTE: Remember to run this script inside the prime-router directory of the prime-reportstream codebase | ||
# Make sure to add a CDCTI_HOME environment variable pointing to the trusted-intermediary directory | ||
# export CDCTI_HOME="/path/to/trusted-intermediary" | ||
|
||
./gradlew resetDB | ||
./gradlew reloadTable | ||
./gradlew flywayRepair | ||
./gradlew reloadSettings | ||
./prime multiple-settings set -s -i ./settings/staging/0166-flexion-staging-results-handling.yml | ||
./prime organization addkey --public-key $CDCTI_HOME/mock_credentials/organization-trusted-intermediary-public-key-local.pem --scope "flexion.*.report" --orgName flexion --kid flexion.etor-service-sender --doit | ||
./prime organization addkey --public-key $CDCTI_HOME/mock_credentials/organization-trusted-intermediary-public-key-local.pem --scope "flexion.*.report" --orgName flexion --kid flexion.simulated-hospital --doit | ||
./prime organization addkey --public-key $CDCTI_HOME/mock_credentials/organization-trusted-intermediary-public-key-local.pem --scope "flexion.*.report" --orgName flexion --kid flexion.simulated-lab --doit | ||
|
||
# Reset database | ||
../gradlew resetDB | ||
|
||
# Reload tables | ||
./prime lookuptables loadall | ||
|
||
# Load baseline organization settings | ||
./prime multiple-settings set -s -i ./settings/organizations.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters